changing gmp install name

Jason Moxham J.L.Moxham@maths.soton.ac.uk
Tue, 7 Jan 2003 17:11:35 +0000


On Tuesday 07 Jan 2003 2:21 pm, Niels M=F6ller wrote:
> Jason Moxham <J.L.Moxham@maths.soton.ac.uk> writes:
> > No , I asked if it's possible to change the gmp install name , so I c=
an
> > just treat the modified gmp package like a normal one and just type
> > configure , make , make install  to install it under a different name=
=2E
>
> I think the recommended way to have several gmp versions installed at
> once it to simply install them under a different prefix.
>
> When compiling programs that use gmp, you set LDFLAGS and CPPFLAGS so
> that it uses the right version. If you're linking dynamically, you
> will also want to use -R (-Wl,-rpath, on linux, IIRC) toy make sure
> that your binaries also pick up the right library at run time.
>
> If for some reason that simple scheme doesn't work for you, you
> probably need to explain why.
>
> > I know how to write scripts to do all this before and after . What I
> > expect the answer to be is something like a varible "package name"
> > in Makefile.am which I would change from "GMP" to "GMP_TEST"
>
> I'm afraid it's harder than that to change it in Makefile.am. You
> first need to change the line
>
>   lib_LTLIBRARIES =3D libgmp.la $(GMPXX_LTLIBRARIES_OPTION)
> $(MPBSD_LTLIBRARIES_OPTION)
>
> to
>
>   lib_LTLIBRARIES =3D libfoogmp.la
>
> and then search and replace all occurances of libgmp. You probably
> also need to understand and change the LIBGMP_LT_* definitions at the
> top of the file.
>
> I've never used libtool, perhaps there's some other trick you can do
> with it.
>
> /Niels

Excelent , thanks

using

tar xzf gmp-4.1.2.tar.gz
cd gmp-4.1.2
sed -e s/libgmp/libjaygmp/g Makefile.am > temp1
sed -e s/LIBGMP/LIBJAYGMP/g temp1 > temp2
sed -e "s/gmp\.h/jaygmp.h/g" temp2 > Makefile.am
sed -e "s/gmp\.h/jaygmp.h/g" configure.in > temp1
sed -e s/libgmp/libjaygmp/g temp1 > configure.in
rm temp1 temp2
autoheader
autoconf
automake
cd ..
mv gmp-4.1.2 jaygmp-4.1.2
tar cjf jaygmp-4.1.2.tar.bz2 jaygmp-4.1.2
rm -r jaygmp-4.1.2

to create a new package jaygmp , which can use the usual ./configure ; ma=
ke ;=20
make install to use it , and using "#include "jaygmp.h" in the C programs=
 and=20
-ljaygmp on the compile line.

A few problems remain , make check fails , --enable-cxx fails , probably=20
--enable-mpfr fails , the info files are still under gmp , and who's know=
s=20
what else :)



This appears to work , although info files are still under gmp