Fix libetpan version test
authorRicardo Mones <ricardo@mones.org>
Fri, 6 Nov 2015 11:10:02 +0000 (12:10 +0100)
committerRicardo Mones <ricardo@mones.org>
Fri, 6 Nov 2015 11:10:02 +0000 (12:10 +0100)
For current libetpan versioning schema ;-)
Thanks Brian Morrison for the heads up!

configure.ac

index 2aa91d0ab69005f0599301fd57a7f33719af7705..546a473f9c6b37b295bd469c5f31b9b50c350ef8 100644 (file)
@@ -98,6 +98,7 @@ LT_INIT
 LT_AC_PROG_RC
 AC_LIBTOOL_RC
 AC_PROG_LIBTOOL
 LT_AC_PROG_RC
 AC_LIBTOOL_RC
 AC_PROG_LIBTOOL
+AC_PROG_AWK
 
 AC_SYS_LARGEFILE
 
 
 AC_SYS_LARGEFILE
 
@@ -871,12 +872,8 @@ if test x"$enable_libetpan" = xyes; then
        if test "x$libetpan_result" = "xyes"; then
           LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
           LIBETPAN_LIBS="`$libetpanconfig --libs`"
        if test "x$libetpan_result" = "xyes"; then
           LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
           LIBETPAN_LIBS="`$libetpanconfig --libs`"
-           LIBETPAN_STABLE=`$libetpanconfig --version | grep -v ^0`
-          LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
-           if test x"$LIBETPAN_STABLE" != "x"; then
-                LIBETPAN_VERSION="100"
-           fi
-          if test "$LIBETPAN_VERSION" -lt "057"; then
+          LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 100) + $2}'`
+          if test "$LIBETPAN_VERSION" -lt "57"; then
                AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
                AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
                 AC_MSG_ERROR([libetpan 0.57 not found])
                AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
                AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
                 AC_MSG_ERROR([libetpan 0.57 not found])