Modify the documentation that discusses how to override INSTALL_PATH

Mmke.vars.in:
    Modify the documentation that discusses how to override INSTALL_PATH
    to describe setting of $DESTDIR instead.

    Don't add a slash before INSTALL_PATH if DESTDIR is empty since this
    breaks installation on Windows.  (This change has already been made
    in Mmake.common.in)

    Set more FINAL_INSTALL_ variables to support the new code in
    Mmakefile and bindist.Makefile.in.

Mmake.common.in:
    Improve the prose in a comment.

Mmakefile:
    Update installation message.

    Tell the user that their install is in $(DESTDIR) if applicable.

    Use FINAL_INSTALL variables rather than INSTALL variables.
This commit is contained in:
Paul Bone
2010-12-17 00:28:08 +00:00
parent 0d22a819d9
commit 0ee263a3fe
3 changed files with 53 additions and 30 deletions

View File

@@ -119,9 +119,9 @@ SHARED_LIBS = @SHARED_LIBS@
# in scripts/Mmake.vars to avoid accidentally overwriting an # in scripts/Mmake.vars to avoid accidentally overwriting an
# existing installation when using an installed mmake. # existing installation when using an installed mmake.
ifeq ($(DESTDIR),) ifeq ($(DESTDIR),)
# DESTDIR is The empty string, DESTDIR_AND_SLASH is therefore empty. since # DESTDIR is the empty string, DESTDIR_AND_SLASH must therefore be empty.
# the slash can change a relative path into an absolute one; or on Windows, # Otherwise the slash can change a relative path into an absolute one; or
# from an invalid path name. # on Windows, it can create an invalid path name.
DESTDIR_AND_SLASH= DESTDIR_AND_SLASH=
else else
# We cannot append paths like this in Windows, but we don't think anyone # We cannot append paths like this in Windows, but we don't think anyone

View File

@@ -518,20 +518,26 @@ install: install_main install_grades
@echo @echo
@echo "-- Installation complete." @echo "-- Installation complete."
@echo @echo
@echo "-- Don't forget to add $(INSTALL_BINDIR) to your PATH," @if test -n "$(DESTDIR)"; then \
@echo "-- $(INSTALL_MAN_DIR) to your MANPATH," echo "-- The installation was placed in $(DESTDIR)."; \
@echo "-- and $(INSTALL_INFO_DIR) to your INFOPATH," echo "-- to complete installation copy the contents of"; \
echo "-- $(DESTDIR) to the root directory of your system(s)."; \
echo; \
fi
@echo "-- Don't forget to add $(FINAL_INSTALL_BINDIR) to your PATH,"
@echo "-- $(FINAL_INSTALL_MAN_DIR) to your MANPATH,"
@echo "-- and $(FINAL_INSTALL_INFO_DIR) to your INFOPATH,"
@if test $(ENABLE_DEEP_PROFILER) != yes || \ @if test $(ENABLE_DEEP_PROFILER) != yes || \
cmp -s deep_profiler/mdprof_cgi \ cmp -s deep_profiler/mdprof_cgi \
$(INSTALL_CGI_DIR)/mdprof_cgi; \ $(INSTALL_CGI_DIR)/mdprof_cgi; \
then true ; else \ then true ; else \
echo "-- to copy deep_profiler/mdprof_cgi" \ echo "-- to copy deep_profiler/mdprof_cgi" \
"to $(INSTALL_CGI_DIR),"; \ "to $(FINAL_INSTALL_CGI_DIR),"; \
fi fi
@echo "-- and to add the following lines to the \`.emacs' file" @echo "-- and to add the following lines to the \`.emacs' file"
@echo "-- in your home directory:" @echo "-- in your home directory:"
@echo " (add-to-list 'load-path " @echo " (add-to-list 'load-path "
@echo " \"$(INSTALL_ELISP_DIR)\")" @echo " \"$(FINAL_INSTALL_ELISP_DIR)\")"
@echo " (autoload 'mdb \"gud\" \"Invoke the Mercury debugger\" t)" @echo " (autoload 'mdb \"gud\" \"Invoke the Mercury debugger\" t)"
.PHONY: install_main .PHONY: install_main

View File

@@ -664,43 +664,60 @@ INSTALL_MKDIR = mkdir -p
# HTML files. # HTML files.
# FINAL_INSTALL_PREFIX describes the directory that the installation # FINAL_INSTALL_PREFIX describes the directory that the installation
# will finally end up in. When building the Mercury compiler, it # will finally end up in. When building the Mercury compiler, it should
# should only be set by the configure script. Other # only be set by the configure script. Other FINAL_INSTALL_* variables
# FINAL_INSTALL_* variables have a similar meaning. # have a similar meaning.
#
# If you want to install to a different directory temporarily (e.g. to
# build a package, or if you don't have the permissions to install to a
# final directory), set DESTDIR on the command-line. If you have
# previously configured to the directory you want to finally install to,
# you will then be able to move the files safely, since any hard-coded
# paths will be set to their final destination already (note that the
# installation in the temporary directory may not work until moved into
# its final destination). e.g.
# #
# If you want to install to a different directory temporarily (e.g.
# to build a package, or if you don't have the permissions to install
# to a final directory), override INSTALL_PREFIX on the command-line.
# If you have previously configured to the directory you want to
# finally install to, you will then be able to move the files safely,
# since any hard-coded paths will be set to their final destination
# already (note that the installation in the temporary directory may
# not work until moved into its final destination).
# e.g.
# configure --prefix /usr # configure --prefix /usr
# make INSTALL_PREFIX=/some/temporary/directory/usr # make DESTDIR=/some/temporary/directory
# If you don't intend to install to a temporary directory, rather than # If you don't intend to install to a temporary directory, rather than
# overriding INSTALL_PREFIX you should reconfigure using the configure # setting DESTDIR you should reconfigure using the configure script,
# script, since there are some hardcoded paths created by the configure # since there are some hardcoded paths created by the configure script
# script (e.g. in the shell scripts mmc, ml, mmake, etc) that will not # (e.g. in the shell scripts mmc, ml, mmake, etc) that will not be
# be updated simply by overriding INSTALL_PREFIX. # updated simply by overriding INSTALL_PREFIX.
INSTALL_PREFIX = $(DESTDIR)/@prefix@ ifeq ($(DESTDIR),)
FINAL_INSTALL_PREFIX = @prefix@ # DESTDIR is the empty string, DESTDIR_AND_SLASH must therefore be empty.
# Otherwise the slash can change a relative path into an absolute one; or
# on Windows, it can create an invalid path name.
DESTDIR_AND_SLASH=
else
# We cannot append paths like this in Windows, but we don't think anyone
# will use DESTDIR on Windows.
DESTDIR_AND_SLASH=$(DESTDIR)/
endif
INSTALL_PREFIX = $(DESTDIR_AND_SLASH)@prefix@
INSTALL_BINDIR = $(INSTALL_PREFIX)/bin INSTALL_BINDIR = $(INSTALL_PREFIX)/bin
INSTALL_LIBDIR = $(INSTALL_PREFIX)/lib/mercury INSTALL_LIBDIR = $(INSTALL_PREFIX)/lib/mercury
FINAL_INSTALL_LIBDIR = $(FINAL_INSTALL_PREFIX)/lib/mercury
INSTALL_INFO_DIR = $(INSTALL_PREFIX)/info INSTALL_INFO_DIR = $(INSTALL_PREFIX)/info
INSTALL_DVI_DIR = $(INSTALL_PREFIX)/lib/mercury/doc INSTALL_DVI_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
INSTALL_TEXT_DIR = $(INSTALL_PREFIX)/lib/mercury/doc INSTALL_TEXT_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
INSTALL_PS_DIR = $(INSTALL_PREFIX)/lib/mercury/doc INSTALL_PS_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
INSTALL_PDF_DIR = $(INSTALL_PREFIX)/lib/mercury/doc INSTALL_PDF_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
INSTALL_MAN_DIR = $(INSTALL_PREFIX)/man INSTALL_MAN_DIR = $(INSTALL_PREFIX)/Man
INSTALL_HTML_DIR = $(INSTALL_PREFIX)/lib/mercury/html INSTALL_HTML_DIR = $(INSTALL_PREFIX)/lib/mercury/html
INSTALL_MDB_DOC_DIR = $(INSTALL_PREFIX)/lib/mercury/mdb INSTALL_MDB_DOC_DIR = $(INSTALL_PREFIX)/lib/mercury/mdb
INSTALL_ELISP_DIR = $(INSTALL_PREFIX)/lib/mercury/elisp INSTALL_ELISP_DIR = $(INSTALL_PREFIX)/lib/mercury/elisp
INSTALL_CGI_DIR = $(DESTDIR)/@CGIDIR@ INSTALL_CGI_DIR = $(DESTDIR_AND_SLASH)@CGIDIR@
FINAL_INSTALL_PREFIX = @prefix@
FINAL_INSTALL_BINDIR = $(FINAL_INSTALL_PREFIX)/bin
FINAL_INSTALL_LIBDIR = $(FINAL_INSTALL_PREFIX)/lib/mercury
FINAL_INSTALL_INFO_DIR = $(FINAL_INSTALL_PREFIX)/info
FINAL_INSTALL_MAN_DIR = $(FINAL_INSTALL_PREFIX)/man
FINAL_INSTALL_ELISP_DIR = $(FINAL_INSTALL_PREFIX)/lib/mercury/elisp
FINAL_INSTALL_CGI_DIR = @CGIDIR@
# You should not need to override anything below here # You should not need to override anything below here