Status update: mini-gmp

Niels Möller nisse at lysator.liu.se
Thu Feb 16 12:03:04 CET 2012


Torbjorn Granlund <tg at gmplib.org> writes:

> It would be nicer to have it in a separate directory, both for GMP
> directory cleanness and for easy extraction by users.

Right, I guess that makes the most sense.

After copying the mini-gmp directory, I can build gmp with the attached
patch. For the functions in dumbmp.c:

* Most aren't needed any more.

* Functions used in only one file are copied to that file.

* The remaining few functions are moved to a new file, named
  mini-gmp-extra.c, at the gmp top-level.

Functions which get by with just mini-gmp include mini-gmp/mini-gmp.c,
the rest instead include mini-gmp-extra.c.

I did some other minor changes to the files: Use assert rather than
ASSERT. Use memmove rather than mem_copyi. Deleted casts of the return
value from xmalloc, instead expecting the return value to be of type
void *. In mini-gmp-extra.c, I defined xmalloc as an alias for
gmp_default_xalloc, an internal function in mini-gmp.c, rather than
including yet another copy of the same thing.

I'm not sure how to best do the automakery to get mini-gmp included in
the gmp distribution. Is it good enough to just add the mini-gmp
directory to EXTRA_DIST? Or do we need a list or glob pattern for the
wanted files somewhere? I'd like to avoid that backup files, build
products etc from the mini-gmp directory are picked up by accident, and
I'm not sure how smart the automake rules are for directories listed in
EXTRA_DIST.

> From GMP's perspective, I don't think mini-gmp unit testing should be
> necessary.

I see. But it would be nice with a top-level make targat check-mini-gmp,
to build and test mini-gmp with the same configuration (compiler,
builddir, etc) as set up for gmp.

Regards,
/Niels

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mini-gmp.patch.2
URL: <http://gmplib.org/list-archives/gmp-devel/attachments/20120216/9ce351cf/attachment.ksh>
-------------- next part --------------

-- 
Niels M?ller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list