Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   configure.ac: cleanup duplication in --enable-git-version (http://www.linux-archive.org/archlinux-pacman-development/707139-configure-ac-cleanup-duplication-enable-git-version.html)

Allan McRae 09-25-2012 04:19 AM

configure.ac: cleanup duplication in --enable-git-version
 
On 23/09/12 02:17, Dave Reisner wrote:
> Avoid adding our own messaging, as autoconf will add this for us with
> the result of the AC_CHECK_FILE test. Reuse the cache variable from
> autoconf to set our local variable.
>
> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> ---
> configure.ac | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 7fe696a..7c65a75 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -424,13 +424,9 @@ AC_MSG_CHECKING(whether to use git version if available)
> if test "x$wantgitver" = "xyes" ; then
> AC_CHECK_PROGS([GIT], [git])
> AC_CHECK_FILE([.git/], hasgitdir=yes)
> + usegitver=$ac_cv_file__git

That should be:

$ac_cv_file__git_

> if test $GIT -a "x$hasgitdir" = "xyes"; then
> - AC_MSG_RESULT([yes])
> - usegitver=yes
> AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string])
> - else
> - AC_MSG_RESULT([no, git or .git dir missing])
> - usegitver=no
> fi
> else
> AC_MSG_RESULT([no, disabled by configure])
>

Dave Reisner 09-25-2012 04:24 AM

configure.ac: cleanup duplication in --enable-git-version
 
On Tue, Sep 25, 2012 at 02:19:16PM +1000, Allan McRae wrote:
> On 23/09/12 02:17, Dave Reisner wrote:
> > Avoid adding our own messaging, as autoconf will add this for us with
> > the result of the AC_CHECK_FILE test. Reuse the cache variable from
> > autoconf to set our local variable.
> >
> > Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> > ---
> > configure.ac | 6 +-----
> > 1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 7fe696a..7c65a75 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -424,13 +424,9 @@ AC_MSG_CHECKING(whether to use git version if available)
> > if test "x$wantgitver" = "xyes" ; then
> > AC_CHECK_PROGS([GIT], [git])
> > AC_CHECK_FILE([.git/], hasgitdir=yes)
> > + usegitver=$ac_cv_file__git
>
> That should be:
>
> $ac_cv_file__git_
>

Interesting that it still appeared to work as intended. Anyways, you're
right. Fixed.

> > if test $GIT -a "x$hasgitdir" = "xyes"; then
> > - AC_MSG_RESULT([yes])
> > - usegitver=yes
> > AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string])
> > - else
> > - AC_MSG_RESULT([no, git or .git dir missing])
> > - usegitver=no
> > fi
> > else
> > AC_MSG_RESULT([no, disabled by configure])
> >
>
>
>

Allan McRae 09-25-2012 04:25 AM

configure.ac: cleanup duplication in --enable-git-version
 
On 25/09/12 14:24, Dave Reisner wrote:
> On Tue, Sep 25, 2012 at 02:19:16PM +1000, Allan McRae wrote:
>> On 23/09/12 02:17, Dave Reisner wrote:
>>> Avoid adding our own messaging, as autoconf will add this for us with
>>> the result of the AC_CHECK_FILE test. Reuse the cache variable from
>>> autoconf to set our local variable.
>>>
>>> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
>>> ---
>>> configure.ac | 6 +-----
>>> 1 file changed, 1 insertion(+), 5 deletions(-)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 7fe696a..7c65a75 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -424,13 +424,9 @@ AC_MSG_CHECKING(whether to use git version if available)
>>> if test "x$wantgitver" = "xyes" ; then
>>> AC_CHECK_PROGS([GIT], [git])
>>> AC_CHECK_FILE([.git/], hasgitdir=yes)
>>> + usegitver=$ac_cv_file__git
>>
>> That should be:
>>
>> $ac_cv_file__git_
>>
>
> Interesting that it still appeared to work as intended. Anyways, you're
> right. Fixed.
>

Hmm... it did not work for me (which is how I noticed it).

Which brings up the point, do we want to rely on autoconf naming of such
variables?

Allan

Dave Reisner 09-25-2012 04:33 AM

configure.ac: cleanup duplication in --enable-git-version
 
On Tue, Sep 25, 2012 at 02:25:59PM +1000, Allan McRae wrote:
> On 25/09/12 14:24, Dave Reisner wrote:
> > On Tue, Sep 25, 2012 at 02:19:16PM +1000, Allan McRae wrote:
> >> On 23/09/12 02:17, Dave Reisner wrote:
> >>> Avoid adding our own messaging, as autoconf will add this for us with
> >>> the result of the AC_CHECK_FILE test. Reuse the cache variable from
> >>> autoconf to set our local variable.
> >>>
> >>> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> >>> ---
> >>> configure.ac | 6 +-----
> >>> 1 file changed, 1 insertion(+), 5 deletions(-)
> >>>
> >>> diff --git a/configure.ac b/configure.ac
> >>> index 7fe696a..7c65a75 100644
> >>> --- a/configure.ac
> >>> +++ b/configure.ac
> >>> @@ -424,13 +424,9 @@ AC_MSG_CHECKING(whether to use git version if available)
> >>> if test "x$wantgitver" = "xyes" ; then
> >>> AC_CHECK_PROGS([GIT], [git])
> >>> AC_CHECK_FILE([.git/], hasgitdir=yes)
> >>> + usegitver=$ac_cv_file__git
> >>
> >> That should be:
> >>
> >> $ac_cv_file__git_
> >>
> >
> > Interesting that it still appeared to work as intended. Anyways, you're
> > right. Fixed.
> >
>
> Hmm... it did not work for me (which is how I noticed it).
>
> Which brings up the point, do we want to rely on autoconf naming of such
> variables?
>
> Allan
>

I don't see why not. The variable naming scheme is documented and
intended to be used. FWIW, we used to use a cache variable for the
purposes of detecting libssl.

Allan McRae 09-25-2012 05:42 AM

configure.ac: cleanup duplication in --enable-git-version
 
On 25/09/12 14:33, Dave Reisner wrote:
> On Tue, Sep 25, 2012 at 02:25:59PM +1000, Allan McRae wrote:
>> On 25/09/12 14:24, Dave Reisner wrote:
>>> On Tue, Sep 25, 2012 at 02:19:16PM +1000, Allan McRae wrote:
>>>> On 23/09/12 02:17, Dave Reisner wrote:
>>>>> Avoid adding our own messaging, as autoconf will add this for us with
>>>>> the result of the AC_CHECK_FILE test. Reuse the cache variable from
>>>>> autoconf to set our local variable.
>>>>>
>>>>> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
>>>>> ---
>>>>> configure.ac | 6 +-----
>>>>> 1 file changed, 1 insertion(+), 5 deletions(-)
>>>>>
>>>>> diff --git a/configure.ac b/configure.ac
>>>>> index 7fe696a..7c65a75 100644
>>>>> --- a/configure.ac
>>>>> +++ b/configure.ac
>>>>> @@ -424,13 +424,9 @@ AC_MSG_CHECKING(whether to use git version if available)
>>>>> if test "x$wantgitver" = "xyes" ; then
>>>>> AC_CHECK_PROGS([GIT], [git])
>>>>> AC_CHECK_FILE([.git/], hasgitdir=yes)
>>>>> + usegitver=$ac_cv_file__git
>>>>
>>>> That should be:
>>>>
>>>> $ac_cv_file__git_
>>>>
>>>
>>> Interesting that it still appeared to work as intended. Anyways, you're
>>> right. Fixed.
>>>
>>
>> Hmm... it did not work for me (which is how I noticed it).
>>
>> Which brings up the point, do we want to rely on autoconf naming of such
>> variables?
>>
>>
>
> I don't see why not. The variable naming scheme is documented and
> intended to be used. FWIW, we used to use a cache variable for the
> purposes of detecting libssl.
>

Ah - I did not realise that scheme was documented. All is good then.


All times are GMT. The time now is 07:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.