Skip to content

Commit

Permalink
configure --with-nss: drop redundant if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudka committed Apr 17, 2015
1 parent 67a8bbb commit 8dc3bbf
Showing 1 changed file with 36 additions and 40 deletions.
76 changes: 36 additions & 40 deletions configure.ac
Expand Up @@ -2145,53 +2145,49 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
nssprefix=$OPT_NSS
fi

# the following check is always satisfied
if test -n "$addlib"; then

CLEANLDFLAGS="$LDFLAGS"
CLEANLIBS="$LIBS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLDFLAGS="$LDFLAGS"
CLEANLIBS="$LIBS"
CLEANCPPFLAGS="$CPPFLAGS"

LDFLAGS="$addld $LDFLAGS"
LIBS="$addlib $LIBS"
if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags"
fi
LDFLAGS="$addld $LDFLAGS"
LIBS="$addlib $LIBS"
if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags"
fi

dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
[
AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
AC_SUBST(USE_NSS, [1])
USE_NSS="yes"
NSS_ENABLED=1
curl_ssl_msg="enabled (NSS)"
],
[
LDFLAGS="$CLEANLDFLAGS"
LIBS="$CLEANLIBS"
CPPFLAGS="$CLEANCPPFLAGS"
])
dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
[
AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
AC_SUBST(USE_NSS, [1])
USE_NSS="yes"
NSS_ENABLED=1
curl_ssl_msg="enabled (NSS)"
],
[
LDFLAGS="$CLEANLDFLAGS"
LIBS="$CLEANLIBS"
CPPFLAGS="$CLEANCPPFLAGS"
])

if test "x$USE_NSS" = "xyes"; then
AC_MSG_NOTICE([detected NSS version $version])
if test "x$USE_NSS" = "xyes"; then
AC_MSG_NOTICE([detected NSS version $version])

dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
NSS_LIBS=$addlib
AC_SUBST([NSS_LIBS])
dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
NSS_LIBS=$addlib
AC_SUBST([NSS_LIBS])

dnl when shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
fi
dnl when shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
fi

fi
fi dnl NSS found

fi dnl NSS not disabled

Expand Down

0 comments on commit 8dc3bbf

Please sign in to comment.