summaryrefslogtreecommitdiff
path: root/ext/mcve
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2003-08-30 10:57:42 +0000
committerfoobar <sniper@php.net>2003-08-30 10:57:42 +0000
commit97b151ee3e02f634339ac7226b5a78d3ad9d36b1 (patch)
treeefa5efcd80d6fc151ca5a0a62090b0f23b017be2 /ext/mcve
parentd1adaf65d15b577ba6e331b287ed928e1192566f (diff)
downloadphp-git-97b151ee3e02f634339ac7226b5a78d3ad9d36b1.tar.gz
Added version checking and --with-openssl-dir option
Diffstat (limited to 'ext/mcve')
-rw-r--r--ext/mcve/config.m464
1 files changed, 53 insertions, 11 deletions
diff --git a/ext/mcve/config.m4 b/ext/mcve/config.m4
index 6e83a8775b..4ac1504bf5 100644
--- a/ext/mcve/config.m4
+++ b/ext/mcve/config.m4
@@ -3,24 +3,66 @@ dnl config.m4 for PHP4 MCVE Extension
PHP_ARG_WITH(mcve, for MCVE support,
[ --with-mcve[=DIR] Include MCVE support])
+PHP_ARG_WITH(openssl-dir,OpenSSL dir for MCVE,
+[ --with-openssl-dir[=DIR] MCVE: openssl install prefix.], no, no)
+
if test "$PHP_MCVE" != "no"; then
- if test -r $PHP_MCVE/include/mcve.h; then
- MCVE_DIR=$PHP_MCVE
- else
- for i in /usr /usr/local /usr/local/mcve ; do
- if test -r $i/include/mcve.h; then
- MCVE_DIR=$i
- fi
- done
+
+ if test "$PHP_OPENSSL_DIR" != "no"; then
+ PHP_OPENSSL=$PHP_OPENSSL_DIR
+ PHP_SETUP_OPENSSL(SNMP_SHARED_LIBADD, [], [
+ AC_MSG_ERROR([MCVE: OpenSSL check failed. Please check config.log for more information.])
+ ])
+ else
+ AC_MSG_RESULT([If configure fails, try adding --with-openssl-dir=DIR])
fi
+ case "$PHP_MCVE" in
+ yes [)]
+ for i in /usr/local/mcve /usr/local /usr; do
+ if test -r $i/include/mcve.h; then
+ MCVE_DIR=$i
+ break
+ fi
+ done
+ ;;
+ * [)]
+ test -r "$PHP_MCVE/include/mcve.h" && MCVE_DIR=$PHP_MCVE
+ ;;
+ esac
+
if test -z "$MCVE_DIR"; then
- AC_MSG_ERROR(not found. Please check your MCVE installation; mcve.h NOT FOUND)
+ AC_MSG_ERROR([mcve.h NOT FOUND. Please check your MCVE installation.])
fi
-
+
+ dnl Check version (M_EXPORT exists in >= 3.2.2)
+ saved_CPPFLAGS=$CPPFLAGS
+ AC_MSG_CHECKING([for correct libmcve version])
+ AC_EGREP_CPP(yes,[
+#include "$MCVE_DIR/include/mcve.h"
+#ifdef M_EXPORT
+yes
+#endif
+ ],[
+ AC_MSG_RESULT([ok])
+ ],[
+ AC_MSG_ERROR([libmcve 3.2.2 or greater required.])
+ ])
+ CPPFLAGS=$saved_CPPFLAGS
+
PHP_ADD_INCLUDE($MCVE_DIR/include)
PHP_ADD_LIBRARY_WITH_PATH(mcve, $MCVE_DIR/lib, MCVE_SHARED_LIBADD)
+
+ dnl Build test
+ PHP_CHECK_LIBRARY(mcve, MCVE_DestroyEngine,
+ [
+ AC_DEFINE(HAVE_MCVE, 1, [ ])
+ ], [
+ AC_MSG_ERROR([MCVE: Sanity check failed. Please check config.log for more information.])
+ ], [
+ $MCVE_SHARED_LIBADD
+ ])
+
PHP_NEW_EXTENSION(mcve, mcve.c, $ext_shared)
PHP_SUBST(MCVE_SHARED_LIBADD)
- AC_DEFINE(HAVE_MCVE, 1, [ ])
fi