Hi Paolo,

> AC_CHECK_FUNCS_ONCE should _always_ expand to an empty string.  The 
> test is done always---and it is done outside the macro.

Then the test of $HAVE_LANGINFO_H = 1 can go away as well: It was meant
to save some configure execution time by not checking for nl_langinfo
when <langinfo.h> does not exist.

Note also that it is more robust to avoid prepending 'x' here: If through
some mistake, AC_CHECK_FUNCS_ONCE([nl_langinfo]) ends up not being executed
before the test of its result, it's preferable to get an error message like
"test: =: unary operator expected" rather than a silent malfunction.

I'm applying this:


2010-01-07  Bruno Haible  <br...@clisp.org>

        * m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Simplify logic.

--- m4/nl_langinfo.m4.orig      Thu Jan  7 21:17:05 2010
+++ m4/nl_langinfo.m4   Thu Jan  7 21:16:54 2010
@@ -1,4 +1,4 @@
-# nl_langinfo.m4 serial 2
+# nl_langinfo.m4 serial 3
 dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,8 +9,7 @@
   AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
   AC_REQUIRE([gl_LANGINFO_H])
   AC_CHECK_FUNCS_ONCE([nl_langinfo])
-  if test $HAVE_LANGINFO_H = 1 \
-     && test x$ac_cv_func_nl_langinfo = xyes; then
+  if test $ac_cv_func_nl_langinfo = yes; then
     if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then
       :
     else


Reply via email to