changing gmp install name

Niels Möller nisse@lysator.liu.se
07 Jan 2003 15:21:11 +0100


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 can just 
> treat the modified gmp package like a normal one and just type configure , 
> make , make install  to install it under a different name.

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 = libgmp.la $(GMPXX_LTLIBRARIES_OPTION) $(MPBSD_LTLIBRARIES_OPTION)

to

  lib_LTLIBRARIES = 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