Hello,

I have been looking at porting SoftHSM
(http://www.opendnssec.org/softhsm/) and later looking at the OpenDNSSEC
tool (http://www.opendnssec.org/).

I have been stopped in my tracks by the libtool in base, but I am not
sure i really need to activate the GNU version as I am possibly just
missing something simple.

A non-port ./configure && make ends with this action (which works):

===
/bin/sh ../libtool --tag=CC    --mode=link gcc  -g -O2 -pedantic -Wall -Wextra 
-no-install -static -shared-libgcc   -o checks checks.o 
../src/lib/libsofthsm.la -lstdc++ 
libtool: link: gcc -g -O2 -pedantic -Wall -Wextra -shared-libgcc -o checks 
checks.o  ../src/lib/.libs/libsofthsm.a -L/usr/local/lib -lbotan-1.10 -lsqlite3 
-lstdc++
../src/lib/.libs/libsofthsm.a(SoftDatabase.o)(.text+0x1e65): In function 
`SoftDatabase::getTokenLabel()':
/home/patrik/softhsm-1.3.4/src/lib/SoftDatabase.cpp:203: warning: sprintf() is 
often misused, please use snprintf()
/usr/local/lib/libbz2.so.10.4: warning: strcat() is almost always misused, 
please use strlcat()
/usr/local/lib/libgmp.so.9.0: warning: strcpy() is almost always misused, 
please use strlcpy()
/usr/local/lib/libgmp.so.9.0: warning: vsprintf() is often misused, please use 
vsnprintf()
===

make build breaks like this:
===
/usr/bin/libtool  --tag=CC    --mode=link cc  -O2 -pipe -pedantic -Wall -Wextra 
-no-install -static -shared-libgcc   -o checks checks.o 
../src/lib/libsofthsm.la -lstdc++
libtool: link: cc -o .libs/checks -O2 -pipe -pedantic -Wall -Wextra 
-shared-libgcc checks.o -L.libs 
/usr/ports/pobj/softhsm-1.3.4/softhsm-1.3.4/src/lib/.libs/libsofthsm.a 
-lbotan-1.10 -lsqlite3 -lstdc++ -lm -Wl,-rpath,/usr/local/lib/softhsm
/usr/ports/pobj/softhsm-1.3.4/softhsm-1.3.4/src/lib/.libs/libsofthsm.a(SoftDatabase.o)(.text+0x1e65):
 In function `SoftDatabase::getTokenLabel()':
: warning: sprintf() is often misused, please use snprintf()
/usr/bin/ld: warning: libbz2.so.10.4, needed by .libs/libbotan-1.10.so.0.1, not 
found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libgmp.so.9.0, needed by .libs/libbotan-1.10.so.0.1, not 
found (try using -rpath or -rpath-link)
.libs/libbotan-1.10.so.0.1: undefined reference to `__gmpz_clear'
.libs/libbotan-1.10.so.0.1: undefined reference to `__gmpz_mod'
.libs/libbotan-1.10.so.0.1: undefined reference to `__gmpz_init_set'
.libs/libbotan-1.10.so.0.1: undefined reference to `BZ2_bzDecompressInit'
[...]
===

If i set USE_LIBTOOL=gnu it works:
===
/usr/local/bin/libtool  --tag=CC    --mode=link cc  -O2 -pipe -pedantic -Wall 
-Wextra -no-install -static -shared-libgcc   -o checks checks.o 
../src/lib/libsofthsm.la -lstdc++ 
libtool: link: cc -O2 -pipe -pedantic -Wall -Wextra -shared-libgcc -o checks 
checks.o  ../src/lib/.libs/libsofthsm.a -L/usr/local/lib -lbotan-1.10 -lsqlite3 
-lstdc++
../src/lib/.libs/libsofthsm.a(SoftDatabase.o)(.text+0x1e65): In function 
`SoftDatabase::getTokenLabel()':
: warning: sprintf() is often misused, please use snprintf()
/usr/local/lib/libbz2.so.10.4: warning: strcat() is almost always misused, 
please use strlcat()
/usr/local/lib/libgmp.so.9.0: warning: strcpy() is almost always misused, 
please use strlcpy()
/usr/local/lib/libgmp.so.9.0: warning: vsprintf() is often misused, please use 
vsnprintf()
===

The problem seems to be that while the GNU version adds -L/usr/local/lib, the
base version does not. I have been grasping for straws by including that in
CFLAGS but the base libtool strips it:
===
/usr/bin/libtool  --tag=CC    --mode=link cc  -L/usr/local/lib -pedantic -Wall 
-Wextra -no-install -static -shared-libgcc   -o checks checks.o 
../src/lib/libsofthsm.la -lstdc++
libtool: link: cc -o .libs/checks -pedantic -Wall -Wextra -shared-libgcc 
checks.o -L.libs 
/usr/ports/pobj/softhsm-1.3.4/softhsm-1.3.4/src/lib/.libs/libsofthsm.a 
-lbotan-1.10 -lsqlite3 -lstdc++ -lm -Wl,-rpath,/usr/local/lib/softhsm
===

Is there a proper way to fix this without resorting to GNU?

Regards,
Patrik Lundin

Reply via email to