cURL / Mailing Lists / curl-library / Single Mail

curl-library

NSS and configure and pkg-config

From: Guenter <lists_at_gknw.net>
Date: Mon, 31 Aug 2009 02:11:21 +0200

Hi,
I'm still trying to convince the MingW32 cross compiler to do a cURL
build with NSS but no go ....
I've hacked a simple test script which checks for NSS via pkg-config:
#!/bin/sh
test -z "${1}" && echo "Usage: ${0%*/} package [platform]" && exit 1
#if test -n "${2}"; then
case "${2}" in
  mingw32)
    export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig
    ;;
  mingw64)
    export
PKG_CONFIG_PATH=/usr/x86_64-pc-mingw32/sys-root/mingw/lib/pkgconfig
    ;;
  *)
    ;;
esac
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
pkg-config --exists ${1}
if test "${?}" = "0"; then
  version=`pkg-config --modversion ${1}`
  echo "${1} version : ${version}"
  cflags=`pkg-config --cflags ${1}`
  echo "${1} cflags : ${cflags}"
  libs=`pkg-config --libs ${1}`
  echo "${1} libs : ${libs}"
else
  echo "Package ${1} not found."
fi

now when I check with this for NSS I get:
PKG_CONFIG_PATH=/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig
nss version : 3.12.3
nss cflags : -I/usr/i686-pc-mingw32/sys-root/mingw/include/nss3
-I/usr/i686-pc-mingw32/sys-root/mingw/include/nspr4
nss libs : -L/usr/i686-pc-mingw32/sys-root/mingw/lib -lssl3 -lsmime3
-lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4

so all looks fine, but nevertheless configure fails to detect:
http://curl.haxx.se/auto/log.cgi?id=20090830224447-21556
checking for PK11_CreateGenericObject in -lnss3... yes
checking for NSS_Initialize in -lnss3... no

looking into config.log it seems that for the second test the Linux libs
are used:
configure:26605: checking for PK11_CreateGenericObject in -lnss3
configure:26637: i686-pc-mingw32-gcc -o conftest.exe
-D_WIN32_WINNT=0x0501 -g -O0 -pedantic -Wall -W -Wpointer-arith
-Wwrite-strings -Wunused -Wshadow -Winline -Wnested-externs
-Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal
-Wno-multichar -Wsign-compare -Wundef -Wno-format-nonliteral
-Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement
-Wcast-align -Wtype-limits -Wold-style-declaration
-Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers
-Wconversion -Wno-sign-conversion -Wvla -Wno-system-headers -DCURLDEBUG
-DDEBUGBUILD conftest.c -lnss3 -lssh2 -lwldap32 -lws2_32 -lz >&5
conftest.c:70: warning: function declaration isn't a prototype
configure:26644: $? = 0
configure:26665: result: yes
configure:26689: checking for NSS_Initialize in -lnss3
configure:26721: i686-pc-mingw32-gcc -o conftest.exe
-D_WIN32_WINNT=0x0501 -g -O0 -pedantic -Wall -W -Wpointer-arith
-Wwrite-strings -Wunused -Wshadow -Winline -Wnested-externs
-Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal
-Wno-multichar -Wsign-compare -Wundef -Wno-format-nonliteral
-Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement
-Wcast-align -Wtype-limits -Wold-style-declaration
-Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers
-Wconversion -Wno-sign-conversion -Wvla -Wno-system-headers -DCURLDEBUG
-DDEBUGBUILD -I/usr/i686-pc-mingw32/sys-root/mingw/include conftest.c
-lnss3 -lssh2 -lwldap32 -lws2_32 -lz
-L/usr/i686-pc-mingw32/sys-root/mingw/lib -lssl3 -lsmime3 -lnss3 -lplds4
-lplc4 -lnspr4 -lpthread -ldl >&5
conftest.c:71: warning: function declaration isn't a prototype
/usr/lib64/gcc/i686-pc-mingw32/4.3.3/../../../../i686-pc-mingw32/bin/ld:
cannot find -ldl
collect2: ld returned 1 exit status
configure:26728: $? = 1

anyone an idea why this happens?

Gün.
Received on 2009-08-31