I've just pushed these. Petr, I had to use two backslashes before # in configure.ac, since it's in a double-quoted string there.
>From 61af16213a488af3a8e994399ebd0859d390edb6 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Sat, 20 Mar 2010 13:05:58 +0100 Subject: [PATCH 1/4] use assembly code matcher when possible * configure.ac (ASCPPPOST): Backslash-escape "#" in AC_SUBST'd variable, to keep make from seeing it as a comment-introducer. Based on a patch by Petr Pisar. * lib/Makefile.am (match.$(OBJEXT)): Use AM_V_GEN and AM_V_at. * lib/match.c: Don't include <config.h>. It would impede configure-time assembler test. * .x-sc_require_config_h: Exempt lib/match.c from syntax-check. * .x-sc_require_config_h_first: Likewise. --- .x-sc_require_config_h | 1 + .x-sc_require_config_h_first | 1 + THANKS | 1 + configure.ac | 2 +- lib/Makefile.am | 12 ++++++------ lib/match.c | 2 -- 6 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 .x-sc_require_config_h create mode 100644 .x-sc_require_config_h_first diff --git a/.x-sc_require_config_h b/.x-sc_require_config_h new file mode 100644 index 0000000..a89d68c --- /dev/null +++ b/.x-sc_require_config_h @@ -0,0 +1 @@ +lib/match\.c diff --git a/.x-sc_require_config_h_first b/.x-sc_require_config_h_first new file mode 100644 index 0000000..a89d68c --- /dev/null +++ b/.x-sc_require_config_h_first @@ -0,0 +1 @@ +lib/match\.c diff --git a/THANKS b/THANKS index a69f832..713558b 100644 --- a/THANKS +++ b/THANKS @@ -204,6 +204,7 @@ Pascal Petit pe...@cadillac.ibp.fr Bruno Pillard b...@chorus.fr Franc,ois Pinard pin...@iro.umontreal.ca Jay Pinkos pin...@butyng.bu.edu +Petr Písař petr.pi...@atlas.cz Thomas Plass tho...@cogsci.ed.ac.uk Mike Polo mi...@cfsmo.honeywell.com Francesco Potorti p...@fly.cnuce.cnr.it diff --git a/configure.ac b/configure.ac index e9246e3..39c6d52 100644 --- a/configure.ac +++ b/configure.ac @@ -130,7 +130,7 @@ if test "$gl_gcc_warnings" = yes; then fi # cc -E produces incorrect asm files on SVR4, so postprocess it. -ASCPPPOST="sed '/^ *#/d; s,//.*,,; s/% /%/g; s/\\. /./g'" +ASCPPPOST="sed '/^ *\\#/d; s,//.*,,; s/% /%/g; s/\\. /./g'" AC_SUBST([ASCPPPOST]) AC_CACHE_CHECK([for underline in external names], [gzip_cv_underline], diff --git a/lib/Makefile.am b/lib/Makefile.am index 6f4f55e..b4c105c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -24,11 +24,11 @@ libgzip_a_DEPENDENCIES += $(LIBOBJS) AM_CFLAGS += $(WARN_CFLAGS) $(WERROR_CFLAGS) match.$(OBJEXT): match.c - cp $(srcdir)/match.c _match.S - $(CPP) $(CPPFLAGS) $(ASCPPFLAGS) _match.S > _match.i - $(ASCPPPOST) < _match.i > match_.s - $(CC) $(CPPFLAGS) $(CFLAGS) $(ASFLAGS_config) -c match_.s - mv match_.$(OBJEXT) $@ - rm -f _match.S _match.i match_.s + $(AM_V_GEN)cp $(srcdir)/match.c _match.S + $(AM_V_at)$(CPP) $(CPPFLAGS) $(ASCPPFLAGS) _match.S > _match.i + $(AM_V_at)$(ASCPPPOST) < _match.i > match_.s + $(AM_V_at)$(CC) $(CPPFLAGS) $(CFLAGS) $(ASFLAGS_config) -c match_.s + $(AM_V_at)mv match_.$(OBJEXT) $@ + $(AM_V_at)rm -f _match.S _match.i match_.s MOSTLYCLEANFILES += _match.S _match.i match_.s diff --git a/lib/match.c b/lib/match.c index 4ef6128..5dd8d64 100644 --- a/lib/match.c +++ b/lib/match.c @@ -28,8 +28,6 @@ * David Mosberger-Tang <dav...@hpl.hp.com>. */ -#include <config.h> - /* Preprocess with -DNO_UNDERLINE if your C compiler does not prefix * external symbols with an underline character '_'. */ -- 1.7.0.4.552.gc303 >From edfad78619d52479e02228a5789a2e98d7b0f9f6 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Mon, 5 Apr 2010 20:56:19 +0200 Subject: [PATCH 2/4] build: update gnulib submodule to latest, and adapt * cfg.mk: Update to use new _sc_search_regexp interface. Run this: perl -pi -e 's/\b_prohibit_regexp\b/_sc_search_regexp/;' -e 's/\bmsg=/halt=/; s/\bre=/prohibit=/;' cfg.mk and then adjust backslashes so they still line up. * cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it. * msdos/tailor.c (fcalloc): Mark a diagnostic for translation, to placate stricter syntax-check, even though no one uses this file. --- cfg.mk | 19 ++++++++++--------- gnulib | 2 +- lib/.gitignore | 3 +++ m4/.gitignore | 4 ++++ msdos/tailor.c | 2 +- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/cfg.mk b/cfg.mk index 61e8cfe..879637b 100644 --- a/cfg.mk +++ b/cfg.mk @@ -28,6 +28,7 @@ local-checks-to-skip = \ sc_prohibit_atoi_atof \ sc_prohibit_stat_st_blocks \ sc_space_tab \ + sc_texinfo_acronym \ sc_useless_cpp_parens @@ -42,9 +43,9 @@ old_NEWS_hash = e35901d8427a032d2b88a3195ed24a8f sc_obs_header_regex = \ \<(STDC_HEADERS|HAVE_(LIMITS|STRING|UNISTD|STDLIB)_H)\> sc_prohibit_obsolete_HAVE_HEADER_H: - @re='^[ ]*#[ ]*(el)?if.*$(sc_obs_header_regex)' \ - msg='remove the above obsolete #if...HAVE_HEADER_H test(s)' \ - $(_prohibit_regexp) + @prohibit='^[ ]*#[ ]*(el)?if.*$(sc_obs_header_regex)' \ + halt='remove the above obsolete #if...HAVE_HEADER_H test(s)' \ + $(_sc_search_regexp) update-copyright-env = \ UPDATE_COPYRIGHT_USE_INTERVALS=1 \ @@ -52,14 +53,14 @@ update-copyright-env = \ # Indent only with spaces. sc_prohibit_tab_based_indentation: - @re='^ * ' \ - msg='TAB in indentation; use only spaces' \ - $(_prohibit_regexp) + @prohibit='^ * ' \ + halt='TAB in indentation; use only spaces' \ + $(_sc_search_regexp) # Don't use "indent-tabs-mode: nil" anymore. No longer needed. sc_prohibit_emacs__indent_tabs_mode__setting: - @re='^( *[*#] *)?indent-tabs-mode:' \ - msg='use of emacs indent-tabs-mode: setting' \ - $(_prohibit_regexp) + @prohibit='^( *[*#] *)?indent-tabs-mode:' \ + halt='use of emacs indent-tabs-mode: setting' \ + $(_sc_search_regexp) include $(srcdir)/dist-check.mk diff --git a/gnulib b/gnulib index 9d0ad65..fb814d4 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 9d0ad652de159d08e5f679842f8a2a5658196361 +Subproject commit fb814d4cf9834324f0c05bcd04899003933933fa diff --git a/lib/.gitignore b/lib/.gitignore index 461e93b..2916a59 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -11,6 +11,8 @@ charset.alias chdir-long.c chdir-long.h chown.c +cloexec.c +cloexec.h close-hook.c close-hook.h close-stream.c @@ -73,6 +75,7 @@ fseterr.h fstatat.c ftello.c getcwd.c +getdtablesize.c getopt.c getopt.h getopt.in.h diff --git a/m4/.gitignore b/m4/.gitignore index 657e29f..ff53b60 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -5,6 +5,7 @@ calloc.m4 chdir-long.m4 chown.m4 clock_time.m4 +cloexec.m4 close-stream.m4 close.m4 closein.m4 @@ -45,6 +46,7 @@ ftello.m4 getcwd-abort-bug.m4 getcwd-path-max.m4 getcwd.m4 +getdtablesize.m4 getopt.m4 getpagesize.m4 gettime.m4 @@ -124,8 +126,10 @@ vfprintf-posix.m4 warn-on-use.m4 warnings.m4 wchar.m4 +wchar_h.m4 wchar_t.m4 wctype.m4 +wctype_h.m4 wint_t.m4 xalloc.m4 xgetcwd.m4 diff --git a/msdos/tailor.c b/msdos/tailor.c index af9d5da..1d6d6ef 100644 --- a/msdos/tailor.c +++ b/msdos/tailor.c @@ -36,7 +36,7 @@ void * fcalloc(items, size) if (ptr_offset == 0) { ptr_offset = (ush)((uch*)buf-0); } else if (ptr_offset != (ush)((uch*)buf-0)) { - error("inconsistent ptr_offset"); + error(_("inconsistent ptr_offset")); } *((ush*)&buf+1) += (ptr_offset + 15) >> 4; *(ush*)&buf = 0; -- 1.7.0.4.552.gc303 >From a7eb71b602cc52903596011deffadc134171e26f Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Mon, 5 Apr 2010 21:35:07 +0200 Subject: [PATCH 3/4] maint: let configure-invoked cpp emit diagnostics to config.log * configure.ac: Do not discard CPP's stderr. --- configure.ac | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 39c6d52..9e3d7c9 100644 --- a/configure.ac +++ b/configure.ac @@ -154,18 +154,18 @@ AC_CACHE_CHECK([for an assembler syntax supported by this package], *' NO_ASM '*) ;; *) if cp $srcdir/lib/match.c _match.S && - eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" 2>/dev/null && - eval "$ASCPPPOST < _match.i > match_.s" 2>/dev/null; then + eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" && + eval "$ASCPPPOST < _match.i > match_.s"; then if test ! -s match_.s || grep error < match_.s > /dev/null; then : - elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null 2>&1" && + elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null" && test -f match_.$OBJEXT; then rm -f match_.$OBJEXT gzip_cv_assembler=yes if echo 'void foo (void) {}' > conftest.c && - eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null 2>&1" && - grep '\.note\.GNU-stack' conftest.s >/dev/null 2>&1 && - eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null 2>&1" && + eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null" && + grep '\.note\.GNU-stack' conftest.s >/dev/null && + eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null" && test -f match_.$OBJEXT; then gzip_cv_assembler='yes, with -Wa,--noexecstack' fi -- 1.7.0.4.552.gc303 >From 259ec94f37491280d152c850c4801608da539c86 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Mon, 5 Apr 2010 21:46:23 +0200 Subject: [PATCH 4/4] build: use gnulib's lib-ignore module * bootstrap.conf (gnulib_modules): Add lib-ignore, in case it helps. * Makefile.am (AM_LDFLAGS): Define it. --- Makefile.am | 3 +++ bootstrap.conf | 1 + m4/.gitignore | 1 + 3 files changed, 5 insertions(+), 0 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3b048b8..c7ab7f2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,6 +24,9 @@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I$(top_srcdir)/lib AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) +# Tell the linker to omit references to unused shared libraries. +AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS) + man_MANS = gunzip.1 gzexe.1 gzip.1 \ zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1 diff --git a/bootstrap.conf b/bootstrap.conf index f943559..c937da2 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -39,6 +39,7 @@ gnu-web-doc-update gnumakefile gnupload ignore-value +lib-ignore lstat maintainer-makefile malloc diff --git a/m4/.gitignore b/m4/.gitignore index ff53b60..4fc85a9 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -66,6 +66,7 @@ isnanf.m4 isnanl.m4 lchown.m4 ldexpl.m4 +lib-ignore.m4 localcharset.m4 locale-fr.m4 locale-ja.m4 -- 1.7.0.4.552.gc303