summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-08-14 19:51:56 +0200
committerBruno Haible <bruno@clisp.org>2020-08-14 19:51:56 +0200
commitefbd8572b569730fefffd469a123ca864baeae60 (patch)
treea34b7f42cce4348c5e2af3384c06a4a683040e09 /m4
parent4e082bffbcc46e68644ae0d59b4f09bf2b5feb84 (diff)
downloadgnulib-efbd8572b569730fefffd469a123ca864baeae60.tar.gz
strdup: Assume the function exists.
* m4/strdup.m4 (gl_FUNC_STRDUP, gl_FUNC_STRDUP_POSIX): Don't test whether strdup exists. * modules/strdup (Files): Remove lib/strdup.c. (configure.ac): Don't compile strdup.c. * modules/strdup-posix (Depends-on, configure.ac): Don't test ac_cv_func_strdup. * doc/posix-functions/strdup.texi: Update. * lib/unistr/u8-strdup.c: Assume HAVE_STRDUP is 1. * modules/unistr/u8-strdup (Files): Remove lib/unistr/u-strdup.h. (Depends-on): Remove unistr/u8-strlen.
Diffstat (limited to 'm4')
-rw-r--r--m4/strdup.m410
1 files changed, 3 insertions, 7 deletions
diff --git a/m4/strdup.m4 b/m4/strdup.m4
index 2d1fcc416a..6340209422 100644
--- a/m4/strdup.m4
+++ b/m4/strdup.m4
@@ -1,4 +1,4 @@
-# strdup.m4 serial 13
+# strdup.m4 serial 14
dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
@@ -9,7 +9,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRDUP],
[
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([strdup])
AC_CHECK_DECLS_ONCE([strdup])
if test $ac_cv_have_decl_strdup = no; then
HAVE_DECL_STRDUP=0
@@ -20,11 +19,8 @@ AC_DEFUN([gl_FUNC_STRDUP_POSIX],
[
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
- AC_CHECK_FUNCS_ONCE([strdup])
- if test $ac_cv_func_strdup = yes; then
- if test $gl_cv_func_malloc_posix != yes; then
- REPLACE_STRDUP=1
- fi
+ if test $gl_cv_func_malloc_posix != yes; then
+ REPLACE_STRDUP=1
fi
AC_CHECK_DECLS_ONCE([strdup])
if test $ac_cv_have_decl_strdup = no; then