[Pacemaker] [patch] low: unset CFLAGS in a dash-friendly way

Simon Horman horms at verge.net.au
Mon Jul 5 04:19:10 EDT 2010

# HG changeset patch
# User Simon Horman <horms at verge.net.au>
# Date 1278317844 -32400
# Node ID e823bf55e0d875bcd9dc1668f24547345b9bdf81
# Parent  7499efa9c2a3f8c5c6396dc6c3631e9f3898547e
low: unset CFLAGS in a dash-friendly way

According to the dash man page, the only way to unexport a variable
is to unset it. This also works in bash.

For the record, the reason that CFLAGS is exported from the environment to
configure and configure appends -Werror to the CFLAGS then it will be
re-exported by configure and has been observed to cause trouble when
configure runs a separate configure is the libltdl directory.

See:	Debian Bug #582874 - http://bugs.debian.org/582874
	Debian Bug #582875 - http://bugs.debian.org/582875

Signed-off-by: Simon Horman <horms at verge.net.au>

diff -r 7499efa9c2a3 -r e823bf55e0d8 configure.in
--- a/configure.in	Wed Jan 07 15:02:59 2009 +0100
+++ b/configure.in	Mon Jul 05 17:17:24 2010 +0900
@@ -1475,11 +1475,12 @@
 dnl no effect. However if CFLAGS was exported from the user's
 dnl environment, then the new CFLAGS will also be exported
 dnl to sub processes. This causes a problem when configure
-dnl is run in the libltdl directory. Horms 16th July 2002
+dnl is run in the libltdl directory.
 if export | fgrep " CFLAGS=" > /dev/null; then
-	export -n CFLAGS || true # We don't want to bomb out if this fails
+	unset CFLAGS
 if test "$GCC" = yes; then

More information about the Pacemaker mailing list