strdup.m4 956 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # strdup.m4 serial 11
  2. dnl Copyright (C) 2002-2009 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. AC_DEFUN([gl_FUNC_STRDUP],
  7. [
  8. AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
  9. AC_REPLACE_FUNCS([strdup])
  10. AC_CHECK_DECLS_ONCE([strdup])
  11. if test $ac_cv_have_decl_strdup = no; then
  12. HAVE_DECL_STRDUP=0
  13. fi
  14. gl_PREREQ_STRDUP
  15. ])
  16. AC_DEFUN([gl_FUNC_STRDUP_POSIX],
  17. [
  18. AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
  19. AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
  20. if test $gl_cv_func_malloc_posix != yes; then
  21. REPLACE_STRDUP=1
  22. AC_LIBOBJ([strdup])
  23. else
  24. AC_REPLACE_FUNCS([strdup])
  25. fi
  26. AC_CHECK_DECLS_ONCE([strdup])
  27. if test $ac_cv_have_decl_strdup = no; then
  28. HAVE_DECL_STRDUP=0
  29. fi
  30. gl_PREREQ_STRDUP
  31. ])
  32. # Prerequisites of lib/strdup.c.
  33. AC_DEFUN([gl_PREREQ_STRDUP], [:])