[Patches] Patch to src/Modules/mpzmodule.c

Peter Funk pf@artcom-gmbh.de
Thu, 24 Feb 2000 16:33:24 +0100 (MET)


Hi!

Andrew M. Kuchling schrieb:
> Peter Funk writes:
> >This patch allows building the Python 'mpzmodule' under SuSE Linux
> >without having to install the source package of the GMP-libary.
> >The gmp-mparam.h seems to be an internal header file.  The patch 
> >shouldn't hurt any other platforms.
> >+ #if defined __GLIBC__ && __GLIBC__ >= 2 /*aid building on Linux distributions*/
> >+ #define BITS_PER_MP_LIMB mp_bits_per_limb
> >+ #else
> >  #include "gmp-mparam.h"
> >+ #endif
> 
> This seems like the wrong fix, tying GMP to the version of glibc!
> (They haven't rolled GMP into glibc, have they?)  

No GMP and GLIBC are still distinct packages.  May be this was too 
pragmatic patch just to be able to build the module without having
to install the source-rpm previously.  On RPM-based Linux distributions
like Red Hat, SuSE and others you usually don't have the source tree
unpacked during the build process of another package.  Packages are 
unpacked and build one at a time on demand.

> If GMP 2.0 exposes
> an mp_bits_per_limb constant, then the correct patch may just be
> changing BITS_PER_MP_LIMB to mp_bits_per_limb, inside an #ifdef GMP2
> if necessary.

I've used the following version of GMP during my build:
Name        : gmp                         Distribution: SuSE Linux 6.3 (i386)
Version     : 2.0.2                             Vendor: SuSE GmbH, Nuernberg, Germany
[...]
/usr/include/gmp.h
[...]
/usr/lib/libgmp.a

As you can see, there is no 'gmp-param.h' exposed by the package.  The package
builder at SuSE used the same patch for building the Python 1.5.2 RPM
distributed with SuSE Linux in 6.x.  I have simply stolen his idea while 
building the CVS snapshot.

Regards, Peter
-- 
Peter Funk, Oldenburger Str.86, 27777 Ganderkesee, Tel: 04222 9502 70, Fax: -60