Skip to content

Commit

Permalink
Secondary compile check for libevent min version = 1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamcat4 committed Sep 27, 2009
1 parent 5a53a6d commit ff5f2d2
Show file tree
Hide file tree
Showing 5 changed files with 1,289 additions and 4,900 deletions.
37 changes: 28 additions & 9 deletions ac/fpm_libevent.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dnl @synopsis AC_LIB_EVENT([MINIMUM-VERSION])
dnl @synopsis AC_LIB_EVENT([MINIMUM-VERSION],[REQUIRED-VERSION])
dnl
dnl Test for the libevent library of a particular version (or newer).
dnl Source: http://svn.apache.org/repos/asf/incubator/thrift/trunk/aclocal/ax_lib_event.m4
Expand Down Expand Up @@ -142,13 +142,12 @@ PHP_ARG_WITH(libevent,,
[ --with-libevent[=PATH] Path to the libevent, needed for fpm SAPI [/usr/local]], yes, yes)
if test "$PHP_LIBEVENT" != "no"; then
WANT_LIBEVENT_VERSION=ifelse([$1], ,1.2,$1)
LIBEVENT_MIN_VERSION=ifelse([$1], ,1.4.3,$1)
LIBEVENT_REQ_VERSION=ifelse([$2], ,1.4.11,$2)
# Default library search paths ($sys_lib_search_path_spec)
AC_LIBTOOL_SYS_DYNAMIC_LINKER
AC_MSG_CHECKING(for libevent >= $WANT_LIBEVENT_VERSION)
libevent_prefix=$ac_default_prefix
if test $prefix != "NONE" -a $prefix != "" -a $prefix != "no" ; then
libevent_prefix=$prefix
Expand All @@ -158,12 +157,36 @@ if test "$PHP_LIBEVENT" != "no"; then
PHP_LIBEVENT=$libevent_prefix
fi
AC_MSG_CHECKING(for libevent >= $LIBEVENT_REQ_VERSION)
for ac_libevent_path in "" $PHP_LIBEVENT /usr /usr/local /opt /opt/local /opt/libevent ; do
WANT_LIBEVENT_VERSION="$LIBEVENT_REQ_VERSION"
AC_LIB_EVENT_DO_CHECK
if test "$success" = "yes"; then
break;
fi
done
if test "$success" = "no"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([Could not find libevent $LIBEVENT_REQ_VERSION.])
AC_MSG_WARN([The use of earlier versions of libevent is not recommended])
AC_MSG_WARN([and can result in unspecified or unsupported behaviour.])
AC_MSG_CHECKING(for minimum libevent version >= $LIBEVENT_MIN_VERSION)
for ac_libevent_path in "" $PHP_LIBEVENT /usr /usr/local /opt /opt/local /opt/libevent ; do
WANT_LIBEVENT_VERSION="$LIBEVENT_MIN_VERSION"
AC_LIB_EVENT_DO_CHECK
if test "$success" = "yes"; then
break;
fi
done
if test "$success" = "no"; then
AC_MSG_RESULT(no)
LIBEVENT_LIBS=""
ac_have_libevent=no
AC_MSG_ERROR([Libevent minimum version >= $LIBEVENT_MIN_VERSION could not be found.])
fi
fi
if test "$ext_shared" = "yes"; then
if test -n "$ac_libevent_path"; then
Expand All @@ -190,11 +213,7 @@ if test "$PHP_LIBEVENT" != "no"; then
fi
fi
if test "$success" != "yes" ; then
AC_MSG_RESULT(no)
ac_have_libevent=no
AC_MSG_ERROR([Libevent $WANT_LIBEVENT_VERSION could not be found])
else
if test "$success" = "yes" ; then
AC_MSG_RESULT(yes)
ac_have_libevent=yes
AC_DEFINE(HAVE_LIBEVENT, 1, [define if libevent is available])
Expand Down
2 changes: 1 addition & 1 deletion config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if test "$PHP_FPM" != "no"; then
PHP_CONFIGURE_PART(Configuring fpm)

sinclude(sapi/fpm/ac/fpm_libevent.m4)
AC_LIB_EVENT([1.4.11])
AC_LIB_EVENT([1.4.3],[1.4.11])

sinclude(sapi/fpm/ac/fpm_checks.m4)
AC_FPM_CHECKS
Expand Down
Loading

0 comments on commit ff5f2d2

Please sign in to comment.