diff --git a/build-binutils.sh b/build-binutils.sh new file mode 100644 index 0000000..80b5be1 --- /dev/null +++ b/build-binutils.sh @@ -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 diff --git a/build-crtls.sh b/build-crtls.sh new file mode 100755 index 0000000..4a8e493 --- /dev/null +++ b/build-crtls.sh @@ -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 diff --git a/build-devkit.sh b/build-devkit.sh index 5f57f5c..5593159 100755 --- a/build-devkit.sh +++ b/build-devkit.sh @@ -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 diff --git a/build-gcc-stage1.sh b/build-gcc-stage1.sh new file mode 100755 index 0000000..2179f90 --- /dev/null +++ b/build-gcc-stage1.sh @@ -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 diff --git a/build-gcc-stage2.sh b/build-gcc-stage2.sh new file mode 100755 index 0000000..7fe5cff --- /dev/null +++ b/build-gcc-stage2.sh @@ -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 diff --git a/build-mn10200-binutils.sh b/build-mn10200-binutils.sh new file mode 100644 index 0000000..9df40d3 --- /dev/null +++ b/build-mn10200-binutils.sh @@ -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 diff --git a/build-newlib.sh b/build-newlib.sh new file mode 100644 index 0000000..226d074 --- /dev/null +++ b/build-newlib.sh @@ -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 diff --git a/dka64/rules/base_rules b/dka64/rules/base_rules deleted file mode 100644 index 15894db..0000000 --- a/dka64/rules/base_rules +++ /dev/null @@ -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 $( `(echo $(> `(echo $(> `(echo $(&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g' -endif diff --git a/dka64/scripts/build-crtls.sh b/dka64/scripts/build-crtls.sh deleted file mode 100644 index c3885cf..0000000 --- a/dka64/scripts/build-crtls.sh +++ /dev/null @@ -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 diff --git a/dka64/scripts/build-gcc.sh b/dka64/scripts/build-gcc.sh deleted file mode 100755 index 9561be7..0000000 --- a/dka64/scripts/build-gcc.sh +++ /dev/null @@ -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 diff --git a/dkarm-eabi/scripts/build-crtls.sh b/dkarm-eabi/scripts/build-crtls.sh deleted file mode 100755 index 3286d32..0000000 --- a/dkarm-eabi/scripts/build-crtls.sh +++ /dev/null @@ -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 - diff --git a/dkarm-eabi/scripts/build-gcc.sh b/dkarm-eabi/scripts/build-gcc.sh deleted file mode 100755 index 7ac486f..0000000 --- a/dkarm-eabi/scripts/build-gcc.sh +++ /dev/null @@ -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 diff --git a/dkppc/scripts/build-crtls.sh b/dkppc/scripts/build-crtls.sh deleted file mode 100755 index b74a4c4..0000000 --- a/dkppc/scripts/build-crtls.sh +++ /dev/null @@ -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 diff --git a/dkppc/scripts/build-gcc.sh b/dkppc/scripts/build-gcc.sh deleted file mode 100755 index 6bf2ffd..0000000 --- a/dkppc/scripts/build-gcc.sh +++ /dev/null @@ -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 diff --git a/select_toolchain.sh b/select_toolchain.sh index 1e7ce1b..7945b96 100755 --- a/select_toolchain.sh +++ b/select_toolchain.sh @@ -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