[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] nl_langinfo: avoid configure-time syntax error

From: Bruno Haible
Subject: Re: [PATCH] nl_langinfo: avoid configure-time syntax error
Date: Thu, 7 Jan 2010 21:25:21 +0100
User-agent: KMail/1.9.9

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  <address@hidden>

        * 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 @@
-  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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]