On 10/26/2012 08:37 AM, Jim Meyering wrote: > I would like to generate that table with a portable awk script (maybe > even Perl). If someone can provide such a script, I would be happy > to dump the C program. That would solve the problem.
It'd be a pain to do it in portable awk, as it requires arithmetic modulo (UINTMAX_MAX + 1), which Awk is not likely to support directly. Since there are only two or three plausible values of UINTMAX_MAX these days, one possibility is to precompute primes.h for these two or three values, and ship the precomputed primes.h in the tarball, and to use the precomputed primes.h on hosts with typical UINTMAX_MAX values. People who are on a weird platform where UINTMAX_MAX is an unusual value wouldn't be able to cross-compile, but that's unlikely to ever happen and even if it does, we simply add the unusual case to the precomputed primes.h.
