[3.4] DESTDIR support completed

Christian Cornelssen ccorn@cs.tu-berlin.de
Thu Jan 9 18:34:00 GMT 2003


Hello,

On Thu, 9 Jan 2003, Benjamin Kosnik wrote:

> Instead of doing
>
> $(DESTDIR)${gcc_include_dir} in all of the install routines (over ten)
> why don't you just do:
>
> gxx_include_dir = $(DESTDIR)@gxx_include_dir@
>
> And set it in one place?

This is Automake's style.  The rationale is that DESTDIR is only
used for ultimate installation, and there shall be no possibility
of compiling it into binaries or permanently storing it in
any configuration.  The general alternative would be to use two
variants of every xxxdir variable, but such an approach could be
more confusing (or at least apparently more complex) to readers
than would be justified by the ease of writing such fragments.

Someone has indeed practiced your suggested method in
`libstdc++-v3/po/Makefile.am' by hiding the $(DESTDIR) in the
definition of locale_installdir.  This means that the value of this
variable cannot safely be used as configuration data.

I'd even suggest converting that `Makefile.am' to the "verbose
but canonical and transparent" style.  Why?  Because with explicit
$(DESTDIR) in the installation commands, you can easily recognize
which install-* rules support DESTDIR.  I use several scripts
to scan the GCC tree for non-DESTDIRed installation commands,
and finding the commands acting on $(locale_installdir) in
`libstdc++-v3/po/Makefile.am' every time is disturbing.  I have
already filtered out those variables that are known to hold buildtree
subdir names, but locale_installdir is not really that type,
therefore I don't like the idea of filtering it out.  Note that I am
going to convert the 3.3 branch too, so these things do still matter
for me.

> What's this for, anyway?

See `destdir6-doc.diff' in
`http://gcc.gnu.org/ml/gcc-patches/2003-01/msg00248.html'.
DESTDIR is also described in the GNU Makefile standards.

Regards,

Christian Cornelssen



More information about the Libstdc++ mailing list