threads / patch / 17257

patchFix naming scheme for configure cache variables.

Subject: [PATCH] Fix naming scheme for configure cache variables.

## tl;dr

4 messages between Jan 19, 2009 and Jan 21, 2009. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Ralf Wildenhues· Jan 19, 2009, 20:34 UTC · lore

In order to be cached, configure variables need to contain the string '_cv_', and they should begin with a package-specific prefix in order to avoid interfering with third-party macros. Rename ld_dashr, ld_wl_rpath, ld_rpath to git_cv_ld_dashr etc. ---

This avoids a warning with newer autoconf versions about the naming of the cache variables, and makes the caching work for them.

As to the 'git_' prefix, it could be argued that the other cache variables used in configure.ac should also be renamed s/ac_/git_/ If you like, I can provide a patch for those, too.

Thanks, Ralf

 configure.ac |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
Show changes to configure.ac +9 −9
diff --git a/configure.ac b/configure.ac
index 0a5fc8c..363547c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,31 +114,31 @@ AC_MSG_NOTICE([CHECKS for programs])
 #
 AC_PROG_CC([cc gcc])
 # which switch to pass runtime path to dynamic libraries to the linker
-AC_CACHE_CHECK([if linker supports -R], ld_dashr, [
+AC_CACHE_CHECK([if linker supports -R], git_cv_ld_dashr, [
    SAVE_LDFLAGS="${LDFLAGS}"
    LDFLAGS="${SAVE_LDFLAGS} -R /"
-   AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_dashr=yes], [ld_dashr=no])
+   AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_dashr=yes], [git_cv_ld_dashr=no])
    LDFLAGS="${SAVE_LDFLAGS}"
 ])
-if test "$ld_dashr" = "yes"; then
+if test "$git_cv_ld_dashr" = "yes"; then
    AC_SUBST(CC_LD_DYNPATH, [-R])
 else
-   AC_CACHE_CHECK([if linker supports -Wl,-rpath,], ld_wl_rpath, [
+   AC_CACHE_CHECK([if linker supports -Wl,-rpath,], git_cv_ld_wl_rpath, [
       SAVE_LDFLAGS="${LDFLAGS}"
       LDFLAGS="${SAVE_LDFLAGS} -Wl,-rpath,/"
-      AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_wl_rpath=yes], [ld_wl_rpath=no])
+      AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_wl_rpath=yes], [git_cv_ld_wl_rpath=no])
       LDFLAGS="${SAVE_LDFLAGS}"
    ])
-   if test "$ld_wl_rpath" = "yes"; then
+   if test "$git_cv_ld_wl_rpath" = "yes"; then
       AC_SUBST(CC_LD_DYNPATH, [-Wl,-rpath,])
    else
-      AC_CACHE_CHECK([if linker supports -rpath], ld_rpath, [
+      AC_CACHE_CHECK([if linker supports -rpath], git_cv_ld_rpath, [
          SAVE_LDFLAGS="${LDFLAGS}"
          LDFLAGS="${SAVE_LDFLAGS} -rpath /"
-         AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_rpath=yes], [ld_rpath=no])
+         AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_rpath=yes], [git_cv_ld_rpath=no])
          LDFLAGS="${SAVE_LDFLAGS}"
       ])
-      if test "$ld_rpath" = "yes"; then
+      if test "$git_cv_ld_rpath" = "yes"; then
          AC_SUBST(CC_LD_DYNPATH, [-rpath])
       else
          AC_MSG_WARN([linker does not support runtime path to dynamic libraries])
-- 
1.6.1.137.g3d9e8
Junio C Hamano· Jan 20, 2009, 06:30 UTC · re: Ralf Wildenhues · lore

Re: [PATCH] Fix naming scheme for configure cache variables.

Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
Show 8 quoted lines
> In order to be cached, configure variables need to contain the
> string '_cv_', and they should begin with a package-specific
> prefix in order to avoid interfering with third-party macros.
> Rename ld_dashr, ld_wl_rpath, ld_rpath to git_cv_ld_dashr etc.
> ---
>
> This avoids a warning with newer autoconf versions about the naming of
> the cache variables, and makes the caching work for them.
Thanks.
We require every patch we accept to be accompanied with a sign-off.

Can you certify that ... [see Documentation/SubmittingPatches and look for (4) Sign your work] ... please?

Ralf Wildenhues· Jan 20, 2009, 07:08 UTC · re: Junio C Hamano · lore

Re: [PATCH] Fix naming scheme for configure cache variables.

* Junio C Hamano wrote on Tue, Jan 20, 2009 at 07:30:27AM CET:
Show 6 quoted lines
> Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
> 
> > In order to be cached, configure variables need to contain the
> > string '_cv_', and they should begin with a package-specific
> > prefix in order to avoid interfering with third-party macros.
> > Rename ld_dashr, ld_wl_rpath, ld_rpath to git_cv_ld_dashr etc.
> We require every patch we accept to be accompanied with a sign-off.
> 
> Can you certify that ... [see Documentation/SubmittingPatches and look for
> (4) Sign your work] ... please?
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Sorry about that.

Cheers, Ralf

Junio C Hamano· Jan 21, 2009, 10:26 UTC · re: Ralf Wildenhues · lore

Re: [PATCH] Fix naming scheme for configure cache variables.

Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
Show 6 quoted lines
> In order to be cached, configure variables need to contain the
> string '_cv_', and they should begin with a package-specific
> prefix in order to avoid interfering with third-party macros.
> Rename ld_dashr, ld_wl_rpath, ld_rpath to git_cv_ld_dashr etc.
>
> Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Thanks.

← back to recent threads