summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-12-07 01:00:33 +0000
committerIan Lynagh <igloo@earth.li>2010-12-07 01:00:33 +0000
commit75cd9c50ea68a5e426e3105735713b8015d63413 (patch)
treed42739ff3a6766b255264844527861e9efb05ffe
parentc0eb9d997653da4357873829990cc338475bca39 (diff)
downloadhaskell-75cd9c50ea68a5e426e3105735713b8015d63413.tar.gz
Make CPPFLAGS variables, as well as CFLAGS and LDFLAGS
This fixes the "does unsetenv return void" test in the unix package on OS X, if I tell it to make 10.4-compatible binaries. The test uses CPPFLAGS but not CFLAGS, so it thought it returned int (as it was in 10.5-mode), but the C compiler (using CFLAGS, so in 10.4 mode) thought it returned void. I also added CONF_LD_OPTS_STAGE$3 to the list of things in LDFLAGS, which looks like an accidental ommission.
-rw-r--r--aclocal.m45
-rw-r--r--configure.ac11
-rw-r--r--mk/config.mk.in3
-rw-r--r--rules/build-package-data.mk3
4 files changed, 16 insertions, 6 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 4701bc9354..f5ae279eb8 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -9,7 +9,7 @@
# Set the C and LD flags for a given platform
AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
[
- AC_MSG_CHECKING([Setting up $2 and $3])
+ AC_MSG_CHECKING([Setting up $2, $3 and $4])
case $$1 in
i386-apple-darwin)
# By default, gcc on OS X will generate SSE
@@ -18,10 +18,12 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
# back to generic i686 compatibility. Trac #2983.
$2="$$2 -march=i686 -m32"
$3="$$3 -march=i686 -m32"
+ $4="$$4 -march=i686 -m32"
;;
x86_64-apple-darwin)
$2="$$2 -m64"
$3="$$3 -m64"
+ $4="$$4 -m64"
;;
esac
@@ -30,6 +32,7 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
# We support back to OS X 10.5
$2="$$2 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"
$3="$$3 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"
+ $4="$$4 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"
;;
esac
diff --git a/configure.ac b/configure.ac
index 28a5875832..e89a2fe4ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -530,11 +530,11 @@ dnl If gcc, make sure it's at least 2.1
dnl
FP_HAVE_GCC
-FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS])
-FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0],[CONF_LD_OPTS_STAGE0])
-FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE1],[CONF_LD_OPTS_STAGE1])
+FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS],[CPPFLAGS])
+FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0],[CONF_LD_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
+FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE1],[CONF_LD_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
# Stage 3 won't be supported by cross-compilation
-FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE2],[CONF_LD_OPTS_STAGE2])
+FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE2],[CONF_LD_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
FP_GCC_EXTRA_FLAGS
@@ -547,6 +547,9 @@ AC_SUBST(CONF_CC_OPTS_STAGE2)
AC_SUBST(CONF_LD_OPTS_STAGE0)
AC_SUBST(CONF_LD_OPTS_STAGE1)
AC_SUBST(CONF_LD_OPTS_STAGE2)
+AC_SUBST(CONF_CPP_OPTS_STAGE0)
+AC_SUBST(CONF_CPP_OPTS_STAGE1)
+AC_SUBST(CONF_CPP_OPTS_STAGE2)
dnl ** figure out how to do context diffs
FP_PROG_CONTEXT_DIFF
diff --git a/mk/config.mk.in b/mk/config.mk.in
index fd6ee477f0..558624fbfe 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -537,6 +537,9 @@ CONF_CC_OPTS_STAGE2 = @CONF_CC_OPTS_STAGE2@
CONF_LD_OPTS_STAGE0 = @CONF_LD_OPTS_STAGE0@
CONF_LD_OPTS_STAGE1 = @CONF_LD_OPTS_STAGE1@
CONF_LD_OPTS_STAGE2 = @CONF_LD_OPTS_STAGE2@
+CONF_CPP_OPTS_STAGE0 = @CONF_CPP_OPTS_STAGE0@
+CONF_CPP_OPTS_STAGE1 = @CONF_CPP_OPTS_STAGE1@
+CONF_CPP_OPTS_STAGE2 = @CONF_CPP_OPTS_STAGE2@
ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
CONF_CC_OPTS += -G0
diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk
index 9b8474a248..a74e096e4a 100644
--- a/rules/build-package-data.mk
+++ b/rules/build-package-data.mk
@@ -39,7 +39,8 @@ endif
# for a feature it may not generate warning-free C code, and thus may
# think that the feature doesn't exist if -Werror is on.
$1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS_STAGE$3) $$($1_CC_OPTS) $$($1_$2_CC_OPTS)"
-$1_$2_CONFIGURE_OPTS += --configure-option=LDFLAGS="$$(SRC_LD_OPTS) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)"
+$1_$2_CONFIGURE_OPTS += --configure-option=LDFLAGS="$$(SRC_LD_OPTS) $$(CONF_LD_OPTS_STAGE$3) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)"
+$1_$2_CONFIGURE_OPTS += --configure-option=CPPFLAGS="$$(SRC_CPP_OPTS) $$(CONF_CPP_OPTS_STAGE$3) $$($1_CPP_OPTS) $$($1_$2_CPP_OPTS)"
ifneq "$$(ICONV_INCLUDE_DIRS)" ""
$1_$2_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="$$(ICONV_INCLUDE_DIRS)"