mirror of
https://github.com/devkitPro/buildscripts.git
synced 2026-03-21 17:44:41 -05:00
unified build for all toolchains
This commit is contained in:
parent
f1d8ff0e21
commit
51244357b7
35
build-binutils.sh
Normal file
35
build-binutils.sh
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/sh
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install binutils
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
mkdir -p $target/binutils
|
||||
pushd $target/binutils
|
||||
|
||||
if [ ! -f configured-binutils ]
|
||||
then
|
||||
CPPFLAGS="$cppflags $CPPFLAGS" LDFLAGS="$ldflags $LDFLAGS" ../../binutils-$BINUTILS_VER/configure \
|
||||
--prefix=$prefix --target=$target \
|
||||
--disable-nls --disable-werror \
|
||||
--disable-shared --disable-debug \
|
||||
--enable-lto --enable-plugins \
|
||||
--enable-poison-system-directories \
|
||||
$CROSS_PARAMS \
|
||||
|| { echo "Error configuring binutils"; exit 1; }
|
||||
touch configured-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f built-binutils ]
|
||||
then
|
||||
$MAKE || { echo "Error building binutils"; exit 1; }
|
||||
touch built-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f installed-binutils ]
|
||||
then
|
||||
$MAKE install || { echo "Error installing binutils"; exit 1; }
|
||||
touch installed-binutils
|
||||
fi
|
||||
popd
|
||||
40
build-crtls.sh
Executable file
40
build-crtls.sh
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# set env variables
|
||||
#---------------------------------------------------------------------------------
|
||||
export DEVKITPRO=$TOOLPATH
|
||||
export DEVKITPPC=$DEVKITPRO/devkitPPC
|
||||
export DEVKITARM=$DEVKITPRO/devkitARM
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Install the rules files
|
||||
#---------------------------------------------------------------------------------
|
||||
cd $BUILDDIR
|
||||
|
||||
if [ ! -f extracted-${_prefix}-rules ]; then
|
||||
tar -xvf $SRCDIR/${_prefix}-rules-${_rules_ver}.tar.gz || touch extracted-${_prefix}-rules
|
||||
fi
|
||||
|
||||
cd ${_prefix}-rules-${_rules_ver}
|
||||
|
||||
if [ ! -f installed-${_prefix}-rules ]; then
|
||||
$MAKE install || touch installed-${_prefix}-rules
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Install the linkscripts
|
||||
#---------------------------------------------------------------------------------
|
||||
if [ $VERSION -ne 3 ]; then
|
||||
cd $BUILDDIR
|
||||
|
||||
if [ ! -f extracted-${_prefix}-crtls ]; then
|
||||
tar -xvf $SRCDIR/${_prefix}-crtls-${_crtls_ver}.tar.gz || touch extracted-${_prefix}-crtls
|
||||
fi
|
||||
|
||||
cd ${_prefix}-crtls-${_crtls_ver}
|
||||
|
||||
if [ ! -f installed-${_prefix}-crtls ]; then
|
||||
$MAKE install || touch installed-${_prefix}-crtls
|
||||
fi
|
||||
fi
|
||||
|
|
@ -132,6 +132,7 @@ if [ ! -z $CROSSBUILD ]; then
|
|||
CROSS_GCC_PARAMS="--with-gmp=$CROSSPATH --with-mpfr=$CROSSPATH --with-mpc=$CROSSPATH --with-isl=$CROSSPATH --with-zstd=$CROSSPATH"
|
||||
else
|
||||
prefix=$INSTALLDIR/$package
|
||||
CROSS_PARAMS="$CROSS_PARAMS --host=`./config.guess`"
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
|
@ -239,11 +240,16 @@ if [ $VERSION -eq 2 ]; then extract_and_patch binutils $MN_BINUTILS_VER bz2; fi
|
|||
#---------------------------------------------------------------------------------
|
||||
# Build and install devkit components
|
||||
#---------------------------------------------------------------------------------
|
||||
if [ -f $scriptdir/build-gcc.sh ]; then . $scriptdir/build-gcc.sh || { echo "Error building toolchain"; exit 1; }; cd $BUILDSCRIPTDIR; fi
|
||||
. ${BUILDSCRIPTDIR}/build-binutils.sh || { echo "Error building binutils"; exit 1; };
|
||||
if [ $VERSION -eq 2 ]; then . ${BUILDSCRIPTDIR}/build-mn10200-binutils.sh || { echo "Error building mn10200 binutils"; exit 1; }; fi
|
||||
|
||||
. ${BUILDSCRIPTDIR}/build-gcc-stage1.sh || { echo "Error building gcc stage1"; exit 1; };
|
||||
. ${BUILDSCRIPTDIR}/build-newlib.sh || { echo "Error building newlib"; exit 1; };
|
||||
. ${BUILDSCRIPTDIR}/build-gcc-stage2.sh || { echo "Error building gcc stage2"; exit 1; };
|
||||
|
||||
|
||||
if [ "$BUILD_DKPRO_SKIP_CRTLS" != "1" ] && [ -f $scriptdir/build-crtls.sh ]; then
|
||||
. $scriptdir/build-crtls.sh || { echo "Error building crtls & rules"; exit 1; }; cd $BUILDSCRIPTDIR;
|
||||
if [ "$BUILD_DKPRO_SKIP_CRTLS" != "1" ]; then
|
||||
. ${BUILDSCRIPTDIR}/build-crtls.sh || { echo "Error building crtls & rules"; exit 1; };
|
||||
fi
|
||||
|
||||
cd $BUILDSCRIPTDIR
|
||||
|
|
|
|||
56
build-gcc-stage1.sh
Executable file
56
build-gcc-stage1.sh
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bash
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install the full compiler
|
||||
#---------------------------------------------------------------------------------
|
||||
mkdir -p ${BUILDDIR}/$target/gcc
|
||||
cd ${BUILDDIR}/$target/gcc
|
||||
|
||||
|
||||
if [ ! -f configured-gcc ]
|
||||
then
|
||||
CPPFLAGS="$cppflags $CPPFLAGS" \
|
||||
LDFLAGS="$ldflags $LDFLAGS" \
|
||||
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
CXXFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
LDFLAGS_FOR_TARGET="" \
|
||||
../../gcc-$GCC_VER/configure \
|
||||
--target=$target \
|
||||
--prefix=$prefix \
|
||||
--enable-languages=c,c++,objc,lto \
|
||||
--with-gnu-as --with-gnu-ld --with-gcc \
|
||||
--enable-cxx-flags='-ffunction-sections' \
|
||||
--disable-libstdcxx-verbose \
|
||||
--enable-poison-system-directories \
|
||||
--enable-threads=posix --disable-win32-registry --disable-nls --disable-debug \
|
||||
--disable-libmudflap --disable-libssp --disable-libgomp \
|
||||
--disable-libstdcxx-pch \
|
||||
--enable-libstdcxx-time=yes \
|
||||
--enable-libstdcxx-filesystem-ts \
|
||||
--with-newlib=yes \
|
||||
--with-native-system-header-dir=/include \
|
||||
--with-sysroot=${prefix}/${target} \
|
||||
--enable-lto \
|
||||
--disable-tm-clone-registry \
|
||||
--disable-__cxa_atexit \
|
||||
--with-bugurl="https://devkitpro.org" \
|
||||
${_toolchain_options} \
|
||||
$CROSS_PARAMS \
|
||||
$CROSS_GCC_PARAMS \
|
||||
$EXTRA_GCC_PARAMS \
|
||||
|| { echo "Error configuring gcc"; exit 1; }
|
||||
touch configured-gcc
|
||||
fi
|
||||
|
||||
if [ ! -f built-gcc ]
|
||||
then
|
||||
$MAKE all-gcc || { echo "Error building gcc stage1"; exit 1; }
|
||||
touch built-gcc
|
||||
fi
|
||||
|
||||
if [ ! -f installed-gcc ]
|
||||
then
|
||||
$MAKE install-gcc || { echo "Error installing gcc stage 1"; exit 1; }
|
||||
touch installed-gcc
|
||||
fi
|
||||
21
build-gcc-stage2.sh
Executable file
21
build-gcc-stage2.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install the full compiler
|
||||
#---------------------------------------------------------------------------------
|
||||
mkdir -p ${BUILDDIR}/$target/gcc
|
||||
cd ${BUILDDIR}/$target/gcc
|
||||
|
||||
|
||||
if [ ! -f built-gcc-stage2 ]
|
||||
then
|
||||
$MAKE || { echo "Error building gcc stage2"; exit 1; }
|
||||
touch built-gcc-stage2
|
||||
fi
|
||||
|
||||
if [ ! -f installed-gcc-stage2 ]
|
||||
then
|
||||
$MAKE install-strip || { echo "Error installing gcc"; exit 1; }
|
||||
touch installed-gcc-stage2
|
||||
fi
|
||||
33
build-mn10200-binutils.sh
Normal file
33
build-mn10200-binutils.sh
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#---------------------------------------------------------------------------------
|
||||
# build and install mn10200 binutils
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
# Use modern config.sub for aarch64 host
|
||||
cp binutils-$BINUTILS_VER/config.sub binutils-$MN_BINUTILS_VER/config.sub
|
||||
|
||||
mkdir -p mn10200/binutils
|
||||
pushd mn10200/binutils
|
||||
|
||||
if [ ! -f configured-binutils ]
|
||||
then
|
||||
../../binutils-$MN_BINUTILS_VER/configure \
|
||||
--prefix=$prefix --target=mn10200 --disable-nls --disable-debug \
|
||||
--disable-multilib \
|
||||
--disable-werror $CROSS_PARAMS \
|
||||
|| { echo "Error configuing mn10200 binutils"; exit 1; }
|
||||
touch configured-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f built-binutils ]
|
||||
then
|
||||
$MAKE || { echo "Error building mn10200 binutils"; exit 1; }
|
||||
touch built-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f installed-binutils ]
|
||||
then
|
||||
$MAKE install || { echo "Error installing mn10200 binutils"; exit 1; }
|
||||
touch installed-binutils
|
||||
fi
|
||||
|
||||
popd
|
||||
56
build-newlib.sh
Normal file
56
build-newlib.sh
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bash
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install newlib
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
unset CFLAGS
|
||||
cd $BUILDDIR
|
||||
|
||||
OLD_CC=$CC
|
||||
OLDCXX=$CXX
|
||||
unset CC
|
||||
unset CXX
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install newlib
|
||||
#---------------------------------------------------------------------------------
|
||||
mkdir -p ${BUILDDIR}/$target/newlib
|
||||
cd ${BUILDDIR}/$target/newlib
|
||||
|
||||
_target_cflags="-O2 -ffunction-sections -fdata-sections"
|
||||
|
||||
if [ $VERSION -eq 2 ]; then
|
||||
_target_cflags="${_target_cflags} -DCUSTOM_MALLOC_LOCK"
|
||||
fi
|
||||
|
||||
if [ ! -f configured-newlib ]
|
||||
then
|
||||
CFLAGS_FOR_TARGET="${_target_cflags}" \
|
||||
../../newlib-$NEWLIB_VER/configure \
|
||||
--disable-newlib-supplied-syscalls \
|
||||
--enable-newlib-mb \
|
||||
--disable-newlib-wide-orient \
|
||||
--enable-newlib-register-fini \
|
||||
--target=$target \
|
||||
--prefix=$prefix \
|
||||
|| { echo "Error configuring newlib"; exit 1; }
|
||||
touch configured-newlib
|
||||
fi
|
||||
|
||||
if [ ! -f built-newlib ]
|
||||
then
|
||||
$MAKE || { echo "Error building newlib"; exit 1; }
|
||||
touch built-newlib
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f installed-newlib ]
|
||||
then
|
||||
$MAKE install -j1 || { echo "Error installing newlib"; exit 1; }
|
||||
touch installed-newlib
|
||||
fi
|
||||
|
||||
export CC=$OLD_CC
|
||||
export CXX=$OLD_CXX
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
include $(DEVKITPRO)/devkitA64/base_tools
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.a:
|
||||
#---------------------------------------------------------------------------------
|
||||
@echo $(notdir $@)
|
||||
@rm -f $@
|
||||
$(AR) -rc $@ $^
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.cpp
|
||||
@echo $(notdir $<)
|
||||
$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.c
|
||||
@echo $(notdir $<)
|
||||
$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.s
|
||||
@echo $(notdir $<)
|
||||
$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.S
|
||||
@echo $(notdir $<)
|
||||
$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# canned command sequence for binary data
|
||||
#---------------------------------------------------------------------------------
|
||||
define bin2o
|
||||
bin2s $< | $(AS) -o $(@)
|
||||
echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' -e 's/[^A-Za-z0-9_]/_/g')`"_end[];" > `(echo $(<F) | tr . _)`.h
|
||||
echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' -e 's/[^A-Za-z0-9_]/_/g')`"[];" >> `(echo $(<F) | tr . _)`.h
|
||||
echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' -e 's/[^A-Za-z0-9_]/_/g')`_size";" >> `(echo $(<F) | tr . _)`.h
|
||||
endef
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
#---------------------------------------------------------------------------------
|
||||
# make sure we have bash on OSX
|
||||
#---------------------------------------------------------------------------------
|
||||
UNAME_S := $(shell uname -s)
|
||||
UNAME_R := $(shell uname -r)
|
||||
|
||||
ifneq (,$(findstring Darwin,$(UNAME_S)))
|
||||
export SHELL=/bin/bash
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# path to tools
|
||||
#---------------------------------------------------------------------------------
|
||||
DEVKITPATH=$(shell echo "$(DEVKITPRO)" | sed -e 's/^\([a-zA-Z]\):/\/\1/')
|
||||
export PATH := $(DEVKITPATH)/tools/bin:$(DEVKITPATH)/devkitA64/bin:$(PATH)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# add portlibs path
|
||||
#---------------------------------------------------------------------------------
|
||||
export PORTLIBS_PATH := $(DEVKITPATH)/portlibs
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# the prefix on the compiler executables
|
||||
#---------------------------------------------------------------------------------
|
||||
PREFIX := aarch64-none-elf-
|
||||
|
||||
export CC := $(PREFIX)gcc
|
||||
export CXX := $(PREFIX)g++
|
||||
export AS := $(PREFIX)as
|
||||
export AR := $(PREFIX)gcc-ar
|
||||
export OBJCOPY := $(PREFIX)objcopy
|
||||
export STRIP := $(PREFIX)strip
|
||||
export NM := $(PREFIX)gcc-nm
|
||||
export RANLIB := $(PREFIX)gcc-ranlib
|
||||
|
||||
ISVC=$(or $(VCBUILDHELPER_COMMAND),$(MSBUILDEXTENSIONSPATH32),$(MSBUILDEXTENSIONSPATH))
|
||||
|
||||
ifneq (,$(ISVC))
|
||||
ERROR_FILTER := 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g'
|
||||
endif
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# set env variables
|
||||
#---------------------------------------------------------------------------------
|
||||
export DEVKITPRO=$TOOLPATH
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Install the rules files
|
||||
#---------------------------------------------------------------------------------
|
||||
cd $BUILDDIR
|
||||
|
||||
tar -xvf $SRCDIR/devkita64-rules-$DKA64_RULES_VER.tar.gz
|
||||
cd devkita64-rules-$DKA64_RULES_VER
|
||||
$MAKE install
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
#!/bin/sh
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install binutils
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
mkdir -p $target/binutils
|
||||
cd $target/binutils
|
||||
|
||||
if [ ! -f configured-binutils ]
|
||||
then
|
||||
../../binutils-$BINUTILS_VER/configure \
|
||||
--prefix=$prefix --target=$target --disable-nls --disable-werror \
|
||||
--enable-lto --enable-plugins --enable-poison-system-directories \
|
||||
$CROSS_PARAMS \
|
||||
|| { echo "Error configuring binutils"; exit 1; }
|
||||
touch configured-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f built-binutils ]
|
||||
then
|
||||
$MAKE || { echo "Error building binutils"; exit 1; }
|
||||
touch built-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f installed-binutils ]
|
||||
then
|
||||
$MAKE install || { echo "Error installing binutils"; exit 1; }
|
||||
touch installed-binutils
|
||||
fi
|
||||
cd $BUILDDIR
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install just the c compiler
|
||||
#---------------------------------------------------------------------------------
|
||||
mkdir -p $target/gcc
|
||||
cd $target/gcc
|
||||
|
||||
if [ ! -f configured-gcc ]
|
||||
then
|
||||
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
CXXFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
LDFLAGS_FOR_TARGET="" \
|
||||
../../gcc-$GCC_VER/configure \
|
||||
--enable-languages=c,c++,objc,lto \
|
||||
--with-gnu-as --with-gnu-ld --with-gcc \
|
||||
--with-march=armv8\
|
||||
--enable-cxx-flags='-ffunction-sections' \
|
||||
--disable-libstdcxx-verbose \
|
||||
--enable-poison-system-directories \
|
||||
--enable-multilib \
|
||||
--enable-threads --disable-win32-registry --disable-nls --disable-debug\
|
||||
--disable-libmudflap --disable-libssp --disable-libgomp \
|
||||
--disable-libstdcxx-pch \
|
||||
--enable-libstdcxx-time \
|
||||
--enable-libstdcxx-filesystem-ts \
|
||||
--target=$target \
|
||||
--with-newlib=yes \
|
||||
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
|
||||
--prefix=$prefix \
|
||||
--enable-lto \
|
||||
--disable-tm-clone-registry \
|
||||
--disable-__cxa_atexit \
|
||||
--with-bugurl="https://github.com/devkitPro/buildscripts/issues" --with-pkgversion="devkitA64 release 29" \
|
||||
$CROSS_PARAMS \
|
||||
$CROSS_GCC_PARAMS \
|
||||
$EXTRA_GCC_PARAMS \
|
||||
|| { echo "Error configuring gcc"; exit 1; }
|
||||
touch configured-gcc
|
||||
fi
|
||||
|
||||
if [ ! -f built-gcc ]
|
||||
then
|
||||
$MAKE all-gcc || { echo "Error building gcc stage1"; exit 1; }
|
||||
touch built-gcc
|
||||
fi
|
||||
|
||||
if [ ! -f installed-gcc ]
|
||||
then
|
||||
$MAKE install-gcc || { echo "Error installing gcc"; exit 1; }
|
||||
touch installed-gcc
|
||||
fi
|
||||
|
||||
|
||||
unset CFLAGS
|
||||
cd $BUILDDIR
|
||||
|
||||
OLD_CC=$CC
|
||||
OLDCXX=$CXX
|
||||
unset CC
|
||||
unset CXX
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install newlib
|
||||
#---------------------------------------------------------------------------------
|
||||
mkdir -p $target/newlib
|
||||
cd $target/newlib
|
||||
|
||||
if [ ! -f configured-newlib ]
|
||||
then
|
||||
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
../../newlib-$NEWLIB_VER/configure \
|
||||
--disable-newlib-supplied-syscalls \
|
||||
--enable-newlib-mb \
|
||||
--disable-newlib-wide-orient \
|
||||
--target=$target \
|
||||
--prefix=$prefix \
|
||||
|| { echo "Error configuring newlib"; exit 1; }
|
||||
touch configured-newlib
|
||||
fi
|
||||
|
||||
if [ ! -f built-newlib ]
|
||||
then
|
||||
$MAKE || { echo "Error building newlib"; exit 1; }
|
||||
touch built-newlib
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f installed-newlib ]
|
||||
then
|
||||
$MAKE install -j1 || { echo "Error installing newlib"; exit 1; }
|
||||
touch installed-newlib
|
||||
fi
|
||||
|
||||
export CC=$OLD_CC
|
||||
export CXX=$OLD_CXX
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install the final compiler
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
cd $BUILDDIR
|
||||
|
||||
cd $target/gcc
|
||||
|
||||
if [ ! -f built-stage2 ]
|
||||
then
|
||||
$MAKE all || { echo "Error building gcc stage2"; exit 1; }
|
||||
touch built-stage2
|
||||
fi
|
||||
|
||||
if [ ! -f installed-stage2 ]
|
||||
then
|
||||
$MAKE install || { echo "Error installing gcc stage2"; exit 1; }
|
||||
touch installed-stage2
|
||||
fi
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# set env variables
|
||||
#---------------------------------------------------------------------------------
|
||||
export DEVKITPRO=$TOOLPATH
|
||||
export DEVKITARM=$DEVKITPRO/devkitARM
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Install the rules files
|
||||
#---------------------------------------------------------------------------------
|
||||
cd $BUILDDIR
|
||||
|
||||
tar -xvf $SRCDIR/devkitarm-rules-$DKARM_RULES_VER.tar.gz
|
||||
cd devkitarm-rules-$DKARM_RULES_VER
|
||||
$MAKE install
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Install and build the crt0 files
|
||||
#---------------------------------------------------------------------------------
|
||||
cd $BUILDDIR
|
||||
|
||||
tar -xvf $SRCDIR/devkitarm-crtls-$DKARM_CRTLS_VER.tar.gz
|
||||
cd devkitarm-crtls-$DKARM_CRTLS_VER
|
||||
$MAKE install
|
||||
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
#!/bin/sh
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install binutils
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
mkdir -p $target/binutils
|
||||
cd $target/binutils
|
||||
|
||||
if [ ! -f configured-binutils ]
|
||||
then
|
||||
CPPFLAGS="$cppflags $CPPFLAGS" LDFLAGS="$ldflags $LDFLAGS" ../../binutils-$BINUTILS_VER/configure \
|
||||
--prefix=$prefix --target=$target --disable-nls --disable-werror \
|
||||
--enable-lto --enable-plugins \
|
||||
--enable-poison-system-directories \
|
||||
$CROSS_PARAMS \
|
||||
|| { echo "Error configuring binutils"; exit 1; }
|
||||
touch configured-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f built-binutils ]
|
||||
then
|
||||
$MAKE || { echo "Error building binutils"; exit 1; }
|
||||
touch built-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f installed-binutils ]
|
||||
then
|
||||
$MAKE install || { echo "Error installing binutils"; exit 1; }
|
||||
touch installed-binutils
|
||||
fi
|
||||
cd $BUILDDIR
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install just the c compiler
|
||||
#---------------------------------------------------------------------------------
|
||||
mkdir -p $target/gcc
|
||||
cd $target/gcc
|
||||
|
||||
if [ ! -f configured-gcc ]
|
||||
then
|
||||
CPPFLAGS="$cppflags $CPPFLAGS" \
|
||||
LDFLAGS="$ldflags $LDFLAGS" \
|
||||
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
CXXFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
LDFLAGS_FOR_TARGET="" \
|
||||
../../gcc-$GCC_VER/configure \
|
||||
--enable-languages=c,c++,objc,lto \
|
||||
--with-gnu-as --with-gnu-ld --with-gcc \
|
||||
--with-march=armv4t\
|
||||
--enable-cxx-flags='-ffunction-sections' \
|
||||
--disable-libstdcxx-verbose \
|
||||
--enable-poison-system-directories \
|
||||
--enable-interwork --enable-multilib \
|
||||
--enable-threads --disable-win32-registry --disable-nls --disable-debug\
|
||||
--disable-libmudflap --disable-libssp --disable-libgomp \
|
||||
--disable-libstdcxx-pch \
|
||||
--enable-libstdcxx-time=yes \
|
||||
--enable-libstdcxx-filesystem-ts \
|
||||
--target=$target \
|
||||
--with-newlib \
|
||||
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
|
||||
--prefix=$prefix \
|
||||
--enable-lto\
|
||||
--with-system-zlib \
|
||||
--disable-tm-clone-registry \
|
||||
--disable-__cxa_atexit \
|
||||
--with-bugurl="https://devkitpro.org" --with-pkgversion="devkitARM release 67" \
|
||||
$CROSS_PARAMS \
|
||||
$CROSS_GCC_PARAMS \
|
||||
$EXTRA_GCC_PARAMS \
|
||||
|| { echo "Error configuring gcc"; exit 1; }
|
||||
touch configured-gcc
|
||||
fi
|
||||
|
||||
if [ ! -f built-gcc ]
|
||||
then
|
||||
$MAKE all-gcc || { echo "Error building gcc stage1"; exit 1; }
|
||||
touch built-gcc
|
||||
fi
|
||||
|
||||
if [ ! -f installed-gcc ]
|
||||
then
|
||||
$MAKE install-gcc || { echo "Error installing gcc"; exit 1; }
|
||||
touch installed-gcc
|
||||
fi
|
||||
|
||||
|
||||
unset CFLAGS
|
||||
cd $BUILDDIR
|
||||
|
||||
OLD_CC=$CC
|
||||
OLDCXX=$CXX
|
||||
unset CC
|
||||
unset CXX
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install newlib
|
||||
#---------------------------------------------------------------------------------
|
||||
mkdir -p $target/newlib
|
||||
cd $target/newlib
|
||||
|
||||
if [ ! -f configured-newlib ]
|
||||
then
|
||||
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
../../newlib-$NEWLIB_VER/configure \
|
||||
--disable-newlib-supplied-syscalls \
|
||||
--enable-newlib-mb \
|
||||
--disable-newlib-wide-orient \
|
||||
--target=$target \
|
||||
--prefix=$prefix \
|
||||
|| { echo "Error configuring newlib"; exit 1; }
|
||||
touch configured-newlib
|
||||
fi
|
||||
|
||||
if [ ! -f built-newlib ]
|
||||
then
|
||||
$MAKE || { echo "Error building newlib"; exit 1; }
|
||||
touch built-newlib
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f installed-newlib ]
|
||||
then
|
||||
$MAKE install -j1 || { echo "Error installing newlib"; exit 1; }
|
||||
touch installed-newlib
|
||||
fi
|
||||
|
||||
export CC=$OLD_CC
|
||||
export CXX=$OLD_CXX
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install the final compiler
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
cd $BUILDDIR
|
||||
|
||||
cd $target/gcc
|
||||
|
||||
if [ ! -f built-stage2 ]
|
||||
then
|
||||
$MAKE all || { echo "Error building gcc stage2"; exit 1; }
|
||||
touch built-stage2
|
||||
fi
|
||||
|
||||
if [ ! -f installed-stage2 ]
|
||||
then
|
||||
$MAKE install || { echo "Error installing gcc stage2"; exit 1; }
|
||||
touch installed-stage2
|
||||
fi
|
||||
|
||||
rm -fr $prefix/$target/sys-include
|
||||
|
||||
cd $BUILDDIR
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# set env variables
|
||||
#---------------------------------------------------------------------------------
|
||||
export DEVKITPRO=$TOOLPATH
|
||||
export DEVKITPPC=$DEVKITPRO/devkitPPC
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Install the rules files
|
||||
#---------------------------------------------------------------------------------
|
||||
cd $BUILDDIR
|
||||
|
||||
tar -xvf $SRCDIR/devkitppc-rules-$DKPPC_RULES_VER.tar.gz
|
||||
cd devkitppc-rules-$DKPPC_RULES_VER
|
||||
$MAKE install
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Install the linkscripts
|
||||
#---------------------------------------------------------------------------------
|
||||
cd $BUILDDIR
|
||||
|
||||
tar -xvf $SRCDIR/devkitppc-crtls-$DKPPC_CRTLS_VER.tar.gz
|
||||
cd devkitppc-crtls-$DKPPC_CRTLS_VER
|
||||
$MAKE install
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
#!/bin/bash
|
||||
#---------------------------------------------------------------------------------
|
||||
# Check Parameters
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install ppc binutils
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
mkdir -p $target/binutils
|
||||
cd $target/binutils
|
||||
|
||||
if [ ! -f configured-binutils ]
|
||||
then
|
||||
../../binutils-$BINUTILS_VER/configure \
|
||||
--prefix=$prefix --target=$target --disable-nls --disable-shared --disable-debug \
|
||||
--disable-werror \
|
||||
--enable-poison-system-directories \
|
||||
--enable-plugins --enable-lto \
|
||||
--disable-werror $CROSS_PARAMS \
|
||||
|| { echo "Error configuing ppc binutils"; exit 1; }
|
||||
touch configured-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f built-binutils ]
|
||||
then
|
||||
$MAKE || { echo "Error building ppc binutils"; exit 1; }
|
||||
touch built-binutils
|
||||
fi
|
||||
|
||||
if [ ! -f installed-binutils ]
|
||||
then
|
||||
$MAKE install || { echo "Error installing ppc binutils"; exit 1; }
|
||||
touch installed-binutils
|
||||
fi
|
||||
cd $BUILDDIR
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install just the c compiler
|
||||
#---------------------------------------------------------------------------------
|
||||
mkdir -p $target/gcc
|
||||
cd $target/gcc
|
||||
|
||||
if [ ! -f configured-gcc ]
|
||||
then
|
||||
CPPFLAGS="-DSTDINT_LONG32=0 ${CPPFLAGS}" \
|
||||
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
CXXFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|
||||
LDFLAGS_FOR_TARGET="" \
|
||||
../../gcc-$GCC_VER/configure \
|
||||
--target=$target \
|
||||
--prefix=$prefix \
|
||||
--enable-languages=c,c++,objc,lto \
|
||||
--enable-lto \
|
||||
--with-cpu=750 \
|
||||
--disable-nls --disable-shared --enable-threads=posix --disable-multilib \
|
||||
--disable-win32-registry \
|
||||
--disable-libstdcxx-pch \
|
||||
--disable-libstdcxx-verbose \
|
||||
--enable-libstdcxx-time=yes \
|
||||
--enable-libstdcxx-filesystem-ts \
|
||||
--disable-tm-clone-registry \
|
||||
--disable-__cxa_atexit \
|
||||
--disable-libssp \
|
||||
--enable-cxx-flags='-ffunction-sections -fdata-sections' \
|
||||
--with-newlib \
|
||||
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
|
||||
--with-bugurl="https://github.com/devkitpro/buildscripts/issues" --with-pkgversion="devkitPPC release 48" \
|
||||
$CROSS_PARAMS \
|
||||
$CROSS_GCC_PARAMS \
|
||||
$EXTRA_GCC_PARAMS \
|
||||
|| { echo "Error configuring gcc stage 1"; exit 1; }
|
||||
touch configured-gcc
|
||||
fi
|
||||
|
||||
if [ ! -f built-gcc-stage1 ]
|
||||
then
|
||||
$MAKE all-gcc || { echo "Error building gcc stage1"; exit 1; }
|
||||
touch built-gcc-stage1
|
||||
fi
|
||||
|
||||
if [ ! -f installed-gcc-stage1 ]
|
||||
then
|
||||
$MAKE install-gcc || { echo "Error installing gcc stage1"; exit 1; }
|
||||
touch installed-gcc-stage1
|
||||
fi
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install newlib
|
||||
#---------------------------------------------------------------------------------
|
||||
cd $BUILDDIR
|
||||
mkdir -p $target/newlib
|
||||
cd $target/newlib
|
||||
|
||||
unset CFLAGS
|
||||
unset LDFLAGS
|
||||
|
||||
OLD_CC=$CC
|
||||
OLD_CXX=$CXX
|
||||
unset CC
|
||||
unset CXX
|
||||
|
||||
if [ ! -f configured-newlib ]
|
||||
then
|
||||
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections -DCUSTOM_MALLOC_LOCK" \
|
||||
../../newlib-$NEWLIB_VER/configure \
|
||||
--target=$target \
|
||||
--prefix=$prefix \
|
||||
--enable-newlib-mb \
|
||||
--enable-newlib-register-fini \
|
||||
|| { echo "Error configuring newlib"; exit 1; }
|
||||
touch configured-newlib
|
||||
fi
|
||||
|
||||
if [ ! -f built-newlib ]
|
||||
then
|
||||
$MAKE || { echo "Error building newlib"; exit 1; }
|
||||
touch built-newlib
|
||||
fi
|
||||
if [ ! -f installed-newlib ]
|
||||
then
|
||||
$MAKE install -j1 || { echo "Error installing newlib"; exit 1; }
|
||||
touch installed-newlib
|
||||
fi
|
||||
|
||||
export CC=$OLD_CC
|
||||
export CXX=$OLD_CXX
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build and install the final compiler
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
cd $BUILDDIR
|
||||
|
||||
cd $target/gcc
|
||||
|
||||
if [ ! -f built-stage2 ]
|
||||
then
|
||||
$MAKE all || { echo "Error building gcc stage2"; exit 1; }
|
||||
touch built-stage2
|
||||
fi
|
||||
|
||||
if [ ! -f installed-stage2 ]
|
||||
then
|
||||
$MAKE install || { echo "Error installing gcc stage2"; exit 1; }
|
||||
touch installed-stage2
|
||||
fi
|
||||
|
||||
cd $BUILDDIR
|
||||
|
|
@ -37,6 +37,10 @@ case "$VERSION" in
|
|||
package=devkitARM
|
||||
target=arm-none-eabi
|
||||
toolchain=DEVKITARM
|
||||
_prefix=devkitarm
|
||||
_toolchain_options='--with-march=armv4t --enable-interwork --enable-multilib --with-pkgversion="devkitARM"'
|
||||
_rules_ver=${DKARM_RULES_VER}
|
||||
_crtls_ver=${DKARM_CRTLS_VER}
|
||||
;;
|
||||
"2" )
|
||||
GCC_VER=15.2.0
|
||||
|
|
@ -47,6 +51,11 @@ case "$VERSION" in
|
|||
package=devkitPPC
|
||||
target=powerpc-eabi
|
||||
toolchain=DEVKITPPC
|
||||
_prefix=devkitppc
|
||||
cppflags="-DSTDINT_LONG32=0 ${cppflags}"
|
||||
_toolchain_options='--with-cpu=750 --disable-multilib --with-pkgversion="devkitPPC"'
|
||||
_rules_ver=${DKPPC_RULES_VER}
|
||||
_crtls_ver=${DKPPC_CRTLS_VER}
|
||||
;;
|
||||
"3" )
|
||||
GCC_VER=15.2.0
|
||||
|
|
@ -56,5 +65,9 @@ case "$VERSION" in
|
|||
package=devkitA64
|
||||
target=aarch64-none-elf
|
||||
toolchain=DEVKITA64
|
||||
_prefix=devkita64
|
||||
_toolchain_options='--with-march=armv8 --enable-multilib --with-pkgversion="devkitA64"'
|
||||
_rules_ver=${DKA64_RULES_VER}
|
||||
_crtls_ver=${DKA64_CRTLS_VER}
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user