define HAVE_AWK... we require awk for many parts, but for some cases
authorng0 <ng0@n0.is>
Sun, 1 Dec 2019 23:29:37 +0000 (23:29 +0000)
committerng0 <ng0@n0.is>
Sun, 1 Dec 2019 23:29:37 +0000 (23:29 +0000)
it could make sense to skip it.

Makefile.am
configure.ac
contrib/scripts/Makefile.am

index edcd28b92afbcd0f344f1d67f4f9f050773e7585..f8725390e190505d45690b5c1fb8e2f3231acc67 100644 (file)
@@ -70,5 +70,7 @@ check-python:
        printf "Running flake8 and 2to3 if detected.\n"
        $(top_srcdir)/contrib/scripts/lint/lint-python.sh || true
 
+if HAVE_AWK
 check-texinfo:
        @cd $(top_srcdir); find . -type f ! -path '*/.*' -name '*.texi' -print0 | xargs -0 ./contrib/scripts/check-texinfo.awk > $(srcdir)/texinfo_lint.log || true
+endif
index e8a450b6138feca46df9762a260d7c12ca5bf6c3..7de7b26fc17654ac15d7e7d9f34163abb6256b00 100644 (file)
@@ -254,6 +254,9 @@ AS_IF([test -x "$PERL"],
 # awk
 AC_PATH_PROGS( AWK_BINARY, [awk gawk], ,$PATH:/usr/bin/:/usr/local/bin )
 AC_SUBST([AWK_BINARY])
+AS_IF([test -x "$AWK_BINARY"],
+  [AC_DEFINE_UNQUOTED([HAVE_AWK], [1], [Path to awk])],
+  [AC_DEFINE_UNQUOTED([HAVE_AWK], [0], [Path to awk])])
 
 # should we install gnunet-logread?
 AC_MSG_CHECKING(whether to install gnunet-logread)
index b76e57db7f72fc5180de41cac68b204eab1d5939..9416596c7cb9104628f5034282c5b0e1b8db41ab 100644 (file)
@@ -10,7 +10,14 @@ noinst_SCRIPTS = \
  gnunet_pyexpect.py \
  gnunet_janitor.py \
  gnunet-chk.py \
+ $(AWK_SCRIPTS)
+
+if HAVE_AWK
+AWK_SCRIPTS = \
  check-texinfo.awk
+else
+AWK_SCRIPTS =
+endif
 
 bin_SCRIPTS = \
  gnunet-bugreport \
@@ -49,6 +56,8 @@ SUFFIXES = .py.in .py
        $(do_subst) < $< > $@
        chmod +x $@
 
+if HAVE_AWK
 check-texinfo.awk: check-texinfo.awk.in Makefile
        $(do_subst) < $(srcdir)/check-texinfo.awk.in > check-texinfo.awk
        chmod +x check-texinfo.awk
+endif