From patchwork Thu Jun 11 23:46:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sebor X-Patchwork-Id: 483322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D66BB1401DA for ; Fri, 12 Jun 2015 09:46:33 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sourceware.org header.i=@sourceware.org header.b=RdMfnhtB; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type; q=dns; s=default; b=PI7EgusPkcymzENFUx8Dzv0ZTOaGK WU1POdAZYtKRcIbf8vVhYowS0C0q7aJlyCfUfxd8MpMh2GgHg0DVNX+tcc3E8P69 JtotlYFAMW/IedxGHtnr6Q72BNM73+iI3lGGKqQSMbmsShNv6vuqOgIYS+Hih+GJ WXO09V8HQoxMqk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type; s=default; bh=SfuWA0Kgs/oyyviEYndJNQQWA1E=; b=RdM fnhtBuQM22uCBSM5DHonnNj/aRMif5yMlCq288JtRnKMCrpy8+ugvyE5Y1AqCqWM f8ogb9hX2qG4Y914+X9RUCNHQKTu2F5zJudiAWNGPb3pkK2Ur9A3C9M9szszopzo bIj8h8RJICSnCbWvH/CJ15JKhhGs4BS//xnmDfBA= Received: (qmail 56803 invoked by alias); 11 Jun 2015 23:46:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 56794 invoked by uid 89); 11 Jun 2015 23:46:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Message-ID: <557A1DCF.6080208@redhat.com> Date: Thu, 11 Jun 2015 17:46:23 -0600 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: GNU C Library Subject: [PATCH] detect overridden install prefix [BZ #18512] Attempting to install glibc configured with --prefix=/usr into a non-standard directory specified by the prefix make variable fails with an error. Carlos indicated this is an unsupported use case that he would prefer to detect and error out on early in the installation process. Attached is a simple patch that implements this detection. The patch also updates the INSTALL file to mention this caveat and recommend using DESTDIR instead. To keep the patch simple I didn't implement the idea of detecting whether the overridden prefix is actually different than the prefix the library was configured with. ChangeLog: 2015-06-11 Martin Sebor [BZ #18512] * Makerules (check-install-supported): New target. install: Add check-install-supported as a dependency. * INSTALL (Installing the C Library): Document that overriding prefix and exec_prefix is not supported. Mention DESTDIR. Martin diff --git a/INSTALL b/INSTALL index 8e13f2c..c1a8ecf 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 c79915f..502d22a 100644 --- a/Makerules +++ b/Makerules @@ -906,6 +906,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 (sed 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)