From 5437fa7c354b5ddf12b4e13136834d86168e3580 Mon Sep 17 00:00:00 2001 From: Dan Vrátil Date: Mon, 8 Oct 2012 23:27:29 +0200 Subject: Bug #684447 - Check for highlight during configure. If the highlight program cannot be found width AC_PATH_PROGS, configure will abort with an error message. You can either a) install highlight b) specify the patch with HIGHLIGHT=/path/to/highlight c) pass --disable-text-highlight to configure to exclude the module This also makes text-highlight module to fallback to text/plain formatter when highlight program would crash or fail to ensure the content is delivered to user. --- configure.ac | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 95f6ca979b..db4a7af05f 100644 --- a/configure.ac +++ b/configure.ac @@ -1312,6 +1312,35 @@ fi AM_CONDITIONAL([ENABLE_AUDIO_INLINE], [test "x$enable_audio_inline" = "xyes"]) +dnl ************************************************** +dnl text-highlight plugins requires highlight utility +dnl ************************************************** +AC_ARG_ENABLE([text-highlight], + [AS_HELP_STRING([--enable-text-highlight], + [Enable text-highlight plugin (default=yes)])], + [enable_text_highlight="$enableval"], [enable_text_highlight=yes]) +AC_MSG_CHECKING([if source code highlighting support is enabled]) +AC_MSG_RESULT([$enable_text_highlight]) +msg_text_highlight="$enable_text_highlight" +if test "x$enable_text_highlight" = "xyes"; then + AC_ARG_VAR([HIGHLIGHT], [Source code highlighting utility]) + AC_PATH_PROG([HIGHLIGHT], [highlight]) + if test "x$HIGHLIGHT" == "x"; then + AC_MSG_ERROR([ + + Highlight utility not found. + + If you want to disable text-highlight plugin, + please append --disable-text-highlight to configure.]) + fi + AC_DEFINE_UNQUOTED( + HIGHLIGHT_COMMAND, "$HIGHLIGHT", + [Source code highlighting utility]) + + msg_text_highlight="$msg_text_highlight ($HIGHLIGHT)" +fi +AM_CONDITIONAL([ENABLE_TEXT_HIGHLIGHT], [test "x$enable_text_highlight" = "xyes"]) + dnl ************************************** dnl Weather calendars require gweather-3.0 dnl ************************************** @@ -1685,6 +1714,7 @@ echo " SMIME support: $msg_smime Bogofilter support: $msg_bogofilter SpamAssassin support: $msg_spamassassin + Highlight support: $msg_text_highlight Plugins: $msg_plugins User documentation: $with_help " -- cgit