Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an autoconf option to detect a markdown preprocessor #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ dnl Lua >= 5.1
AX_PROG_LUA(5.1, 5.4)
AX_LUA_HEADERS

dnl markdown converter
AC_PROG_MARKDOWN

dnl Generate output files
AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_HEADER(config.h)
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ dist_doc_DATA += doc/alien.html
dist_doc_DATA += doc/alien.md

doc/alien.html: $(srcdir)/doc/alien.md
markdown $< > $@
@ac_markdown_prog@ $< > $@
18 changes: 18 additions & 0 deletions m4/markdown.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#===
# autoconf macro to check for markdown converters
#

m4_define_default([_AC_MARKDOWN_PROGS],
[markdown \
pandoc])
AC_DEFUN([AC_PROG_MARKDOWN], [
AC_ARG_VAR([MARKDOWN_PROG], [Markdown converter, e.g. /usr/bin/pandoc])
AS_IF([test "x$MARKDOWN_PROG" != 'x'],
[
AC_MSG_RESULT(using $MARKDOWN_PROG to process markdown)
AC_SUBST(ac_markdown_prog, $MARKDOWN_PROG)],
[
AC_CHECK_PROGS(_MARKDOWN_PROG, [_AC_MARKDOWN_PROGS],"")
AS_IF([test "x$_MARKDOWN_PROG" != 'x'],
[AC_SUBST(ac_markdown_prog, $_MARKDOWN_PROG)],
[AC_MSG_ERROR([cannot find a markdown converter (_AC_MARKDOWN_PROGS)])])])])