diff options
author | James Booth <boothj5@gmail.com> | 2014-02-09 00:32:11 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-02-09 00:32:11 +0000 |
commit | fa89e2aa628c769540a73989759394f2bd7744c1 (patch) | |
tree | efdadc4ad612fde5f75ca167851d02a838d79aeb /configure.ac | |
parent | 50afe7366e00767208fc9d17167a768cf924d6cb (diff) | |
download | profani-tty-fa89e2aa628c769540a73989759394f2bd7744c1.tar.gz |
Check for libotr version
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index aed16cd8..65560ac9 100644 --- a/configure.ac +++ b/configure.ac @@ -131,14 +131,38 @@ elif test "x$with_xscreensaver" = x; then [AC_MSG_NOTICE([libX11 not found, falling back to profanity auto-away])]) fi +AM_CONDITIONAL([BUILD_OTR], [false]) AM_CONDITIONAL([BUILD_OTR3], [false]) +AM_CONDITIONAL([BUILD_OTR4], [false]) if test "x$enable_otr" = xyes; then AC_SEARCH_LIBS([otrl_init], [otr], - [AM_CONDITIONAL([BUILD_OTR3], [true]) AC_DEFINE([HAVE_LIBOTR], [1], [Have libotr])], + [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_ERROR([libotr is required for otr encryption support])]) elif test "x$enable_otr" = x; then AC_SEARCH_LIBS([otrl_init], [otr], - [AM_CONDITIONAL([BUILD_OTR3], [true]) AC_DEFINE([HAVE_LIBOTR], [1], [Have libotr])], + [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 entryption support not enabled])]) fi |