Skip to contentSkip to conversation

xfstests: fix compile issue with gdbm and --enable-lib64 warnnings

PATCH In review Wenming Zhang 2 participants 2 messages Apr 9, 2010 – Apr 20, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: fix compile issue with gdbm and --enable-lib64 warnnings

fix couldn't be compiled with gdbm lib issue and clear warnings while configure with --enable-lib64

---
 configure.in |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
configure.in +7 -0
index 45b7fd1..92e2711 100644
@@ -10,6 +10,7 @@ AC_HEADER_STDC
 			errno.h			\
 			malloc.h		\
 			uuid.h			\
+			gdbm.h			\
 			uuid/uuid.h		\
 			sys/uuid.h		\
 			sys/file.h		\
@@ -44,6 +45,12 @@ in
 		;;
 	*)
 		AC_MULTILIB($enable_lib64)
+		AC_ARG_ENABLE([lib64], [AS_HELP_STRING([--enable-lib64],
+                			[enable lib64 support (default is no)])],
+				[enable_lib64=$withval],
+				[enable_lib64=no]
+		)
+
 		AC_PACKAGE_NEED_XFS_XFS_H
 		AC_PACKAGE_WANT_LIBXFS_H
 		AC_PACKAGE_WANT_XLOG_ASSIGN_LSN
Signature · 6 lines
1.6.2.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 13 lines · Wenming Zhang

fix couldn't be compiled with gdbm lib issue and clear warnings while configure with --enable-lib64

---
 configure.in |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
configure.in +0 -0
index 45b7fd1..92e2711 100644

configure.in AC_HEADER_STDC · line 16

Quoted 7 lines
configure.in +1 -0
@@ -10,6 +10,7 @@ AC_HEADER_STDC
 			errno.h			\
 			malloc.h		\
 			uuid.h			\
+			gdbm.h			\
 			uuid/uuid.h		\
 			sys/uuid.h		\
 			sys/file.h		\

I'm not sure why this is needed - we don't directly include gdbm.h. We check for gdbm/ndbm.h (or gdbm-ndbm.h on debian in a a patch I have), the presence of which implies that gdbm.h exists on the system.

Even if it is necessary to check for this, the check needs to go into the GDBM package checks (m4/package_gdbmdev.m4) to enable/disable the have_db variable so that it simply isn't used if it is not present.

configure.in in · line 53

Quoted 10 lines
configure.in +6 -0
@@ -44,6 +45,12 @@ in
 		;;
 	*)
 		AC_MULTILIB($enable_lib64)
+		AC_ARG_ENABLE([lib64], [AS_HELP_STRING([--enable-lib64],
+                			[enable lib64 support (default is no)])],
+				[enable_lib64=$withval],
+				[enable_lib64=no]
+		)
+

I don't think this is right - yes, it will suppress the warning, but I don't think it works correctly. The argument needs to be enabled and evaluated before it is used, and IIRC the AC_ARG_ENABLE result is put into $enableval not $withval.

So shouldn't it be something like this (untested):

		AC_ARG_ENABLE(lib64,
			AS_HELP_STRING([--enable-lib64],
				[enable lib64 support (default=no)]
			enable_lib64=$enableval,
			enable_lib64=no)
		AC_SUBST(enable_lib64)
		AC_MULTILIB($enable_lib64)

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs