2007-04-12 Simon Josefsson <simon@josefsson.org>
[gnulib.git] / m4 / strcasestr.m4
index ae83c48..52f3a58 100644 (file)
@@ -1,20 +1,20 @@
-# strcasestr.m4 serial 2
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
+# strcasestr.m4 serial 6
+dnl Copyright (C) 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,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_STRCASESTR],
 [
-  dnl No known system has a strcasestr() function that works correctly in
-  dnl multibyte locales. Therefore we use our version always.
-  AC_LIBOBJ(strcasestr)
-  AC_DEFINE(strcasestr, rpl_strcasestr, [Define to rpl_strcasestr always.])
-  gl_PREREQ_STRCASESTR
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REPLACE_FUNCS(strcasestr)
+  if test $ac_cv_func_strcasestr = no; then
+    HAVE_STRCASESTR=0
+    gl_PREREQ_STRCASESTR
+  fi
 ])
 
 # Prerequisites of lib/strcasestr.c.
 AC_DEFUN([gl_PREREQ_STRCASESTR], [
-  AC_REQUIRE([gl_FUNC_MBRTOWC])
   :
 ])