make: DESTDIR must be an absolute path

Clarify in the installation notes, and add a check in the makefile.

Closes PR 14935
This commit is contained in:
Matthew Flatt 2015-01-15 06:08:58 -07:00
parent dbba480ad3
commit 5e6debf854
3 changed files with 20 additions and 12 deletions

View File

@ -74,13 +74,14 @@ See "More Instructions: Building Racket" below for more information.
Quick Instructions: Unix-style Install
======================================
On Unix, `make unix-style PREFIX=<dir>' builds and installs into <dir>
with binaries in "<dir>/bin", packages in "<dir>/share/racket/pkgs",
documentation in "<dir>/share/racket/doc", etc.
On Unix, `make unix-style PREFIX=<dir>' builds and installs into
"<dir>" (which must be an absolute path) with binaries in "<dir>/bin",
packages in "<dir>/share/racket/pkgs", documentation in
"<dir>/share/racket/doc", etc.
On Mac OS X, `make unix-style PREFIX=<dir>' builds and installs into
"<dir>" with binaries in "<dir>/bin", packges in "<dir>/share/pkgs",
documentation in "<dir>/doc", etc.
"<dir>" (whichmust be an absolute path) with binaries in "<dir>/bin",
packges in "<dir>/share/pkgs", documentation in "<dir>/doc", etc.
On Windows, Unix-style install is not supported.
@ -88,8 +89,9 @@ A Unix-style install leaves no reference to this source directory.
To split the build and install steps of a Unix-style installation,
supply `DESTDIR=<dest-dir>' with `make unix-style PREFIX=<dir>', which
assembles the installation in "<dest-dir>". Then, copy the content of
"<dest-dir>" to the target root.
assembles the installation in "<dest-dir>" (which must be an absolute
path). Then, copy the content of "<dest-dir>" to the target root
"<dir>".
See "More Instructions: Building Racket" below for more information.

View File

@ -92,6 +92,11 @@ plain-install:
$(MAKE) plain-install-@MAIN_VARIANT@
install-common-first:
if [ "$(DESTDIR)" != "" ]; then \
if [[ "$(DESTDIR)" != /* ]]; then \
echo "expected an absolute path for DESTDIR; given: $(DESTDIR)"; exit 1; \
fi; \
fi
mkdir -p $(ALLDIRINFO)
install-common-middle:

View File

@ -227,11 +227,12 @@ Detailed instructions:
can find the installation directories. At this stage, in case you
are packaging an installation instead of installing directly, you
can redirect the installation by setting the "DESTDIR" environment
variable. For example, `make DESTDIR=/tmp/racket-build install'
places the installation into "/tmp/racket-build" instead of the
location originally specified with `--prefix'. The resulting
installation will not work, however, until it is moved to the
location originally specified with `--prefix'.
variable to an absolute path for the packaging area. For example,
`make DESTDIR=/tmp/racket-build install' places the installation
into "/tmp/racket-build" instead of the location originally
specified with `--prefix'. The resulting installation will not
work, however, until it is moved to the location originally
specified with `--prefix'.
Finally, the `make install' step compiles ".zo" bytecode files for
installed Racket source, generates launcher programs like