X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=Makefile.am;h=ac9561540504171b67cec3afae8ace8bf3d8eedd;hb=d06e0288c7f44218ba9a4175faedeed0b5b2a8e8;hp=917641d4ee042642651c2b32a8df393f03787827;hpb=e7921f54c622e3b32e525f345bc34308821e4ae0;p=debian%2Fgzip diff --git a/Makefile.am b/Makefile.am index 917641d..ac95615 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,11 @@ # Make gzip (GNU zip). -# Copyright (C) 1999, 2001, 2002, 2006 Free Software Foundation, Inc. +# Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2010 Free Software Foundation, +# Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, @@ -19,14 +20,17 @@ SUBDIRS = lib doc ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I$(top_srcdir)/lib +AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_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 EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \ + ChangeLog-2007 \ + tests/hufts-segv.gz \ algorithm.doc amiga/match.a amiga/Makefile.gcc amiga/Makefile.sasc \ amiga/tailor.c amiga/utime.h atari/Makefile.st crypt.h \ - gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \ + gunzip.in gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \ msdos/gzip.prj msdos/doturboc.bat msdos/Makefile.msc msdos/Makefile.bor \ msdos/Makefile.djg nt/Makefile.nt os2/gzip.def os2/Makefile.os2 \ os2/gzip16.def primos/include/errno.h primos/include/fcntl.h \ @@ -35,45 +39,85 @@ EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \ primos/primos.c primos/ci.opts revision.h sample/makecrc.c \ sample/ztouch sample/add.c sample/sub.c sample/zread.c sample/zfile \ tailor.h vms/Makefile.mms vms/gzip.hlp vms/vms.c vms/Readme.vms \ - vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com zdiff.in \ - zforce.in zgrep.in zless.in zmore.in znew.in + vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com zcat.in zcmp.in zdiff.in \ + zegrep.in zfgrep.in zforce.in zgrep.in zless.in zmore.in znew.in \ + tests/init.sh bin_PROGRAMS = gzip -bin_SCRIPTS = gzexe zdiff zgrep zforce zless zmore znew +bin_SCRIPTS = gunzip gzexe zcat zcmp zdiff \ + zegrep zfgrep zforce zgrep zless zmore znew gzip_SOURCES = \ bits.c crypt.c deflate.c gzip.c inflate.c lzw.c \ trees.c unlzh.c unlzw.c unpack.c unzip.c util.c zip.c gzip_LDADD = lib/libgzip.a +gzip_LDADD += $(LIB_CLOCK_GETTIME) gzip.doc: gzip.1 - groff -man -Tascii $(srcdir)/gzip.1 | col -b | uniq >$@ + $(AM_V_GEN)groff -man -Tascii $(srcdir)/gzip.1 | col -b | uniq > $@-t \ + && mv $@-t $@ + +gzip.doc.gz: gzip.doc $(bin_PROGRAMS) + $(AM_V_GEN)./gzip < $(srcdir)/gzip.doc >$@-t && mv $@-t $@ SUFFIXES = .in .in: - sed \ + $(AM_V_GEN)sed \ -e 's|/bin/sh|$(SHELL)|g' \ - -e 's|BINDIR|$(bindir)|g' \ + -e 's|[@]bindir@|'\''$(bindir)'\''|g' \ -e 's|[@]VERSION@|$(VERSION)|g' \ - $(srcdir)/$@.in >$@ - chmod a+x $@ + $(srcdir)/$@.in >$@-t \ + && chmod a+x $@-t \ + && mv $@-t $@ + +# Arrange so that .tarball-version appears only in the distribution +# tarball, and never in a checked-out repository. +dist-hook: gen-ChangeLog + $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version + +gen_start_date = 2008-01-01 +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d .git; then \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + --since=$(gen_start_date) > $(distdir)/cl-t; \ + rm -f $(distdir)/ChangeLog; \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; \ + fi # A simple test, just of gzip -- more of a sanity check than anything else. -FILES_TO_CHECK = $(bin_SCRIPTS) $(gzip_LDADD) \ +FILES_TO_CHECK = $(bin_SCRIPTS) \ $(top_srcdir)/ChangeLog $(top_srcdir)/configure $(top_srcdir)/gzip.c -check-local: $(FILES_TO_CHECK) +check-local: $(FILES_TO_CHECK) $(bin_PROGRAMS) gzip.doc.gz + { test '$(srcdir)' != . || ./zdiff --__bindir . -c gzip.doc.gz; } + ./zdiff --__bindir . -c $(srcdir)/gzip.doc $(srcdir)/gzip.doc + ./zdiff --__bindir . $(srcdir)/gzip.doc gzip.doc.gz + ./zdiff --__bindir . -c - $(srcdir)/gzip.doc /dev/null for file in $(FILES_TO_CHECK); do \ - ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit; \ + ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit 1; \ done + ./gzip -dc $(srcdir)/tests/hufts-segv.gz > /dev/null 2>&1; \ + test $$? = 1 + k=in-$$$$; printf a | ./gzip > $$k && \ + test "`cat $$k | ./gzip -dc $$k - $$k`" = aaa && rm $$k @echo 'Test succeeded.' +TESTS = \ + tests/helin-segv \ + tests/memcpy-abuse \ + tests/trailing-nul \ + tests/zdiff \ + tests/zgrep-f + +EXTRA_DIST += $(TESTS) + install-exec-hook: remove-installed-links install-exec-hook remove-installed-links: @for prog_ext in $(bin_PROGRAMS) $(bin_SCRIPTS); do \ prog=`echo "$$prog_ext"|sed 's/$(EXEEXT)$$//'`; \ case $$prog in \ - gzip) aliases='gunzip zcat';; \ - zdiff) aliases='zcmp';; \ - zgrep) aliases='zegrep zfgrep';; \ + gunzip) aliases='uncompress';; \ *) continue;; \ esac; \ transform='$(transform)'; \ @@ -98,5 +142,46 @@ uninstall-local: remove-installed-links MAINTAINERCLEANFILES = gzip.doc -MOSTLYCLEANFILES = _match.i match_.s _match.S \ - gzexe zdiff zforce zgrep zless zmore znew +MOSTLYCLEANFILES = _match.i match_.s _match.S gzip.doc.gz \ + gunzip gzexe zcat zcmp zdiff zegrep zfgrep zforce zgrep zless zmore znew + +# Note that the first lines are statements. They ensure that environment +# variables that can perturb tests are unset or set to expected values. +# The rest are envvar settings that propagate build-related Makefile +# variables to test scripts. +TESTS_ENVIRONMENT = \ + tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \ + TMPDIR=$$tmp__; export TMPDIR; \ + exec 9>&2; \ + shell_or_perl_() { \ + if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then \ + if $(PERL) -e 'use warnings' > /dev/null 2>&1; then \ + grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=; \ + $(PERL) -w$$T_ -I$(srcdir) -MCoreutils \ + -M"CuTmpdir qw($$f)" -- "$$1"; \ + else \ + echo 1>&2 "$$tst: configure did not find a usable version of Perl," \ + "so skipping this test"; \ + (exit 77); \ + fi; \ + else \ + $(SHELL) "$$1"; \ + fi; \ + }; \ + export \ + abs_top_builddir='$(abs_top_builddir)' \ + abs_top_srcdir='$(abs_top_srcdir)' \ + abs_srcdir='$(abs_srcdir)' \ + srcdir='$(srcdir)' \ + top_srcdir='$(top_srcdir)' \ + CC='$(CC)' \ + MAKE=$(MAKE) \ + PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \ + PACKAGE_VERSION=$(PACKAGE_VERSION) \ + PERL='$(PERL)' \ + PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \ + REPLACE_GETCWD=$(REPLACE_GETCWD) \ + PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \ + ; shell_or_perl_ + +VERBOSE = yes