Skip to content

Commit

Permalink
make: DESTDIR must be an absolute path
Browse files Browse the repository at this point in the history
Clarify in the installation notes, and add a check in the makefile.

Closes PR 14935
  • Loading branch information
mflatt committed Jan 15, 2015
1 parent dbba480 commit 5e6debf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
16 changes: 9 additions & 7 deletions INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,24 @@ 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.

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.

Expand Down
5 changes: 5 additions & 0 deletions racket/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 6 additions & 5 deletions racket/src/README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e6debf

Please sign in to comment.