summaryrefslogtreecommitdiff
path: root/aclocal
diff options
context:
space:
mode:
authorDavid Reiss <dreiss@apache.org>2009-07-29 19:07:27 +0000
committerDavid Reiss <dreiss@apache.org>2009-07-29 19:07:27 +0000
commite657eb43117437b8a2b2036982ec3d4cd953b437 (patch)
tree921a720749b95cae8245a2784b60088a58e9a9ba /aclocal
parentc8e300533cc9d12ecb2325ec89b581647cb7707e (diff)
downloadthrift-e657eb43117437b8a2b2036982ec3d4cd953b437.tar.gz
THRIFT-523. Make ax_lib_event.m4 work with newer versions of libevent
libevent changed is minor version numbering scheme with version 1.4.0, and the simplistic comparison function used by ax_lib_event.m4 did not work with the new scheme. This patch introduced a more accurate comparison function that works with all existing versions of libevent. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@799016 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'aclocal')
-rw-r--r--aclocal/ax_lib_event.m424
1 files changed, 22 insertions, 2 deletions
diff --git a/aclocal/ax_lib_event.m4 b/aclocal/ax_lib_event.m4
index 3a48156a7..08043b4c6 100644
--- a/aclocal/ax_lib_event.m4
+++ b/aclocal/ax_lib_event.m4
@@ -83,12 +83,32 @@ AC_DEFUN([AX_LIB_EVENT_DO_CHECK],
const char* wnt_version = "$WANT_LIBEVENT_VERSION";
for (;;) {
/* If we reached the end of the want version. We have it. */
- if (*wnt_version == '\0') {
+ if (*wnt_version == '\0' || *wnt_version == '-') {
return 0;
}
/* If the want version continues but the lib version does not, */
/* we are missing a letter. We don't have it. */
- if (*lib_version == '\0') {
+ if (*lib_version == '\0' || *lib_version == '-') {
+ return 1;
+ }
+ /* In the 1.4 version numbering style, if there are more digits */
+ /* in one version than the other, that one is higher. */
+ int lib_digits;
+ for (lib_digits = 0;
+ lib_version[lib_digits] >= '0' &&
+ lib_version[lib_digits] <= '9';
+ lib_digits++)
+ ;
+ int wnt_digits;
+ for (wnt_digits = 0;
+ wnt_version[wnt_digits] >= '0' &&
+ wnt_version[wnt_digits] <= '9';
+ wnt_digits++)
+ ;
+ if (lib_digits > wnt_digits) {
+ return 0;
+ }
+ if (lib_digits < wnt_digits) {
return 1;
}
/* If we have greater than what we want. We have it. */