xfs
[Top] [All Lists]

Re: [PATCH] xfstests: fix compile issue with gdbm and --enable-lib64 war

To: Wenming Zhang <wezhang@xxxxxxxxxx>
Subject: Re: [PATCH] xfstests: fix compile issue with gdbm and --enable-lib64 warnnings
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 20 Apr 2010 14:57:48 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1270784882-8130-1-git-send-email-wezhang@xxxxxxxxxx>
References: <1270784882-8130-1-git-send-email-wezhang@xxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Apr 09, 2010 at 11:48:02AM +0800, Wenming Zhang wrote:
> fix couldn't be compiled with gdbm lib issue
> and clear warnings while configure with  --enable-lib64 
> 
> Signed-off-by: Wenming Zhang <wezhang@xxxxxxxxxx>
> ---
>  configure.in |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/configure.in b/configure.in
> index 45b7fd1..92e2711 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -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.


> @@ -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.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>