Jakub Jelinek a769ac
2005-02-07  Roland McGrath  <roland@frob.com>
Jakub Jelinek a769ac
Jakub Jelinek a769ac
	* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
Jakub Jelinek a769ac
Jakub Jelinek a769ac
2003-08-12  Roland McGrath  <roland@redhat.com>
Jakub Jelinek a769ac
Jakub Jelinek a769ac
	* configure.ac: Check for struct stat st_?tim members.
Jakub Jelinek a769ac
	* src/strip.c (process_file): Use st_?time if st_?tim are not there.
Jakub Jelinek a769ac
Jakub Jelinek a769ac
	* configure.ac: Check for futimes function.
Jakub Jelinek a769ac
	* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
Jakub Jelinek a769ac
	(handle_ar) [! HAVE_FUTIMES]: Likewise.
Jakub Jelinek a769ac
roland b73b6e
--- elfutils/Makefile.in
roland b73b6e
+++ elfutils/Makefile.in
roland b73b6e
@@ -127,6 +127,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = @VERSION@
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
--- elfutils/config/Makefile.in
roland b73b6e
+++ elfutils/config/Makefile.in
roland b73b6e
@@ -105,6 +105,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = @VERSION@
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
--- elfutils/configure
roland b73b6e
+++ elfutils/configure
roland b73b6e
@@ -277,7 +277,7 @@ PACKAGE_STRING='Red Hat elfutils 0.104'
roland b73b6e
 PACKAGE_BUGREPORT='http://bugzilla.redhat.com/bugzilla/'
roland b73b6e
 
roland b73b6e
 ac_unique_file="libelf/libelf.h"
roland b73b6e
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu MUDFLAP_TRUE MUDFLAP_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBOBJS LTLIBOBJS'
roland b73b6e
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT WEXTRA LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu MUDFLAP_TRUE MUDFLAP_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBOBJS LTLIBOBJS'
roland b73b6e
 ac_subst_files=''
roland b73b6e
 
roland b73b6e
 # Initialize some variables set by options.
roland b73b6e
@@ -3373,6 +3373,56 @@ echo "$as_me: error: gcc with C99 suppor
roland b73b6e
 fi
roland b73b6e
 
roland b73b6e
 
roland b73b6e
+echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
roland b73b6e
+echo $ECHO_N "checking for -Wextra option to $CC... $ECHO_C" >&6
roland b73b6e
+if test "${ac_cv_cc_wextra+set}" = set; then
roland b73b6e
+  echo $ECHO_N "(cached) $ECHO_C" >&6
roland b73b6e
+else
roland b73b6e
+  old_CFLAGS="$CFLAGS"
roland b73b6e
+CFLAGS="$CFLAGS -Wextra"
roland b73b6e
+cat >conftest.$ac_ext <<_ACEOF
roland b73b6e
+void foo (void) { }
roland b73b6e
+_ACEOF
roland b73b6e
+rm -f conftest.$ac_objext
roland b73b6e
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
roland b73b6e
+  (eval $ac_compile) 2>conftest.er1
roland b73b6e
+  ac_status=$?
roland b73b6e
+  grep -v '^ *+' conftest.er1 >conftest.err
roland b73b6e
+  rm -f conftest.er1
roland b73b6e
+  cat conftest.err >&5
roland b73b6e
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
roland b73b6e
+  (exit $ac_status); } &&
roland b73b6e
+	 { ac_try='test -z "$ac_c_werror_flag"
roland b73b6e
+			 || test ! -s conftest.err'
roland b73b6e
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
roland b73b6e
+  (eval $ac_try) 2>&5
roland b73b6e
+  ac_status=$?
roland b73b6e
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
roland b73b6e
+  (exit $ac_status); }; } &&
roland b73b6e
+	 { ac_try='test -s conftest.$ac_objext'
roland b73b6e
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
roland b73b6e
+  (eval $ac_try) 2>&5
roland b73b6e
+  ac_status=$?
roland b73b6e
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
roland b73b6e
+  (exit $ac_status); }; }; then
roland b73b6e
+  ac_cv_cc_wextra
roland b73b6e
+else
roland b73b6e
+  echo "$as_me: failed program was:" >&5
roland b73b6e
+sed 's/^/| /' conftest.$ac_ext >&5
roland b73b6e
+
roland b73b6e
+ac_cv_cc_wextra=no
roland b73b6e
+fi
roland b73b6e
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
roland b73b6e
+CFLAGS="$old_CFLAGS"
roland b73b6e
+fi
roland b73b6e
+echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
roland b73b6e
+echo "${ECHO_T}$ac_cv_cc_wextra" >&6
roland b73b6e
+
roland b73b6e
+if test "x$ac_cv_cc_wextra" = yes; then
roland b73b6e
+  WEXTRA=-Wextra
roland b73b6e
+fi
roland b73b6e
+
roland b73b6e
+
roland b73b6e
 LOCALEDIR=$datadir
roland b73b6e
 
roland b73b6e
 cat >>confdefs.h <<_ACEOF
roland b73b6e
@@ -4818,6 +4868,7 @@ s,@YACC@,$YACC,;t t
roland b73b6e
 s,@LEX@,$LEX,;t t
roland b73b6e
 s,@LEXLIB@,$LEXLIB,;t t
roland b73b6e
 s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
roland b73b6e
+s,@WEXTRA@,$WEXTRA,;t t
roland b73b6e
 s,@LOCALEDIR@,$LOCALEDIR,;t t
roland b73b6e
 s,@DATADIRNAME@,$DATADIRNAME,;t t
roland b73b6e
 s,@NATIVE_LD_TRUE@,$NATIVE_LD_TRUE,;t t
Jakub Jelinek a769ac
--- elfutils/configure.ac
Jakub Jelinek a769ac
+++ elfutils/configure.ac
roland b73b6e
@@ -64,6 +64,15 @@ CFLAGS="$old_CFLAGS"])
Jakub Jelinek a769ac
 AS_IF([test "x$ac_cv_c99" != xyes],
Jakub Jelinek a769ac
       AC_MSG_ERROR([gcc with C99 support required]))
Jakub Jelinek a769ac
 
Jakub Jelinek a769ac
+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
Jakub Jelinek a769ac
+old_CFLAGS="$CFLAGS"
Jakub Jelinek a769ac
+CFLAGS="$CFLAGS -Wextra"
Jakub Jelinek a769ac
+AC_COMPILE_IFELSE([void foo (void) { }],
Jakub Jelinek a769ac
+		  ac_cv_cc_wextra, ac_cv_cc_wextra=no)
Jakub Jelinek a769ac
+CFLAGS="$old_CFLAGS"])
Jakub Jelinek a769ac
+AC_SUBST(WEXTRA)
Jakub Jelinek a769ac
+AS_IF([test "x$ac_cv_cc_wextra" = yes], [WEXTRA=-Wextra])
Jakub Jelinek a769ac
+
Jakub Jelinek a769ac
 LOCALEDIR=$datadir
Jakub Jelinek a769ac
 AC_SUBST(LOCALEDIR)
Jakub Jelinek a769ac
 AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
Jakub Jelinek a769ac
--- elfutils/lib/ChangeLog
Jakub Jelinek a769ac
+++ elfutils/lib/ChangeLog
Jakub Jelinek a769ac
@@ -1,3 +1,8 @@
Jakub Jelinek a769ac
+2005-02-07  Roland McGrath  <roland@redhat.com>
Jakub Jelinek a769ac
+
Jakub Jelinek a769ac
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
Jakub Jelinek a769ac
+	(AM_CFLAGS): Use it in place of -Wextra.
Jakub Jelinek a769ac
+
Jakub Jelinek a769ac
 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
Jakub Jelinek a769ac
 
Jakub Jelinek a769ac
 	* dynamicsizehash.c (lookup): Mark val parameter as possibly unused.
Jakub Jelinek a769ac
--- elfutils/lib/Makefile.am
Jakub Jelinek a769ac
+++ elfutils/lib/Makefile.am
roland b73b6e
@@ -16,12 +16,13 @@
Jakub Jelinek a769ac
 ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Jakub Jelinek a769ac
 ##
Jakub Jelinek a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
Jakub Jelinek a769ac
+WEXTRA = @WEXTRA@
Jakub Jelinek a769ac
 if MUDFLAP
Jakub Jelinek a769ac
 AM_CFLAGS = -fmudflap
Jakub Jelinek a769ac
 else
Jakub Jelinek a769ac
 AM_CFLAGS =
Jakub Jelinek a769ac
 endif
Jakub Jelinek a769ac
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra $($(*F)_CFLAGS)
Jakub Jelinek a769ac
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS)
Jakub Jelinek a769ac
 INCLUDES = -I$(srcdir)/../libelf -I..
Jakub Jelinek a769ac
 
Jakub Jelinek a769ac
 noinst_LIBRARIES = libeu.a
roland b73b6e
--- elfutils/lib/Makefile.in
roland b73b6e
+++ elfutils/lib/Makefile.in
roland b73b6e
@@ -126,6 +126,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = @VERSION@
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
@@ -168,9 +169,9 @@ sharedstatedir = @sharedstatedir@
roland b73b6e
 sysconfdir = @sysconfdir@
roland b73b6e
 target_alias = @target_alias@
roland b73b6e
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
roland b73b6e
-@MUDFLAP_FALSE@	-Wextra $($(*F)_CFLAGS)
roland b73b6e
+@MUDFLAP_FALSE@	$(WEXTRA) $($(*F)_CFLAGS)
roland b73b6e
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
roland b73b6e
-@MUDFLAP_TRUE@	-Wunused -Wextra $($(*F)_CFLAGS)
roland b73b6e
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) $($(*F)_CFLAGS)
roland b73b6e
 INCLUDES = -I$(srcdir)/../libelf -I..
roland b73b6e
 noinst_LIBRARIES = libeu.a
roland b73b6e
 libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c crc32.c
Jakub Jelinek a769ac
--- elfutils/libasm/Makefile.am
Jakub Jelinek a769ac
+++ elfutils/libasm/Makefile.am
roland b73b6e
@@ -13,12 +13,13 @@
Jakub Jelinek a769ac
 ## 3001 King Ranch Road, Ukiah, CA 95482.
Jakub Jelinek a769ac
 ##
Jakub Jelinek a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
Jakub Jelinek a769ac
+WEXTRA = @WEXTRA@
Jakub Jelinek a769ac
 if MUDFLAP
Jakub Jelinek a769ac
 AM_CFLAGS = -fmudflap
Jakub Jelinek a769ac
 else
Jakub Jelinek a769ac
 AM_CFLAGS =
Jakub Jelinek a769ac
 endif
Jakub Jelinek a769ac
-AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
Jakub Jelinek a769ac
+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2
Jakub Jelinek a769ac
 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
Jakub Jelinek a769ac
 	   -I$(top_srcdir)/lib
Jakub Jelinek a769ac
 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
roland b73b6e
--- elfutils/libasm/Makefile.in
roland b73b6e
+++ elfutils/libasm/Makefile.in
roland b73b6e
@@ -159,6 +159,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = 1
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
@@ -200,10 +201,10 @@ sbindir = @sbindir@
roland b73b6e
 sharedstatedir = @sharedstatedir@
roland b73b6e
 sysconfdir = @sysconfdir@
roland b73b6e
 target_alias = @target_alias@
roland b73b6e
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused -Wextra \
roland b73b6e
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused $(WEXTRA) \
roland b73b6e
 @MUDFLAP_FALSE@	-Wformat=2
roland b73b6e
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Werror -Wunused \
roland b73b6e
-@MUDFLAP_TRUE@	-Wextra -Wformat=2
roland b73b6e
+@MUDFLAP_TRUE@	$(WEXTRA) -Wformat=2
roland b73b6e
 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
roland b73b6e
 	   -I$(top_srcdir)/lib
roland b73b6e
 
roland c881c2
--- elfutils/libcpu/Makefile.am
roland c881c2
+++ elfutils/libcpu/Makefile.am
roland c881c2
@@ -13,7 +13,8 @@
roland c881c2
 ## 3001 King Ranch Road, Ukiah, CA 95482.
roland c881c2
 ##
roland c881c2
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
roland c881c2
-AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
roland c881c2
+WEXTRA = @WEXTRA@
roland c881c2
+AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
roland c881c2
 INCLUDES = -I$(srcdir)
roland c881c2
 
roland c881c2
 noinst_LIBRARIES = libcpu_i386.a
roland b73b6e
--- elfutils/libcpu/Makefile.in
roland b73b6e
+++ elfutils/libcpu/Makefile.in
roland b73b6e
@@ -122,6 +122,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = @VERSION@
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
@@ -163,7 +164,7 @@ sbindir = @sbindir@
roland b73b6e
 sharedstatedir = @sharedstatedir@
roland b73b6e
 sysconfdir = @sysconfdir@
roland b73b6e
 target_alias = @target_alias@
roland b73b6e
-AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
roland b73b6e
+AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
roland b73b6e
 INCLUDES = -I$(srcdir)
roland b73b6e
 noinst_LIBRARIES = libcpu_i386.a
roland b73b6e
 libcpu_i386_a_SOURCES = i386_dis.c
Jakub Jelinek a769ac
--- elfutils/libdw/Makefile.am
Jakub Jelinek a769ac
+++ elfutils/libdw/Makefile.am
roland b73b6e
@@ -13,12 +13,13 @@
Jakub Jelinek a769ac
 ## 3001 King Ranch Road, Ukiah, CA 95482.
Jakub Jelinek a769ac
 ##
Jakub Jelinek a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
Jakub Jelinek a769ac
+WEXTRA = @WEXTRA@
Jakub Jelinek a769ac
 if MUDFLAP
Jakub Jelinek a769ac
 AM_CFLAGS = -fmudflap
Jakub Jelinek a769ac
 else
Jakub Jelinek a769ac
 AM_CFLAGS =
Jakub Jelinek a769ac
 endif
Jakub Jelinek a769ac
-AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
Jakub Jelinek a769ac
+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
Jakub Jelinek a769ac
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
Jakub Jelinek a769ac
 VERSION = 1
Jakub Jelinek a769ac
 
roland b73b6e
--- elfutils/libdw/Makefile.in
roland b73b6e
+++ elfutils/libdw/Makefile.in
roland b73b6e
@@ -183,6 +183,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = 1
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
@@ -225,9 +226,9 @@ sharedstatedir = @sharedstatedir@
roland b73b6e
 sysconfdir = @sysconfdir@
roland b73b6e
 target_alias = @target_alias@
roland b73b6e
 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
roland b73b6e
-@MUDFLAP_FALSE@	-Wextra -std=gnu99
roland b73b6e
+@MUDFLAP_FALSE@	$(WEXTRA) -std=gnu99
roland b73b6e
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \
roland b73b6e
-@MUDFLAP_TRUE@	-Wformat=2 -Wextra -std=gnu99
roland b73b6e
+@MUDFLAP_TRUE@	-Wformat=2 $(WEXTRA) -std=gnu99
roland b73b6e
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
roland b73b6e
 lib_LIBRARIES = libdw.a
roland b73b6e
 @MUDFLAP_FALSE@noinst_LIBRARIES = libdw_pic.a
Jakub Jelinek a769ac
--- elfutils/libebl/Makefile.am
Jakub Jelinek a769ac
+++ elfutils/libebl/Makefile.am
roland b73b6e
@@ -13,12 +13,13 @@
Jakub Jelinek a769ac
 ## 3001 King Ranch Road, Ukiah, CA 95482.
Jakub Jelinek a769ac
 ##
Jakub Jelinek a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
Jakub Jelinek a769ac
+WEXTRA = @WEXTRA@
Jakub Jelinek a769ac
 if MUDFLAP
Jakub Jelinek a769ac
 AM_CFLAGS = -fmudflap
Jakub Jelinek a769ac
 else
Jakub Jelinek a769ac
 AM_CFLAGS =
Jakub Jelinek a769ac
 endif
Jakub Jelinek a769ac
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
Jakub Jelinek a769ac
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
Jakub Jelinek a769ac
 	     -std=gnu99
Jakub Jelinek a769ac
 
Jakub Jelinek a769ac
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I..
roland b73b6e
--- elfutils/libebl/Makefile.in
roland b73b6e
+++ elfutils/libebl/Makefile.in
roland b73b6e
@@ -236,6 +236,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = 1
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
@@ -278,9 +279,9 @@ sharedstatedir = @sharedstatedir@
roland b73b6e
 sysconfdir = @sysconfdir@
roland b73b6e
 target_alias = @target_alias@
roland b73b6e
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
roland b73b6e
-@MUDFLAP_FALSE@	-Wextra -Wformat=2 -std=gnu99
roland b73b6e
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2 -std=gnu99
roland b73b6e
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
roland b73b6e
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2 -std=gnu99
roland b73b6e
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99
roland b73b6e
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I..
roland b73b6e
 lib_LIBRARIES = libebl.a
roland b73b6e
 modules = i386 sh mips x86_64 ia64 alpha arm sparc ppc ppc64
Jakub Jelinek a769ac
--- elfutils/libelf/Makefile.am
Jakub Jelinek a769ac
+++ elfutils/libelf/Makefile.am
roland b73b6e
@@ -16,12 +16,13 @@
Jakub Jelinek a769ac
 ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Jakub Jelinek a769ac
 ##
Jakub Jelinek a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
Jakub Jelinek a769ac
+WEXTRA = @WEXTRA@
Jakub Jelinek a769ac
 if MUDFLAP
Jakub Jelinek a769ac
 AM_CFLAGS = -fpic -fmudflap
Jakub Jelinek a769ac
 else
Jakub Jelinek a769ac
 AM_CFLAGS =
Jakub Jelinek a769ac
 endif
Jakub Jelinek a769ac
-AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
Jakub Jelinek a769ac
+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
Jakub Jelinek a769ac
 	     $($(*F)_CFLAGS)
Jakub Jelinek a769ac
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
Jakub Jelinek a769ac
 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
roland b73b6e
--- elfutils/libelf/Makefile.in
roland b73b6e
+++ elfutils/libelf/Makefile.in
roland b73b6e
@@ -199,6 +199,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = 1
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
@@ -240,10 +241,10 @@ sbindir = @sbindir@
roland b73b6e
 sharedstatedir = @sharedstatedir@
roland b73b6e
 sysconfdir = @sysconfdir@
roland b73b6e
 target_alias = @target_alias@
roland b73b6e
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused -Wextra \
roland b73b6e
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused $(WEXTRA) \
roland b73b6e
 @MUDFLAP_FALSE@	-Wformat=2 -std=gnu99 $($(*F)_CFLAGS)
roland b73b6e
 @MUDFLAP_TRUE@AM_CFLAGS = -fpic -fmudflap -Wall -Wshadow -Werror \
roland b73b6e
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2 -std=gnu99 \
roland b73b6e
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
roland b73b6e
 @MUDFLAP_TRUE@	$($(*F)_CFLAGS)
roland b73b6e
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
roland b73b6e
 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
roland b73b6e
--- elfutils/m4/Makefile.in
roland b73b6e
+++ elfutils/m4/Makefile.in
roland b73b6e
@@ -103,6 +103,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = @VERSION@
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
Jakub Jelinek a769ac
--- elfutils/src/Makefile.am
Jakub Jelinek a769ac
+++ elfutils/src/Makefile.am
roland b73b6e
@@ -14,14 +14,15 @@
Jakub Jelinek a769ac
 ##
Jakub Jelinek a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
Jakub Jelinek a769ac
        -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
Jakub Jelinek a769ac
+WEXTRA = @WEXTRA@
Jakub Jelinek a769ac
 if MUDFLAP
Jakub Jelinek a769ac
-AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \
Jakub Jelinek a769ac
+AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fmudflap \
Jakub Jelinek a769ac
 	    $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \
Jakub Jelinek a769ac
 	    $(if $($(*F)_no_Wformat),,-Wformat=2)
Jakub Jelinek a769ac
 else
Jakub Jelinek a769ac
 AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
Jakub Jelinek a769ac
 	    $(if $($(*F)_no_Werror),,-Werror) \
Jakub Jelinek a769ac
-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
Jakub Jelinek a769ac
+	    $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
Jakub Jelinek a769ac
 	    $(if $($(*F)_no_Wformat),,-Wformat=2)
Jakub Jelinek a769ac
 endif
Jakub Jelinek a769ac
 if MUDFLAP
roland b73b6e
--- elfutils/src/Makefile.in
roland b73b6e
+++ elfutils/src/Makefile.in
roland b73b6e
@@ -189,6 +189,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = @VERSION@
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@ -d
roland b73b6e
 ac_ct_CC = @ac_ct_CC@
roland b73b6e
@@ -232,10 +233,10 @@ sysconfdir = @sysconfdir@
roland b73b6e
 target_alias = @target_alias@
roland b73b6e
 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
roland b73b6e
 @MUDFLAP_FALSE@	    $(if $($(*F)_no_Werror),,-Werror) \
roland b73b6e
-@MUDFLAP_FALSE@	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
roland b73b6e
+@MUDFLAP_FALSE@	    $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
roland b73b6e
 @MUDFLAP_FALSE@	    $(if $($(*F)_no_Wformat),,-Wformat=2)
roland b73b6e
 
roland b73b6e
-@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \
roland b73b6e
+@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fmudflap \
roland b73b6e
 @MUDFLAP_TRUE@	    $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \
roland b73b6e
 @MUDFLAP_TRUE@	    $(if $($(*F)_no_Wformat),,-Wformat=2)
roland b73b6e
 
Jakub Jelinek a769ac
--- elfutils/src/strip.c
Jakub Jelinek a769ac
+++ elfutils/src/strip.c
roland b73b6e
@@ -40,6 +40,12 @@
roland b73b6e
 #include <libebl.h>
roland b73b6e
 #include <system.h>
roland b73b6e
 
roland b73b6e
+#ifdef HAVE_FUTIMES
roland b73b6e
+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
roland b73b6e
+#else
roland b73b6e
+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
roland b73b6e
+#endif
roland b73b6e
+
roland b73b6e
 
roland b73b6e
 /* Name and version of program.  */
roland b73b6e
 static void print_version (FILE *stream, struct argp_state *state);
roland b73b6e
@@ -245,8 +251,18 @@ process_file (const char *fname)
Jakub Jelinek a769ac
 
Jakub Jelinek a769ac
       /* If we have to preserve the timestamp, we need it in the
Jakub Jelinek a769ac
 	 format utimes() understands.  */
Jakub Jelinek a769ac
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
Jakub Jelinek a769ac
       TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
Jakub Jelinek a769ac
+#else
Jakub Jelinek a769ac
+      tv[0].tv_sec = pre_st.st_atime;
Jakub Jelinek a769ac
+      tv[0].tv_usec = 0;
Jakub Jelinek a769ac
+#endif
Jakub Jelinek a769ac
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
Jakub Jelinek a769ac
       TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
Jakub Jelinek a769ac
+#else
Jakub Jelinek a769ac
+      tv[1].tv_sec = pre_st.st_atime;
Jakub Jelinek a769ac
+      tv[1].tv_usec = 0;
Jakub Jelinek a769ac
+#endif
Jakub Jelinek a769ac
     }
Jakub Jelinek a769ac
 
Jakub Jelinek a769ac
   /* Open the file.  */
roland b73b6e
@@ -1677,7 +1693,7 @@ handle_elf (int fd, Elf *elf, const char
Jakub Jelinek a769ac
   /* If requested, preserve the timestamp.  */
Jakub Jelinek a769ac
   if (tvp != NULL)
Jakub Jelinek a769ac
     {
Jakub Jelinek a769ac
-      if (futimes (fd, tvp) != 0)
roland b73b6e
+      if (FUTIMES (fd, output_fname, tvp) != 0)
Jakub Jelinek a769ac
 	{
Jakub Jelinek a769ac
 	  error (0, errno, gettext ("\
Jakub Jelinek a769ac
 cannot set access and modification date of \"%s\""),
roland b73b6e
@@ -1734,7 +1750,7 @@ handle_ar (int fd, Elf *elf, const char 
Jakub Jelinek a769ac
 
Jakub Jelinek a769ac
   if (tvp != NULL)
Jakub Jelinek a769ac
     {
Jakub Jelinek a769ac
-      if (unlikely (futimes (fd, tvp) != 0))
roland b73b6e
+      if (unlikely (FUTIMES (fd, fname, tvp) != 0))
Jakub Jelinek a769ac
 	{
Jakub Jelinek a769ac
 	  error (0, errno, gettext ("\
Jakub Jelinek a769ac
 cannot set access and modification date of \"%s\""), fname);
roland b73b6e
--- elfutils/tests/Makefile.in
roland b73b6e
+++ elfutils/tests/Makefile.in
roland b73b6e
@@ -257,6 +257,7 @@ SHELL = @SHELL@
roland b73b6e
 STRIP = @STRIP@
roland b73b6e
 USE_NLS = @USE_NLS@
roland b73b6e
 VERSION = @VERSION@
roland b73b6e
+WEXTRA = @WEXTRA@
roland b73b6e
 XGETTEXT = @XGETTEXT@
roland b73b6e
 YACC = @YACC@
roland b73b6e
 ac_ct_CC = @ac_ct_CC@