From: Wouter Wijngaards Date: Thu, 23 Apr 2009 15:47:49 +0000 (+0000) Subject: libcrypto and python checks. X-Git-Tag: release-1.3.0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1562a13332d1fe6bc6a7b7395c93791bba02f8da;p=thirdparty%2Funbound.git libcrypto and python checks. git-svn-id: file:///svn/unbound/trunk@1616 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index 314784ff0..614b4a30a 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -606,6 +606,7 @@ AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], ], [ AC_MSG_RESULT(no) # check if -lwsock32 or -lgdi32 are needed. + BAKLIBS="$LIBS" LIBS="$LIBS -lgdi32" AC_MSG_CHECKING([if -lcrypto needs -lgdi32]) AC_TRY_LINK([], [ @@ -617,7 +618,20 @@ AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) + LIBS="$BAKLIBS" + LIBS="$LIBS -ldl" + AC_MSG_CHECKING([if -lcrypto needs -ldl]) + AC_TRY_LINK([], [ + int HMAC_CTX_init(void); + (void)HMAC_CTX_init(); + ],[ + AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, + [If you have HMAC_CTX_init]) + AC_MSG_RESULT(yes) + ],[ + AC_MSG_RESULT(no) AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required]) + ]) ]) ]) fi diff --git a/acx_python.m4 b/acx_python.m4 index 0281979e2..f4bf421f8 100644 --- a/acx_python.m4 +++ b/acx_python.m4 @@ -13,6 +13,11 @@ AC_DEFUN([AC_PYTHON_DEVEL],[ PYTHON_VERSION="" fi + if test -z "$PYTHON_VERSION"; then + PYTHON_VERSION=`$PYTHON -c "import sys, string; \ + print string.split(sys.version)[[0]]"` + fi + # # Check for a version of Python >= 2.1.0 # diff --git a/configure b/configure index cd1269af1..b4643ef62 100755 --- a/configure +++ b/configure @@ -22634,6 +22634,11 @@ echo "$as_me: error: Cannot find python$PYTHON_VERSION in your system path" >&2; PYTHON_VERSION="" fi + if test -z "$PYTHON_VERSION"; then + PYTHON_VERSION=`$PYTHON -c "import sys, string; \ + print string.split(sys.version)[0]"` + fi + # # Check for a version of Python >= 2.1.0 # @@ -22921,7 +22926,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # all done! # - if test ! -z "PYTHON_VERSION"; then + if test ! -z "$PYTHON_VERSION"; then + if test `$PYTHON -c "print '$PYTHON_VERSION' >= '2.4.0'"` = "False"; then + { { echo "$as_me:$LINENO: error: Python version >= 2.4.0 is required" >&5 +echo "$as_me: error: Python version >= 2.4.0 is required" >&2;} + { (exit 1); exit 1; }; } + fi # Have Python @@ -23084,8 +23094,8 @@ _ACEOF fi fi else - { echo "$as_me:$LINENO: result: Python libraries not found, won't build PythonMod or PyUnbound" >&5 -echo "${ECHO_T}Python libraries not found, won't build PythonMod or PyUnbound" >&6; } + { echo "$as_me:$LINENO: result: *** Python libraries not found, won't build PythonMod or PyUnbound ***" >&5 +echo "${ECHO_T}*** Python libraries not found, won't build PythonMod or PyUnbound ***" >&6; } ub_with_pyunbound=no ub_with_pythonmod=no fi @@ -23205,6 +23215,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } # check if -lwsock32 or -lgdi32 are needed. + BAKLIBS="$LIBS" LIBS="$LIBS -lgdi32" { echo "$as_me:$LINENO: checking if -lcrypto needs -lgdi32" >&5 echo $ECHO_N "checking if -lcrypto needs -lgdi32... $ECHO_C" >&6; } @@ -23259,6 +23270,62 @@ sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + LIBS="$BAKLIBS" + LIBS="$LIBS -ldl" + { echo "$as_me:$LINENO: checking if -lcrypto needs -ldl" >&5 +echo $ECHO_N "checking if -lcrypto needs -ldl... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + int HMAC_CTX_init(void); + (void)HMAC_CTX_init(); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_HMAC_CTX_INIT 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { { echo "$as_me:$LINENO: error: OpenSSL found in $ssldir, but version 0.9.7 or higher is required" >&5 echo "$as_me: error: OpenSSL found in $ssldir, but version 0.9.7 or higher is required" >&2;} @@ -23271,6 +23338,11 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + +fi + rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi diff --git a/configure.ac b/configure.ac index aa585e527..6fbfcc8ec 100644 --- a/configure.ac +++ b/configure.ac @@ -296,7 +296,10 @@ if test x_$ub_test_python != x_no; then # Check for Python ub_have_python=no AC_PYTHON_DEVEL - if test ! -z "PYTHON_VERSION"; then + if test ! -z "$PYTHON_VERSION"; then + if test `$PYTHON -c "print '$PYTHON_VERSION' >= '2.4.0'"` = "False"; then + AC_ERROR([Python version >= 2.4.0 is required]) + fi # Have Python AC_DEFINE(HAVE_PYTHON,1,[Define if you have Python libraries and header files.]) @@ -334,7 +337,7 @@ if test x_$ub_test_python != x_no; then fi fi else - AC_MSG_RESULT([Python libraries not found, won't build PythonMod or PyUnbound]) + AC_MSG_RESULT([*** Python libraries not found, won't build PythonMod or PyUnbound ***]) ub_with_pyunbound=no ub_with_pythonmod=no fi diff --git a/doc/Changelog b/doc/Changelog index f57f97443..2654cf3df 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,8 @@ - iana portlist updated. - fix pylib test for Darwin. - fix pymod test for Darwin and a python threading bug in pymod init. + - check python >= 2.4 in configure. + - -ldl check for libcrypto 1.0.0beta. 21 April 2009: Wouter - fix for build outside sourcedir.