configure --with-nss=PATH: query pkg-config if available
Bug: https://github.com/bagder/curl/pull/171
This commit is contained in:
parent
691a07dac6
commit
67a8bbb51a
30
configure.ac
30
configure.ac
@ -2122,18 +2122,37 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Without pkg-config, we'll kludge in some defaults
|
NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
|
||||||
addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
|
if test -f "$NSS_PCDIR/nss.pc"; then
|
||||||
addcflags="-I$OPT_NSS/include"
|
CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
|
||||||
version="unknown"
|
if test "$PKGCONFIG" != "no" ; then
|
||||||
nssprefix=$OPT_NSS
|
addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
|
||||||
|
addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
|
||||||
|
addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
|
||||||
|
version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
|
||||||
|
nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test -z "$addlib"; then
|
||||||
|
# Without pkg-config, we'll kludge in some defaults
|
||||||
|
AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
|
||||||
|
addld="-L$OPT_NSS/lib"
|
||||||
|
addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
|
||||||
|
addcflags="-I$OPT_NSS/include"
|
||||||
|
version="unknown"
|
||||||
|
nssprefix=$OPT_NSS
|
||||||
|
fi
|
||||||
|
|
||||||
|
# the following check is always satisfied
|
||||||
if test -n "$addlib"; then
|
if test -n "$addlib"; then
|
||||||
|
|
||||||
|
CLEANLDFLAGS="$LDFLAGS"
|
||||||
CLEANLIBS="$LIBS"
|
CLEANLIBS="$LIBS"
|
||||||
CLEANCPPFLAGS="$CPPFLAGS"
|
CLEANCPPFLAGS="$CPPFLAGS"
|
||||||
|
|
||||||
|
LDFLAGS="$addld $LDFLAGS"
|
||||||
LIBS="$addlib $LIBS"
|
LIBS="$addlib $LIBS"
|
||||||
if test "$addcflags" != "-I/usr/include"; then
|
if test "$addcflags" != "-I/usr/include"; then
|
||||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||||
@ -2149,6 +2168,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
|||||||
curl_ssl_msg="enabled (NSS)"
|
curl_ssl_msg="enabled (NSS)"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
LDFLAGS="$CLEANLDFLAGS"
|
||||||
LIBS="$CLEANLIBS"
|
LIBS="$CLEANLIBS"
|
||||||
CPPFLAGS="$CLEANCPPFLAGS"
|
CPPFLAGS="$CLEANCPPFLAGS"
|
||||||
])
|
])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user