use CPPFLAGS for extra macros

This commit is contained in:
Dave Murphy 2018-06-05 16:45:17 +01:00
parent e95e74c5bb
commit 5fcb44fb8f
3 changed files with 12 additions and 10 deletions

View File

@ -175,22 +175,26 @@ PLATFORM=`uname -s`
case $PLATFORM in
Darwin )
cflags="-mmacosx-version-min=${OSXMIN} -I/usr/local/include"
cppflags="-mmacosx-version-min=${OSXMIN} -I/usr/local/include"
ldflags="-mmacosx-version-min=${OSXMIN} -L/usr/local/lib"
if [ "x${OSXSDKPATH}x" != "xx" ]; then
cflags="$cflags -isysroot ${OSXSDKPATH}"
cppflags="$cppflags -isysroot ${OSXSDKPATH}"
ldflags="$ldflags -Wl,-syslibroot,${OSXSDKPATH}"
fi
TESTCC=`cc -v 2>&1 | grep clang`
if [ "x${TESTCC}x" != "xx" ]; then
cflags="$cflags -fbracket-depth=512"
cppflags="$cppflags -fbracket-depth=512"
fi
;;
MINGW32* )
cflags="-D__USE_MINGW_ACCESS"
cppflags="-D__USE_MINGW_ACCESS"
;;
esac
if [ ! -z $CROSSBUILD ] && grep -q "mingw" <<<"$CROSSBUILD" ; then
cppflags="-D__USE_MINGW_ACCESS -D__USE_MINGW_ANSI_STDIO=1"
fi
BUILDSCRIPTDIR=$(pwd)
BUILDDIR=$(pwd)/.$package

View File

@ -10,7 +10,7 @@ cd $target/binutils
if [ ! -f configured-binutils ]
then
CFLAGS=$cflags LDFLAGS=$ldflags ../../binutils-$BINUTILS_VER/configure \
CPPFLAGS="$cppflags $CPPFLAGS" LDFLAGS=$ldflags ../../binutils-$BINUTILS_VER/configure \
--prefix=$prefix --target=$target --disable-nls --disable-werror \
--enable-lto --enable-plugins --enable-gold \
$CROSS_PARAMS \
@ -39,8 +39,7 @@ cd $target/gcc
if [ ! -f configured-gcc ]
then
CFLAGS="$cflags" \
CXXFLAGS="$cflags" \
CPPFLAGS="$cppflags $CPPFLAGS" \
LDFLAGS="$ldflags" \
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
CXXFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
@ -194,8 +193,7 @@ PLATFORM=`uname -s`
if [ ! -f configured-gdb ]
then
CFLAGS="$cflags" \
CXXFLAGS="$cflags" \
CPPFLAGS="$cppflags $CPPFLAGS" \
LDFLAGS="$ldflags" \
../../gdb-$GDB_VER/configure \
--disable-nls --prefix=$prefix --target=$target --disable-werror \

View File

@ -6,7 +6,7 @@ do
dir=$(echo $archive | sed -e 's/\(.*\)\.tar\.bz2/\1/' )
cd $BUILDDIR/$dir
if [ ! -f configured ]; then
CXXFLAGS=$cflags CFLAGS=$cflags LDFLAGS=$ldflags ./configure --prefix=$toolsprefix $CROSS_PARAMS || { echo "error configuring $archive"; exit 1; }
CPPFLAGS="$cppflags $CPPFLAGS" ./configure --prefix=$toolsprefix $CROSS_PARAMS || { echo "error configuring $archive"; exit 1; }
touch configured
fi
if [ ! -f built ]; then