strdup.m4 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # strdup.m4 serial 12
  2. dnl Copyright (C) 2002-2010 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_CHECK_FUNCS_ONCE([strdup])
  10. if test $ac_cv_func_strdup != yes; then
  11. AC_LIBOBJ([strdup])
  12. gl_PREREQ_STRDUP
  13. fi
  14. AC_CHECK_DECLS_ONCE([strdup])
  15. if test $ac_cv_have_decl_strdup = no; then
  16. HAVE_DECL_STRDUP=0
  17. fi
  18. ])
  19. AC_DEFUN([gl_FUNC_STRDUP_POSIX],
  20. [
  21. AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
  22. AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
  23. AC_CHECK_FUNCS_ONCE([strdup])
  24. if test $ac_cv_func_strdup = yes; then
  25. if test $gl_cv_func_malloc_posix != yes; then
  26. REPLACE_STRDUP=1
  27. AC_LIBOBJ([strdup])
  28. gl_PREREQ_STRDUP
  29. fi
  30. else
  31. AC_LIBOBJ([strdup])
  32. gl_PREREQ_STRDUP
  33. fi
  34. AC_CHECK_DECLS_ONCE([strdup])
  35. if test $ac_cv_have_decl_strdup = no; then
  36. HAVE_DECL_STRDUP=0
  37. fi
  38. ])
  39. # Prerequisites of lib/strdup.c.
  40. AC_DEFUN([gl_PREREQ_STRDUP], [:])