LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 739 - Can't `make install prefix=/tmp/llvm'. DESTDIR not supported either.
Summary: Can't `make install prefix=/tmp/llvm'. DESTDIR not supported either.
Status: RESOLVED FIXED
Alias: None
Product: Build scripts
Classification: Unclassified
Component: Makefiles (show other bugs)
Version: trunk
Hardware: All All
: P normal
Assignee: Reid Spencer
URL:
Keywords: build-problem
Depends on:
Blocks:
 
Reported: 2006-04-18 05:13 PDT by Ralph Corderoy
Modified: 2010-03-06 14:00 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments
PR739.patch (2.54 KB, patch)
2007-01-08 14:54 PST, Chandler Carruth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Corderoy 2006-04-18 05:13:11 PDT
`make install prefix=$HOME/stow' or `make install DESTDIR=$HOME/stow'
doesn't work.  Installation is attempted to the prefix set at
./configure time.  This breaks utilities like GNU Stow.

http://www.gnu.org/prep/standards/html_node/Command-Variables.html#Command-Variables
suggests how DESTDIR should be supported.

http://www.gnu.org/prep/standards/html_node/Directory-Variables.html#Directory-Variables
covers prefix, giving `make prefix=/usr install' as an example, and
covers things like no-recompilation if prefix alters between `make all'
and `make install'.  Also, `$(prefix)' should be used in Makefile
definitions, e.g. PROJ_bindir.

llvm.spec file uses DESTDIR, but does it work?

http://www.gnu.org/software/stow/manual.html#SEC6 covers how GNU Stow
can make use of configuring for one prefix but actually installing in
another.
Comment 1 Reid Spencer 2006-12-09 22:10:23 PST
Fixed with this patch:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061204/041149.html
Comment 2 Ralph Corderoy 2006-12-10 08:00:33 PST
The patch doesn't really fix the bug.  It defines DESTDIR in the
makefile, something the GNU standards I linked to on opening the bug
explicitly rule out: "You should not set the value of DESTDIR in your
Makefile at all".

And there still isn't a variable called `prefix' that can be overridden
on the command line.

So the patch has implemented its own non-standard scheme which will just
cause confusion in the long run for packagers.  May as well get it right
now, if at all.
Comment 3 Chandler Carruth 2007-01-08 14:54:09 PST
Created attachment 550 [details]
PR739.patch

This is a patch I cooked up. It provides a bare-minimum of GNU "compatability",
at the make command level. "prefix=/some/dir" can be passed in, and overrides
the ./configure prefix, and "DESTDIR=/some/dir" can be passed in to install
into a staging directory other than root. This is (from my experience and
reading the posts above) the intended purpose for both of these arguments. No
other GNU make options have been emulated in this way to keep the makefiles
clean, as this is not a GNU project.

Also, I re-arranged the makefile slightly to allow both projects and the main
LLVM build to share the same functionality without duplicating all of the
directory definitions. If it is actually desirable to have directories defined
in a different manner from one to the other (other than obviously using
separate prefixes, as is already done), I can take this out.

I hope this addresses all the concerns for this bug, I know that my building of
Gentoo ebuilds for LLVM will be eased by just this level of functionality.
Comment 4 Reid Spencer 2007-01-17 13:38:46 PST
This is now mine.
Comment 5 Reid Spencer 2007-01-17 14:25:52 PST
Tested. Works. Patch:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042849.html

Resolved.