[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] Re: lvm build failures without readline-devel installed?



Dave Wysochanski <dwysocha redhat com> wrote:
...
> I'm seeing build failures now with readline-devel _not_ installed and a
> configure line with the readline options absent (only "--enable-debug"
> and "--with-dmdir" options)
>
> http://10.11.231.162:8010/waterfall

Thanks, Dave!

These are the relevant warnings:

  lvm.c:135: warning: implicit declaration of function 'completion_matches'
  lvm.c:135: warning: nested extern declaration of 'completion_matches'
  lvm.c:135: warning: assignment makes pointer from integer without a cast
  lvm.c:138: warning: assignment makes pointer from integer without a cast

In my recent change, I made the mistake of specifying the
previously unspecified ACTION_IF_FOUND parameter to AC_CHECK_LIB.
That overrode the default action (which would prepend -lreadline to LIBS),
so the subsequent check for rl_completion_matches would fail.
Then, the work-around C code would redefine it to "completion_matches",
which would not be declared, resulting in the warnings above.

The following patch also replaces AC_CHECK_FUNC+AC_DEFINE
with an equivalent AC_CHECK_FUNCS call.

I confirmed that this works on a RHEL5 system
with readline-devel not installed.


>From 7ebe4f5308764821afe757d2eb843881cbc9a34a Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering redhat com>
Date: Fri, 25 Jul 2008 09:50:52 +0200
Subject: [PATCH] Avoid compiler warnings (provoked by new configure.in bug) on RHEL5.

Do not override the default action of AC_CHECK_LIB([readline],...
(i.e., leave the ACTION-IF-FOUND parameter blank) so that the
subsequent check for rl_completion_matches can use -lreadline.

Also, replace AC_CHECK_FUNC+AC_DEFINE with an equivalent AC_CHECK_FUNCS call.
---
 configure.in |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/configure.in b/configure.in
index 7936383..a022487 100644
--- a/configure.in
+++ b/configure.in
@@ -516,7 +516,8 @@ AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getop
 ################################################################################
 dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
 if test x$READLINE != xno; then
-	AC_CHECK_LIB([readline], [readline], [rl_found=yes], [rl_found=no])
+	rl_found=yes
+	AC_CHECK_LIB([readline], [readline], , [rl_found=no])
 	test x$READLINE:$rl_found = xyes:no &&
 	  AC_MSG_ERROR(
 GNU Readline could not be found which is required for the
@@ -527,9 +528,7 @@ Note: if you are using precompiled packages you will also need the development
 package as well (which may be called readline-devel or something similar).
 )
 	if test $rl_found = yes; then
-		AC_CHECK_FUNC([rl_completion_matches],
-		  AC_DEFINE([HAVE_RL_COMPLETION_MATCHES], 1,
-		  [Define to 1 if rl_completion_matches() is available.]))
+		AC_CHECK_FUNCS([rl_completion_matches])
 		AC_DEFINE([READLINE_SUPPORT], 1,
 		  [Define to 1 to include the LVM readline shell.])
 	fi
--
1.6.0.rc0.46.g2ac23


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]