diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2020-06-08 17:12:41 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2020-06-11 16:13:02 +0100 |
commit | 489381f9e19e486dd28d2a59631f6cbbfd670db0 (patch) | |
tree | 7c34bb63beb8979ed0599a56a09fb4fcc86a8fae | |
parent | ab9603b004ef2bfd1c3450b915320b45a07f58c8 (diff) |
Support DESTDIR=/some/absolute/path on `make install'
You must have done `make' *without* DESTDIR, first.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | common.make.in | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/common.make.in b/common.make.in index 46add1c..5e0e80b 100644 --- a/common.make.in +++ b/common.make.in @@ -45,11 +45,22 @@ MKSHLIB_1= @MKSHLIB_1@ MKSHLIB_2= @MKSHLIB_2@ MKSHLIB_3= @MKSHLIB_3@ -prefix= @prefix@ -exec_prefix= @exec_prefix@ -bindir= @bindir@ -libdir= @libdir@ -includedir= @includedir@ +prefix := @prefix@ +exec_prefix := @exec_prefix@ +bindir := @bindir@ +libdir := @libdir@ +includedir := @includedir@ + +ifneq ($(DESTDIR),) +# autoconf likes to define some of these in terms of each other +# so if we want to add a prefix to each one we have to do it this way: +destdir_prefix=$(DESTDIR)/ +prefix := ${destdir_prefix}${prefix} +exec_prefix := ${destdir_prefix}${exec_prefix} +bindir := ${destdir_prefix}${bindir} +libdir := ${destdir_prefix}${libdir} +includedir := ${destdir_prefix}${includedir} +endif AC_INSTALL= @INSTALL@ ifeq ($(AC_INSTALL),./install-sh -c) |