`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.
Fixed with this patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061204/041149.html
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.
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.
This is now mine.
Tested. Works. Patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042849.html Resolved.