Commit 15a13bb0 authored by jehan's avatar jehan
Browse files

fix polarssl checking for autotools

parent 98d3b5b3
...@@ -1163,25 +1163,18 @@ if test "$polarssl_prefix" != "none" ; then ...@@ -1163,25 +1163,18 @@ if test "$polarssl_prefix" != "none" ; then
POLARSSL_CFLAGS="-I${polarssl_prefix}/include" POLARSSL_CFLAGS="-I${polarssl_prefix}/include"
POLARSSL_LIBS="-L${polarssl_prefix}/lib" POLARSSL_LIBS="-L${polarssl_prefix}/lib"
fi fi
POLARSSL_LIBS="$POLARSSL_LIBS -lpolarssl"
CPPFLAGS_save=$CPPFLAGS CPPFLAGS_save=$CPPFLAGS
LIBS_save=$LIBS LIBS_save=$LIBS
CPPFLAGS="$CPPFLAGS $POLARSSL_CFLAGS" CPPFLAGS="$CPPFLAGS $POLARSSL_CFLAGS"
LIBS="$LIBS $POLARSSL_LIBS" LIBS="$LIBS $POLARSSL_LIBS"
AC_CHECK_LIB(mbedtls, ssl_init , [POLARSSL_LIBS="$POLARSSL_LIBS -lmbedtls"], AC_CHECK_LIB(mbedtls, sha1_update , [found_polarssl=yes POLARSSL_LIBS="$POLARSSL_LIBS -lmbedtls"],
[AC_CHECK_LIB(polarssl, ssl_init, [POLARSSL_LIBS="$POLARSSL_LIBS -lpolarssl"])]) [AC_CHECK_LIB(polarssl, sha1_update, [found_polarssl=yes POLARSSL_LIBS="$POLARSSL_LIBS -lpolarssl"],[AC_MSG_NOTICE([polarssl library not found !])])])
LIBS="$LIBS $POLARSSL_LIBS" #to add right -l
AC_CHECK_HEADERS(polarssl/ssl.h, [ if test "x$found_polarssl" == "xyes" ; then
AC_CHECK_LIB(polarssl,sha1_hmac, AC_CHECK_HEADERS(polarssl/ssl.h, [found_polarssl=yes],[found_polarssl=no POLARSSL_CFLAGS="" POLARSSL_LIBS=""])
[found_polarssl=yes; AC_MSG_NOTICE([polarssl usable])], fi
[POLARSSL_CFLAGS=""
POLARSSL_LIBS=""
AC_MSG_ERROR([polarssl headers found but library not found !])])
],[POLARSSL_CFLAGS=""
POLARSSL_LIBS=""])
CPPFLAGS=$CPPFLAGS_save CPPFLAGS=$CPPFLAGS_save
LIBS=$LIBS_save LIBS=$LIBS_save
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment