]> granicus.if.org Git - jq/commitdiff
Don't build the manpage unless there's a working Ruby setup.
authorStephen Dolan <mu@netsoc.tcd.ie>
Thu, 9 May 2013 14:22:38 +0000 (15:22 +0100)
committerStephen Dolan <mu@netsoc.tcd.ie>
Thu, 9 May 2013 14:22:38 +0000 (15:22 +0100)
Makefile.am
configure.ac
jq.1.default [new file with mode: 0644]

index abf32376009b5880a9734d159243ad1f452439df..96a885c105c6e1f7c457748e81d0898a8a9697d7 100644 (file)
@@ -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 
index 503ceaa0364afeb9af8c965bb211b945326fbf00..32ecdf7bdc9bfe686faaf2bb9d015ab483cb6966 100644 (file)
@@ -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 (file)
index 0000000..e69de29