Skip to content

Commit

Permalink
add gcc 13.1, 13.2, 14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jwt27 committed Jun 22, 2024
1 parent 46503a7 commit e164c92
Show file tree
Hide file tree
Showing 15 changed files with 2,962 additions and 54 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ If you require compatibility with distributions that use `i586`, you can either:
* 2020-02-07: setenv script is now installed to `$PREFIX/bin/$TARGET-setenv`.
* 2019-06-06: `master` is now the default branch again.

### Current package versions, as of 2024-05-30:
### Current package versions, as of 2024-06-22:

* gcc 12.2.0
* gcc 14.1.0
* binutils 2.42
* gdb 14.2
* djgpp 2.05 / cvs
Expand Down
93 changes: 46 additions & 47 deletions build-djgpp.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

DJCROSS_METHOD=djcross
DJGPP_DOWNLOAD_BASE="http://www.mirrorservice.org/sites/ftp.delorie.com/pub"
PACKAGE_SOURCES="djgpp binutils common"
source script/init.sh
Expand Down Expand Up @@ -139,77 +140,76 @@ fi
cd ${BASE}/build/

if [ ! -z ${GCC_VERSION} ]; then
# build gcc
untar ${DJCROSS_GCC_ARCHIVE} || exit 1
cd djcross-gcc-${GCC_VERSION}/

BUILDDIR=`pwd`
export PATH="${BUILDDIR}/tmpinst/bin:$PATH"
TMPINST="${BASE}/build/tmpinst"
export PATH="${TMPINST}/bin:$PATH"

if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then
if [ ! -e ${TMPINST}/autoconf-version ] || [ "$(cat ${TMPINST}/autoconf-version)" != "${AUTOCONF_VERSION}" ]; then
echo "Building autoconf"
cd $BUILDDIR
cd ${BASE}/build/ || exit 1
untar ${AUTOCONF_ARCHIVE} || exit 1
cd autoconf-${AUTOCONF_VERSION}/
./configure --prefix=$BUILDDIR/tmpinst || exit 1
./configure --prefix=${TMPINST} || exit 1
${MAKE_J} DESTDIR= all install || exit 1
rm ${BUILDDIR}/tmpinst/autoconf-*-built
touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built
echo ${AUTOCONF_VERSION} > ${TMPINST}/autoconf-version
else
echo "autoconf already built, skipping."
fi

if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then
if [ ! -e ${TMPINST}/automake-version ] || [ "$(cat ${TMPINST}/automake-version)" != "${AUTOMAKE_VERSION}" ]; then
echo "Building automake"
cd $BUILDDIR
cd ${BASE}/build/ || exit 1
untar ${AUTOMAKE_ARCHIVE} || exit 1
cd automake-${AUTOMAKE_VERSION}/
./configure --prefix=$BUILDDIR/tmpinst || exit 1
./configure --prefix=${TMPINST} || exit 1
${MAKE} DESTDIR= all install || exit 1
rm ${BUILDDIR}/tmpinst/automake-*-built
touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built
echo ${AUTOMAKE_VERSION} > ${TMPINST}/automake-version
else
echo "automake already built, skipping."
fi

cd $BUILDDIR

if [ ! -e gcc-unpacked ]; then
rm -rf $BUILDDIR/gnu/
cd ${BASE}/build/

if [ `uname` = "FreeBSD" ]; then
# The --verbose option is not recognized by BSD patch
sed -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1
fi

case ${GCC_VERSION} in
4.7.3) UNPACK_PATCH=patch-unpack-gcc-4.7.3.txt ;;
4.8.0) ;&
4.8.1) ;&
4.8.2) UNPACK_PATCH=patch-unpack-gcc-4.8.0.txt ;;
*) UNPACK_PATCH=patch-unpack-gcc.txt ;;
esac
# build gcc
BUILDDIR="${BASE}/build/djcross-gcc-${GCC_VERSION}"
mkdir -p ${BUILDDIR}

patch -p1 -u < ${BASE}/patch/${UNPACK_PATCH} || exit 1
if [ ! -e ${BUILDDIR}/gcc-unpacked ]; then
rm -rf ${BUILDDIR}/gnu/

echo "Unpacking gcc..."
mkdir gnu/
cd gnu/ || exit 1
mkdir -p ${BUILDDIR}/gnu/
cd ${BUILDDIR}/gnu/ || exit 1
untar ${GCC_ARCHIVE}
cd ..

echo "Running unpack-gcc.sh"
sh unpack-gcc.sh --no-djgpp-source || exit 1
if [ "${DJCROSS_METHOD}" = 'djcross' ]; then
( cd ${BASE}/build/ && untar ${DJCROSS_GCC_ARCHIVE} ) || exit 1

if [ `uname` = "FreeBSD" ]; then
# The --verbose option is not recognized by BSD patch
sed -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1
fi

case ${GCC_VERSION} in
4.7.3) UNPACK_PATCH=patch-unpack-gcc-4.7.3.txt ;;
4.8.0) ;&
4.8.1) ;&
4.8.2) UNPACK_PATCH=patch-unpack-gcc-4.8.0.txt ;;
*) UNPACK_PATCH=patch-unpack-gcc.txt ;;
esac

patch -p1 -u < ${BASE}/patch/${UNPACK_PATCH} || exit 1

echo "Running unpack-gcc.sh"
sh unpack-gcc.sh --no-djgpp-source || exit 1
fi

# patch gnu/gcc-X.XX/gcc/doc/gcc.texi
echo "Patch gcc/doc/gcc.texi"
cd gnu/gcc-*/gcc/doc || exit 1
sed -i "s/[^^]@\(\(tex\)\|\(end\)\)/\n@\1/g" gcc.texi || exit 1
cd -

cd $BUILDDIR/

pushd gnu/gcc-${GCC_VERSION} || exit 1
cd ${BUILDDIR}/gnu/gcc-${GCC_VERSION} || exit 1

if [ ! -z ${BUILD_DEB} ]; then
echo "Unpacking gcc dependencies"
Expand All @@ -226,17 +226,16 @@ if [ ! -z ${GCC_VERSION} ]; then

# apply extra patches if necessary
cat ${BASE}/patch/djgpp-gcc-${GCC_VERSION}/* | patch -p1 -u || exit 1
popd

touch gcc-unpacked
touch ${BUILDDIR}/gcc-unpacked
else
echo "gcc already unpacked, skipping."
fi

echo "Building gcc (stage 1)"

mkdir -p djcross
cd djcross || exit 1
mkdir -p ${BUILDDIR}/djcross
cd ${BUILDDIR}/djcross || exit 1

TEMP_CFLAGS="$CFLAGS"
TEMP_CXXFLAGS="$CXXFLAGS"
Expand All @@ -256,7 +255,7 @@ if [ ! -z ${GCC_VERSION} ]; then
sleep 5
fi

cp ${DST}/bin/${TARGET}-stubify ${BUILDDIR}/tmpinst/bin/stubify || exit 1
cp ${DST}/bin/${TARGET}-stubify ${TMPINST}/bin/stubify || exit 1

${MAKE_J} all-gcc || exit 1
echo "Installing gcc (stage 1)"
Expand Down Expand Up @@ -326,7 +325,7 @@ if [ ! -z ${GCC_VERSION} ]; then
echo "Installing gcc (stage 2)"
${SUDO} ${MAKE_J} install-strip || \
${SUDO} ${MAKE_J} install-strip || exit 1
${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst
${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${TMPINST}

CFLAGS="$TEMP_CFLAGS"
CXXFLAGS="$TEMP_CXXFLAGS"
Expand Down
2 changes: 1 addition & 1 deletion common/gcc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
source common/gcc-12.2.0
source common/gcc-14.1.0
14 changes: 14 additions & 0 deletions common/gcc-13.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
GCC_VERSION=13.1.0
GCC_VERSION_SHORT=13.10
AUTOCONF_VERSION=2.69
AUTOMAKE_VERSION=1.15.1

GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz"
AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz"
AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz"

GCC_CONFIGURE_OPTIONS="--disable-plugin \
--enable-lto \
${GCC_CONFIGURE_OPTIONS}"

DJCROSS_METHOD=patch
14 changes: 14 additions & 0 deletions common/gcc-13.2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
GCC_VERSION=13.2.0
GCC_VERSION_SHORT=13.20
AUTOCONF_VERSION=2.69
AUTOMAKE_VERSION=1.15.1

GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz"
AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz"
AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz"

GCC_CONFIGURE_OPTIONS="--disable-plugin \
--enable-lto \
${GCC_CONFIGURE_OPTIONS}"

DJCROSS_METHOD=patch
14 changes: 14 additions & 0 deletions common/gcc-14.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
GCC_VERSION=14.1.0
GCC_VERSION_SHORT=14.10
AUTOCONF_VERSION=2.69
AUTOMAKE_VERSION=1.15.1

GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz"
AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz"
AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz"

GCC_CONFIGURE_OPTIONS="--disable-plugin \
--enable-lto \
${GCC_CONFIGURE_OPTIONS}"

DJCROSS_METHOD=patch
3 changes: 2 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ djgpp-toolchain (12) UNRELEASED; urgency=medium

* Set 'Architecture: all' for library packages.
* binutils version 2.42.
* gcc version 14.1.0.

-- jwt27 <jwjagersma@gmail.com> Thu, 30 May 2024 19:31:25 +0200
-- jwt27 <jwjagersma@gmail.com> Sat, 22 Jun 2024 19:31:21 +0200

djgpp-toolchain (11) unstable; urgency=medium

Expand Down
1 change: 0 additions & 1 deletion djgpp/gcc

This file was deleted.

Loading

0 comments on commit e164c92

Please sign in to comment.