diff options
Diffstat (limited to 'gl/m4/strdup.m4')
-rw-r--r-- | gl/m4/strdup.m4 | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/gl/m4/strdup.m4 b/gl/m4/strdup.m4 index d7daac2b..ce40c215 100644 --- a/gl/m4/strdup.m4 +++ b/gl/m4/strdup.m4 | |||
@@ -1,6 +1,6 @@ | |||
1 | # strdup.m4 serial 11 | 1 | # strdup.m4 serial 12 |
2 | 2 | ||
3 | dnl Copyright (C) 2002-2009 Free Software Foundation, Inc. | 3 | dnl Copyright (C) 2002-2010 Free Software Foundation, Inc. |
4 | 4 | ||
5 | dnl This file is free software; the Free Software Foundation | 5 | dnl This file is free software; the Free Software Foundation |
6 | dnl gives unlimited permission to copy and/or distribute it, | 6 | dnl gives unlimited permission to copy and/or distribute it, |
@@ -9,29 +9,36 @@ dnl with or without modifications, as long as this notice is preserved. | |||
9 | AC_DEFUN([gl_FUNC_STRDUP], | 9 | AC_DEFUN([gl_FUNC_STRDUP], |
10 | [ | 10 | [ |
11 | AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) | 11 | AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) |
12 | AC_REPLACE_FUNCS([strdup]) | 12 | AC_CHECK_FUNCS_ONCE([strdup]) |
13 | if test $ac_cv_func_strdup != yes; then | ||
14 | AC_LIBOBJ([strdup]) | ||
15 | gl_PREREQ_STRDUP | ||
16 | fi | ||
13 | AC_CHECK_DECLS_ONCE([strdup]) | 17 | AC_CHECK_DECLS_ONCE([strdup]) |
14 | if test $ac_cv_have_decl_strdup = no; then | 18 | if test $ac_cv_have_decl_strdup = no; then |
15 | HAVE_DECL_STRDUP=0 | 19 | HAVE_DECL_STRDUP=0 |
16 | fi | 20 | fi |
17 | gl_PREREQ_STRDUP | ||
18 | ]) | 21 | ]) |
19 | 22 | ||
20 | AC_DEFUN([gl_FUNC_STRDUP_POSIX], | 23 | AC_DEFUN([gl_FUNC_STRDUP_POSIX], |
21 | [ | 24 | [ |
22 | AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) | 25 | AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) |
23 | AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) | 26 | AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) |
24 | if test $gl_cv_func_malloc_posix != yes; then | 27 | AC_CHECK_FUNCS_ONCE([strdup]) |
25 | REPLACE_STRDUP=1 | 28 | if test $ac_cv_func_strdup = yes; then |
26 | AC_LIBOBJ([strdup]) | 29 | if test $gl_cv_func_malloc_posix != yes; then |
30 | REPLACE_STRDUP=1 | ||
31 | AC_LIBOBJ([strdup]) | ||
32 | gl_PREREQ_STRDUP | ||
33 | fi | ||
27 | else | 34 | else |
28 | AC_REPLACE_FUNCS([strdup]) | 35 | AC_LIBOBJ([strdup]) |
36 | gl_PREREQ_STRDUP | ||
29 | fi | 37 | fi |
30 | AC_CHECK_DECLS_ONCE([strdup]) | 38 | AC_CHECK_DECLS_ONCE([strdup]) |
31 | if test $ac_cv_have_decl_strdup = no; then | 39 | if test $ac_cv_have_decl_strdup = no; then |
32 | HAVE_DECL_STRDUP=0 | 40 | HAVE_DECL_STRDUP=0 |
33 | fi | 41 | fi |
34 | gl_PREREQ_STRDUP | ||
35 | ]) | 42 | ]) |
36 | 43 | ||
37 | # Prerequisites of lib/strdup.c. | 44 | # Prerequisites of lib/strdup.c. |