chiark / gitweb /
Support DESTDIR=/some/absolute/path on `make install'
[adns.git] / common.make.in
index 46add1c3585b5d74a57cccdb76224bf94b208288..5e0e80b32a0ae43ef6bce75b330489f4522a0de1 100644 (file)
@@ -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)