about summary refs log tree commit diff stats
path: root/configure.ac
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2015-06-21 21:29:20 +0000
committerDmitry Podgorny <pasis.ua@gmail.com>2015-06-21 21:29:20 +0000
commit1dba341da872baa553742ae69b010e285b59e5e5 (patch)
tree164efd04ee67012926b6a3748c90fc36ea6a6259 /configure.ac
parentd7ec339e3ea668668cbe5fb817bf9914d0265116 (diff)
downloadprofani-tty-1dba341da872baa553742ae69b010e285b59e5e5.tar.gz
autotools: Avoid copy-paste in configure.ac
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 4 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index f7402cd2..bead3873 100644
--- a/configure.ac
+++ b/configure.ac
@@ -189,7 +189,7 @@ fi
 AM_CONDITIONAL([BUILD_OTR], [false])
 AM_CONDITIONAL([BUILD_OTR3], [false])
 AM_CONDITIONAL([BUILD_OTR4], [false])
-if test "x$enable_otr" = xyes; then
+if test "x$enable_otr" != xno; then
     AC_SEARCH_LIBS([otrl_init], [otr],
         [AC_COMPILE_IFELSE(
             [AC_LANG_PROGRAM([[
@@ -203,22 +203,9 @@ if test "x$enable_otr" = xyes; then
             ]])],
             [AM_CONDITIONAL([BUILD_OTR], [true]) AM_CONDITIONAL([BUILD_OTR4], [true]) AC_DEFINE([HAVE_LIBOTR], [1], [Have libotr])],
             [AM_CONDITIONAL([BUILD_OTR], [true]) AM_CONDITIONAL([BUILD_OTR3], [true]) AC_DEFINE([HAVE_LIBOTR], [1], [Have libotr])])],
-        [AC_MSG_ERROR([libotr is required for otr encryption support])])
-elif test "x$enable_otr" = x; then
-    AC_SEARCH_LIBS([otrl_init], [otr],
-        [AC_COMPILE_IFELSE(
-            [AC_LANG_PROGRAM([[
-            #include <libotr/version.h>
-            ]],[[
-            #if OTRL_VERSION_MAJOR == 4
-            // OK
-            #else
-            # assume version 3
-            #endif
-            ]])],
-            [AM_CONDITIONAL([BUILD_OTR], [true]) AM_CONDITIONAL([BUILD_OTR4], [true]) AC_DEFINE([HAVE_LIBOTR], [1], [Have libotr])],
-            [AM_CONDITIONAL([BUILD_OTR], [true]) AM_CONDITIONAL([BUILD_OTR3], [true]) AC_DEFINE([HAVE_LIBOTR], [1], [Have libotr])])],
-        [AC_MSG_NOTICE([libotr not found, otr encryption support not enabled])])
+        [AS_IF([test "x$enable_otr" = xyes],
+            [AC_MSG_ERROR([libotr is required for otr encryption support])],
+            [AC_MSG_NOTICE([libotr not found, otr encryption support not enabled])])])
 fi
 
 AS_IF([test "x$with_themes" = xno],