Re: [PATCH] build-sys: add --enable-static-programs

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

 



Hello Mike,

On Wed, Dec 05, 2007 at 03:17:11PM -0500, Mike Frysinger wrote:
> > On Tue, Dec 04, 2007 at 07:25:28PM -0500, Mike Frysinger wrote:
> > > this structure isnt portable shell:
> > > : ${VAR='foo'}

> i dont have any documentation to back up my claim, just code.  ive never seen 
> this construct in autoconf generated code [...]

... yet there is one instance in every configure script:

: ${CONFIG_STATUS=./config.status}

But I admit that's not much.  ;-)

> especially considering this:
>  - older automake used the form
> 	: ${VAR='foo'}
>  - newer automake switched same code base to use
> 	test "${VAR+set}" = set || VAR="foo"

I searched the Automake git and found one such changed, see the patch
attached to this mail.

The comment explains that the intention was to expand the variable.
IOW they wanted to change
	: ${CCAS='$(CC)'}
to
	: ${CCAS="$CC"}

But since the _latter_ can cause problems on some weird systems, it
had to be rewritten using the ${VAR+set} pattern.

BTW, I would not hesitate to use the latter form in
util-linux-ng/configure.ac, because IMHO the portability scope
of util-linux-ng is not as wide as the scope of the Autoconf itself.
(IOW, I think that no one builds util-linux-ng on Ultrix, which is the
only patform known to have problems wit ${CCAS="$CC"}.)

> could you elaborate ?  if there's a bug in say pkg-config.m4, i think it's 

I'm going to send a separate mail covering this topic.

Cheers,
	Stepan
>From ea970953a3104bc969d8082ed42f6fa9ff191eef Mon Sep 17 00:00:00 2001
From: Alexandre Duret-Lutz <adl@xxxxxxx>
Date: Mon, 30 Sep 2002 18:34:46 +0000
Subject: [PATCH] 2002-09-30  Kevin Ryde  <user42@xxxxxxxxxx>

	* m4/as.m4 (AM_PROG_AS): Let CCAS and CCASFLAGS default to the actual
	values of $CC and $CFLAGS (as opposed to $(CC) and $(CFLAGS)), so
	configure tests can use them.  Use AC_ARG_VAR instead of AC_SUBST.
---
 ChangeLog |    6 ++++++
 m4/as.m4  |   10 +++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1a7949c..2ce165b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-09-30  Kevin Ryde  <user42@xxxxxxxxxx>
+
+	* m4/as.m4 (AM_PROG_AS): Let CCAS and CCASFLAGS default to the actual
+	values of $CC and $CFLAGS (as opposed to $(CC) and $(CFLAGS)), so
+	configure tests can use them.  Use AC_ARG_VAR instead of AC_SUBST.
+
 2002-09-30  Alexandre Duret-Lutz  <duret_g@xxxxxxxx>
 
 	* automake.in (require_variables): The fix introduced in 2002-09-19
diff --git a/m4/as.m4 b/m4/as.m4
index ad456c9..2db935e 100644
--- a/m4/as.m4
+++ b/m4/as.m4
@@ -24,8 +24,8 @@
 AC_DEFUN([AM_PROG_AS],
 [# By default we simply use the C compiler to build assembly code.
 AC_REQUIRE([AC_PROG_CC])
-: ${CCAS='$(CC)'}
-# Set ASFLAGS if not already set.
-: ${CCASFLAGS='$(CFLAGS)'}
-AC_SUBST(CCAS)
-AC_SUBST(CCASFLAGS)])
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+AC_ARG_VAR([CCAS],      [Assembler compiler command (defaults to CC)])
+AC_ARG_VAR([CCASFLAGS], [Assembler compiler flags (defaults to CFLAGS)])
+])
-- 
1.5.3.4


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux