[pacman-dev] [PATCH 1/3] configure.ac: cleanup duplication in --enable-git-version
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
This is redundant, and any usage of -D should belong to CPPFLAGS.
Signed-off-by: Dave Reisner
This lets us define the build rule and the dependency all at once, and
additionally removes the need for an intermediate temp file.
Signed-off-by: Dave Reisner
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
--- 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])
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
--- 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])
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
--- 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
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
--- 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.
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
--- 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.
participants (3)
-
Allan McRae
-
Dave Reisner
-
Dave Reisner