
Bruno Haible wrote:
While compiling ppl-0.5 I had problems telling the configure script where my libgmp is installed. Just
--with-gmp-includes=/packages/gnu/include --with-gmp-lib=/packages/gnu/lib
wasn't enough, because
- the test program is linked without any -L option,
- the test program is linked without any -rpath option and then immediately run - which doesn't work when a program depends on shared libraries in nonstandard locations.
As a workaround, I had to use
LDFLAGS="-L/packages/gnu/lib -Wl,-rpath,/packages/gnu/lib" \ ./configure --prefix=/packages/gnu \ --with-gmp-includes=/packages/gnu/include --with-gmp-lib=/packages/gnu/lib
You could make this easier by using AC_LIB_LINKFLAGS(gmpxx, gmp) in your configure.ac file. The AC_LIB_LINKFLAGS macro is defined in gettext-0.12.1/autoconf-lib-link/m4/*.m4 from the GNU gettext-0.12.1 distribution.
Dear Bruno,
thank you very much for your suggestion. I have just downloaded gettext-0.12.1 and looking at AC_LIB_LINKFLAGS(gmpxx, gmp). I must say I was aware of the problem but could not find a portable solution (I know too little about shared libraries and libtool and so on and never find the time to fill this gap).
I agree the problem is very annoying: for example, if you happen to have one libgmp installed into a standard location, but you want to experiment with another version of libgmp, our --with-gmp-* options are of little help.
Would you be so kind to tell us more about the solution you suggest? Is adding AC_LIB_LINKFLAGS(gmpxx, gmp) to configure.ac really all what needs to be done? Shouldn't ac_check_gmp.m4 also be modified so that the directory specified with the option --with-gmp-dir can be taken into account? I also guess the position into configure.ac must be chosen carefully. Thanks again,
Roberto