From ceca6f59a7a33a33572cca9df5105f62506044a6 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sat, 21 May 2011 02:15:03 +0200
Subject: [PATCH] isnanl*: Respect rules for use of AC_LIBOBJ.

* m4/isnanl.m4 (gl_FUNC_ISNANL, gl_FUNC_ISNANL_NO_LIBM): Move AC_LIBOBJ
invocation from here...
* modules/isnanl (configure.ac): ... to here.
* modules/isnanl-nolibm (configure.ac): ... and here.
---
 ChangeLog             | 8 ++++++++
 m4/isnanl.m4          | 7 +------
 modules/isnanl        | 4 ++++
 modules/isnanl-nolibm | 4 ++++
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fdbc3e0160..3cbbbc5025 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-20  Bruno Haible  <bruno@clisp.org>
+
+	isnanl*: Respect rules for use of AC_LIBOBJ.
+	* m4/isnanl.m4 (gl_FUNC_ISNANL, gl_FUNC_ISNANL_NO_LIBM): Move AC_LIBOBJ
+	invocation from here...
+	* modules/isnanl (configure.ac): ... to here.
+	* modules/isnanl-nolibm (configure.ac): ... and here.
+
 2011-05-20  Bruno Haible  <bruno@clisp.org>
 
 	isnand*: Move AC_LIBOBJ invocations to module description.
diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
index e6b10c3ebd..c79308b035 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -1,4 +1,4 @@
-# isnanl.m4 serial 15
+# isnanl.m4 serial 16
 dnl Copyright (C) 2007-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,
@@ -31,8 +31,6 @@ AC_DEFUN([gl_FUNC_ISNANL],
   fi
   if test $gl_func_isnanl != yes; then
     HAVE_ISNANL=0
-    AC_LIBOBJ([isnanl])
-    gl_PREREQ_ISNANL
   fi
   AC_SUBST([ISNANL_LIBM])
 ])
@@ -51,9 +49,6 @@ AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM],
   if test $gl_func_isnanl_no_libm = yes; then
     AC_DEFINE([HAVE_ISNANL_IN_LIBC], [1],
       [Define if the isnan(long double) function is available in libc.])
-  else
-    AC_LIBOBJ([isnanl])
-    gl_PREREQ_ISNANL
   fi
 ])
 
diff --git a/modules/isnanl b/modules/isnanl
index 8bad6f672a..01b4417f26 100644
--- a/modules/isnanl
+++ b/modules/isnanl
@@ -16,6 +16,10 @@ memcmp
 
 configure.ac:
 gl_FUNC_ISNANL
+if test $HAVE_ISNANL = 0; then
+  AC_LIBOBJ([isnanl])
+  gl_PREREQ_ISNANL
+fi
 gl_MATH_MODULE_INDICATOR([isnanl])
 
 Makefile.am:
diff --git a/modules/isnanl-nolibm b/modules/isnanl-nolibm
index 85823c9128..5a98e4904a 100644
--- a/modules/isnanl-nolibm
+++ b/modules/isnanl-nolibm
@@ -16,6 +16,10 @@ memcmp
 
 configure.ac:
 gl_FUNC_ISNANL_NO_LIBM
+if test $gl_func_isnanl_no_libm != yes; then
+  AC_LIBOBJ([isnanl])
+  gl_PREREQ_ISNANL
+fi
 
 Makefile.am:
 
-- 
2.30.2