[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Overriding LN_S
From: |
Ralf Wildenhues |
Subject: |
Re: Overriding LN_S |
Date: |
Sat, 16 Oct 2010 11:30:01 +0200 |
User-agent: |
Mutt/1.5.20 (2010-08-04) |
Here's testsuite exposure for your patch.
- 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.
Cheers,
Ralf
Testsuite coverage for LN_S overrides.
* tests/base.at (AC_PROG_LN_S): New test.
* tests/m4sh.at (AS@&address@hidden): Likewise.
diff --git a/tests/base.at b/tests/base.at
index 0973fc4..b545bc4 100644
--- a/tests/base.at
+++ b/tests/base.at
@@ -708,3 +708,28 @@ libdir=${exec_prefix}/lib
]])
AT_CLEANUP
+
+
+## ------------- ##
+## AC_PROG_LN_S ##
+## ------------- ##
+
+AT_SETUP([AC_PROG_LN_S])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_LN_S
+rm -f foo link
+echo foo > file
+$LN_S file link || AC_MSG_ERROR([$LN_S failed])
+grep foo link || AC_MSG_ERROR([link not created correctly])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+AT_CHECK_CONFIGURE([LN_S='cp -p'])
+rm -f foo
+AT_CHECK([grep foo link], [], [ignore])
+AT_CHECK_CONFIGURE([LN_S=false], [1], [ignore], [ignore])
+
+AT_CLEANUP
diff --git a/tests/m4sh.at b/tests/m4sh.at
index c01027f..918975a 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -518,6 +518,32 @@ AT_CHECK([$CONFIG_SHELL ./script])
AT_CLEANUP
+## ------------ ##
+## AS_MKDIR_P. ##
+## ------------ ##
+
+# Build nested dirs.
+AT_SETUP([AS@&address@hidden)
+AT_KEYWORDS([m4sh])
+
+AT_DATA_M4SH([script.as],
+[[AS_INIT
+rm -f foo link
+echo foo > file
+AS_LN_S([file], [link]) || AS_EXIT([1])
+grep foo link || AS_EXIT([1])
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([$CONFIG_SHELL ./script], [], [foo
+])
+AT_CHECK([env LN_S='cp -p' $CONFIG_SHELL ./script], [], [foo
+])
+rm -f foo
+AT_CHECK([grep foo link], [], [ignore])
+AT_CHECK([env LN_S='false' $CONFIG_SHELL ./script], [1])
+
+AT_CLEANUP
## -------------------- ##