]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: maintainer builds primes.h, not builder
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 12 Nov 2012 16:32:04 +0000 (08:32 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 12 Nov 2012 16:32:31 +0000 (08:32 -0800)
commitf16e251dae43117c2cd19359c26ce7b5e05165b6
tree7232d39cb3dba3f89480d3aac383b73779826aba
parent0d664d227cadb8cf4892e70954cd6c616192c0f8
factor: maintainer builds primes.h, not builder

With this change, the maintainer builds primes.h and it is part of
the tarball.  primes.h's contents are not architecture-specific.
* .gitignore: Remove /src/primes.h.
* src/factor.c: Include verify.h.
(W): New constant.  Verify that uintmax_t lacks holes
and that W is no wider than the integers used to generate primes.h.
* src/local.mk (EXTRA_DIST): Add src/primes.h.
(BUILT_SOURCES, CLEANFILES): Remove src/primes.h.
($(top_srcdir)/src/primes.h): Rename from src/primes.h.
Do not depend on src/make-prime-list.  Instead, use sub-make to
build, so that we build primes.h only if it does not exist.
* src/make-prime-list.c: Include <limits.h>, for ULONG_MAX.
(wide_uint): Define to uintmax_t or unsigned __int128 if not #defined.
(struct prime, binvert, process_prime): Use it instead of uintmax_t.
(print_wide_uint): New function.  This generates the proper pinv
value regardless of the width of uintmax_t on the target, so long
as the width doesn't exceed that of the width of wide_uint on the
maintainer host that generated src/primes.h.
(output_primes): Use it.  Output WIDE_UINT_BITS, too.  Let the
target compute its own lim, since its uintmax_t may be narrower
than ours.
(SZ): Remove.
* src/primes.h: New file, generated with 128-bit integers and usable
on any host where uintmax_t's width is no greater than 128 bits.
.gitignore
src/factor.c
src/local.mk
src/make-prime-list.c
src/primes.h [new file with mode: 0644]