Bug 56416 - Inconsistent substitution of AC_SUBST variables
Inconsistent substitution of AC_SUBST variables
Status: CLOSED CURRENTRELEASE
Product: Red Hat Raw Hide
Classification: Retired
Component: automake (Show other bugs)
1.0
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Jens Petersen
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-16 19:29 EST by Enrico Scholz
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-11-09 22:05:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Enrico Scholz 2001-11-16 19:29:29 EST
Description of Problem:

When using 'AC_SUBST(FOO)' in configure.ac directly, automake generates a
variable

| FOO = @FOO@

in each Makefile.in. This works also when using AC_SUBST() in an AC_DEFUN
and specifiying the varname explicitely, but it fails if a '$...'
parametername is used.


Version-Release number of selected component (if applicable):

autoconf-2.52-3
automake-1.5-1


How Reproducible:

everytime


Steps to Reproduce:
1. cat <<EOF >configure.ac
AC_INIT(foo, 0.0.1)
AM_INIT_AUTOMAKE(foo, 0.0.1, XX)

AC_DEFUN(foo_TEST,
[
        FOOIN=fooin
        AC_SUBST(FOOIN)

        $1=foo
        AC_SUBST($1)
])

BAR=bar

foo_TEST(FOO)
AC_SUBST(BAR)

AC_CONFIG_FILES(Makefile)
AC_OUTPUT
EOF

2. cat <<EOF >Makefile.am 
AUTOMAKE_OPTIONS = foreign

FOO_EXPLICIT    =  @FOO@

all-local:
                @echo "FOO   = '${FOO}'"
                @echo "FOO   = '${FOO_EXPLICIT}'  (explicit)"
                @echo "BAR   = '${BAR}'"
                @echo "FOOIN = '${FOOIN}'"
EOF

3. automake=automake autoreconf -i

4. make


Actual Results:

FOO   = ''
FOO   = 'foo'  (explicit)
BAR   = 'bar'
FOOIN = 'fooin'


Expected Results:

FOO   = 'foo'
FOO   = 'foo'  (explicit)
BAR   = 'bar'
FOOIN = 'fooin'
Comment 1 Enrico Scholz 2001-11-16 19:35:58 EST
An alternative expected result would be

FOO   = ''
FOO   = 'foo'  (explicit)
BAR   = ''
FOOIN = ''

There the behavior of AC_SUBST is more consistent.
Comment 2 Tom Tromey 2001-11-26 14:56:58 EST
This is a known bug in automake.

In 1.5 and earlier releases, automake configure.in scanning
was relatively dumb.  It did only textual scanning of configure.in
and related files.  So things like your code confused it.

An upcoming automake release will fix this by using autoconf's
"trace" facility to more correctly scan configure.in.
No one knows when this release will happen, however.
Comment 3 Jens Petersen 2002-03-27 01:25:03 EST
moved to automake15 component
Comment 4 Jens Petersen 2002-07-09 04:18:25 EDT
With autoconf-2.53-7 and automake-1.6.2-1 I still get:

FOO   = ''
FOO   = 'foo'  (explicit)
BAR   = 'bar'
FOOIN = 'fooin'

(Did you mean "AUTOMAKE=automake" by "automake=automake"?)


[Just btw: "cat <<EOF >file" doesn't work so well here for me
since my shell expands the embedded "$VAR"'s and the tabs
in "Makefile.am" are lost.]
Comment 5 Jens Petersen 2003-11-09 22:05:02 EST
With automake-1.7.8 and autoconf-2.58 I now see
the expected result.  I suspect this is probably
fixed in all 1.7.x.

Note You need to log in before you can comment on or make changes to this bug.