aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2015-06-12 13:15:57 -0600
committerMartin Sebor <msebor@redhat.com>2015-06-12 13:15:57 -0600
commita82a3db95077c8343b988a6f1b03adea3d40f6d4 (patch)
tree16f417d70fc3431e77901a0535107bd8026bffd9 /Makerules
parentFix aio_* pread namespace (bug 18519). (diff)
downloadglibc-a82a3db95077c8343b988a6f1b03adea3d40f6d4.tar.gz
glibc-a82a3db95077c8343b988a6f1b03adea3d40f6d4.tar.bz2
glibc-a82a3db95077c8343b988a6f1b03adea3d40f6d4.zip
Attempting to install glibc configured with --prefix=/usr into
a non-standard directory specified by the prefix make variable fails with an error. Since this is an unsupported use case, this change makes make install fail early and with a descriptive error message when either the prefix or the exec_prefix make variable is overridden on the command line.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules20
1 files changed, 20 insertions, 0 deletions
diff --git a/Makerules b/Makerules
index ad9d74f660..372b3c0103 100644
--- a/Makerules
+++ b/Makerules
@@ -916,6 +916,26 @@ endef
installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
$(inst_libdir)/$(patsubst %,$(libtype$o),\
$(libprefix)$(libc-name)))
+
+.PHONY: check-install-supported
+check-install-supported:
+
+# Check to see if the prefix or exec_prefix GNU standard variable
+# has been overridden on the command line and, if so, fail with
+# an error message since doing so is not supported (set DESTDIR
+# instead).
+ifeq ($(origin prefix),command line)
+check-install-supported:
+ $(error Overriding prefix is not supported. Set DESTDIR instead.)
+endif
+
+ifeq ($(origin exec_prefix),command line)
+check-install-supported:
+ $(error Overriding exec_prefix is not supported. Set DESTDIR instead.)
+endif
+
+install: check-install-supported
+
install: $(installed-libcs)
$(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
$(make-target-directory)