diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 36a4102a40..cf0d6a87d7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -4,6 +4,43 @@ dnl This file contains local autoconf functions. sinclude(dynlib.m4) +AC_DEFUN(PHP_SETUP_OPENSSL,[ + if test "$PHP_OPENSSL" = "no"; then + PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl" + fi + + for i in $PHP_OPENSSL; do + if test -r $i/include/openssl/evp.h; then + OPENSSL_DIR=$i + OPENSSL_INC=$i/include + fi + done + + if test -z "$OPENSSL_DIR"; then + AC_MSG_ERROR(Cannot find OpenSSL's <evp.h>) + fi + + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS="-I$OPENSSL_INC" + AC_MSG_CHECKING(for OpenSSL version) + AC_EGREP_CPP(yes,[ + #include <openssl/opensslv.h> + #if OPENSSL_VERSION_NUMBER >= 0x0090600fL + yes + #endif + ],[ + AC_MSG_RESULT(>= 0.9.6) + ],[ + AC_MSG_ERROR(OpenSSL version 0.9.6 or greater required.) + ]) + CPPFLAGS=$old_CPPFLAGS + + AC_ADD_LIBPATH($OPENSSL_DIR/lib) + AC_ADD_LIBRARY(ssl) + AC_ADD_LIBRARY(crypto) + AC_ADD_INCLUDE($OPENSSL_INC) +]) + dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD) dnl dnl Use this macro, if you need to add libraries and or library search |