autoconf-patches
[Top][All Lists]
Advanced

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

Re: Overriding LN_S


From: Peter Rosin
Subject: Re: Overriding LN_S
Date: Mon, 18 Oct 2010 10:07:25 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

Hi Ralf,

Den 2010-10-16 11:30 skrev Ralf Wildenhues:
> Here's testsuite exposure for your patch.

Thank you very much for this! Much appreciated.

> - AS_LN_S is undocumented at the moment.  This would be a good
> opportunity to document it, OTOH there is no pressing need,
> testsuite coverage for undocumented APIs is not a problem.
> 
> - Your patch doesn't work: specifying LN_S as argument on the
> configure command line does not override AC_PROG_LN_S nor AS_LN_S
> usage.  The reason for this is that _AS_LN_S_PREPARE is (necessarily)
> expanded in the configure script before command-line handling takes
> place:
> 
> ../../autoconf/tests/base.at:733: ./configure $configure_options LN_S=false
> ++ ./configure LN_S=false
> stderr:
> stdout:
> checking whether ln -s works... yes
> foo
> ../../autoconf/tests/base.at:733: exit code was 0, expected 1
> 
> So, your patch needs more work, either in autoconf.texi (documenting
> that LN_S needs to be set in the environment rather than on the
> configure command line) or we need to think or some other way to
> fixup the _AS_LN_S_PREPARE result after command-line parsing, or
> restructure the code otherwise.

The below one-liner makes the tests pass.  I don't know if we should
perhaps use test "${LN_S+set}" = set instead, and I don't know if it's
ok to clobber as_ln_s from "the outside" like this.  I also suppose
there's an area of the configure script that will run with unexpected
outcome of any AS_LN_S([foo], [bar]) macros (between the _AS_LN_S_PREPARE
expansion and AC_PROG_LN_S, at least as long as _AS_LN_S_PREPARE is
expanded first but that seems pretty hard to change).

Cheers,
Peter


2010-10-18  Peter Rosin  <address@hidden>

        AC_PROG_LN_S: allow overriding of as_ln_s with LN_S.
        * lib/autoconf/programs.m4 (AC_PROG_LN_S): If LN_S is non-empty,
        override as_ln_s with the value provided by the user.  Fixes the
        AC_PROG_LN_S test in tests/base.at.

diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index c90d9b2..9dc4f32 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -799,6 +799,7 @@ AN_MAKEVAR([LN], [AC_PROG_LN_S])
 AN_PROGRAM([ln], [AC_PROG_LN_S])
 AC_DEFUN([AC_PROG_LN_S],
 [AC_MSG_CHECKING([whether ln -s works])
+test -n "$LN_S" && as_ln_s=$LN_S
 AC_SUBST([LN_S], [$as_ln_s])dnl
 if test "$LN_S" = "ln -s"; then
   AC_MSG_RESULT([yes])



reply via email to

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