From 473a663dba5be199561383fcab1c44d5cb73f8b0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 1 May 2007 18:21:31 +0000 Subject: [PATCH] Make the generated wctype.h more self-contained. --- ChangeLog | 9 ++++++++- lib/wctype_.h | 2 +- m4/wctype.m4 | 8 +++++++- modules/wctype | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a84e79867..f302e6200 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2007-05-01 Bruno Haible + * 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 + * 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, @@ -30171,4 +30178,4 @@ * m4/isc-posix.m4: New file. -1998-05-10 Jim Meyering \ No newline at end of file +1998-05-10 Jim Meyering diff --git a/lib/wctype_.h b/lib/wctype_.h index 460cee2bc..110a68eda 100644 --- a/lib/wctype_.h +++ b/lib/wctype_.h @@ -63,7 +63,7 @@ typedef int __wctype_wint_t; /* FreeBSD 4.4 to 4.11 has 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 macros like _P, and they diff --git a/m4/wctype.m4 b/m4/wctype.m4 index 62994c62b..a56834d0c 100644 --- a/m4/wctype.m4 +++ b/m4/wctype.m4 @@ -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, diff --git a/modules/wctype b/modules/wctype index a6fd3467e..3365ecc23 100644 --- a/modules/wctype +++ b/modules/wctype @@ -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 -- 2.11.0