Change the conditions under which strcasecmp.c is compiled.
authorBruno Haible <bruno@clisp.org>
Mon, 5 Feb 2007 02:09:22 +0000 (02:09 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 5 Feb 2007 02:09:22 +0000 (02:09 +0000)
ChangeLog
m4/strcase.m4
modules/string

index 03a18d9..68d8616 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        Change the conditional link warning.
        (mbscasecmp): New declaration.
        * m4/mbscasecmp.m4: New file.
+       * m4/strcase.m4 (gl_FUNC_STRCASECMP): Enable the replacement only if
+       the system lacks strcasecmp. Set HAVE_STRCASECMP instead of
+       REPLACE_STRCASECMP.
        * m4/string_h.m4 (gl_STRING_MODULE_INDICATOR_DEFAULTS): Initialize
        GNULIB_MBSCASECMP.
        * modules/string (string.h): Also substitute GNULIB_MBSCASECMP.
+       Substitute HAVE_STRCASECMP instead of REPLACE_STRCASECMP.
        * MODULES.html.sh (Internationalization functions): Add mbscasecmp.
 
 2007-02-04  Bruno Haible  <bruno@clisp.org>
index f8275d9..8b2ba97 100644 (file)
@@ -1,4 +1,4 @@
-# strcase.m4 serial 6
+# strcase.m4 serial 7
 dnl Copyright (C) 2002, 2005-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,11 +13,11 @@ AC_DEFUN([gl_STRCASE],
 AC_DEFUN([gl_FUNC_STRCASECMP],
 [
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  dnl No known system has a strcasecmp() function that works correctly in
-  dnl multibyte locales. Therefore we use our version always.
-  AC_LIBOBJ(strcasecmp)
-  REPLACE_STRCASECMP=1
-  gl_PREREQ_STRCASECMP
+  AC_REPLACE_FUNCS(strcasecmp)
+  if test $ac_cv_func_strcasecmp = no; then
+    HAVE_STRCASECMP=0
+    gl_PREREQ_STRCASECMP
+  fi
 ])
 
 AC_DEFUN([gl_FUNC_STRNCASECMP],
index f48369f..8e65725 100644 (file)
@@ -44,6 +44,7 @@ string.h: string_.h
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
              -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
              -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+             -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
              -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
              -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
              -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
@@ -53,7 +54,6 @@ string.h: string_.h
              -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
              -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
              -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-             -e 's|@''REPLACE_STRCASECMP''@|$(REPLACE_STRCASECMP)|g' \
              -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
              < $(srcdir)/string_.h; \
        } > $@-t