diff options
-rw-r--r-- | Makefile.am | 13 | ||||
-rw-r--r-- | configure.ac | 26 | ||||
-rw-r--r-- | jq.1.default | 0 |
3 files changed, 31 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am index abf32376..96a885c1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -49,8 +49,19 @@ TEST_LOG_COMPILER = ${srcdir}/tests/run ### Building the manpage man_MANS = jq.1 +.PHONY: real_docs +if ENABLE_DOCS jq.1: $(srcdir)/docs/content/3.manual/manual.yml ( cd ${abs_srcdir}/docs; rake manpage ) > $@ || { rm -f $@; false; } +real_docs: + true +else +jq.1: jq.1.default + cp $^ $@ +real_docs: + @echo "Cannot build full manpage" > /dev/stderr + false +endif @@ -63,6 +74,8 @@ docs/site.yml: configure.ac install-binaries: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec +# Ensure "make dist" fails when we can't build the real manpage +dist-hook: real_docs # setup is only used by distribution developers, not package developers. # Still, as a matter of allowing patching, its not a bad idea to distribute diff --git a/configure.ac b/configure.ac index 503ceaa0..32ecdf7b 100644 --- a/configure.ac +++ b/configure.ac @@ -26,18 +26,28 @@ if test "x$LEX" != xflex; then fi -dnl Check for flex -AC_CHECK_PROGS(flex_cmd, flex) -if test x$flex_cmd = "x" ; then - AC_MSG_NOTICE([flex is required to patch jq.]) -fi - dnl Check for valgrind AC_CHECK_PROGS(valgrind_cmd, valgrind) -if test x$valgrind_cmd = "x" ; then - AC_MSG_NOTICE([valgrind is required to test jq.]) +if test "x$valgrind_cmd" = "x" ; then + AC_MSG_WARN([valgrind is required to test jq.]) fi + +dnl Don't attempt to build docs if there's no Ruby lying around +AC_ARG_ENABLE([docs], + AC_HELP_STRING([--disable-docs], [don't build docs])) + +AS_IF([test "x$enable_docs" != "xno"],[ + AC_CHECK_PROG(bundle_cmd, bundle) + AS_IF([test "x$bundle_cmd" = "x" || \ + ! ( cd ${srcdir}/docs; bundle check 2>/dev/null )],[ + AC_MSG_WARN([no bundler]) + enable_docs=no + ]) +]) + +AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno]) + dnl AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE([-Wall]) diff --git a/jq.1.default b/jq.1.default new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/jq.1.default |