On 28/06/11 13:45, Paul Emsley wrote:
Hi,
I don't understand how the --with-libgmp-prefix is supposed to work.
In fact, I'd go as far as saying that it's broken.
./configure --with-libgmp-prefix=/opt
in configure additional_includedir and additional_libdir get set correctly
but in config.log, I see:
configure:36897: checking for libgmp
configure:36919: gcc -o conftest -g -O2 conftest.c -lcrypt -lm -lgmp>&5
conftest.c:569:17: fatal error: gmp.h: No such file or directory
... that is (AFAICS), additional_includedir and additional_libdir are
not being used (in AC_LIB_HAVE_LINKFLAGS?)
Additional info:
If I configure with --with-libgmp=/opt (given my reading of
|AC_LIB_HAVE_LINKFLAGS documentation):
https://www.gnu.org/software/gnulib/manual/html_node/Searching-for-Libraries.html
|
then:
checking for libgmp... no
configure: error: GNU MP 4.1 or greater not found, see README
configure:36897: checking for libgmp
configure:36919: gcc -o conftest -g -O2 conftest.c /opt/lib/libgmp.so
-Wl,-rpath -Wl,/opt/lib -lcrypt -lm >&5
conftest.c:569:17: fatal error: gmp.h: No such file or directory
compilation terminated.
Incidentally, configure complains about that:
configure: WARNING: unrecognized options: --with-libgmp
Nevertheless, I believe that that is progress, configure knows how to
handle the library at least.
If I set CPPFLAGS=-I/opt/include, then:
configure:36897: checking for libgmp
configure:36919: gcc -o conftest -g -O2 -I/opt/include conftest.c
/opt/lib/libgmp.so -Wl,-rpath -Wl,/opt/lib -lcrypt -lm >&5
configure:36919: $? = 0
configure:36929: result: yes
configure:36936: checking how to link with libgmp
configure:36938: result: /opt/lib/libgmp.so -Wl,-rpath -Wl,/opt/lib
OK, that worked. But using CPPFLAGS is a hack - and should not be
needed for libgmp dependency (IMHO).
Cheers,
Paul.