autoconf: Check asciidoc version to automatically set ASCIIDOC8
Check for asciidoc, and if it exists check asciidoc version, setting ASCIIDOC8 when needed. Currently it just runs asciidoc in asciidoc7 compatibility mode (see: Documentation/Makefile). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jakub Narebski committed
Dec 9, 2007 at 13:57 UTC
923db42eea6fac743d8c93f0af4904740a445edf
2 files changed
+22
config.mak.in
+1
@@ -23,6 +23,7 @@ VPATH = @srcdir@
23
export exec_prefix mandir
24
export srcdir VPATH
25
26
+ASCIIDOC8=@ASCIIDOC8@
27
NEEDS_SSL_WITH_CRYPTO=@NEEDS_SSL_WITH_CRYPTO@
28
NO_OPENSSL=@NO_OPENSSL@
29
NO_CURL=@NO_CURL@
configure.ac
+21
@@ -122,6 +122,27 @@ if test -z "$NO_TCLTK"; then
122
AC_SUBST(TCLTK_PATH)
123
fi
124
fi
125
+AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
126
+if test -n "$ASCIIDOC"; then
127
+ AC_MSG_CHECKING([for asciidoc version])
128
+ asciidoc_version=`$ASCIIDOC --version 2>&1`
129
+ case "${asciidoc_version}" in
130
+ asciidoc' '8*)
131
+ ASCIIDOC8=YesPlease
132
+ AC_MSG_RESULT([${asciidoc_version} > 7])
133
+ ;;
134
+ asciidoc' '7*)
135
+ ASCIIDOC8=
136
+ AC_MSG_RESULT([${asciidoc_version}])
137
+ ;;
138
+ *)
139
+ ASCIIDOC8=
140
+ AC_MSG_RESULT([${asciidoc_version} (unknown)])
141
+ ;;
142
+ esac
143
+fi
144
+AC_SUBST(ASCIIDOC8)
145
+
146
147
## Checks for libraries.
148
AC_MSG_NOTICE([CHECKS for libraries])