changeset 14957:20685414cb63

getdelim: Move AC_LIBOBJ invocations to module description. * m4/getdelim.m4 (gl_FUNC_GETDELIM): Set HAVE_GETDELIM. Move AC_LIBOBJ and gl_PREREQ_GETDELIM invocations from here... * modules/getdelim (configure.ac): ... to here. (Depends-on): Fix condition.
author Bruno Haible <bruno@clisp.org>
date Sun, 08 May 2011 11:32:02 +0200
parents 590a6b9eefc0
children 0f9adf6a2b9e
files ChangeLog m4/getdelim.m4 modules/getdelim
diffstat 3 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-08  Bruno Haible  <bruno@clisp.org>
+
+	getdelim: Move AC_LIBOBJ invocations to module description.
+	* m4/getdelim.m4 (gl_FUNC_GETDELIM): Set HAVE_GETDELIM. Move AC_LIBOBJ
+	and gl_PREREQ_GETDELIM invocations from here...
+	* modules/getdelim (configure.ac): ... to here.
+	(Depends-on): Fix condition.
+
 2011-05-08  Bruno Haible  <bruno@clisp.org>
 
 	getcwd: Move AC_LIBOBJ invocations to module description.
--- a/m4/getdelim.m4
+++ b/m4/getdelim.m4
@@ -1,4 +1,4 @@
-# getdelim.m4 serial 8
+# getdelim.m4 serial 9
 
 dnl Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
 dnl
@@ -19,6 +19,7 @@
 
   AC_CHECK_FUNCS_ONCE([getdelim])
   if test $ac_cv_func_getdelim = yes; then
+    HAVE_GETDELIM=1
     dnl Found it in some library.  Verify that it works.
     AC_CACHE_CHECK([for working getdelim function], [gl_cv_func_working_getdelim],
     [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
@@ -65,21 +66,16 @@
          [gl_cv_func_working_getdelim=yes],
          [gl_cv_func_working_getdelim=no])]
     )])
+    if test $gl_cv_func_working_getdelim = no; then
+      REPLACE_GETDELIM=1
+    fi
   else
-    gl_cv_func_working_getdelim=no
+    HAVE_GETDELIM=0
   fi
 
   if test $ac_cv_have_decl_getdelim = no; then
     HAVE_DECL_GETDELIM=0
   fi
-
-  if test $gl_cv_func_working_getdelim = no; then
-    if test $ac_cv_func_getdelim = yes; then
-      REPLACE_GETDELIM=1
-    fi
-    AC_LIBOBJ([getdelim])
-    gl_PREREQ_GETDELIM
-  fi
 ])
 
 # Prerequisites of lib/getdelim.c.
--- a/modules/getdelim
+++ b/modules/getdelim
@@ -8,12 +8,16 @@
 Depends-on:
 stdio
 extensions
-stdint          [test $HAVE_DECL_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
-realloc-posix   [test $HAVE_DECL_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
-errno           [test $HAVE_DECL_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
+stdint          [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
+realloc-posix   [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
+errno           [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
 
 configure.ac:
 gl_FUNC_GETDELIM
+if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then
+  AC_LIBOBJ([getdelim])
+  gl_PREREQ_GETDELIM
+fi
 gl_STDIO_MODULE_INDICATOR([getdelim])
 
 Makefile.am: