From 36c5bb40a27c7faac2a167df8c5cbd7c98c5168d Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Mon, 16 Sep 2013 19:57:14 +0100 Subject: [PATCH] Makefiles: Fix CC variable override. The CC override in commit f42b2d4bbf16345e5b5457f4298e751d5c134776 caused the built-in value to be used instead of the configured value when it wasn't being overridden. The behaviour is explained here: http://stackoverflow.com/questions/18007326/how-to-change-default-values-of-variables-like-cc-in-makefile --- WHATS_NEW | 1 + make.tmpl.in | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index d51f08c84..45e0050ab 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.101 - =================================== + Fix CC Makefile override which had reverted to using built-in value. (2.02.75) Recognise bcache block devices in filter (experimental). Run lvm2-activation-net after lvm2-activation service to prevent parallel run. Add man page entries for lvmdump's -u and -l options. diff --git a/make.tmpl.in b/make.tmpl.in index 699225531..321875868 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -17,7 +17,18 @@ SHELL = /bin/sh @SET_MAKE@ +# Allow environment to override any built-in default value for CC. +# If there is a built-in default, CC is NOT set to @CC@ here. CC ?= @CC@ + +# If $(CC) holds the usual built-in default value of 'cc' then replace it with +# the configured value. +# (To avoid this and force the use of 'cc' from the environment, supply its +# full path.) +ifeq ($(CC), cc) + CC = @CC@ +endif + RANLIB = @RANLIB@ INSTALL = @INSTALL@ MKDIR_P = @MKDIR_P@