|
lalbornoz |
340f4c |
# Order: stage1, runtime, full, native
|
|
lalbornoz |
340f4c |
|
|
lalbornoz |
340f4c |
if is_build_script_done finished; then
|
|
lalbornoz |
340f4c |
exit 212;
|
|
lalbornoz |
340f4c |
elif [ "x${3}" = "xruntime" ]\
|
|
lalbornoz |
340f4c |
|| [ "x${3}" = "xfull" ]; then
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
c49754 |
set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
96b309 |
cd ${BUILD_DIR};
|
|
lalbornoz |
340f4c |
if [ "x${3}" = "xruntime" ]; then
|
|
lalbornoz |
340f4c |
# GCC, compiler runtime.
|
|
lalbornoz |
340f4c |
if ! is_build_script_done built; then
|
|
lalbornoz |
340f4c |
make ${MAKEFLAGS} all-target-libgcc;
|
|
lalbornoz |
340f4c |
set_build_script_done built -installed;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
if ! is_build_script_done installed; then
|
|
lalbornoz |
340f4c |
make ${MAKEFLAGS} install-target-libgcc;
|
|
lalbornoz |
340f4c |
set_build_script_done installed finished;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
elif [ "x${3}" = "xfull" ]; then
|
|
lalbornoz |
340f4c |
# GCC, everything else.
|
|
lalbornoz |
340f4c |
if ! is_build_script_done built1; then
|
|
lalbornoz |
340f4c |
make ${MAKEFLAGS} all-target-libstdc++-v3;
|
|
lalbornoz |
340f4c |
set_build_script_done built1 -installed1;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
if ! is_build_script_done installed1; then
|
|
lalbornoz |
340f4c |
make ${MAKEFLAGS} install-target-libstdc++-v3;
|
|
lalbornoz |
340f4c |
set_build_script_done installed1 -built2;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
if ! is_build_script_done built2; then
|
|
lalbornoz |
340f4c |
make ${MAKEFLAGS};
|
|
lalbornoz |
340f4c |
set_build_script_done built2 -installed2;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
if ! is_build_script_done installed2; then
|
|
lalbornoz |
340f4c |
make ${MAKEFLAGS} install;
|
|
lalbornoz |
340f4c |
set_build_script_done installed2 finished;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
else
|
|
lalbornoz |
340f4c |
if [ "x${3}" = "xstage1" ]; then
|
|
lalbornoz |
340f4c |
# GCC, stage1.
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
c49754 |
set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
export cbb_ldflags_for_target=--sysroot=${PREFIX_LVL} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
cbb_sysroot_for_libgcc=${PREFIX_LVL} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
cbb_target=${TARGET} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
cbb_neutral_libiberty=no \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
96b309 |
cbb_xgcc_for_specs=${WORKDIR}/${BUILD_DIR}/gcc/xgcc;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_LVL}";
|
|
lalbornoz |
340f4c |
elif [ "x${3}" = "xnative" ]; then
|
|
lalbornoz |
340f4c |
# GCC, native.
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
6e940c |
set_build_dir cbb-gcc-${PKG_GCC_VERSION} native;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
export cbb_ldflags_for_target=--sysroot=${PREFIX_LVL} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
cbb_sysroot_for_libgcc=${PREFIX_LVL} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
cbb_target=${TARGET} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
6e940c |
cbb_xgcc_for_specs=${TARGET}-gcc;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_LVL}";
|
|
lalbornoz |
340f4c |
fi;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
bd43d0 |
GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f ${WORKDIR}/cbb-gcc-${PKG_GCC_VERSION}/libc/cbb-musl-pe.h)";
|
|
lalbornoz |
340f4c |
set_env_vars "${GCCFLAGS}" CFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS CXXFLAGS_FOR_BUILD;
|
|
lalbornoz |
340f4c |
set_env_vars "${CFLAGS_FOR_BUILD}" cbb_cflags_for_stage1 cbb_cflags_for_stage2 cbb_cflags_for_stage3 cbb_cflags_for_stage4;
|
|
lalbornoz |
340f4c |
set_env_vars "${GCCTARGET_FLAGS}" CFLAGS_FOR_TARGET CPPFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET LIBCFLAGS_FOR_TARGET XGCC_FLAGS_FOR_TARGET;
|
|
lalbornoz |
340f4c |
export CFLAGS CXXFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CFLAGS_FOR_TARGET XGCC_FLAGS_FOR_TARGET CPPFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET LIBCFLAGS_FOR_TARGET;
|
|
lalbornoz |
340f4c |
if ! is_build_script_done configured; then
|
|
lalbornoz |
340f4c |
if [ "x${3}" = "xstage1" ]; then
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
mkdir -p ${PREFIX_LVL}/include;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
[ \! -d ${PREFIX_LVL}/usr ] && \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
ln -s . ${PREFIX_LVL}/usr;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
_configure_args="--prefix=${PREFIX} --with-sysroot=${PREFIX_LVL}";
|
|
lalbornoz |
340f4c |
elif [ "x${3}" = "xnative" ]; then
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
mkdir -p ${PREFIX_LVL}/${TARGET};
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
if [ \! -d ${PREFIX_LVL}/${TARGET}/usr ]; then
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
ln -s . ${PREFIX_LVL}/${TARGET}/usr;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
_configure_args=" \
|
|
lalbornoz |
340f4c |
--host=x86_64-nt64-midipix \
|
|
lalbornoz |
340f4c |
--prefix=/ \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
--with-elf=${PREFIX_LVL} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
--with-gmp=${PREFIX_LVL} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
--with-mpc=${PREFIX_LVL} \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
--with-mpfr=${PREFIX_LVL} \
|
|
lalbornoz |
340f4c |
--with-sysroot=";
|
|
lalbornoz |
340f4c |
fi;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
96b309 |
rm_if_exists -m -c ${BUILD_DIR};
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
6e940c |
../cbb-gcc-${PKG_GCC_VERSION}/configure \
|
|
lalbornoz |
340f4c |
--disable-bootstrap \
|
|
lalbornoz |
340f4c |
--disable-libmudflap \
|
|
lalbornoz |
340f4c |
--disable-multilib \
|
|
lalbornoz |
340f4c |
--disable-nls \
|
|
lalbornoz |
340f4c |
--disable-obsolete \
|
|
lalbornoz |
340f4c |
--disable-sjlj-exceptions \
|
|
lalbornoz |
340f4c |
--disable-symvers \
|
|
lalbornoz |
340f4c |
--enable-canonical-system-headers \
|
|
lalbornoz |
340f4c |
--enable-__cxa_atexit \
|
|
lalbornoz |
340f4c |
--enable-debug \
|
|
lalbornoz |
340f4c |
--enable-gnu-indirect-function \
|
|
lalbornoz |
340f4c |
--enable-gnu-unique-object \
|
|
lalbornoz |
340f4c |
--enable-initfini-array \
|
|
lalbornoz |
340f4c |
--enable-languages=c,c++,objc,lto \
|
|
lalbornoz |
340f4c |
--enable-libstdcxx-debug \
|
|
lalbornoz |
340f4c |
--enable-lto \
|
|
lalbornoz |
340f4c |
--enable-multiarch \
|
|
lalbornoz |
340f4c |
--enable-secureplt \
|
|
lalbornoz |
340f4c |
--enable-shared \
|
|
lalbornoz |
340f4c |
--enable-threads=posix \
|
|
lalbornoz |
340f4c |
--target=${TARGET} \
|
|
lalbornoz |
340f4c |
--with-fpmath=sse \
|
|
lalbornoz |
340f4c |
${_configure_args};
|
|
lalbornoz |
340f4c |
set_build_script_done configured -built;
|
|
lalbornoz |
340f4c |
else
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
96b309 |
cd ${BUILD_DIR};
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
if ! is_build_script_done built; then
|
|
lalbornoz |
340f4c |
if [ "x${3}" = "xstage1" ]; then
|
|
lalbornoz |
340f4c |
make ${MAKEFLAGS} all-gcc;
|
|
lalbornoz |
340f4c |
elif [ "x${3}" = "xnative" ]; then
|
|
lalbornoz |
340f4c |
make -j18 all-gcc;
|
|
lalbornoz |
340f4c |
make -j18 all-target-libgcc;
|
|
lalbornoz |
340f4c |
make -j18 all-target-libstdc++-v3;
|
|
lalbornoz |
340f4c |
make -j18 all;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
set_build_script_done built -installed;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
if ! is_build_script_done installed; then
|
|
lalbornoz |
340f4c |
if [ "x${3}" = "xstage1" ]; then
|
|
lalbornoz |
340f4c |
make ${MAKEFLAGS} install-gcc;
|
|
lalbornoz |
340f4c |
elif [ "x${3}" = "xnative" ]; then
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
f9c386 |
make -j18 DESTDIR=${PREFIX_LVL} install;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
set_build_script_done installed finished;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
fi;
|
|
lalbornoz |
340f4c |
|
|
lalbornoz |
340f4c |
# vim:filetype=sh
|