strndup: Move AC_LIBOBJ invocations to module description.
authorBruno Haible <bruno@clisp.org>
Sun, 22 May 2011 11:32:55 +0000 (13:32 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Jun 2011 22:06:50 +0000 (00:06 +0200)
* m4/strndup.m4 (gl_FUNC_STRNDUP): Set HAVE_STRNDUP. Move AC_LIBOBJ
invocations from here...
* modules/strndup (configure.ac): ... to here.
(Depends-on): Update conditions.

ChangeLog
m4/strndup.m4
modules/strndup

index 6e338a673a1b6dd5f4f92aa0af69225e5cafba77..4a9a8902ea640832fbbda43b17e4a037275cfe0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-22  Bruno Haible  <bruno@clisp.org>
+
+       strndup: Move AC_LIBOBJ invocations to module description.
+       * m4/strndup.m4 (gl_FUNC_STRNDUP): Set HAVE_STRNDUP. Move AC_LIBOBJ
+       invocations from here...
+       * modules/strndup (configure.ac): ... to here.
+       (Depends-on): Update conditions.
+
 2011-05-22  Bruno Haible  <bruno@clisp.org>
 
        strncat: Move AC_LIBOBJ invocations to module description.
index d8f00caba76406d199d8c1ec8a68d60a0d16258d..969e3191a40fbec0ea2f6319d9ff5b560660308f 100644 (file)
@@ -1,4 +1,4 @@
-# strndup.m4 serial 18
+# strndup.m4 serial 19
 dnl Copyright (C) 2002-2003, 2005-2011 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,6 +18,7 @@ AC_DEFUN([gl_FUNC_STRNDUP],
   fi
 
   if test $ac_cv_func_strndup = yes; then
+    HAVE_STRNDUP=1
     # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
     AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup_works],
       [AC_RUN_IFELSE([
@@ -42,12 +43,9 @@ changequote(,)dnl
 changequote([,])dnl
          ])])
     case $gl_cv_func_strndup_works in
-      *no)
-        REPLACE_STRNDUP=1
-        AC_LIBOBJ([strndup])
-        ;;
+      *no) REPLACE_STRNDUP=1 ;;
     esac
   else
-    AC_LIBOBJ([strndup])
+    HAVE_STRNDUP=0
   fi
 ])
index c76e966a57061801cf5e50b56c591c0779a6474d..4cb5a903c5704dd58f15719442cc6c58702a628f 100644 (file)
@@ -8,10 +8,13 @@ m4/strndup.m4
 Depends-on:
 string
 extensions
-strnlen         [test $ac_cv_func_strndup = no || test $REPLACE_STRNDUP = 1]
+strnlen         [test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1]
 
 configure.ac:
 gl_FUNC_STRNDUP
+if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
+  AC_LIBOBJ([strndup])
+fi
 gl_STRING_MODULE_INDICATOR([strndup])
 
 Makefile.am: