null+****@clear*****
null+****@clear*****
2010年 8月 21日 (土) 20:26:16 JST
Kouhei Sutou 2010-08-21 11:26:16 +0000 (Sat, 21 Aug 2010)
New Revision: 71cd0995efe37dc16784b82f861b5f4f930c761c
Log:
check sphinx version.
Modified files:
configure.ac
doc/ja/Makefile.am
Modified: configure.ac (+51 -0)
===================================================================
--- configure.ac 2010-08-21 07:00:23 +0000 (f87105c)
+++ configure.ac 2010-08-21 11:26:16 +0000 (049ddd5)
@@ -575,6 +575,57 @@ fi
AC_MSG_CHECKING([whether enable futex])
AC_MSG_RESULT($enable_futex)
+# check sphinx-build for documentation
+ac_sphinx_available="no"
+sphinx_required_version="1.0.1"
+sphinx_required_version_major=$(echo $sphinx_required_version | cut -d. -f1)
+sphinx_required_version_minor=$(echo $sphinx_required_version | cut -d. -f2)
+sphinx_required_version_micro=$(echo $sphinx_required_version | cut -d. -f3)
+AC_ARG_WITH([sphinx_build],
+ AS_HELP_STRING([--with-sphinx-build=PATH],
+ [sphinx-build path (default: auto-detect)]),
+ [SPHINX_BUILD="$withval"])
+
+if test "$SPHINX_BUILD" = "no"; then
+ : # ignore
+elif test "$SPHINX_BUILD" = ""; then
+ AC_PATH_PROG(SPHINX_BUILD, sphinx-build, none)
+ if test "$SPHINX_BUILD" != "none"; then
+ ac_sphinx_available="yes"
+ fi
+else
+ AC_CHECK_FILE([$SPHINX_BUILD],
+ [ac_sphinx_available="yes"],
+ [AC_MSG_WARN([$SPHINX_BUILD is not found. Disable document gerataion.])])
+fi
+if test "$ac_sphinx_available" = "yes"; then
+ sphinx_build_version=$($SPHINX_BUILD 2>&1 | head -1 | $SED -e 's/^Sphinx v//')
+ sphinx_build_version_major=$(echo $sphinx_build_version | cut -d. -f1)
+ sphinx_build_version_minor=$(echo $sphinx_build_version | cut -d. -f2)
+ sphinx_build_version_micro=$(echo $sphinx_build_version | cut -d. -f3)
+ if test \
+ \( "$sphinx_build_version_major" -gt \
+ "$sphinx_required_version_major" \) -o \
+ \( "$sphinx_build_version_major" -eq \
+ "$sphinx_required_version_major" -a \
+ "$sphinx_build_version_minor" -gt \
+ "$sphinx_required_version_minor" \) -o \
+ \( "$sphinx_build_version_major" -eq \
+ "$sphinx_required_version_major" -a \
+ "$sphinx_build_version_minor" -eq \
+ "$sphinx_required_version_minor" -a \
+ "$sphinx_build_version_micro" -ge \
+ "$sphinx_required_version_micro" \); then
+ :
+ else
+ ac_sphinx_available="no"
+ fi
+fi
+AC_SUBST(SPHINX_BUILD)
+AM_CONDITIONAL([WITH_SPHINX], [test "$ac_sphinx_available" = "yes"])
+AC_MSG_CHECKING([for sphinx availablity])
+AC_MSG_RESULT($ac_sphinx_available (sphinx-build=$SPHINX_BUILD version=$sphinx_build_version required=$sphinx_required_version))
+
# modules check
modulesdir="\${libdir}/\$(PACKAGE)/modules"
AC_SUBST(modulesdir)
Modified: doc/ja/Makefile.am (+2 -1)
===================================================================
--- doc/ja/Makefile.am 2010-08-21 07:00:23 +0000 (41c537f)
+++ doc/ja/Makefile.am 2010-08-21 11:26:16 +0000 (e5b9db3)
@@ -6,7 +6,6 @@ doc_jadir = $(docdir)/ja
# You can set these variables from the command line.
SPHINXOPTS =
-SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = .
@@ -121,6 +120,7 @@ pdf:
@echo
@echo "Build finished. The PDF files are in $(BUILDDIR)/pdf."
+if WITH_SPHINX
dist-hook:
@touch $(distdir)/man-build-stamp
@touch $(distdir)/html-build-stamp
@@ -401,3 +401,4 @@ html_files = \
$(html_files): html-build-stamp
html-build-stamp:
$(MAKE) html
+endif