Commit 75cd9c50 authored by Ian Lynagh's avatar Ian Lynagh

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.
parent c0eb9d99
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment