-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 4/21/2008 5:57 PM:
|
| Weird... I'm applying this fix. It replaces the iswprint etc. functions.
| The replacement does not consider isprint (since that would make the
| assumption that all locales are unibyte), but only ASCII. Still better than
| the completely broken functions.
|
| !       AC_CACHE_CHECK([whether iswcntrl works],
[gl_cv_func_iswcntrl_works],
| !         [
| !           AC_TRY_RUN([#include <stddef.h>
| !                       #include <stdio.h>
| !                       #include <time.h>
| !                       #include <wchar.h>
| !                       #include <wctype.h>
| !                       int main () { return iswprint ('x') == 0; }],
| !             [gl_cv_func_iswcntrl_works=yes],
[gl_cv_func_iswcntrl_works=no])
| !         ],
| !         [

Oops - you made the AC_TRY_COMPILE the fourth argument to AC_CACHE_CHECK,
instead of AC_TRY_RUN, breaking this macro on cross-compilation.

| !           AC_TRY_COMPILE([#include <stdlib.h>
| !                           #if __GNU_LIBRARY__ == 1
| !                           Linux libc5 i18n is broken.
| !                           #endif],
| !             [gl_cv_func_iswcntrl_works=yes],
[gl_cv_func_iswcntrl_works=no])

Oops.  You got bitten by the deprecated API.  Had you used
AC_COMPILE_IFELSE, where the second argument is the desired
action-if-true, this would work.  But in the old AC_TRY_COMPILE,
action-if-true is the third argument.

Fixed as follows:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgia2sACgkQ84KuGfSFAYADLgCdGvT+CHArJAqhlHZc6d5yQLiL
pT4An3mCix+xy/gWWvfKYcMA4/sMD+/1
=BBxc
-----END PGP SIGNATURE-----
From b792aeb401b00124b3c27c9f1d850d3312e7b849 Mon Sep 17 00:00:00 2001
From: Eric Blake <[EMAIL PROTECTED]>
Date: Wed, 7 May 2008 20:53:19 -0600
Subject: [PATCH] Support cross-compilation of <wctype.h>.

* m4/wctype.m4 (gl_WCTYPE_H): Fix improper nesting in
AC_CACHE_CHECK.

Signed-off-by: Eric Blake <[EMAIL PROTECTED]>
---
 ChangeLog    |    6 ++++++
 m4/wctype.m4 |   13 ++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index df3cc32..db8e106 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-07  Eric Blake  <[EMAIL PROTECTED]>
+
+       Support cross-compilation of <wctype.h>.
+       * m4/wctype.m4 (gl_WCTYPE_H): Fix improper nesting in
+       AC_CACHE_CHECK.
+
 2008-05-06  Soren Hansen  <[EMAIL PROTECTED]>  (tiny change)
 
        * build-aux/vc-list-files: Add support for bzr.
diff --git a/m4/wctype.m4 b/m4/wctype.m4
index 7c6718c..1ace2f6 100644
--- a/m4/wctype.m4
+++ b/m4/wctype.m4
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 dnl Written by Paul Eggert.
 
+#serial 2
 AC_DEFUN([gl_WCTYPE_H],
 [
   AC_REQUIRE([AC_PROG_CC])
@@ -41,15 +42,13 @@ AC_DEFUN([gl_WCTYPE_H],
                       #include <wchar.h>
                       #include <wctype.h>
                       int main () { return iswprint ('x') == 0; }],
-            [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
-        ],
-        [
-          AC_TRY_COMPILE([#include <stdlib.h>
+            [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
+            [AC_TRY_COMPILE([#include <stdlib.h>
                           #if __GNU_LIBRARY__ == 1
                           Linux libc5 i18n is broken.
-                          #endif],
-            [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
-        ])
+                          #endif], [],
+              [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
+        ])])
       if test $gl_cv_func_iswcntrl_works = yes; then
         WCTYPE_H=
       fi
-- 
1.5.5.1

Reply via email to