On 11 January 2016 at 23:08, Paul Eggert <egg...@cs.ucla.edu> wrote: > On 01/11/2016 12:32 PM, Gavin Smith wrote: >>
> Let's do the latter, since these variables should all be set to 0 or 1 by > then. > > The macro in question AC_REQUIREs gl_LANGINFO_SET, which should set > HAVE_LANGINFO_CODESET and HAVE_LANGINFO_ERA to either 0 or 1. The macro also > sets FUNC_NL_LANGINFO_YESEXPR_WORKS to either 0 or 1, before using it. So, > can you investigate which of these variables is not set as expected, and > why? Neither HAVE_LANGINFO_CODESET nor HAVE_LANGINFO_ERA is set. FUNC_NL_LANGINFO_YESEXPR_WORKS is set. gl_LANGINFO_H_DEFAULTS is expanded in func_gl_gnulib_m4code_langinfo, which I believe contains the code from the langinfo module. func_gl_gnulib_m4code_langinfo is only called from func_gl_gnulib_m4code_nl_langinfo, which is from the nl_langinfo module, which was the only module imported explicitly. func_gl_gnulib_m4code_nl_langinfo only calls func_gl_gnulib_m4code_langinfo after the code that tries to use HAVE_LANGINFO_CODESET, thus the error. It calls it because of the dependencies between the modules: Description: nl_langinfo() function: query locale dependent information. Files: lib/nl_langinfo.c m4/nl_langinfo.m4 Depends-on: langinfo localeconv [test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1] and func_gl_gnulib_m4code_langinfo if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then func_gl_gnulib_m4code_localeconv fi Maybe AC_REQUIRE isn't hoisting the code far enough? The code is remaining in the function corresponding to a gnulib module's code, and not going to the very top level. The code is expanded, but is executed too late.