Make the generated wctype.h more self-contained.
authorBruno Haible <bruno@clisp.org>
Tue, 1 May 2007 18:21:31 +0000 (18:21 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 1 May 2007 18:21:31 +0000 (18:21 +0000)
ChangeLog
lib/wctype_.h
m4/wctype.m4
modules/wctype

index a84e798..f302e62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-05-01  Bruno Haible  <bruno@clisp.org>
 
+       * lib/wctype_.h: Test HAVE_ISWCNTRL at configure time.
+       * m4/wctype.m4 (gl_WCTYPE_H): Substitute HAVE_ISWCNTRL.
+       * modules/wctype (Makefile.am): Substitute HAVE_ISWCNTRL instead of
+       HAVE_WCTYPE_CTMP_BUG into wctype.h.
+
+2007-05-01  Bruno Haible  <bruno@clisp.org>
+
        * lib/sys_stat_.h: Test HAVE_LSTAT, HAVE_DECL_MKDIR, HAVE_IO_H at
        configure time.
        * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Substitute HAVE_LSTAT,
 
        * m4/isc-posix.m4: New file.
 
-1998-05-10  Jim Meyering  <meyering@ascend.com>
\ No newline at end of file
+1998-05-10  Jim Meyering  <meyering@ascend.com>
index 460cee2..110a68e 100644 (file)
@@ -63,7 +63,7 @@ typedef int __wctype_wint_t;
 
 /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
    Assume all 12 functions are implemented the same way, or not at all.  */
-#if ! HAVE_ISWCNTRL
+#if ! @HAVE_ISWCNTRL@
 
 /* IRIX 5.3 has macros but no functions, its isw* macros refer to an
    undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
index 62994c6..a56834d 100644 (file)
@@ -10,6 +10,12 @@ dnl Written by Paul Eggert.
 AC_DEFUN([gl_WCTYPE_H],
 [
   AC_CHECK_FUNCS_ONCE([iswcntrl])
+  if test $ac_cv_func_iswcntrl = yes; then
+    HAVE_ISWCNTRL=1
+  else
+    HAVE_ISWCNTRL=0
+  fi
+  AC_SUBST([HAVE_ISWCNTRL])
   AC_CHECK_HEADERS_ONCE([wctype.h])
   AC_REQUIRE([AC_C_INLINE])
 
@@ -23,7 +29,7 @@ AC_DEFUN([gl_WCTYPE_H],
 
   WCTYPE_H=wctype.h
   if test $ac_cv_header_wctype_h = yes; then
-    if test "$ac_cv_func_iswcntrl" = yes; then
+    if test $ac_cv_func_iswcntrl = yes; then
       WCTYPE_H=
     fi
     dnl Compute ABSOLUTE_WCTYPE_H even if WCTYPE_H is empty,
index a6fd346..3365ecc 100644 (file)
@@ -22,7 +22,7 @@ wctype.h: wctype_.h
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
              -e 's|@''ABSOLUTE_WCTYPE_H''@|$(ABSOLUTE_WCTYPE_H)|g' \
-             -e 's/@''HAVE_WCTYPE_CTMP_BUG''@/$(HAVE_WCTYPE_CTMP_BUG)/g' \
+             -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
              < $(srcdir)/wctype_.h; \
        } > $@-t