GNU bug report logs - #35886
Built-in variable dependency issue with bindir/exec_prefix/prefix

Previous Next

Package: automake;

Reported by: "Sternberg, Jay E" <jay.e.sternberg <at> intel.com>

Date: Fri, 24 May 2019 17:47:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Sternberg, Jay E" <jay.e.sternberg <at> intel.com>
Subject: bug#35886: closed (Re: bug#35886: Built-in variable dependency
 issue with bindir/exec_prefix/prefix)
Date: Fri, 24 May 2019 18:06:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#35886: Built-in variable dependency issue with bindir/exec_prefix/prefix

which was filed against the automake package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 35886 <at> debbugs.gnu.org.

-- 
35886: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35886
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eric Blake <eblake <at> redhat.com>
To: "Sternberg, Jay E" <jay.e.sternberg <at> intel.com>, 35886-done <at> debbugs.gnu.org
Subject: Re: bug#35886: Built-in variable dependency issue with
 bindir/exec_prefix/prefix
Date: Fri, 24 May 2019 13:04:58 -0500
[Message part 3 (text/plain, inline)]
tag 35886 notabug
thanks

On 5/24/19 12:33 PM, Sternberg, Jay E wrote:
> Built-in variables are stored in the generated Makefile in ascending sort order.  This results in dependency issues specifically for bindir and exec_prefix. after running './configure --prefix /usr'; the resulting Makefile variables are as follows:
> 
> ...
> bindir = ${exec_prefix}/bin
> build_alias =
> builddir = .
> ...
> dvidir = ${docdir}
> exec_prefix = ${prefix}
> host_alias =
> ...
> pdfdir = ${docdir}
> prefix = /usr
> program_transform_name = s,x,x,
> ...
> 
> The result is that when make install uses bindir, the value is "/bin", not "/usr/bin"

You are misunderstanding how makefile macros are handled, and forgetting
that it is a two-phase process.  Make macros are not like shell
variables processed in textual order (where 'bindir =
${exec_prefix}/bin' would assign '/bin/' to the variable bindir if the
variable exec_prefix were currently empty) but rather the first pass
stores all macro definitions, and the second pass then refers to those
stored definitions when determining rules to run. When a macro is
encountered, the literal text stored in the first pass is then expanded
recursively, regardless of the order the macros were defined (so
expanding ${bindir} substitutes the text '${exec_prefix}/bin' then
rescans that output to notice that more substitution is needed, which in
turn expands exec_prefix, then in turn prefix).

Proof:

$ make -f - <<\EOF
> a=${b}
> c=${d}
> d=hi
> all:
>       echo ${a}
> b=${c}
> EOF
echo hi
hi

I see no bug here, so I'm closing this, but feel free to add more
details if there is something else we're missing from your report and we
can reopen as needed.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

[signature.asc (application/pgp-signature, attachment)]
[Message part 5 (message/rfc822, inline)]
From: "Sternberg, Jay E" <jay.e.sternberg <at> intel.com>
To: "bug-automake <at> gnu.org" <bug-automake <at> gnu.org>
Subject: Built-in variable dependency issue with bindir/exec_prefix/prefix
Date: Fri, 24 May 2019 17:33:24 +0000
Built-in variables are stored in the generated Makefile in ascending sort order.  This results in dependency issues specifically for bindir and exec_prefix. after running './configure --prefix /usr'; the resulting Makefile variables are as follows:

...
bindir = ${exec_prefix}/bin
build_alias =
builddir = .
...
dvidir = ${docdir}
exec_prefix = ${prefix}
host_alias =
...
pdfdir = ${docdir}
prefix = /usr
program_transform_name = s,x,x,
...

The result is that when make install uses bindir, the value is "/bin", not "/usr/bin"

Cheers,
Jay



This bug report was last modified 5 years and 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.