#
TESTBINDIR = ./$(BUILD_DIR)/bin/local
TESTBIN = $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR)
+
+#
+# For creating documentation via doc/all.mk
+#
+ASCIIDOCTOR := @ASCIIDOCTOR@
+PANDOC := @PANDOC@
+PANDOC_ENGINE := @PANDOC_ENGINE@
build_vendor
build_cpu
build
+PANDOC_ENGINE
+PANDOC
+ASCIIDOCTOR
GIT
RADIUSD_VERSION_STRING
target_alias
+# Extract the first word of "asciidoctor", so it can be a program name with args.
+set dummy asciidoctor; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ASCIIDOCTOR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ASCIIDOCTOR in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ASCIIDOCTOR="$ASCIIDOCTOR" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ASCIIDOCTOR="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ASCIIDOCTOR=$ac_cv_path_ASCIIDOCTOR
+if test -n "$ASCIIDOCTOR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASCIIDOCTOR" >&5
+$as_echo "$ASCIIDOCTOR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test "x$ac_cv_path_ASCIIDOCTOR" = "x"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asciidoctor not found - Please install if you want build the docs" >&5
+$as_echo "$as_me: WARNING: asciidoctor not found - Please install if you want build the docs" >&2;}
+fi
+
+ # Extract the first word of "pandoc", so it can be a program name with args.
+set dummy pandoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PANDOC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PANDOC in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PANDOC=$ac_cv_path_PANDOC
+if test -n "$PANDOC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5
+$as_echo "$PANDOC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test "x$ac_cv_path_PANDOC" = "x"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pandoc not found - Please install if you want build the docs" >&5
+$as_echo "$as_me: WARNING: pandoc not found - Please install if you want build the docs" >&2;}
+else
+ #
+ # Pandoc v2 onwards renamed --latex-engine to --pdf-engine
+ #
+ if pandoc --help 2>&1 | grep -q "latex-engine"; then
+ PANDOC_ENGINE=latex
+ else
+ PANDOC_ENGINE=pdf
+ fi
+
+fi
+
# Check whether --enable-developer was given.
if test "${enable_developer+set}" = set; then :
enableval=$enable_developer; case "$enableval" in
dnl #
AC_CHECK_PROG(GIT, git, yes, no)
+dnl #
+dnl # check for ASCIIDOCTOR and pandoc
+dnl #
+AC_PATH_PROG(ASCIIDOCTOR, asciidoctor)
+if test "x$ac_cv_path_ASCIIDOCTOR" = "x"; then
+ AC_MSG_WARN([asciidoctor not found - Please install if you want build the docs])
+fi
+
+ AC_PATH_PROG(PANDOC, pandoc)
+if test "x$ac_cv_path_PANDOC" = "x"; then
+ AC_MSG_WARN([pandoc not found - Please install if you want build the docs])
+else
+ #
+ # Pandoc v2 onwards renamed --latex-engine to --pdf-engine
+ #
+ if pandoc --help 2>&1 | grep -q "latex-engine"; then
+ PANDOC_ENGINE=latex
+ else
+ PANDOC_ENGINE=pdf
+ fi
+ AC_SUBST(PANDOC_ENGINE)
+fi
+
dnl #
dnl # Enable developer features like debugging symbols.
dnl # These checks must be done before expanding the AC_PROG_CC
-ifneq "$(docdir)" "no"
+#
+# Check if we can build the documentation.
+#
+# We try to build it, but turn off the build unless
+# all of the prerequisites have been found.
+#
+WITH_DOCS=yes
+
+ifeq "$(ASCIIDOCTOR)" ""
+WITH_DOCS=no
+endif
+
+ifeq "$(PANDOC)" ""
+WITH_DOCS=no
+endif
+
+ifeq "$(docdir)" "no"
+WITH_DOCS=no
+endif
+
+ifeq "$(WITH_DOCS)" "yes"
#
# Running "shell" is expensive on OSX. Building the documentation
clean.doc:
${Q}rm -f *~ rfc/*~ examples/*~ $(ADOC_FILES) $(HTML_FILES) $(PDF_FILES)
-#
-# Checking some dependencies
-#
-ifneq "$(strip $(foreach x,html pdf adoc asciidoc,$(findstring $(x),$(MAKECMDGOALS))))" ""
-ifeq ($(shell which pandoc 2>/dev/null),)
-$(error You need to install pandoc)
-endif
-endif
-
-ifneq "$(strip $(foreach x,adoc asciidoc,$(findstring $(x),$(MAKECMDGOALS))))" ""
-ifeq ($(shell which asciidoctor 2>/dev/null),)
-$(error You need to install asciidoctor)
-endif
-endif
-
-#
-# Pandoc v2 onwards renamed --latex-engine to --pdf-engine
-#
-PANDOC_ENGINE=pdf
-ifneq ($(shell pandoc --help | grep latex-engine),)
-PANDOC_ENGINE=latex
-endif
-
#
# Markdown files get converted to asciidoc via pandoc.
#
doc/raddb/%.adoc: raddb/%.md
@echo PANDOC $^
@mkdir -p $(dir $@)
- @pandoc --filter=scripts/asciidoc/pandoc-filter -w asciidoc -o $@ $^
+ @$(PANDOC) --filter=scripts/asciidoc/pandoc-filter -w asciidoc -o $@ $^
#
# Conf files get converted to Asciidoc via our own magic script.
doc/%.html: doc/%.adoc
@echo HTML $^
- @asciidoctor $< -b html5 -o $@ $<
+ @$(ASCIIDOCTOR) $< -b html5 -o $@ $<
doc/%.pdf: doc/%.adoc
@echo PDF $^
- @asciidoctor $< -b docbook5 -o - | \
- pandoc -f docbook -t latex --${PANDOC_ENGINE}-engine=xelatex \
+ @$(ASCIIDOCTOR) $< -b docbook5 -o - | \
+ $(PANDOC) -f docbook -t latex --${PANDOC_ENGINE}-engine=xelatex \
-V papersize=letter \
-V images=yes \
--template=./scripts/asciidoc/freeradius.template -o $@
doc/%.pdf: doc/%.md
@echo PDF $^
- pandoc -f markdown -t latex --${PANDOC_ENGINE}-engine=xelatex \
+ @$(PANDOC) -f markdown -t latex --${PANDOC_ENGINE}-engine=xelatex \
-V papersize=letter \
--template=./scripts/asciidoc/freeradius.template -o $@ $<