Changeset 4a59eb9 in rtems-source-builder


Ignore:
Timestamp:
Oct 25, 2013, 11:12:15 PM (6 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
ae717cb
Parents:
3bc9e31
Message:

Split FLAGS into CFLAGS and LDFLAGS.

The clang compiler on MacOS 10.9 (Maverick) generated a warning when
LDFLAGS where passed on the command line. This change lets the RSB
build RTEMS GCC tools on a clean Maverick install.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/defaults.mc

    r3bc9e31 r4a59eb9  
    176176SB_SOURCE_DIR="%{_sourcedir}"
    177177SB_BUILD_DIR="%{_builddir}"
    178 SB_OPT_HOST_FLAGS="%{optflags} %{?_tmproot:-I%{_tmproot}/${SB_PREFIX_CLEAN}/include -L%{_tmproot}/${SB_PREFIX_CLEAN}/lib}"
    179 SB_OPT_BUILD_FLAGS="%{optflags} %{optincludes}"
    180 SB_OPT_FLAGS="${SB_OPT_HOST_FLAGS} %{optincludes}"
     178SB_OPT_HOST_CFLAGS="%{optflags} %{?_tmproot:-I%{_tmproot}/${SB_PREFIX_CLEAN}/include}"
     179SB_OPT_HOST_LDFLAGS="%{?_tmproot:-L%{_tmproot}/${SB_PREFIX_CLEAN}/lib}"
     180SB_OPT_BUILD_CFLAGS="%{optflags} %{optincludes}"
     181SB_OPT_CFLAGS="${SB_OPT_HOST_CFLAGS} %{optincludes}"
    181182SB_ARCH="%{_arch}"
    182183SB_OS="%{_os}"
    183 export SB_SOURCE_DIR SB_BUILD_DIR SB_OPT_HOST_FLAGS SB_OPT_BUILD_FLAGS SB_OPT_FLAGS SB_ARCH SB_OS
     184export SB_SOURCE_DIR SB_BUILD_DIR SB_OPT_HOST_CFLAGS SB_OPT_BUILD_CFLAGS SB_OPT_CFLAGS SB_ARCH SB_OS
    184185# Documentation
    185186SB_DOC_DIR="%{_docdir}"
     
    237238# Configure command
    238239configure:           none,    none,     '''
    239 CFLAGS="${CFLAGS:-${SB_OPT_FLAGS}" ; export CFLAGS ;
    240 CXXFLAGS="${CXXFLAGS:-${SB_OPT_FLAGS}}" ; export CXXFLAGS ;
    241 FFLAGS="${FFLAGS:-${SB_OPT_FLAGS}}" ; export FFLAGS ;
     240CFLAGS="${CFLAGS:-${SB_OPT_CFLAGS}" ; export CFLAGS ;
     241CXXFLAGS="${CXXFLAGS:-${SB_OPT_CFLAGS}}" ; export CXXFLAGS ;
     242FFLAGS="${FFLAGS:-${SB_OPT_CFLAGS}}" ; export FFLAGS ;
    242243./configure --build=%{_build} --host=%{_host} \
    243244      --target=%{_target_platform} \
     
    269270# Host and build flags
    270271if test "%{_build}" != "%{_host}" ; then
    271   CFLAGS_FOR_BUILD="${SB_OPT_HOST_FLAGS}"
    272   CC=$(echo "%{_host}-gcc ${SB_OPT_HOST_FLAGS}" | sed -e 's,-std=gnu99 ,,')
    273   CXXFLAGS_FOR_BUILD="${SB_OPT_HOST_FLAGS}"
    274   CXX=$(echo "%{_host}-g++ ${SB_OPT_HOST_FLAGS}" | sed -e 's,-std=gnu99 ,,')
    275   CC_FOR_BUILD=$(echo "%{__cc} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,')
    276   CXX_FOR_BUILD=$(echo "%{__cxx} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,')
     272  CFLAGS_FOR_BUILD="${SB_OPT_HOST_CFLAGS}"
     273  LDFLAGS_FOR_BUILD="${SB_OPT_HOST_LDFLAGS}"
     274  CC=$(echo "%{_host}-gcc ${SB_OPT_HOST_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
     275  CXXFLAGS_FOR_BUILD="${SB_OPT_HOST_CFLAGS}"
     276  CXX=$(echo "%{_host}-g++ ${SB_OPT_HOST_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
     277  CC_FOR_BUILD=$(echo "%{__cc} ${SB_OPT_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
     278  CXX_FOR_BUILD=$(echo "%{__cxx} ${SB_OPT_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
    277279else
    278280  # gcc is not ready to be compiled with -std=gnu99
    279   CC=$(echo "%{__cc} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,')
    280   CXX=$(echo "%{__cxx} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,')
     281  LDFLAGS="${SB_OPT_HOST_LDFLAGS}"
     282  CC=$(echo "%{__cc} ${SB_OPT_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
     283  CXX=$(echo "%{__cxx} ${SB_OPT_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
    281284  CC_FOR_BUILD=${CC}
    282285  CXX_FOR_BUILD=${CXX}
    283286fi
    284 export CC CXX CC_FOR_BUILD CXX_FOR_BUILD CFLAGS CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD'''
     287export CC CXX CC_FOR_BUILD CXX_FOR_BUILD CFLAGS CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD LDFLAGS LDFLAGS_FOR_BUILD'''
    285288
    286289# Build/build flags.
     
    288291# Build and build flags means force build == host
    289292# gcc is not ready to be compiled with -std=gnu99
    290 CC=$(echo "%{__cc} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,')
    291 CXX=$(echo "%{__cxx} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,')
     293LDFLAGS="${SB_OPT_HOST_LDFLAGS}"
     294CC=$(echo "%{__cc} ${SB_OPT_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
     295CXX=$(echo "%{__cxx} ${SB_OPT_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
    292296CC_FOR_BUILD=${CC}
    293297CXX_FOR_BUILD=${CXX}
    294 export CC CXX CC_FOR_BUILD CXX_FOR_BUILD CFLAGS'''
     298export CC CXX CC_FOR_BUILD CXX_FOR_BUILD CFLAGS LDFLAGS'''
    295299
    296300# Default package settings
Note: See TracChangeset for help on using the changeset viewer.