diff options
author | Bruno Haible <bruno@clisp.org> | 2008-09-21 14:54:54 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2008-09-21 14:54:54 +0200 |
commit | cfa381fc27ccee5fefcab6be96596f63d84d1fa5 (patch) | |
tree | 8608e44535e7b6a847463ef072e06608fe50dc52 /m4 | |
parent | 1d6dbd3f560572a6a627beb9e17f53834ca7fa38 (diff) | |
download | gnulib-cfa381fc27ccee5fefcab6be96596f63d84d1fa5.tar.gz |
New module 'strdup-posix'.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/strdup.m4 | 22 | ||||
-rw-r--r-- | m4/string_h.m4 | 9 |
2 files changed, 24 insertions, 7 deletions
diff --git a/m4/strdup.m4 b/m4/strdup.m4 index 8796e9e02f..0537def373 100644 --- a/m4/strdup.m4 +++ b/m4/strdup.m4 @@ -1,7 +1,6 @@ -# strdup.m4 serial 9 +# strdup.m4 serial 10 -dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,5 +17,22 @@ AC_DEFUN([gl_FUNC_STRDUP], gl_PREREQ_STRDUP ]) +AC_DEFUN([gl_FUNC_STRDUP_POSIX], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) + if test $gl_cv_func_malloc_posix != yes; then + REPLACE_STRDUP=1 + AC_LIBOBJ([strdup]) + else + AC_REPLACE_FUNCS(strdup) + fi + AC_CHECK_DECLS_ONCE(strdup) + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi + gl_PREREQ_STRDUP +]) + # Prerequisites of lib/strdup.c. AC_DEFUN([gl_PREREQ_STRDUP], [:]) diff --git a/m4/string_h.m4 b/m4/string_h.m4 index b37f843ab2..2d5553c374 100644 --- a/m4/string_h.m4 +++ b/m4/string_h.m4 @@ -5,7 +5,7 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 6 # Written by Paul Eggert. @@ -83,9 +83,10 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) - REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) - REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) - REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) + REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) + REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) + REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) + REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) ]) |