projects
/
gnulib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1d1b262
)
Skip linear-time test if it is redundant.
author
Bruno Haible
<bruno@clisp.org>
Thu, 18 Jun 2009 08:16:21 +0000
(10:16 +0200)
committer
Bruno Haible
<bruno@clisp.org>
Thu, 18 Jun 2009 08:16:21 +0000
(10:16 +0200)
ChangeLog
patch
|
blob
|
history
m4/strcasestr.m4
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index
f001677
..
9ef6472
100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,10
@@
+2009-06-18 Bruno Haible <bruno@clisp.org>
+
+ * m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Invoke AC_LIBOBJ only
+ in one place.
+ (gl_FUNC_STRCASESTR): Skip linear time test if strcasestr is going to
+ be replaced anyway.
+
2009-06-18 Eric Blake <ebb9@byu.net>
hash: check for resize before insertion
2009-06-18 Eric Blake <ebb9@byu.net>
hash: check for resize before insertion
diff --git
a/m4/strcasestr.m4
b/m4/strcasestr.m4
index
d641958
..
62991b1
100644
(file)
--- a/
m4/strcasestr.m4
+++ b/
m4/strcasestr.m4
@@
-7,17
+7,21
@@
dnl with or without modifications, as long as this notice is preserved.
dnl Check that strcasestr is present and works.
AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE],
[
dnl Check that strcasestr is present and works.
AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE],
[
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+
dnl Persuade glibc <string.h> to declare strcasestr().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
dnl Persuade glibc <string.h> to declare strcasestr().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_MEMCHR])
AC_REQUIRE([gl_FUNC_MEMCHR])
- AC_
REPLACE
_FUNCS([strcasestr])
+ AC_
CHECK
_FUNCS([strcasestr])
if test $ac_cv_func_strcasestr = no; then
HAVE_STRCASESTR=0
if test $ac_cv_func_strcasestr = no; then
HAVE_STRCASESTR=0
- gl_PREREQ_STRCASESTR
- elif test "$gl_cv_func_memchr_works" != yes; then
- REPLACE_STRCASESTR=1
+ else
+ if test "$gl_cv_func_memchr_works" != yes; then
+ REPLACE_STRCASESTR=1
+ fi
+ fi
+ if test $HAVE_STRCASESTR = 0 || test $REPLACE_STRCASESTR = 1; then
AC_LIBOBJ([strcasestr])
gl_PREREQ_STRCASESTR
fi
AC_LIBOBJ([strcasestr])
gl_PREREQ_STRCASESTR
fi
@@
-27,7
+31,7
@@
dnl Additionally, check that strcasestr is efficient.
AC_DEFUN([gl_FUNC_STRCASESTR],
[
AC_REQUIRE([gl_FUNC_STRCASESTR_SIMPLE])
AC_DEFUN([gl_FUNC_STRCASESTR],
[
AC_REQUIRE([gl_FUNC_STRCASESTR_SIMPLE])
- if test $
ac_cv_func_strcasestr = yes
; then
+ if test $
HAVE_STRCASESTR = 1 && test $REPLACE_STRCASESTR = 0
; then
AC_CACHE_CHECK([whether strcasestr works in linear time],
[gl_cv_func_strcasestr_linear],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
AC_CACHE_CHECK([whether strcasestr works in linear time],
[gl_cv_func_strcasestr_linear],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
@@
-80,6
+84,7
@@
AC_DEFUN([gl_FUNC_STRCASESTR],
if test "$gl_cv_func_strcasestr_linear" != yes; then
REPLACE_STRCASESTR=1
AC_LIBOBJ([strcasestr])
if test "$gl_cv_func_strcasestr_linear" != yes; then
REPLACE_STRCASESTR=1
AC_LIBOBJ([strcasestr])
+ gl_PREREQ_STRCASESTR
fi
fi
]) # gl_FUNC_STRCASESTR
fi
fi
]) # gl_FUNC_STRCASESTR