summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-12-14 17:29:38 +0000
committerSascha Schumann <sas@php.net>2000-12-14 17:29:38 +0000
commit80e1124c218923a31b872a3d820e812e6d6c4660 (patch)
tree582ffe5ab72dc6916bd6852314e2f13645002d13 /acinclude.m4
parent6b5c37a8c5d00e204dc80315615fb95ac22e8a49 (diff)
downloadphp-git-80e1124c218923a31b872a3d820e812e6d6c4660.tar.gz
New m4 macros should go into acinclude.m4.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m437
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