bug-gnulib
[Top][All Lists]
Advanced

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

Re: check_version


From: Jim Meyering
Subject: Re: check_version
Date: Tue, 28 Jun 2005 09:04:22 +0200

Simon Josefsson <address@hidden> wrote:
> Paul Eggert <address@hidden> writes:
>
>> Simon Josefsson <address@hidden> writes:
>>
>>>        /* Check version of libgcrypt. */
>>>        if (!gcry_check_version (GCRYPT_VERSION))
>>>          die ("version mismatch\n");
>>
>> Can't you use strverscmp for this?  E.g.:
>>
>>     if (strverscmp (GCRYPT_VERSION, VERSION) < 0)
>>       die ("version mismatch\n");
>>
>> Even if strverscmp itself can't be used directly, it seems to me that
>> its use would greatly simplify this package, and avoid the
>> integer-overflow glitches Jim mentioned.
>
> Good idea!  How about this?
>
> 2005-06-25  Simon Josefsson  <address@hidden>
>
>       * modules/check_version: New file.
>
> 2005-06-25  Simon Josefsson  <address@hidden>
>
>       * check_version.h, check_version.c: New file.

I just noticed that you used an underscore in the middle of a
file name rather than a hyphen.  Long-standing GNU tradition is
to use hyphens there.  I think one of the reasons is that hyphens
are slightly easier to type.

> +Makefile.am:
> +lib_SOURCES += check_version.h check_version.c

Also, in coreutils and gnulib, we've been moving away from
using the `Makefile.am' section of the modules files, for reasons
discussed at length a few months ago.  And I'm pretty sure I saw
some automake changes that will help Bruno do things the way he
wants in gettext.

So, you might want to remove that line and instead add a file
named m4/check-version.m4 like this:

#serial 1
dnl Copyright (C) 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

AC_DEFUN([gl_CHECK_VERSION],
[
  AC_LIBSOURCES([check-version.c, check-version.h])
  AC_LIBOBJ([check-version])
])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]