[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [platform-testers] Request for testing GnuCOBOL 3.1-rc1
From: |
Bruno Haible |
Subject: |
Re: [platform-testers] Request for testing GnuCOBOL 3.1-rc1 |
Date: |
Mon, 13 Jul 2020 00:27:14 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; ) |
On a glibc system, configuring in such a way that it should find and use
my previously installed packages
../configure --prefix=/inst-x86_64-64 \
CPPFLAGS="-I/inst-x86_64-64/include -Wall" \
LDFLAGS="-L/inst-x86_64-64/lib"
fails:
configure: Checks for GMP/MPIR ...
checking for gmp... no
checking for libgmp... no
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for gmp.h... (cached) yes
checking if linking against libgmp with "-lgmp" works... yes
checking matching GMP version... no (header: 6.2 / library: 6.1.0)
configure: error: Unable to use GMP - Please check config.log
The config.log reveals that the test program was linked without -rpath
option:
configure:15363: checking matching GMP version
configure:15395: gcc -o conftest -O2 -I/inst-x86_64-64/include -Wall
-L/inst-x86_64-64/lib conftest.c -lgmp >&5
configure:15395: $? = 0
configure:15395: ./conftest
configure:15395: $? = 0
configure:15432: gcc -o conftest -O2 -I/inst-x86_64-64/include -Wall
-L/inst-x86_64-64/lib conftest.c -lgmp >&5
configure:15432: $? = 0
configure:15432: ./conftest
configure:15432: $? = 0
configure:15452: result: no (header: 6.2 / library: 6.1.0)
and thus used the library installed in /usr, not the one in /inst-x86_64-64.
Of course, I don't use
../configure --prefix=/inst-x86_64-64 \
CPPFLAGS="-I/inst-x86_64-64/include -Wall" \
LDFLAGS="-L/inst-x86_64-64/lib -Wl,-rpath,/inst-x86_64-64/lib"
because that would cause _all_ built programs to have the RPATH entry, not
only those that need it.
The remedy will be to use the Gnulib module 'libgmp'. It uses an
AC_LIB_HAVE_LINKFLAGS invocation; it is this invocation which adds the
necessary -rpath option.
Bruno