about summary refs log tree commit diff
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
parent9714012ca015f1f6763f66bd74d6f3f9e1512b36 (diff)
downloadglibc-a82a3db95077c8343b988a6f1b03adea3d40f6d4.tar.gz
glibc-a82a3db95077c8343b988a6f1b03adea3d40f6d4.tar.xz
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.
-rw-r--r--ChangeLog10
-rw-r--r--INSTALL8
-rw-r--r--Makerules20
-rw-r--r--NEWS2
-rw-r--r--manual/install.texi14
5 files changed, 44 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 3e6b877dfa..ba9f629452 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-06-12  Martin Sebor  <msebor@redhat.com>
+
+	[BZ #18512]
+	* Makerules (check-install-supported): New target.
+	(install): Add check-install-supported as a dependency.
+	* manual/install.texi (Installing the C Library): Document
+	that overriding prefix and exec_prefix is not supported.
+	Mention DESTDIR.
+	* INSTALL: Regenerate from the above.
+
 2015-06-12  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #18519]
diff --git a/INSTALL b/INSTALL
index 8e13f2cef7..d55de5dd47 100644
--- a/INSTALL
+++ b/INSTALL
@@ -295,11 +295,13 @@ headers from libraries other than the GNU C Library yourself after
 installing the library.
 
    You can install the GNU C Library somewhere other than where you
-configured it to go by setting the 'install_root' variable on the
-command line for 'make install'.  The value of this variable is
+configured it to go by setting the 'DESTDIR' GNU standard make variable
+on the command line for 'make install'.  The value of this variable is
 prepended to all the paths for installation.  This is useful when
 setting up a chroot environment or preparing a binary distribution.  The
-directory should be specified with an absolute file name.
+directory should be specified with an absolute file name.  Installing
+with the 'prefix' and 'exec_prefix' GNU standard make variables set is
+not supported.
 
    The GNU C Library includes a daemon called 'nscd', which you may or
 may not want to run.  'nscd' caches name service lookups; it can
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)
diff --git a/NEWS b/NEWS
index ea3d824966..da8bccfef3 100644
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,7 @@ Version 2.22
   18211, 18217, 18220, 18221, 18234, 18244, 18247, 18287, 18319, 18324,
   18333, 18346, 18397, 18409, 18410, 18412, 18418, 18422, 18434, 18444,
   18468, 18469, 18470, 18479, 18483, 18495, 18496, 18497, 18498, 18507,
-  18519, 18520, 18522.
+  18512, 18519, 18520, 18522.
 
 * Cache information can be queried via sysconf() function on s390 e.g. with
   _SC_LEVEL1_ICACHE_SIZE as argument.
diff --git a/manual/install.texi b/manual/install.texi
index 42ee467463..63c41b0b8d 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -333,12 +333,14 @@ headers, but nothing else.  If you do this, you will need to restore
 any headers from libraries other than @theglibc{} yourself after installing the
 library.
 
-You can install @theglibc{} somewhere other than where you configured it to go
-by setting the @code{install_root} variable on the command line for
-@samp{make install}.  The value of this variable is prepended to all the
-paths for installation.  This is useful when setting up a chroot
-environment or preparing a binary distribution.  The directory should be
-specified with an absolute file name.
+You can install @theglibc{} somewhere other than where you configured
+it to go by setting the @code{DESTDIR} GNU standard make variable on
+the command line for @samp{make install}.  The value of this variable
+is prepended to all the paths for installation.  This is useful when
+setting up a chroot environment or preparing a binary distribution.
+The directory should be specified with an absolute file name. Installing
+with the @code{prefix} and @code{exec_prefix} GNU standard make variables
+set is not supported.
 
 @Theglibc{} includes a daemon called @code{nscd}, which you
 may or may not want to run.  @code{nscd} caches name service lookups; it