changeset 24623:f39ae754a7d8

configure: test that makeinfo supports the @sortas command * acinclude.m4 (OCTAVE_PROG_MAKEINFO): Test that makeinfo supports the @sortas command, print a warning and disable docs if it doesn't. This makes explicit the newest command required to build the manual, which depends on Texinfo 6.1 and newer. * configure.ac: Update disabling documentation warning messages.
author Mike Miller <mtmiller@octave.org>
date Fri, 19 Jan 2018 15:09:42 -0800
parents 298c6a6bd869
children ce2eb28e0a6d
files configure.ac m4/acinclude.m4
diffstat 2 files changed, 41 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Fri Jan 19 13:25:24 2018 -0800
+++ b/configure.ac	Fri Jan 19 15:09:42 2018 -0800
@@ -2777,20 +2777,20 @@
   [AS_HELP_STRING([--disable-docs], [don't build documentation files])],
   [if test "$enableval" = no; then
      ENABLE_DOCS=no
-     warn_docs="building documentation disabled; make dist will fail"
+     warn_docs="building documentation disabled; make dist will fail."
      OCTAVE_CONFIGURE_WARNING([warn_docs])
    fi], [])
 if test $ENABLE_DOCS = yes; then
   if test $opengl_graphics = no || test -n "$warn_OSMesa"; then
     if test -n "$warn_gnuplot"; then
       ENABLE_DOCS=no
-      warn_docs_graphics="building documentation disabled because no suitable graphics toolkit is available; make dist will fail"
+      warn_docs_graphics="building documentation disabled because no suitable graphics toolkit is available; make dist will fail."
         OCTAVE_CONFIGURE_WARNING([warn_docs_graphics])
     fi
   fi
   if test -n "$warn_makeinfo"; then
     ENABLE_DOCS=no
-    warn_docs_makeinfo="building documentation disabled because makeinfo was not found; make dist will fail"
+    warn_docs_makeinfo="building documentation disabled because makeinfo was not found or does not support @sortas; make dist will fail."
     OCTAVE_CONFIGURE_WARNING([warn_docs_makeinfo])
   fi
 fi
--- a/m4/acinclude.m4	Fri Jan 19 13:25:24 2018 -0800
+++ b/m4/acinclude.m4	Fri Jan 19 15:09:42 2018 -0800
@@ -2633,6 +2633,44 @@
 "
     OCTAVE_CONFIGURE_WARNING([warn_makeinfo])
   fi
+  dnl If we have a GNU makeinfo program, see if it supports the @sortas command
+  dnl for defining a custom sort key for an index entry.
+  if test -n "$MKINFO"; then
+    AC_CACHE_CHECK([for makeinfo support for @sortas command],
+      [octave_cv_makeinfo_sortas_command],
+      [cat << EOF > conftest.texi
+\input texinfo
+@node Top
+@top Document
+@menu
+* Chapter::
+* Index::
+@end menu
+@node Chapter
+@chapter Chapter
+@cindex @sortas{a} foo
+@node Index
+@unnumbered Index
+@printindex cp
+@bye
+EOF
+        if $MKINFO --no-warn conftest.texi 2>/dev/null; then
+          octave_cv_makeinfo_sortas_command=yes
+        else
+          octave_cv_makeinfo_sortas_command=no
+        fi
+        rm -f conftest.info conftest.texi
+    ])
+    if test $octave_cv_makeinfo_sortas_command = no; then
+      warn_makeinfo="
+
+I wasn't able to find a version of GNU makeinfo that supports the
+@sortas command, but it's only a problem if you need to build the
+manual, which is the case if you're building from VCS sources.
+"
+      OCTAVE_CONFIGURE_WARNING([warn_makeinfo])
+    fi
+  fi
 ])
 dnl
 dnl What pager should we use?