From 89e9e678bfc8bec9cfaa97335d03d0b19431a736 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 5 Feb 2007 02:09:22 +0000 Subject: [PATCH] Change the conditions under which strcasecmp.c is compiled. --- ChangeLog | 4 ++++ m4/strcase.m4 | 12 ++++++------ modules/string | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03a18d959..68d8616b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,9 +10,13 @@ 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 diff --git a/m4/strcase.m4 b/m4/strcase.m4 index f8275d9af..8b2ba9757 100644 --- a/m4/strcase.m4 +++ b/m4/strcase.m4 @@ -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], diff --git a/modules/string b/modules/string index f48369f34..8e657257f 100644 --- a/modules/string +++ b/modules/string @@ -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 -- 2.11.0