1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-10 23:31:19 -07:00

Set DOCLANGS with autoconf depending on texinfo.tex/texindex versions.

This commit is contained in:
Vincent Belaïche 2026-05-02 19:19:58 +02:00
parent e2240b93d4
commit 96ca45312d
2 changed files with 49 additions and 2 deletions

View file

@ -115,8 +115,7 @@ HAVE_GSETTINGS = @HAVE_GSETTINGS@
ANDROID = @ANDROID@
# TODO : make a configure option to keep only desired languages
DOCLANGS?=default fr
DOCLANGS?=@DOCLANGS@
# ==================== Where To Install Things ====================

View file

@ -9,6 +9,7 @@ dnl
AC_DEFUN([gl_TEXINFO],[dnl
AC_REQUIRE([gl_SET_MAKEINFO])
AC_REQUIRE([gl_SET_DOCMISC_W32])
AC_REQUIRE([gl_SET_DOCLANGS])
])
dnl
dnl gl_FIND_MAKEINFO
@ -56,3 +57,50 @@ fi
]AC_SUBST([DOCMISC_W32])
])
dnl
dnl gl_dollar is need for $1, $2 etc. in AWK snippets not to be intepreted by
dnl M4 as macros arguments.
m4_define([gl_dollar],[m4_quote([$])])dnl
m4_define([gl_DOCLANGS_FULL],[[default fr]])dnl
dnl This is minimal texinfo.tex version with "-" removed from the ISO date
dnl part from which there is no issue with index key sorting when document
dnl language/encoding corresponding locale is not installer nor active.
m4_define([gl_TEXINFO_TEX_MINVER],[[20260401.0]])dnl
m4_define([gl_TEXINDEX_MINVER],[[7.1]])dnl
m4_define([gl_TEXINFO_INDEXING_IS_LOCALE_DEPENDANT],[dnl
[DOCLANGS='default']
AC_MSG_WARN([texinfo.tex/texindex versions suggest that indexing is locale dependant, manual compilation is restricted to lang 'default', override this by setting DOCLANGS in the environment])
])dnl
m4_define([gl_GET_TEXINFO_TEX_VER],[dnl
[texinfo_tex_ver=`tex -jobname=conftest '\nonstopmode\input texinfo.tex @typeout{TEXINFO_TEX_VER=@texinfoversion}@bye' | awk 'BEGIN{R=1;FS="="};]gl_dollar[1=="TEXINFO_TEX_VER" { gsub("-","");print ]gl_dollar[2; R=0; exit}; END{ exit R}'`
if test $? -ne 0; then
texinfo_tex_ver_ver=0.0]
AC_MSG_WARN([Can't find texinfo.tex version, check tex and texinfo.tex are installed.])
[fi
]])dnl
m4_define([gl_GET_TEXINDEX_VER],[dnl
[texindex_ver=`texindex --version | awk 'BEGIN { R=1};NR==1 && ]gl_dollar[1 == "texindex"{ print $NF; R=0; exit}; {exit}; END { exit R}'`
if test $? -ne 0; then
texindex_ver=0.0]
AC_MSG_WARN([Can't find texindex version, check texindex is installed.])
[fi
]
])dnl
AC_DEFUN([gl_TEXINFO_VERSION_COMPARE],[dnl
AC_REQUIRE([AS_VERSION_COMPARE])
AS_VERSION_COMPARE([$1],[$2],[gl_TEXINFO_INDEXING_IS_LOCALE_DEPENDANT()],[$3],[$3])dnl
])dnl
dnl gl_SET_DOCLANGS
AC_DEFUN([gl_SET_DOCLANGS],[dnl
AC_REQUIRE([gl_TEXINFO_VERSION_COMPARE])
AC_ARG_VAR([DOCLANGS],[languages for which manuals are compiled, languages supported: ]gl_DOCLANGS_FULL()[, list is space separated])
gl_GET_TEXINFO_TEX_VER()
gl_GET_TEXINDEX_VER()
gl_TEXINFO_VERSION_COMPARE([$texinfo_tex_ver],[gl_TEXINFO_TEX_MINVER()],[dnl
gl_TEXINFO_VERSION_COMPARE([$texindex_ver],[gl_TEXINDEX_MINVER()],[dnl
[DOCLANGS=']gl_DOCLANGS_FULL()[']
AC_MSG_NOTICE([texinfo.tex/texindex versions suggest that indexing is not locale dependant, setting DOCLANGS to ']gl_DOCLANGS_FULL()['])
])
])
AC_SUBST([DOCLANGS])
])
dnl