From 7dfb288ba74ac06a1ee9b2a0e661b5da016ab3d7 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 22 Dec 2015 22:52:04 -0500 Subject: [PATCH] dia check via configure --- configure.ac | 17 +++++++++++++++++ doc/Makefile.am | 14 +++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 5dacabe..9b9481d 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,23 @@ AS_IF(test "$JAVA" -a ! "$CCJAR", AM_CONDITIONAL(HAS_CCJAR, [test "$CCJAR"]) +# dia used for documentation images +path_dia=dia +AC_ARG_WITH([dia], + [AS_HELP_STRING([--without-dia], + [disable support for documentation graphics])], + [], + [with_dia=yes]) + +AS_IF([test "$with_dia" != no], + [AC_CHECK_PROGS(DIA, [dia]) + AS_IF([test "$DIA"], + [], + [AC_MSG_WARN([could not locate dia (--without-dia to disable)])]) + ]) + +AM_CONDITIONAL(HAS_DIA, [test "$DIA"]) + # check for performance tests AC_MSG_CHECKING([for performance tests]) PERF_TESTS=$( find $srcdir/test/perf -name 'perf-*.js' | tr '\n' ' ' | LC_ALL=C sort ) diff --git a/doc/Makefile.am b/doc/Makefile.am index e985d28..c370b4d 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -59,13 +59,21 @@ pdf-local: img html-local: img easejs.css highlight.pack.js interactive.js # doc images +if HAS_DIA img/%.png: img/%.dia echo "$<" | grep -q 'wide' \ - && dia -e $@ -s x250 $< \ - || dia -e $@ -s 300x $< + && $(DIA) -e $@ -s x250 $< \ + || $(DIA) -e $@ -s 300x $< +else + @echo "warning: not building eps (--without-dia)" +endif img/%.eps: img/%.dia - dia -e $@ $< +if HAS_DIA + $(DIA) -e $@ $< +else + @echo "warning: not building eps (--without-dia)" +endif # doc plain text $(path_doc_output_plain): $(doc_imgs_txt)