changeset 8781:ef37a3689142

Make the generated wctype.h more self-contained.
author Bruno Haible <bruno@clisp.org>
date Tue, 01 May 2007 18:21:31 +0000
parents d9e13374d316
children 651dfbbfd8d1
files ChangeLog lib/wctype_.h m4/wctype.m4 modules/wctype
diffstat 4 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
@@ -30171,4 +30178,4 @@
 
 	* 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>
--- a/lib/wctype_.h
+++ b/lib/wctype_.h
@@ -63,7 +63,7 @@
 
 /* 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
--- a/m4/wctype.m4
+++ b/m4/wctype.m4
@@ -10,6 +10,12 @@
 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 @@
 
   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,
--- a/modules/wctype
+++ b/modules/wctype
@@ -22,7 +22,7 @@
 	{ 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