From 5e6debf8549415759def472e4a0c45473b65df9a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 15 Jan 2015 06:08:58 -0700 Subject: [PATCH] make: DESTDIR must be an absolute path Clarify in the installation notes, and add a check in the makefile. Closes PR 14935 --- INSTALL.txt | 16 +++++++++------- racket/src/Makefile.in | 5 +++++ racket/src/README | 11 ++++++----- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index cf1bb09ad07..fcaded5282b 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -74,13 +74,14 @@ See "More Instructions: Building Racket" below for more information. Quick Instructions: Unix-style Install ====================================== -On Unix, `make unix-style PREFIX=' builds and installs into -with binaries in "/bin", packages in "/share/racket/pkgs", -documentation in "/share/racket/doc", etc. +On Unix, `make unix-style PREFIX=' builds and installs into +"" (which must be an absolute path) with binaries in "/bin", +packages in "/share/racket/pkgs", documentation in +"/share/racket/doc", etc. On Mac OS X, `make unix-style PREFIX=' builds and installs into -"" with binaries in "/bin", packges in "/share/pkgs", -documentation in "/doc", etc. +"" (whichmust be an absolute path) with binaries in "/bin", +packges in "/share/pkgs", documentation in "/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=' with `make unix-style PREFIX=', which -assembles the installation in "". Then, copy the content of -"" to the target root. +assembles the installation in "" (which must be an absolute +path). Then, copy the content of "" to the target root +"". See "More Instructions: Building Racket" below for more information. diff --git a/racket/src/Makefile.in b/racket/src/Makefile.in index d9860731b33..af98447690c 100644 --- a/racket/src/Makefile.in +++ b/racket/src/Makefile.in @@ -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: diff --git a/racket/src/README b/racket/src/README index 5502d50edec..e3bdb12b15b 100644 --- a/racket/src/README +++ b/racket/src/README @@ -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