From d67c01b1f1847704bc82494c983b4a13328b83f5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 20:17:54 +0100 Subject: [PATCH 001/536] use contrib/download_prerequisites script instead of building gcc libraries separately. --- script/7.2.0 | 48 ++---------------------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index 63ea981..a5331f2 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -20,9 +20,6 @@ DJDEV_VERSION=205 GCC_VERSION=7.2.0 GCC_VERSION_SHORT=7.20 -GMP_VERSION=6.1.2 -MPFR_VERSION=3.1.5 -MPC_VERSION=1.0.3 AUTOCONF_VERSION=2.64 AUTOMAKE_VERSION=1.11.6 @@ -49,9 +46,6 @@ DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.xz" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.xz" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" 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" @@ -101,7 +95,6 @@ OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" echo "Download source files..." @@ -243,9 +236,6 @@ if [ ! -z $SED_VERSION ]; then fi cd $BUILDDIR -tar xJf ../../download/gmp-${GMP_VERSION}.tar.xz || exit 1 -tar xJf ../../download/mpfr-${MPFR_VERSION}.tar.xz || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX # patch from : @@ -271,44 +261,14 @@ cd - # copy stubify programs cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - echo "Building gcc" cd $BUILDDIR/ mkdir djcross cd djcross +../gnu/gcc-${GCC_VERSION_SHORT}/contrib/download_prerequisites --directory=../gnu/gcc-${GCC_VERSION_SHORT} + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=i586-pc-msdosdjgpp \ @@ -316,13 +276,9 @@ PATH="$BUILDDIR//tmpinst/bin:$PATH" \ --prefix=$DJGPP_PREFIX \ --disable-nls \ --disable-plugin \ - --disable-lto \ --enable-lto \ --enable-libstdcxx-filesystem-ts \ --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ --enable-version-specific-runtime-libs \ --enable-languages=${ENABLE_LANGUAGES} \ || exit 1 From 7b25bbbe827b42c864ada7b7914b1e45a3665504 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 20:30:48 +0100 Subject: [PATCH 002/536] use current binutils version 2291. --- script/7.2.0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index a5331f2..bf60544 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -13,7 +13,7 @@ ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" # source tarball versions -BINUTILS_VERSION=229 +BINUTILS_VERSION=2291 DJCRX_VERSION=205 DJLSR_VERSION=205 DJDEV_VERSION=205 @@ -39,7 +39,7 @@ fi export CC CXX CFLAGS MAKE # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" +BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" From 21ca10e5ea5b3df4e54bc72135f3e01af8865afa Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 21:03:15 +0100 Subject: [PATCH 003/536] run download_prerequisites from gcc source directory. --- script/7.2.0 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/7.2.0 b/script/7.2.0 index bf60544..ada2b70 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -267,7 +267,9 @@ cd $BUILDDIR/ mkdir djcross cd djcross -../gnu/gcc-${GCC_VERSION_SHORT}/contrib/download_prerequisites --directory=../gnu/gcc-${GCC_VERSION_SHORT} +pushd ../gnu/gcc-${GCC_VERSION_SHORT} +./contrib/download_prerequisites +popd PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ From e17ba0cc73d0a2ec5fa2cfc426c5f5db148cc32b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 21:27:49 +0100 Subject: [PATCH 004/536] use cd - instead of pushd/popd --- script/7.2.0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index ada2b70..136698d 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -267,9 +267,9 @@ cd $BUILDDIR/ mkdir djcross cd djcross -pushd ../gnu/gcc-${GCC_VERSION_SHORT} +cd ../gnu/gcc-${GCC_VERSION_SHORT} ./contrib/download_prerequisites -popd +cd - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ From c97757c4378db220db400ade0f15d608e0eb551f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 21:34:55 +0100 Subject: [PATCH 005/536] don't remove build/ directory - build in stages for easier resumption in case of errors. --- script/7.2.0 | 192 +++++++++++++++++++++++++++------------------------ 1 file changed, 100 insertions(+), 92 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index 136698d..48263f9 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -140,50 +140,52 @@ fi # make build dir echo "Make build dir" -rm -rf build || exit 1 mkdir -p build || exit 1 cd build -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/binutils-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 +if [ ! -e binutils-${BINUTILS_VERSION}-installed ] + # build binutils + echo "Building binutils" + mkdir bnu${BINUTILS_VERSION}s + cd bnu${BINUTILS_VERSION}s + unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 + cd gnu/binutils-* || exit + + # exec permission of some files are not set, fix it. + for EXEC_FILE in install-sh missing; do + echo "chmod a+x $EXEC_FILE" + chmod a+x $EXEC_FILE || exit 1 + done + + sh ./configure \ + --prefix=$DJGPP_PREFIX \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --disable-werror \ + --disable-nls \ + || exit 1 + + ${MAKE} configure-bfd || exit 1 + ${MAKE} -C bfd stmp-lcoff-h || exit 1 + ${MAKE} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} check || exit 1 + fi + + ${MAKE} install || exit 1 + + cd ../../.. + touch binutils-${BINUTILS_VERSION}-installed + # binutils done fi -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - # prepare djcrx echo "Prepare djcrx" mkdir djcrx${DJCRX_VERSION} cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 +unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 cd src/stub @@ -207,70 +209,76 @@ cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` -echo "Building autoconf" -cd $BUILDDIR -tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" +if [ ! -e gcc-unpacked ] + echo "Building autoconf" cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ + tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 + cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 + + echo "Building automake" + cd $BUILDDIR + tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 + cd automake-${AUTOMAKE_VERSION}/ + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ${MAKE} all install || exit 1 + + # build GNU sed if needed. + SED=sed + if [ ! -z $SED_VERSION ]; then + echo "Building sed" + cd $BUILDDIR + tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} all install || exit 1 + SED=$BUILDDIR/tmpinst/bin/sed + fi + + cd $BUILDDIR + + # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) + echo "Patch unpack-gcc.sh" + $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 + + echo "Running unpack-gcc.sh" + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 + + # 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 - + + # copy stubify programs + cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin + + echo "Building gcc" + cd $BUILDDIR/ + + # download mpc/gmp/mpfr/isl libraries + cd gnu/gcc-${GCC_VERSION_SHORT} + ./contrib/download_prerequisites + cd - + + touch gcc-unpacked fi -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross +rm -rf djcross || exit 1 +mkdir -p djcross || exit 1 cd djcross -cd ../gnu/gcc-${GCC_VERSION_SHORT} -./contrib/download_prerequisites -cd - - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=i586-pc-msdosdjgpp \ From 9b658d227b3b0e9fa21bad2d841a383c3d2a64a6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 21:43:48 +0100 Subject: [PATCH 006/536] fix if statements --- script/7.2.0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index 48263f9..c43cf45 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -143,7 +143,7 @@ echo "Make build dir" mkdir -p build || exit 1 cd build -if [ ! -e binutils-${BINUTILS_VERSION}-installed ] +if [ ! -e binutils-${BINUTILS_VERSION}-installed ]; then # build binutils echo "Building binutils" mkdir bnu${BINUTILS_VERSION}s @@ -209,7 +209,7 @@ cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` -if [ ! -e gcc-unpacked ] +if [ ! -e gcc-unpacked ]; then echo "Building autoconf" cd $BUILDDIR tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 From f84864d40a12c8d372e541b9386a4446da152b05 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 22:05:30 +0100 Subject: [PATCH 007/536] split up build process in smaller stages. --- script/7.2.0 | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index c43cf45..872b489 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -209,14 +209,16 @@ cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` -if [ ! -e gcc-unpacked ]; then +if [ ! -e autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" cd $BUILDDIR tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} all install || exit 1 - +fi + +if [ ! -e automake-${AUTOMAKE_VERSION}-built ]; then echo "Building automake" cd $BUILDDIR tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 @@ -225,21 +227,23 @@ if [ ! -e gcc-unpacked ]; then ./configure --prefix=$BUILDDIR/tmpinst || exit 1 PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ${MAKE} all install || exit 1 - - # build GNU sed if needed. - SED=sed - if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed - fi - +fi + +# build GNU sed if needed. +SED=sed +if [ ! -z $SED_VERSION ]; then + echo "Building sed" cd $BUILDDIR - + tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} all install || exit 1 + SED=$BUILDDIR/tmpinst/bin/sed +fi + +cd $BUILDDIR + +if [ ! -e gcc-unpacked ]; then # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX # patch from : # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) @@ -264,7 +268,6 @@ if [ ! -e gcc-unpacked ]; then # copy stubify programs cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - echo "Building gcc" cd $BUILDDIR/ # download mpc/gmp/mpfr/isl libraries @@ -275,6 +278,8 @@ if [ ! -e gcc-unpacked ]; then touch gcc-unpacked fi +echo "Building gcc" + rm -rf djcross || exit 1 mkdir -p djcross || exit 1 cd djcross From 2b0440abeb0be9dbb2b6a9078c26833c8d535b63 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 22:09:07 +0100 Subject: [PATCH 008/536] describe what's going on. --- script/7.2.0 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/7.2.0 b/script/7.2.0 index 872b489..7e22cbc 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -179,6 +179,8 @@ if [ ! -e binutils-${BINUTILS_VERSION}-installed ]; then cd ../../.. touch binutils-${BINUTILS_VERSION}-installed # binutils done +else + echo "Current binutils version already installed, skipping." fi # prepare djcrx @@ -271,11 +273,14 @@ if [ ! -e gcc-unpacked ]; then cd $BUILDDIR/ # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" cd gnu/gcc-${GCC_VERSION_SHORT} ./contrib/download_prerequisites cd - touch gcc-unpacked +else + echo "gcc already unpacked, skipping." fi echo "Building gcc" From 35ab0963e9a46d8bbb01401942eeeaa9ec597d5b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 22:16:21 +0100 Subject: [PATCH 009/536] Squashed commit of the following: commit bd7ebd6d28086c22fc61a52e92148af762ddcd23 Author: J.W. Jagersma Date: Mon Jan 22 21:56:56 2018 +0100 don't build automake in parallel. commit 9791e0abbfe7769427bec80708d3c7bdbb295867 Author: J.W. Jagersma Date: Mon Jan 22 21:47:28 2018 +0100 build DXE tools in parallel too. commit f209154bc1591cdcadcb217bfec1818bb4635864 Author: J.W. Jagersma Date: Mon Jan 22 20:53:26 2018 +0100 add -j parameter to individual make commands instead of global MAKE variable. commit f5654cb625fd6f9a486b3745fedc78cdfb8b757a Author: J.W. Jagersma Date: Mon Jan 22 20:28:48 2018 +0100 add -j parameter to MAKE variable after checking for required programs. commit 6e3369363707ebc58c03ed52016ce7d202df15e5 Author: J.W. Jagersma Date: Mon Jan 22 20:25:41 2018 +0100 add new environment variable MAKE_JOBS to specify number of parallel build threads. --- script/7.2.0 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index 7e22cbc..23bd4ea 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -9,6 +9,9 @@ DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} #ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} +# number of parallel build threads +MAKE_JOBS=${MAKE_JOBS-4} + #DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" @@ -34,6 +37,7 @@ if [ `uname` = "FreeBSD" ]; then else MAKE=make fi + #CFLAGS="-O2 -g $CFLAGS -std=gnu11" export CC CXX CFLAGS MAKE @@ -165,16 +169,16 @@ if [ ! -e binutils-${BINUTILS_VERSION}-installed ]; then --disable-nls \ || exit 1 - ${MAKE} configure-bfd || exit 1 - ${MAKE} -C bfd stmp-lcoff-h || exit 1 - ${MAKE} || exit 1 + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 + ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 if [ ! -z $MAKE_CHECK ]; then echo "Run ${MAKE} check" - ${MAKE} check || exit 1 + ${MAKE} -j${MAKE_JOBS} check || exit 1 fi - ${MAKE} install || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 cd ../../.. touch binutils-${BINUTILS_VERSION}-installed @@ -217,7 +221,7 @@ if [ ! -e autoconf-${AUTOCONF_VERSION}-built ]; then tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 fi if [ ! -e automake-${AUTOMAKE_VERSION}-built ]; then @@ -239,7 +243,7 @@ if [ ! -z $SED_VERSION ]; then tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 cd sed-${SED_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 SED=$BUILDDIR/tmpinst/bin/sed fi @@ -303,9 +307,9 @@ PATH="$BUILDDIR//tmpinst/bin:$PATH" \ --enable-languages=${ENABLE_LANGUAGES} \ || exit 1 -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 +${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 -${MAKE} install-strip || exit 1 +${MAKE} -j${MAKE_JOBS} install-strip || exit 1 echo "Copy long name executables to short name." ( @@ -334,7 +338,7 @@ patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 if [ "$CC" == "gcc" ]; then echo "Building DXE tools." cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 + PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} -j${MAKE_JOBS} || exit 1 cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 cd .. else From 88e2a27b4a1bae682bcafb8023632c0dd156fb40 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 22:24:12 +0100 Subject: [PATCH 010/536] skip building autoconf/automake when possible. --- script/7.2.0 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index 23bd4ea..39367a6 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -215,16 +215,19 @@ cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` -if [ ! -e autoconf-${AUTOCONF_VERSION}-built ]; then +if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" cd $BUILDDIR tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 + touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built +else + echo "autoconf already built, skipping." fi -if [ ! -e automake-${AUTOMAKE_VERSION}-built ]; then +if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then echo "Building automake" cd $BUILDDIR tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 @@ -233,6 +236,9 @@ if [ ! -e automake-${AUTOMAKE_VERSION}-built ]; then ./configure --prefix=$BUILDDIR/tmpinst || exit 1 PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ${MAKE} all install || exit 1 + touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built +else + echo "automake already built, skipping." fi # build GNU sed if needed. From ac8b359163140d420d2e64792084a2388fe6b9cf Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 22:33:27 +0100 Subject: [PATCH 011/536] remove other signaling files after each build stage. --- script/7.2.0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/7.2.0 b/script/7.2.0 index 39367a6..bc9dde5 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -181,6 +181,7 @@ if [ ! -e binutils-${BINUTILS_VERSION}-installed ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 cd ../../.. + rm binutils-*-installed touch binutils-${BINUTILS_VERSION}-installed # binutils done else @@ -222,6 +223,7 @@ if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 + rm ${BUILDDIR}/tmpinst/autoconf-*-built touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built else echo "autoconf already built, skipping." @@ -236,6 +238,7 @@ if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then ./configure --prefix=$BUILDDIR/tmpinst || exit 1 PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ${MAKE} all install || exit 1 + rm ${BUILDDIR}/tmpinst/automake-*-built touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built else echo "automake already built, skipping." From 731e08936a1d3ca28bac4d65d45027d4135641ff Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 22:44:16 +0100 Subject: [PATCH 012/536] skip configuring gcc when a makefile already exists. --- script/7.2.0 | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index bc9dde5..6923809 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -298,23 +298,27 @@ fi echo "Building gcc" -rm -rf djcross || exit 1 mkdir -p djcross || exit 1 cd djcross -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 +if [ ! -e Makefile ]; then + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --prefix=$DJGPP_PREFIX \ + --disable-nls \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + --enable-libquadmath-support \ + --enable-version-specific-runtime-libs \ + --enable-languages=${ENABLE_LANGUAGES} \ + || exit 1 +else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" + sleep 5 +fi ${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 From 861c55fb17c9f32edaa0f4ac8f105bc3a529d683 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 22:51:00 +0100 Subject: [PATCH 013/536] don't build DXE tools in parallel. --- script/7.2.0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/7.2.0 b/script/7.2.0 index 6923809..b1597b5 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -351,7 +351,7 @@ patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 if [ "$CC" == "gcc" ]; then echo "Building DXE tools." cd src - PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} -j${MAKE_JOBS} || exit 1 + PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 cd .. else From e7b2c919283a56497d9d83e685b3039e6cfbe7f3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 23:11:24 +0100 Subject: [PATCH 014/536] add message about removing temporary build files. --- script/7.2.0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/7.2.0 b/script/7.2.0 index b1597b5..b0c08f7 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -382,4 +382,4 @@ do esac done -echo "build-djgpp.sh done." +echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" From 99d5b035f44c215f294a9f5ad09e6f0c99ff1575 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 23:11:55 +0100 Subject: [PATCH 015/536] update README.md with information about MAKE_JOBS variable. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index f9983fb..b0a983f 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,12 @@ Default support language is C and C++. You can change supported languages by set ENABLE_LANGUAGES=c,c++,f95,objc,obj-c++ ``` +Default number of parallel builds is 4. You can change this number by setting environment variable *MAKE_JOBS* : + +``` +MAKE_JOBS=8 +``` + ### Building DJGPP compiler To build DJGPP, just run : From de2550aa36e8c581a65b43e037ddef929a2fe07e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 23:20:46 +0100 Subject: [PATCH 016/536] keep track of installed binutils version in DJGPP_PREFIX directory. --- script/7.2.0 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/7.2.0 b/script/7.2.0 index b0c08f7..1c4cbb7 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -147,7 +147,7 @@ echo "Make build dir" mkdir -p build || exit 1 cd build -if [ ! -e binutils-${BINUTILS_VERSION}-installed ]; then +if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then # build binutils echo "Building binutils" mkdir bnu${BINUTILS_VERSION}s @@ -181,8 +181,8 @@ if [ ! -e binutils-${BINUTILS_VERSION}-installed ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 cd ../../.. - rm binutils-*-installed - touch binutils-${BINUTILS_VERSION}-installed + rm ${DJGPP_PREFIX}/etc/binutils-*-installed + touch ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed # binutils done else echo "Current binutils version already installed, skipping." From 955e1a00e44acdf60ba1d2be0d29db7e27e6a0a7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 23:46:33 +0100 Subject: [PATCH 017/536] initial attempt at a more modular build script system. --- build-djgpp.sh | 36 ++++- script/7.2.0 | 389 ++---------------------------------------------- script/build.sh | 346 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 387 insertions(+), 384 deletions(-) create mode 100644 script/build.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index 0ad29f4..026ec8c 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -9,10 +9,38 @@ if [ -z $BUILD_VER ]; then exit 1 fi -if [ -x script/$BUILD_VER ]; then - echo "Building version : $BUILD_VER" - script/$BUILD_VER || exit 1 -else +if [ ! -x script/$BUILD_VER ]; then echo "Unsupported version : $BUILD_VER" exit 1 fi + +echo "Building version : $BUILD_VER" + +unset CDPATH + +# target directory +export DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} + +# enabled languages +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} +export ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} + +# number of parallel build threads +export MAKE_JOBS=${MAKE_JOBS-4} + +#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" +export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" + +# source tarball versions +export DJCRX_VERSION=205 +export DJLSR_VERSION=205 +export DJDEV_VERSION=205 +export BINUTILS_VERSION=2291 + +# source tarball locations +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" +export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" +export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" +export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" + +./script/$BUILD_VER diff --git a/script/7.2.0 b/script/7.2.0 index 1c4cbb7..3a38c80 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -1,385 +1,14 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -# number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-4} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=2291 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=7.2.0 -GCC_VERSION_SHORT=7.20 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi - -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=7.2.0 +export GCC_VERSION_SHORT=7.20 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -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" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -mkdir -p build || exit 1 -cd build - -if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then - # build binutils - echo "Building binutils" - mkdir bnu${BINUTILS_VERSION}s - cd bnu${BINUTILS_VERSION}s - unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - cd gnu/binutils-* || exit - - # exec permission of some files are not set, fix it. - for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 - done - - sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - - ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 - ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 - fi - - ${MAKE} -j${MAKE_JOBS} install || exit 1 - - cd ../../.. - rm ${DJGPP_PREFIX}/etc/binutils-*-installed - touch ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed - # binutils done -else - echo "Current binutils version already installed, skipping." -fi - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then - echo "Building autoconf" - cd $BUILDDIR - tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 - cd autoconf-${AUTOCONF_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - rm ${BUILDDIR}/tmpinst/autoconf-*-built - touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built -else - echo "autoconf already built, skipping." -fi - -if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then - echo "Building automake" - cd $BUILDDIR - tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 - cd automake-${AUTOMAKE_VERSION}/ - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ${MAKE} all install || exit 1 - rm ${BUILDDIR}/tmpinst/automake-*-built - touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built -else - echo "automake already built, skipping." -fi - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR - -if [ ! -e gcc-unpacked ]; then - # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) - echo "Patch unpack-gcc.sh" - $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 - - echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 - - # 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 - - - # copy stubify programs - cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - - cd $BUILDDIR/ - - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gnu/gcc-${GCC_VERSION_SHORT} - ./contrib/download_prerequisites - cd - - - touch gcc-unpacked -else - echo "gcc already unpacked, skipping." -fi - -echo "Building gcc" - -mkdir -p djcross || exit 1 -cd djcross - -if [ ! -e Makefile ]; then - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 -else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" - sleep 5 -fi - -${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 - -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" +./script/build.sh diff --git a/script/build.sh b/script/build.sh new file mode 100644 index 0000000..8613a81 --- /dev/null +++ b/script/build.sh @@ -0,0 +1,346 @@ +#!/usr/bin/env bash + +CC=gcc +CXX=g++ + +# use gmake under FreeBSD +if [ `uname` = "FreeBSD" ]; then + MAKE=gmake + CC=clang + CXX=clang++ +else + MAKE=make +fi + +export CC CXX CFLAGS MAKE + +# check required programs +REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" + +# MinGW doesn't have curl, so we use wget. +if uname|grep "^MINGW32" > /dev/null; then + USE_WGET=1 +fi + +# use curl or wget? +if [ ! -z $USE_WGET ]; then + REQ_PROG_LIST+=" wget" +else + REQ_PROG_LIST+=" curl" +fi + +for REQ_PROG in $REQ_PROG_LIST; do + if ! which $REQ_PROG > /dev/null; then + echo "$REQ_PROG not installed" + exit 1 + fi +done + +# check GNU sed is installed or not. +# It is for OSX, which doesn't ship with GNU sed. +if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then + echo GNU sed is not installed, need to download. + SED_VERSION=4.2.2 + SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" +else + SED_ARCHIVE="" +fi + +# check zlib is installed +if ! ${CC} test-zlib.c -o test-zlib -lz; then + echo "zlib not installed" + exit 1 +fi +rm test-zlib 2>/dev/null +rm test-zlib.exe 2>/dev/null + +# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. +OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} + +# download source files +ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE + $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" + +echo "Download source files..." +mkdir -p download || exit 1 +cd download + +for ARCHIVE in $ARCHIVE_LIST; do + FILE=`basename $ARCHIVE` + if ! [ -f $FILE ]; then + echo "Download $ARCHIVE ..." + if [ ! -z $USE_WGET ]; then + DL_CMD="wget -U firefox $ARCHIVE" + else + DL_CMD="curl -f $ARCHIVE -L -o $FILE" + fi + echo "Command : $DL_CMD" + if ! eval $DL_CMD; then + if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then + echo "$FILE maybe moved to deleted/ directory." + else + rm $FILE + echo "Download $ARCHIVE failed." + exit 1 + fi + fi + fi +done +cd .. + +# create target directory, check writable. +echo "Make prefix directory : $DJGPP_PREFIX" +mkdir -p $DJGPP_PREFIX + +if ! [ -d $DJGPP_PREFIX ]; then + echo "Unable to create prefix directory" + exit 1 +fi + +if ! [ -w $DJGPP_PREFIX ]; then + echo "prefix directory is not writable." + exit 1 +fi + +# make build dir +echo "Make build dir" +mkdir -p build || exit 1 +cd build + +if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then + # build binutils + echo "Building binutils" + mkdir bnu${BINUTILS_VERSION}s + cd bnu${BINUTILS_VERSION}s + unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 + cd gnu/binutils-* || exit + + # exec permission of some files are not set, fix it. + for EXEC_FILE in install-sh missing; do + echo "chmod a+x $EXEC_FILE" + chmod a+x $EXEC_FILE || exit 1 + done + + sh ./configure \ + --prefix=$DJGPP_PREFIX \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --disable-werror \ + --disable-nls \ + || exit 1 + + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 + ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 + fi + + ${MAKE} -j${MAKE_JOBS} install || exit 1 + + cd ../../.. + rm ${DJGPP_PREFIX}/etc/binutils-*-installed + touch ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed + # binutils done +else + echo "Current binutils version already installed, skipping." +fi + +# prepare djcrx +echo "Prepare djcrx" +mkdir djcrx${DJCRX_VERSION} +cd djcrx${DJCRX_VERSION} +unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 +patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 + +cd src/stub +${CC} -O2 stubify.c -o stubify || exit 1 +${CC} -O2 stubedit.c -o stubedit || exit 1 + +cd ../.. + +mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 +cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 +cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 +cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 +cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + +cd .. +# djcrx done + +# build gcc +tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 +cd djcross-gcc-${GCC_VERSION}/ + +BUILDDIR=`pwd` + +if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then + echo "Building autoconf" + cd $BUILDDIR + tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 + cd autoconf-${AUTOCONF_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + rm ${BUILDDIR}/tmpinst/autoconf-*-built + touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built +else + echo "autoconf already built, skipping." +fi + +if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then + echo "Building automake" + cd $BUILDDIR + tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 + cd automake-${AUTOMAKE_VERSION}/ + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ${MAKE} all install || exit 1 + rm ${BUILDDIR}/tmpinst/automake-*-built + touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built +else + echo "automake already built, skipping." +fi + +# build GNU sed if needed. +SED=sed +if [ ! -z $SED_VERSION ]; then + echo "Building sed" + cd $BUILDDIR + tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + SED=$BUILDDIR/tmpinst/bin/sed +fi + +cd $BUILDDIR + +if [ ! -e gcc-unpacked ]; then + # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) + echo "Patch unpack-gcc.sh" + $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 + + echo "Running unpack-gcc.sh" + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 + + # 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 - + + # copy stubify programs + cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin + + cd $BUILDDIR/ + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gnu/gcc-${GCC_VERSION_SHORT} + ./contrib/download_prerequisites + cd - + + touch gcc-unpacked +else + echo "gcc already unpacked, skipping." +fi + +echo "Building gcc" + +mkdir -p djcross || exit 1 +cd djcross + +if [ ! -e Makefile ]; then + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --prefix=$DJGPP_PREFIX \ + --disable-nls \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + --enable-libquadmath-support \ + --enable-version-specific-runtime-libs \ + --enable-languages=${ENABLE_LANGUAGES} \ + || exit 1 +else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" + sleep 5 +fi + +${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 + +${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + +echo "Copy long name executables to short name." +( + cd $DJGPP_PREFIX || exit 1 + SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" + for SHORT_NAME in $SHORT_NAME_LIST; do + if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then + cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME + fi + done +) || exit 1 + +# gcc done + +# build djlsr (for dxegen / exe2coff) +echo "Prepare djlsr" +cd $BUILDDIR +cd .. +rm -rf djlsr${DJLSR_VERSION} +mkdir djlsr${DJLSR_VERSION} +cd djlsr${DJLSR_VERSION} +unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 +unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 +unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 +patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 +if [ "$CC" == "gcc" ]; then + echo "Building DXE tools." + cd src + PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 + cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + cd .. +else + echo "Building DXE tools requires gcc, skip." +fi +cd src/stub +${CC} -o exe2coff exe2coff.c || exit 1 +cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 +cd ../../.. +# djlsr done + +# copy setenv script +(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 + +echo "Testing DJGPP." +cd $BUILDDIR +cd .. +echo "Use DJGPP to build a test C program." +$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 + +for x in $(echo $ENABLE_LANGUAGES | tr "," " ") +do + case $x in + c++) + echo "Use DJGPP to build a test C++ program." + $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 + ;; + esac +done + +echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" From fed91c1fbdd546436f9fbebbc0336ced39f4026b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 00:49:52 +0100 Subject: [PATCH 018/536] remove binutils directory before rebuilding. --- script/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/build.sh b/script/build.sh index 8613a81..4a2e1e0 100644 --- a/script/build.sh +++ b/script/build.sh @@ -111,6 +111,7 @@ cd build if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then # build binutils echo "Building binutils" + rm -rf bnu${BINUTILS_VERSION}s mkdir bnu${BINUTILS_VERSION}s cd bnu${BINUTILS_VERSION}s unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 From dc1e053fa3f011184f662575d423fef9c78c3707 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 00:50:36 +0100 Subject: [PATCH 019/536] store which prefix gcc was configured for. --- script/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 4a2e1e0..a6274b3 100644 --- a/script/build.sh +++ b/script/build.sh @@ -263,7 +263,7 @@ echo "Building gcc" mkdir -p djcross || exit 1 cd djcross -if [ ! -e Makefile ]; then +if [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=i586-pc-msdosdjgpp \ @@ -277,6 +277,7 @@ if [ ! -e Makefile ]; then --enable-version-specific-runtime-libs \ --enable-languages=${ENABLE_LANGUAGES} \ || exit 1 + echo ${DJGPP_PREFIX} > gcc-configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" sleep 5 From e280064aaf5d9611a85ba3af2d85f398b49b38d6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 00:55:13 +0100 Subject: [PATCH 020/536] create /etc/ directory to store binutils version signal file. --- script/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/build.sh b/script/build.sh index a6274b3..e0cae0a 100644 --- a/script/build.sh +++ b/script/build.sh @@ -103,6 +103,8 @@ if ! [ -w $DJGPP_PREFIX ]; then exit 1 fi +mkdir -p ${DJGPP_PREFIX}/etc/ || exit 1 + # make build dir echo "Make build dir" mkdir -p build || exit 1 From 38dc9e382f28d960430b5f5577533141ab1c705d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 01:20:57 +0100 Subject: [PATCH 021/536] fixed check if gcc was already configured. --- script/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index e0cae0a..3cfa84c 100644 --- a/script/build.sh +++ b/script/build.sh @@ -265,7 +265,8 @@ echo "Building gcc" mkdir -p djcross || exit 1 cd djcross -if [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then +if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then + ${MAKE} distclean PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=i586-pc-msdosdjgpp \ From cceb9220f3ec76c601f54e2272862ca38aec9714 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 01:21:54 +0100 Subject: [PATCH 022/536] modularize script for 7.1.0. --- script/7.1.0 | 391 ++------------------------------------------------- 1 file changed, 9 insertions(+), 382 deletions(-) diff --git a/script/7.1.0 b/script/7.1.0 index 3134a57..545f338 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -1,387 +1,14 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=227 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=7.1.0 -GCC_VERSION_SHORT=7.10 -GMP_VERSION=6.1.2 -MPFR_VERSION=3.1.5 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=7.1.0 +export GCC_VERSION_SHORT=7.10 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/binutils-* || exit - -# patch for binutils 2.27 -patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 - -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -echo "build-djgpp.sh done." +./script/build.sh From 601cd5eda0c18aa35aa749231a4d835242b23f4f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:02:36 +0100 Subject: [PATCH 023/536] use tar -a switch to autodetect compression algorithm. --- script/build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/build.sh b/script/build.sh index 3cfa84c..c6e2fbe 100644 --- a/script/build.sh +++ b/script/build.sh @@ -175,7 +175,7 @@ cd .. # djcrx done # build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 +tar -xavf ../download/djcross-gcc-${GCC_VERSION}.tar.* || exit 1 cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` @@ -183,7 +183,7 @@ BUILDDIR=`pwd` if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" cd $BUILDDIR - tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 + tar -xavf ../../download/autoconf-${AUTOCONF_VERSION}.tar.* || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -196,7 +196,7 @@ fi if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then echo "Building automake" cd $BUILDDIR - tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 + tar -xavf ../../download/automake-${AUTOMAKE_VERSION}.tar.* || exit 1 cd automake-${AUTOMAKE_VERSION}/ PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 @@ -213,7 +213,7 @@ SED=sed if [ ! -z $SED_VERSION ]; then echo "Building sed" cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 + tar -xavf ../../download/sed-${SED_VERSION}.tar.* || exit 1 cd sed-${SED_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -229,14 +229,14 @@ if [ ! -e gcc-unpacked ]; then # to : # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) echo "Patch unpack-gcc.sh" - $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || exit 1 + $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || 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 echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.* || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" From 6ada84596ffbfebbe2b30bba74f6d7b814557cc7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:06:49 +0100 Subject: [PATCH 024/536] automatically find djcross tarball location. --- script/7.1.0 | 1 - script/7.2.0 | 1 - script/build.sh | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/script/7.1.0 b/script/7.1.0 index 545f338..24dd354 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -6,7 +6,6 @@ export AUTOCONF_VERSION=2.64 export AUTOMAKE_VERSION=1.11.6 # tarball location -export DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" diff --git a/script/7.2.0 b/script/7.2.0 index 3a38c80..f60de64 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -6,7 +6,6 @@ export AUTOCONF_VERSION=2.64 export AUTOMAKE_VERSION=1.11.6 # tarball location -export DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" diff --git a/script/build.sh b/script/build.sh index c6e2fbe..3f4ee4a 100644 --- a/script/build.sh +++ b/script/build.sh @@ -54,6 +54,7 @@ fi rm test-zlib 2>/dev/null rm test-zlib.exe 2>/dev/null +DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} From ee099959aca8bd39bc6352cd09d10198d8152db2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:15:06 +0100 Subject: [PATCH 025/536] add GCC_CONFIGURE_OPTIONS variable for each specific version. --- script/7.1.0 | 5 +++++ script/7.2.0 | 5 +++++ script/build.sh | 5 +---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/script/7.1.0 b/script/7.1.0 index 24dd354..c8ea2e7 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -10,4 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export GCC_CONFIGURE_OPTIONS=${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts + ./script/build.sh diff --git a/script/7.2.0 b/script/7.2.0 index f60de64..febaa42 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -10,4 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export GCC_CONFIGURE_OPTIONS=${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts + ./script/build.sh diff --git a/script/build.sh b/script/build.sh index 3f4ee4a..924b9df 100644 --- a/script/build.sh +++ b/script/build.sh @@ -274,13 +274,10 @@ if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PR --program-prefix=i586-pc-msdosdjgpp- \ --prefix=$DJGPP_PREFIX \ --disable-nls \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ --enable-libquadmath-support \ --enable-version-specific-runtime-libs \ --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 + ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${DJGPP_PREFIX} > gcc-configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" From cedde22dd6c219d790909d4700f6a5d58374c746 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:20:44 +0100 Subject: [PATCH 026/536] fixed multiline configure options. --- script/7.1.0 | 8 ++++---- script/7.2.0 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/script/7.1.0 b/script/7.1.0 index c8ea2e7..aa4c9aa 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -10,9 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -export GCC_CONFIGURE_OPTIONS=${GCC_CONFIGURE_OPTIONS} \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts +export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts" ./script/build.sh diff --git a/script/7.2.0 b/script/7.2.0 index febaa42..71e05ab 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -10,9 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -export GCC_CONFIGURE_OPTIONS=${GCC_CONFIGURE_OPTIONS} \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts +export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts" ./script/build.sh From bc93e1e0876073301cb2568443837dd938f5b0f7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:25:34 +0100 Subject: [PATCH 027/536] modularize 6.4.0 --- script/6.4.0 | 401 ++------------------------------------------------- 1 file changed, 12 insertions(+), 389 deletions(-) diff --git a/script/6.4.0 b/script/6.4.0 index 6d44257..716f88f 100755 --- a/script/6.4.0 +++ b/script/6.4.0 @@ -1,395 +1,18 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=227 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=6.4.0 -GCC_VERSION_SHORT=6.40 -GMP_VERSION=6.1.2 -MPFR_VERSION=3.1.4 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=6.4.0 +export GCC_VERSION_SHORT=6.40 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/binutils-* || exit - -# patch for binutils 2.27 -patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --enable-libstdcxx-filesystem-ts \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts" -echo "build-djgpp.sh done." +./script/build.sh From 261967a2c0da7c64efba9d63c408594c6d08430c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:46:22 +0100 Subject: [PATCH 028/536] create /etc/ directory to store binutils version signal file. --- script/7.2.0 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/7.2.0 b/script/7.2.0 index 1c4cbb7..67eb400 100755 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -142,6 +142,8 @@ if ! [ -w $DJGPP_PREFIX ]; then exit 1 fi +mkdir -p ${DJGPP_PREFIX}/etc/ || exit 1 + # make build dir echo "Make build dir" mkdir -p build || exit 1 From 02e2772f609358a340e07cb3f823582f4868cb6e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 22 Jan 2018 23:46:33 +0100 Subject: [PATCH 029/536] initial attempt at a more modular build script system. --- build-djgpp.sh | 36 ++++- script/7.2.0 | 391 ++---------------------------------------------- script/build.sh | 346 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 387 insertions(+), 386 deletions(-) mode change 100755 => 100644 script/7.2.0 create mode 100644 script/build.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index 0ad29f4..026ec8c 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -9,10 +9,38 @@ if [ -z $BUILD_VER ]; then exit 1 fi -if [ -x script/$BUILD_VER ]; then - echo "Building version : $BUILD_VER" - script/$BUILD_VER || exit 1 -else +if [ ! -x script/$BUILD_VER ]; then echo "Unsupported version : $BUILD_VER" exit 1 fi + +echo "Building version : $BUILD_VER" + +unset CDPATH + +# target directory +export DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} + +# enabled languages +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} +export ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} + +# number of parallel build threads +export MAKE_JOBS=${MAKE_JOBS-4} + +#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" +export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" + +# source tarball versions +export DJCRX_VERSION=205 +export DJLSR_VERSION=205 +export DJDEV_VERSION=205 +export BINUTILS_VERSION=2291 + +# source tarball locations +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" +export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" +export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" +export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" + +./script/$BUILD_VER diff --git a/script/7.2.0 b/script/7.2.0 old mode 100755 new mode 100644 index 67eb400..3a38c80 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -1,387 +1,14 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -# number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-4} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=2291 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=7.2.0 -GCC_VERSION_SHORT=7.20 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi - -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=7.2.0 +export GCC_VERSION_SHORT=7.20 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -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" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -mkdir -p ${DJGPP_PREFIX}/etc/ || exit 1 - -# make build dir -echo "Make build dir" -mkdir -p build || exit 1 -cd build - -if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then - # build binutils - echo "Building binutils" - mkdir bnu${BINUTILS_VERSION}s - cd bnu${BINUTILS_VERSION}s - unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - cd gnu/binutils-* || exit - - # exec permission of some files are not set, fix it. - for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 - done - - sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - - ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 - ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 - fi - - ${MAKE} -j${MAKE_JOBS} install || exit 1 - - cd ../../.. - rm ${DJGPP_PREFIX}/etc/binutils-*-installed - touch ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed - # binutils done -else - echo "Current binutils version already installed, skipping." -fi - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then - echo "Building autoconf" - cd $BUILDDIR - tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 - cd autoconf-${AUTOCONF_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - rm ${BUILDDIR}/tmpinst/autoconf-*-built - touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built -else - echo "autoconf already built, skipping." -fi - -if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then - echo "Building automake" - cd $BUILDDIR - tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 - cd automake-${AUTOMAKE_VERSION}/ - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ${MAKE} all install || exit 1 - rm ${BUILDDIR}/tmpinst/automake-*-built - touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built -else - echo "automake already built, skipping." -fi - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR - -if [ ! -e gcc-unpacked ]; then - # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) - echo "Patch unpack-gcc.sh" - $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 - - echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 - - # 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 - - - # copy stubify programs - cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - - cd $BUILDDIR/ - - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gnu/gcc-${GCC_VERSION_SHORT} - ./contrib/download_prerequisites - cd - - - touch gcc-unpacked -else - echo "gcc already unpacked, skipping." -fi - -echo "Building gcc" - -mkdir -p djcross || exit 1 -cd djcross - -if [ ! -e Makefile ]; then - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 -else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" - sleep 5 -fi - -${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 - -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" +./script/build.sh diff --git a/script/build.sh b/script/build.sh new file mode 100644 index 0000000..8613a81 --- /dev/null +++ b/script/build.sh @@ -0,0 +1,346 @@ +#!/usr/bin/env bash + +CC=gcc +CXX=g++ + +# use gmake under FreeBSD +if [ `uname` = "FreeBSD" ]; then + MAKE=gmake + CC=clang + CXX=clang++ +else + MAKE=make +fi + +export CC CXX CFLAGS MAKE + +# check required programs +REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" + +# MinGW doesn't have curl, so we use wget. +if uname|grep "^MINGW32" > /dev/null; then + USE_WGET=1 +fi + +# use curl or wget? +if [ ! -z $USE_WGET ]; then + REQ_PROG_LIST+=" wget" +else + REQ_PROG_LIST+=" curl" +fi + +for REQ_PROG in $REQ_PROG_LIST; do + if ! which $REQ_PROG > /dev/null; then + echo "$REQ_PROG not installed" + exit 1 + fi +done + +# check GNU sed is installed or not. +# It is for OSX, which doesn't ship with GNU sed. +if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then + echo GNU sed is not installed, need to download. + SED_VERSION=4.2.2 + SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" +else + SED_ARCHIVE="" +fi + +# check zlib is installed +if ! ${CC} test-zlib.c -o test-zlib -lz; then + echo "zlib not installed" + exit 1 +fi +rm test-zlib 2>/dev/null +rm test-zlib.exe 2>/dev/null + +# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. +OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} + +# download source files +ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE + $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" + +echo "Download source files..." +mkdir -p download || exit 1 +cd download + +for ARCHIVE in $ARCHIVE_LIST; do + FILE=`basename $ARCHIVE` + if ! [ -f $FILE ]; then + echo "Download $ARCHIVE ..." + if [ ! -z $USE_WGET ]; then + DL_CMD="wget -U firefox $ARCHIVE" + else + DL_CMD="curl -f $ARCHIVE -L -o $FILE" + fi + echo "Command : $DL_CMD" + if ! eval $DL_CMD; then + if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then + echo "$FILE maybe moved to deleted/ directory." + else + rm $FILE + echo "Download $ARCHIVE failed." + exit 1 + fi + fi + fi +done +cd .. + +# create target directory, check writable. +echo "Make prefix directory : $DJGPP_PREFIX" +mkdir -p $DJGPP_PREFIX + +if ! [ -d $DJGPP_PREFIX ]; then + echo "Unable to create prefix directory" + exit 1 +fi + +if ! [ -w $DJGPP_PREFIX ]; then + echo "prefix directory is not writable." + exit 1 +fi + +# make build dir +echo "Make build dir" +mkdir -p build || exit 1 +cd build + +if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then + # build binutils + echo "Building binutils" + mkdir bnu${BINUTILS_VERSION}s + cd bnu${BINUTILS_VERSION}s + unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 + cd gnu/binutils-* || exit + + # exec permission of some files are not set, fix it. + for EXEC_FILE in install-sh missing; do + echo "chmod a+x $EXEC_FILE" + chmod a+x $EXEC_FILE || exit 1 + done + + sh ./configure \ + --prefix=$DJGPP_PREFIX \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --disable-werror \ + --disable-nls \ + || exit 1 + + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 + ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 + fi + + ${MAKE} -j${MAKE_JOBS} install || exit 1 + + cd ../../.. + rm ${DJGPP_PREFIX}/etc/binutils-*-installed + touch ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed + # binutils done +else + echo "Current binutils version already installed, skipping." +fi + +# prepare djcrx +echo "Prepare djcrx" +mkdir djcrx${DJCRX_VERSION} +cd djcrx${DJCRX_VERSION} +unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 +patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 + +cd src/stub +${CC} -O2 stubify.c -o stubify || exit 1 +${CC} -O2 stubedit.c -o stubedit || exit 1 + +cd ../.. + +mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 +cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 +cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 +cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 +cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + +cd .. +# djcrx done + +# build gcc +tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 +cd djcross-gcc-${GCC_VERSION}/ + +BUILDDIR=`pwd` + +if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then + echo "Building autoconf" + cd $BUILDDIR + tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 + cd autoconf-${AUTOCONF_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + rm ${BUILDDIR}/tmpinst/autoconf-*-built + touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built +else + echo "autoconf already built, skipping." +fi + +if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then + echo "Building automake" + cd $BUILDDIR + tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 + cd automake-${AUTOMAKE_VERSION}/ + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ${MAKE} all install || exit 1 + rm ${BUILDDIR}/tmpinst/automake-*-built + touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built +else + echo "automake already built, skipping." +fi + +# build GNU sed if needed. +SED=sed +if [ ! -z $SED_VERSION ]; then + echo "Building sed" + cd $BUILDDIR + tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + SED=$BUILDDIR/tmpinst/bin/sed +fi + +cd $BUILDDIR + +if [ ! -e gcc-unpacked ]; then + # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) + echo "Patch unpack-gcc.sh" + $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 + + echo "Running unpack-gcc.sh" + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 + + # 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 - + + # copy stubify programs + cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin + + cd $BUILDDIR/ + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gnu/gcc-${GCC_VERSION_SHORT} + ./contrib/download_prerequisites + cd - + + touch gcc-unpacked +else + echo "gcc already unpacked, skipping." +fi + +echo "Building gcc" + +mkdir -p djcross || exit 1 +cd djcross + +if [ ! -e Makefile ]; then + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --prefix=$DJGPP_PREFIX \ + --disable-nls \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + --enable-libquadmath-support \ + --enable-version-specific-runtime-libs \ + --enable-languages=${ENABLE_LANGUAGES} \ + || exit 1 +else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" + sleep 5 +fi + +${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 + +${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + +echo "Copy long name executables to short name." +( + cd $DJGPP_PREFIX || exit 1 + SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" + for SHORT_NAME in $SHORT_NAME_LIST; do + if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then + cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME + fi + done +) || exit 1 + +# gcc done + +# build djlsr (for dxegen / exe2coff) +echo "Prepare djlsr" +cd $BUILDDIR +cd .. +rm -rf djlsr${DJLSR_VERSION} +mkdir djlsr${DJLSR_VERSION} +cd djlsr${DJLSR_VERSION} +unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 +unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 +unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 +patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 +if [ "$CC" == "gcc" ]; then + echo "Building DXE tools." + cd src + PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 + cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + cd .. +else + echo "Building DXE tools requires gcc, skip." +fi +cd src/stub +${CC} -o exe2coff exe2coff.c || exit 1 +cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 +cd ../../.. +# djlsr done + +# copy setenv script +(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 + +echo "Testing DJGPP." +cd $BUILDDIR +cd .. +echo "Use DJGPP to build a test C program." +$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 + +for x in $(echo $ENABLE_LANGUAGES | tr "," " ") +do + case $x in + c++) + echo "Use DJGPP to build a test C++ program." + $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 + ;; + esac +done + +echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" From e5cc8467ea84188e262199e4f91c7195a9813f17 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 00:49:52 +0100 Subject: [PATCH 030/536] remove binutils directory before rebuilding. --- script/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/build.sh b/script/build.sh index 8613a81..4a2e1e0 100644 --- a/script/build.sh +++ b/script/build.sh @@ -111,6 +111,7 @@ cd build if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then # build binutils echo "Building binutils" + rm -rf bnu${BINUTILS_VERSION}s mkdir bnu${BINUTILS_VERSION}s cd bnu${BINUTILS_VERSION}s unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 From ed04771bd956345e785b50352db0ad888a911a42 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 00:50:36 +0100 Subject: [PATCH 031/536] store which prefix gcc was configured for. --- script/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 4a2e1e0..a6274b3 100644 --- a/script/build.sh +++ b/script/build.sh @@ -263,7 +263,7 @@ echo "Building gcc" mkdir -p djcross || exit 1 cd djcross -if [ ! -e Makefile ]; then +if [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=i586-pc-msdosdjgpp \ @@ -277,6 +277,7 @@ if [ ! -e Makefile ]; then --enable-version-specific-runtime-libs \ --enable-languages=${ENABLE_LANGUAGES} \ || exit 1 + echo ${DJGPP_PREFIX} > gcc-configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" sleep 5 From 558810d5e4c1c8271c8570bbf5e0939ed20bea96 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 00:55:13 +0100 Subject: [PATCH 032/536] create /etc/ directory to store binutils version signal file. --- script/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/build.sh b/script/build.sh index a6274b3..e0cae0a 100644 --- a/script/build.sh +++ b/script/build.sh @@ -103,6 +103,8 @@ if ! [ -w $DJGPP_PREFIX ]; then exit 1 fi +mkdir -p ${DJGPP_PREFIX}/etc/ || exit 1 + # make build dir echo "Make build dir" mkdir -p build || exit 1 From 161cd06bb00222b0bc482016bcc3929ed18f4650 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 01:20:57 +0100 Subject: [PATCH 033/536] fixed check if gcc was already configured. --- script/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index e0cae0a..3cfa84c 100644 --- a/script/build.sh +++ b/script/build.sh @@ -265,7 +265,8 @@ echo "Building gcc" mkdir -p djcross || exit 1 cd djcross -if [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then +if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then + ${MAKE} distclean PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=i586-pc-msdosdjgpp \ From 432d63e74dac4c125696cdb3ef60d900b8efcaa5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 01:21:54 +0100 Subject: [PATCH 034/536] modularize script for 7.1.0. --- script/7.1.0 | 391 ++------------------------------------------------- 1 file changed, 9 insertions(+), 382 deletions(-) diff --git a/script/7.1.0 b/script/7.1.0 index 3134a57..545f338 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -1,387 +1,14 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=227 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=7.1.0 -GCC_VERSION_SHORT=7.10 -GMP_VERSION=6.1.2 -MPFR_VERSION=3.1.5 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=7.1.0 +export GCC_VERSION_SHORT=7.10 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/binutils-* || exit - -# patch for binutils 2.27 -patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 - -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -echo "build-djgpp.sh done." +./script/build.sh From 10724d476928c3a8a49f137e7be17ce44e3c6068 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:02:36 +0100 Subject: [PATCH 035/536] use tar -a switch to autodetect compression algorithm. --- script/build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/build.sh b/script/build.sh index 3cfa84c..c6e2fbe 100644 --- a/script/build.sh +++ b/script/build.sh @@ -175,7 +175,7 @@ cd .. # djcrx done # build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 +tar -xavf ../download/djcross-gcc-${GCC_VERSION}.tar.* || exit 1 cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` @@ -183,7 +183,7 @@ BUILDDIR=`pwd` if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" cd $BUILDDIR - tar xJf ../../download/autoconf-${AUTOCONF_VERSION}.tar.xz || exit 1 + tar -xavf ../../download/autoconf-${AUTOCONF_VERSION}.tar.* || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -196,7 +196,7 @@ fi if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then echo "Building automake" cd $BUILDDIR - tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 + tar -xavf ../../download/automake-${AUTOMAKE_VERSION}.tar.* || exit 1 cd automake-${AUTOMAKE_VERSION}/ PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 @@ -213,7 +213,7 @@ SED=sed if [ ! -z $SED_VERSION ]; then echo "Building sed" cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 + tar -xavf ../../download/sed-${SED_VERSION}.tar.* || exit 1 cd sed-${SED_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -229,14 +229,14 @@ if [ ! -e gcc-unpacked ]; then # to : # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) echo "Patch unpack-gcc.sh" - $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || exit 1 + $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || 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 echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.* || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" From 4d6891d9cba8bcfe5c3101aa1a188c3dc78affc1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:06:49 +0100 Subject: [PATCH 036/536] automatically find djcross tarball location. --- script/7.1.0 | 1 - script/7.2.0 | 1 - script/build.sh | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/script/7.1.0 b/script/7.1.0 index 545f338..24dd354 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -6,7 +6,6 @@ export AUTOCONF_VERSION=2.64 export AUTOMAKE_VERSION=1.11.6 # tarball location -export DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" diff --git a/script/7.2.0 b/script/7.2.0 index 3a38c80..f60de64 100644 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -6,7 +6,6 @@ export AUTOCONF_VERSION=2.64 export AUTOMAKE_VERSION=1.11.6 # tarball location -export DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" diff --git a/script/build.sh b/script/build.sh index c6e2fbe..3f4ee4a 100644 --- a/script/build.sh +++ b/script/build.sh @@ -54,6 +54,7 @@ fi rm test-zlib 2>/dev/null rm test-zlib.exe 2>/dev/null +DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} From 081ca9e0d70d54213b80c5dc29e5087765243063 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:15:06 +0100 Subject: [PATCH 037/536] add GCC_CONFIGURE_OPTIONS variable for each specific version. --- script/7.1.0 | 5 +++++ script/7.2.0 | 5 +++++ script/build.sh | 5 +---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/script/7.1.0 b/script/7.1.0 index 24dd354..c8ea2e7 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -10,4 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export GCC_CONFIGURE_OPTIONS=${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts + ./script/build.sh diff --git a/script/7.2.0 b/script/7.2.0 index f60de64..febaa42 100644 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -10,4 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export GCC_CONFIGURE_OPTIONS=${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts + ./script/build.sh diff --git a/script/build.sh b/script/build.sh index 3f4ee4a..924b9df 100644 --- a/script/build.sh +++ b/script/build.sh @@ -274,13 +274,10 @@ if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PR --program-prefix=i586-pc-msdosdjgpp- \ --prefix=$DJGPP_PREFIX \ --disable-nls \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ --enable-libquadmath-support \ --enable-version-specific-runtime-libs \ --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 + ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${DJGPP_PREFIX} > gcc-configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" From 947683d1680d5c94d7a4da01def8f97c0b4916e9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:20:44 +0100 Subject: [PATCH 038/536] fixed multiline configure options. --- script/7.1.0 | 8 ++++---- script/7.2.0 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/script/7.1.0 b/script/7.1.0 index c8ea2e7..aa4c9aa 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -10,9 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -export GCC_CONFIGURE_OPTIONS=${GCC_CONFIGURE_OPTIONS} \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts +export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts" ./script/build.sh diff --git a/script/7.2.0 b/script/7.2.0 index febaa42..71e05ab 100644 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -10,9 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -export GCC_CONFIGURE_OPTIONS=${GCC_CONFIGURE_OPTIONS} \ - --disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts +export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts" ./script/build.sh From f14b6237390b22a209d795d699bce2ac70c72347 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 02:25:34 +0100 Subject: [PATCH 039/536] modularize 6.4.0 --- script/6.4.0 | 401 ++------------------------------------------------- 1 file changed, 12 insertions(+), 389 deletions(-) diff --git a/script/6.4.0 b/script/6.4.0 index 6d44257..716f88f 100755 --- a/script/6.4.0 +++ b/script/6.4.0 @@ -1,395 +1,18 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=227 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=6.4.0 -GCC_VERSION_SHORT=6.40 -GMP_VERSION=6.1.2 -MPFR_VERSION=3.1.4 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=6.4.0 +export GCC_VERSION_SHORT=6.40 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/binutils-* || exit - -# patch for binutils 2.27 -patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --enable-libstdcxx-filesystem-ts \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ + --disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts" -echo "build-djgpp.sh done." +./script/build.sh From 6f2cea1daafc0e9ad8f69f397e7ef48b944de5d5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 03:47:42 +0100 Subject: [PATCH 040/536] resolve ambiguity when multiple tarballs with different compression formats exist. --- script/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/build.sh b/script/build.sh index 924b9df..37bdf30 100644 --- a/script/build.sh +++ b/script/build.sh @@ -176,7 +176,7 @@ cd .. # djcrx done # build gcc -tar -xavf ../download/djcross-gcc-${GCC_VERSION}.tar.* || exit 1 +tar -xavf $(ls -t ../download/djcross-gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` @@ -184,7 +184,7 @@ BUILDDIR=`pwd` if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" cd $BUILDDIR - tar -xavf ../../download/autoconf-${AUTOCONF_VERSION}.tar.* || exit 1 + tar -xavf $(ls -t ../../download/autoconf-${AUTOCONF_VERSION}.tar.* | head -n 1) || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -197,7 +197,7 @@ fi if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then echo "Building automake" cd $BUILDDIR - tar -xavf ../../download/automake-${AUTOMAKE_VERSION}.tar.* || exit 1 + tar -xavf $(ls -t ../../download/automake-${AUTOMAKE_VERSION}.tar.* | head -n 1) || exit 1 cd automake-${AUTOMAKE_VERSION}/ PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 @@ -214,7 +214,7 @@ SED=sed if [ ! -z $SED_VERSION ]; then echo "Building sed" cd $BUILDDIR - tar -xavf ../../download/sed-${SED_VERSION}.tar.* || exit 1 + tar -xavf $(ls -t ../../download/sed-${SED_VERSION}.tar.* | head -n 1) || exit 1 cd sed-${SED_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -237,7 +237,7 @@ if [ ! -e gcc-unpacked ]; then fi echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.* || exit 1 + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" From dfda8440b63451d4764176241400418d68a16ce1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 03:49:15 +0100 Subject: [PATCH 041/536] added some helpful messages. --- script/build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/build.sh b/script/build.sh index 37bdf30..b65456a 100644 --- a/script/build.sh +++ b/script/build.sh @@ -151,6 +151,8 @@ if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then # binutils done else echo "Current binutils version already installed, skipping." + echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed" + sleep 5 fi # prepare djcrx @@ -347,3 +349,4 @@ do done echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" +echo "To remove downloaded source tarballs, use: rm -rf download/" From 34b34036f1987dd35c58fe89b9d906bc8dcebb63 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 03:51:56 +0100 Subject: [PATCH 042/536] user-defined configure options should take precedence. --- script/6.4.0 | 6 +++--- script/7.1.0 | 8 ++++---- script/7.2.0 | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/script/6.4.0 b/script/6.4.0 index 716f88f..508311c 100755 --- a/script/6.4.0 +++ b/script/6.4.0 @@ -10,9 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ - --disable-plugin \ +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ - --enable-libstdcxx-filesystem-ts" + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" ./script/build.sh diff --git a/script/7.1.0 b/script/7.1.0 index aa4c9aa..7745d9c 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -10,9 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ - --disable-plugin \ +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ - --enable-libstdcxx-filesystem-ts" - + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" + ./script/build.sh diff --git a/script/7.2.0 b/script/7.2.0 index 71e05ab..f75d4ae 100644 --- a/script/7.2.0 +++ b/script/7.2.0 @@ -10,9 +10,9 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS} \ - --disable-plugin \ +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ - --enable-libstdcxx-filesystem-ts" + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" ./script/build.sh From 3c6398b105a153e809b93c3a729da0668fbb1172 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 04:02:48 +0100 Subject: [PATCH 043/536] add info about GCC_CONFIGURE_OPTIONS in readme. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b0a983f..0c1d80b 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,12 @@ Default number of parallel builds is 4. You can change this number by setting en MAKE_JOBS=8 ``` +To configure gcc with additional options, add your custom flags to environment variable *GCC_CONFIGURE_OPTIONS* : + +``` +GCC_CONFIGURE_OPTIONS="--enable-nls" +``` + ### Building DJGPP compiler To build DJGPP, just run : From c1fd797e86fe450d3b03b9d4c15c3f93b3c61c4b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 04:29:03 +0100 Subject: [PATCH 044/536] modularize version 6.x scripts. --- script/6.1.0 | 389 ++------------------------------------------------ script/6.2.0 | 389 ++------------------------------------------------ script/6.3.0 | 392 ++------------------------------------------------- script/6.4.0 | 2 +- script/7.1.0 | 2 +- 5 files changed, 35 insertions(+), 1139 deletions(-) diff --git a/script/6.1.0 b/script/6.1.0 index 4e4d7fe..253206d 100755 --- a/script/6.1.0 +++ b/script/6.1.0 @@ -1,384 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=6.1.0 -GCC_VERSION_SHORT=6.10 -GMP_VERSION=6.1.0 -MPFR_VERSION=3.1.4 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=6.1.0 +export GCC_VERSION_SHORT=6.10 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/6.2.0 b/script/6.2.0 index f70ca3c..9a8319d 100755 --- a/script/6.2.0 +++ b/script/6.2.0 @@ -1,384 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=226 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=6.2.0 -GCC_VERSION_SHORT=6.20 -GMP_VERSION=6.1.1 -MPFR_VERSION=3.1.4 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=6.2.0 +export GCC_VERSION_SHORT=6.20 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}sr3.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}sr3 -cd bnu${BINUTILS_VERSION}sr3 -unzip ../../download/bnu${BINUTILS_VERSION}sr3.zip || exit 1 -cd gnu/binutils-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/6.3.0 b/script/6.3.0 index 6b25030..d45235d 100755 --- a/script/6.3.0 +++ b/script/6.3.0 @@ -1,387 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=227 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=6.3.0 -GCC_VERSION_SHORT=6.30 -GMP_VERSION=6.1.2 -MPFR_VERSION=3.1.4 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.6 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=6.3.0 +export GCC_VERSION_SHORT=6.30 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/binutils-* || exit - -# patch for binutils 2.27 -patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xJf ../../download/automake-${AUTOMAKE_VERSION}.tar.xz || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/6.4.0 b/script/6.4.0 index 508311c..dcc3345 100755 --- a/script/6.4.0 +++ b/script/6.4.0 @@ -7,7 +7,7 @@ export AUTOMAKE_VERSION=1.11.6 # tarball location export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" export GCC_CONFIGURE_OPTIONS="--disable-plugin \ diff --git a/script/7.1.0 b/script/7.1.0 index 7745d9c..0833d5f 100755 --- a/script/7.1.0 +++ b/script/7.1.0 @@ -7,7 +7,7 @@ export AUTOMAKE_VERSION=1.11.6 # tarball location export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" export GCC_CONFIGURE_OPTIONS="--disable-plugin \ From d52d85d30baa40f0cd9c1ce46493bda5b8374f2c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 04:53:44 +0100 Subject: [PATCH 045/536] modularize version 5.x scripts --- script/5.1.0 | 389 ++------------------------------------------------ script/5.2.0 | 389 ++------------------------------------------------ script/5.3.0 | 389 ++------------------------------------------------ script/5.4.0 | 389 ++------------------------------------------------ script/5.5.0 | 396 ++------------------------------------------------- 5 files changed, 55 insertions(+), 1897 deletions(-) diff --git a/script/5.1.0 b/script/5.1.0 index 1c2cef3..6393b4d 100755 --- a/script/5.1.0 +++ b/script/5.1.0 @@ -1,384 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=5.1.0 -GCC_VERSION_SHORT=5.10 -GMP_VERSION=6.0.0a -MPFR_VERSION=3.1.2 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=5.1.0 +export GCC_VERSION_SHORT=5.10 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/5.2.0 b/script/5.2.0 index 86a9e86..9ed9603 100755 --- a/script/5.2.0 +++ b/script/5.2.0 @@ -1,384 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=5.2.0 -GCC_VERSION_SHORT=5.20 -GMP_VERSION=6.0.0a -MPFR_VERSION=3.1.2 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=5.2.0 +export GCC_VERSION_SHORT=5.20 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/5.3.0 b/script/5.3.0 index d360d25..450de96 100755 --- a/script/5.3.0 +++ b/script/5.3.0 @@ -1,384 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=5.3.0 -GCC_VERSION_SHORT=5.30 -GMP_VERSION=6.1.0 -MPFR_VERSION=3.1.3 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=5.3.0 +export GCC_VERSION_SHORT=5.30 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/5.4.0 b/script/5.4.0 index 8498339..05f8876 100755 --- a/script/5.4.0 +++ b/script/5.4.0 @@ -1,384 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=226 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=5.4.0 -GCC_VERSION_SHORT=5.40 -GMP_VERSION=6.1.0 -MPFR_VERSION=3.1.4 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=5.4.0 +export GCC_VERSION_SHORT=5.40 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}sr3.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}sr3 -cd bnu${BINUTILS_VERSION}sr3 -unzip ../../download/bnu${BINUTILS_VERSION}sr3.zip || exit 1 -cd gnu/binutils-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/5.5.0 b/script/5.5.0 index d4ada30..418df2b 100755 --- a/script/5.5.0 +++ b/script/5.5.0 @@ -1,391 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=226 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=5.5.0 -GCC_VERSION_SHORT=5.50 -GMP_VERSION=6.1.2 -MPFR_VERSION=3.1.6 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -#CFLAGS="-O2 -g $CFLAGS -std=gnu11" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=5.5.0 +export GCC_VERSION_SHORT=5.50 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}sr3.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}sr3 -cd bnu${BINUTILS_VERSION}sr3 -unzip ../../download/bnu${BINUTILS_VERSION}sr3.zip || exit 1 -cd gnu/binutils-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1J\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.xz || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-plugin \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh From 2e376f4be3256302db356355c0423008cae03691 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 05:07:44 +0100 Subject: [PATCH 046/536] modularized all scripts except 4.7.3 --- script/4.8.4 | 387 ++------------------------------------------------ script/4.8.5 | 394 ++------------------------------------------------- script/4.9.2 | 387 ++------------------------------------------------ script/4.9.3 | 387 ++------------------------------------------------ script/4.9.4 | 394 ++------------------------------------------------- script/5.1.0 | 4 +- script/5.2.0 | 4 +- script/5.3.0 | 4 +- script/5.4.0 | 4 +- script/5.5.0 | 4 +- 10 files changed, 60 insertions(+), 1909 deletions(-) diff --git a/script/4.8.4 b/script/4.8.4 index dd7bdd8..5a224eb 100755 --- a/script/4.8.4 +++ b/script/4.8.4 @@ -1,383 +1,16 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=4.8.4 -GCC_VERSION_SHORT=4.84 -GMP_VERSION=6.0.0a -MPFR_VERSION=3.1.2 -MPC_VERSION=1.0.2 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -CFLAGS="-O2 -g $CFLAGS -std=gnu90" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=4.8.4 +export GCC_VERSION_SHORT=4.84 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.1 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/4.8.5 b/script/4.8.5 index ce28ab2..2fc469a 100755 --- a/script/4.8.5 +++ b/script/4.8.5 @@ -1,390 +1,16 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=4.8.5 -GCC_VERSION_SHORT=4.85 -GMP_VERSION=6.0.0a -MPFR_VERSION=3.1.3 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -CFLAGS="-O2 -g $CFLAGS -std=gnu90" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=4.8.5 +export GCC_VERSION_SHORT=4.85 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.1 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/4.9.2 b/script/4.9.2 index fbb43b9..0428c5b 100755 --- a/script/4.9.2 +++ b/script/4.9.2 @@ -1,383 +1,16 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=4.9.2 -GCC_VERSION_SHORT=4.92 -GMP_VERSION=6.0.0a -MPFR_VERSION=3.1.2 -MPC_VERSION=1.0.1 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -CFLAGS="-O2 -g $CFLAGS -std=gnu90" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=4.9.2 +export GCC_VERSION_SHORT=4.92 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.1 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/4.9.3 b/script/4.9.3 index a4071d6..5428042 100755 --- a/script/4.9.3 +++ b/script/4.9.3 @@ -1,383 +1,16 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=4.9.3 -GCC_VERSION_SHORT=4.93 -GMP_VERSION=6.0.0a -MPFR_VERSION=3.1.3 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -CFLAGS="-O2 -g $CFLAGS -std=gnu90" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=4.9.3 +export GCC_VERSION_SHORT=4.93 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.1 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/4.9.4 b/script/4.9.4 index 49c4285..48ec2b3 100755 --- a/script/4.9.4 +++ b/script/4.9.4 @@ -1,390 +1,16 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=226 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=4.9.4 -GCC_VERSION_SHORT=4.94 -GMP_VERSION=6.1.1 -MPFR_VERSION=3.1.4 -MPC_VERSION=1.0.3 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -CFLAGS="-O2 -g $CFLAGS -std=gnu90" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=4.9.4 +export GCC_VERSION_SHORT=4.94 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.1 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}sr3.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}sr3 -cd bnu${BINUTILS_VERSION}sr3 -unzip ../../download/bnu${BINUTILS_VERSION}sr3.zip || exit 1 -cd gnu/binutils-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-*/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --enable-fat --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-lto \ - --enable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install-strip || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -echo "build-djgpp.sh done." +./script/build.sh diff --git a/script/5.1.0 b/script/5.1.0 index 6393b4d..de6400a 100755 --- a/script/5.1.0 +++ b/script/5.1.0 @@ -3,12 +3,12 @@ export GCC_VERSION=5.1.0 export GCC_VERSION_SHORT=5.10 export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +export AUTOMAKE_VERSION=1.11.1 # tarball location export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ diff --git a/script/5.2.0 b/script/5.2.0 index 9ed9603..a6b6be2 100755 --- a/script/5.2.0 +++ b/script/5.2.0 @@ -3,12 +3,12 @@ export GCC_VERSION=5.2.0 export GCC_VERSION_SHORT=5.20 export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +export AUTOMAKE_VERSION=1.11.1 # tarball location export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ diff --git a/script/5.3.0 b/script/5.3.0 index 450de96..2cc23ff 100755 --- a/script/5.3.0 +++ b/script/5.3.0 @@ -3,12 +3,12 @@ export GCC_VERSION=5.3.0 export GCC_VERSION_SHORT=5.30 export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +export AUTOMAKE_VERSION=1.11.1 # tarball location export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ diff --git a/script/5.4.0 b/script/5.4.0 index 05f8876..c02b761 100755 --- a/script/5.4.0 +++ b/script/5.4.0 @@ -3,12 +3,12 @@ export GCC_VERSION=5.4.0 export GCC_VERSION_SHORT=5.40 export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +export AUTOMAKE_VERSION=1.11.1 # tarball location export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ diff --git a/script/5.5.0 b/script/5.5.0 index 418df2b..2ef3ada 100755 --- a/script/5.5.0 +++ b/script/5.5.0 @@ -3,12 +3,12 @@ export GCC_VERSION=5.5.0 export GCC_VERSION_SHORT=5.50 export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +export AUTOMAKE_VERSION=1.11.1 # tarball location export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ From 77be7730b85841390ddfde58a831768634b46ff1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 05:17:02 +0100 Subject: [PATCH 047/536] add patch for binutils 2.27 --- script/build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/build.sh b/script/build.sh index b65456a..c1ed86c 100644 --- a/script/build.sh +++ b/script/build.sh @@ -120,6 +120,9 @@ if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 cd gnu/binutils-* || exit + # patch for binutils 2.27 + ([ ${BINUTILS_VERSION} == 227 ] && patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt) || exit 1 + # exec permission of some files are not set, fix it. for EXEC_FILE in install-sh missing; do echo "chmod a+x $EXEC_FILE" From 48c00cc9ced6badbf6b6a02298188983aad92689 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 05:22:20 +0100 Subject: [PATCH 048/536] build gcc 4.x with -std=gnu90. --- script/4.8.4 | 2 ++ script/4.8.5 | 2 ++ script/4.9.2 | 2 ++ script/4.9.3 | 2 ++ script/4.9.4 | 2 ++ 5 files changed, 10 insertions(+) diff --git a/script/4.8.4 b/script/4.8.4 index 5a224eb..e4de22a 100755 --- a/script/4.8.4 +++ b/script/4.8.4 @@ -13,4 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" +export CFLAGS="${CFLAGS} -std=gnu90" + ./script/build.sh diff --git a/script/4.8.5 b/script/4.8.5 index 2fc469a..c2471f8 100755 --- a/script/4.8.5 +++ b/script/4.8.5 @@ -13,4 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" +export CFLAGS="${CFLAGS} -std=gnu90" + ./script/build.sh diff --git a/script/4.9.2 b/script/4.9.2 index 0428c5b..4e264d6 100755 --- a/script/4.9.2 +++ b/script/4.9.2 @@ -13,4 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" +export CFLAGS="${CFLAGS} -std=gnu90" + ./script/build.sh diff --git a/script/4.9.3 b/script/4.9.3 index 5428042..acd0e95 100755 --- a/script/4.9.3 +++ b/script/4.9.3 @@ -13,4 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" +export CFLAGS="${CFLAGS} -std=gnu90" + ./script/build.sh diff --git a/script/4.9.4 b/script/4.9.4 index 48ec2b3..b5a9364 100755 --- a/script/4.9.4 +++ b/script/4.9.4 @@ -13,4 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" +export CFLAGS="${CFLAGS} -std=gnu90" + ./script/build.sh From 5883818618018e5930c8b6d66153141020708b91 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 05:26:13 +0100 Subject: [PATCH 049/536] build stubify, stubedit, and exe2coff with custom CFLAGS. --- script/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/build.sh b/script/build.sh index c1ed86c..8df3239 100644 --- a/script/build.sh +++ b/script/build.sh @@ -166,8 +166,8 @@ unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 +${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 +${CC} -O2 ${CFLAGS} stubedit.c -o stubedit || exit 1 cd ../.. @@ -327,7 +327,7 @@ else echo "Building DXE tools requires gcc, skip." fi cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 +${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 cd ../../.. # djlsr done From 06bc9f161eb2dc225ce9fde81001c24ed7c6763f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 05:39:03 +0100 Subject: [PATCH 050/536] hide build.sh from supported versions list. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 026ec8c..7f91558 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -5,7 +5,7 @@ BUILD_VER=$1 if [ -z $BUILD_VER ]; then echo "Usage : $0 djgpp-version" echo "Supported djgpp-version :" - for F in `(cd script/;echo *)`; do echo " "$F; done + for F in `(cd script/;echo *.*.*)`; do echo " "$F; done exit 1 fi From e16efb9776dec511ba2e9042c8b82164f93c9363 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 06:49:38 +0100 Subject: [PATCH 051/536] _mkdir() does not exist on my mingw. --- patch/patch-djlsr205.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch/patch-djlsr205.txt b/patch/patch-djlsr205.txt index 14b375b..6274348 100644 --- a/patch/patch-djlsr205.txt +++ b/patch/patch-djlsr205.txt @@ -134,7 +134,7 @@ diff -ur djlsr205-orig/src/misc.c djlsr205/src/misc.c /* MS-DOS uses \, unix uses / */ if (argc > 2 && strcmp(argv[1], "mkdir") == 0) +#if defined(__MINGW32__) || defined(__MINGW64__) -+ _mkdir(argv[2]); ++ mkdir(argv[2]); +#else mkdir(argv[2], 0777); +#endif From 52bec4c5c1545c980588641bb39d5cfaea0d7ea4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 06:50:13 +0100 Subject: [PATCH 052/536] check if curl is available, instead of assuming that it doesn't exist on mingw. --- script/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 8df3239..feb9dc9 100644 --- a/script/build.sh +++ b/script/build.sh @@ -18,7 +18,7 @@ export CC CXX CFLAGS MAKE REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" # MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then +if ! which curl > /dev/null; then USE_WGET=1 fi From e0bd695eaf59ceb115a1dcf5840cbd477d9a3909 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 18:28:52 +0100 Subject: [PATCH 053/536] run a new shell at end of setenv script, otherwise the exported variables have no effect. there may be a nicer way to do this, so for example setenv can be called from within another script too. --- setenv/setenv | 1 + 1 file changed, 1 insertion(+) diff --git a/setenv/setenv b/setenv/setenv index 1b1b878..5c037a4 100644 --- a/setenv/setenv +++ b/setenv/setenv @@ -1,3 +1,4 @@ export PATH="$(cd "$(dirname "$0")"; pwd)"/i586-pc-msdosdjgpp/bin/:"$(cd "$(dirname "$0")"; pwd)"/bin/:$PATH export GCC_EXEC_PREFIX="$(cd "$(dirname "$0")"; pwd)"/lib/gcc/ export DJDIR="$(cd "$(dirname "$0")"; pwd)"/i586-pc-msdosdjgpp +${SHELL} From 999385f1a730d805f122be2490d6df6a48e7764f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 18:45:43 +0100 Subject: [PATCH 054/536] don't hardcode the version number in the djlsr/djcrx patch files, in case a newer version of djgpp is ever released. --- script/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build.sh b/script/build.sh index feb9dc9..315550a 100644 --- a/script/build.sh +++ b/script/build.sh @@ -163,7 +163,7 @@ echo "Prepare djcrx" mkdir djcrx${DJCRX_VERSION} cd djcrx${DJCRX_VERSION} unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 +patch -p1 -u < ../../patch/patch-djcrx${DJCRX_VERSION}.txt || exit 1 cd src/stub ${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 @@ -316,7 +316,7 @@ cd djlsr${DJLSR_VERSION} unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 +patch -p1 -u < ../../patch/patch-djlsr${DJLSR_VERSION}.txt || exit 1 if [ "$CC" == "gcc" ]; then echo "Building DXE tools." cd src From 1df550d473ac7178a96a28d8779d4f7d31b77de6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 18:57:36 +0100 Subject: [PATCH 055/536] don't override global CFLAGS with gcc-specific flags. instead use a separate variable GCC_EXTRA_CFLAGS. --- script/4.8.4 | 2 +- script/4.8.5 | 2 +- script/4.9.2 | 2 +- script/4.9.3 | 2 +- script/4.9.4 | 2 +- script/build.sh | 5 +++++ 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/script/4.8.4 b/script/4.8.4 index e4de22a..201fbaf 100755 --- a/script/4.8.4 +++ b/script/4.8.4 @@ -13,6 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" -export CFLAGS="${CFLAGS} -std=gnu90" +export GCC_EXTRA_CFLAGS="-std=gnu90" ./script/build.sh diff --git a/script/4.8.5 b/script/4.8.5 index c2471f8..4aca656 100755 --- a/script/4.8.5 +++ b/script/4.8.5 @@ -13,6 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" -export CFLAGS="${CFLAGS} -std=gnu90" +export GCC_EXTRA_CFLAGS="-std=gnu90" ./script/build.sh diff --git a/script/4.9.2 b/script/4.9.2 index 4e264d6..d1fa62b 100755 --- a/script/4.9.2 +++ b/script/4.9.2 @@ -13,6 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" -export CFLAGS="${CFLAGS} -std=gnu90" +export GCC_EXTRA_CFLAGS="-std=gnu90" ./script/build.sh diff --git a/script/4.9.3 b/script/4.9.3 index acd0e95..4f77562 100755 --- a/script/4.9.3 +++ b/script/4.9.3 @@ -13,6 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" -export CFLAGS="${CFLAGS} -std=gnu90" +export GCC_EXTRA_CFLAGS="-std=gnu90" ./script/build.sh diff --git a/script/4.9.4 b/script/4.9.4 index b5a9364..b31591c 100755 --- a/script/4.9.4 +++ b/script/4.9.4 @@ -13,6 +13,6 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" -export CFLAGS="${CFLAGS} -std=gnu90" +export GCC_EXTRA_CFLAGS="-std=gnu90" ./script/build.sh diff --git a/script/build.sh b/script/build.sh index 315550a..c71df87 100644 --- a/script/build.sh +++ b/script/build.sh @@ -271,6 +271,9 @@ echo "Building gcc" mkdir -p djcross || exit 1 cd djcross +TEMP_CFLAGS="$CFLAGS" +export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then ${MAKE} distclean PATH="$BUILDDIR//tmpinst/bin:$PATH" \ @@ -293,6 +296,8 @@ ${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 +export CFLAGS="$TEMP_CFLAGS" + echo "Copy long name executables to short name." ( cd $DJGPP_PREFIX || exit 1 From 2ca23ccf475ff02afc3b14279479e0b7c6670522 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 19:15:18 +0100 Subject: [PATCH 056/536] add a special case for patching gcc 4.7.3 unpack-gcc.sh. --- script/build.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/script/build.sh b/script/build.sh index c71df87..8d68e45 100644 --- a/script/build.sh +++ b/script/build.sh @@ -229,13 +229,24 @@ fi cd $BUILDDIR if [ ! -e gcc-unpacked ]; then - # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) echo "Patch unpack-gcc.sh" - $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || exit 1 + + if [ ${GCC_VERSION} == "4.7.3" ]; then + # gcc 4.7.3 unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive --use=`case $archive in *.gz|*.tgz) echo 'gzip';; *.bz2) echo 'bzip2';; *.xz) echo 'xz';; esac` && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) + $SED -i "s/\(cd gnu && tar x\)\([^-]*\)\([^&]*\)/\1j\2/" unpack-gcc.sh || exit 1 + else + # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) + $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || exit 1 + fi + if [ `uname` = "FreeBSD" ]; then # The --verbose option is not recognized by BSD patch $SED -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1 From 1e8ea3681bf6ea6b06bacd0ec2111df752d82878 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 19:19:33 +0100 Subject: [PATCH 057/536] modularize version 4.7.3 script. --- script/4.7.3 | 385 ++------------------------------------------------- 1 file changed, 10 insertions(+), 375 deletions(-) diff --git a/script/4.7.3 b/script/4.7.3 index 86a5cb5..92b7aae 100755 --- a/script/4.7.3 +++ b/script/4.7.3 @@ -1,382 +1,17 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - -# source tarball versions -BINUTILS_VERSION=224 -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -GCC_VERSION=4.7.3 -GCC_VERSION_SHORT=4.73 -GMP_VERSION=5.0.5 -MPFR_VERSION=3.1.1 -MPC_VERSION=1.0 -AUTOCONF_VERSION=2.64 -AUTOMAKE_VERSION=1.11.1 - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi -CFLAGS="-O2 -g $CFLAGS -std=gnu90" - -export CC CXX CFLAGS MAKE +export GCC_VERSION=4.7.3 +export GCC_VERSION_SHORT=4.73 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.1 # tarball location -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.bz2" -MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.bz2" -MPC_ARCHIVE="http://www.multiprecision.org/mpc/download/mpc-${MPC_VERSION}.tar.gz" -AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2" -AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if uname|grep "^MINGW32" > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - if ! wget -U firefox $ARCHIVE; then - rm $FILE - exit 1 - fi - else - if ! curl -f $ARCHIVE -L -o $FILE; then - rm $FILE - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -# make build dir -echo "Make build dir" -rm -rf build || exit 1 -mkdir -p build || exit 1 -cd build - -# build binutils -echo "Building binutils" -mkdir bnu${BINUTILS_VERSION}s -cd bnu${BINUTILS_VERSION}s -unzip ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 -cd gnu/bnutl-* || exit - -# exec permission of some files are not set, fix it. -for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 -done - -sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - -${MAKE} configure-bfd || exit 1 -${MAKE} -C bfd stmp-lcoff-h || exit 1 -${MAKE} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi - -${MAKE} install || exit 1 - -cd ../../.. -# binutils done - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx205.txt || exit 1 - -cd src/stub -${CC} -O2 stubify.c -o stubify || exit 1 -${CC} -O2 stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xjvf ../download/djcross-gcc-${GCC_VERSION}.tar.bz2 || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -echo "Building autoconf" -cd $BUILDDIR -tar xjf ../../download/autoconf-${AUTOCONF_VERSION}.tar.bz2 || exit 1 -cd autoconf-${AUTOCONF_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -${MAKE} all install || exit 1 - -echo "Building automake" -cd $BUILDDIR -tar xjf ../../download/automake-${AUTOMAKE_VERSION}.tar.bz2 || exit 1 -cd automake-${AUTOMAKE_VERSION}/ -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -./configure --prefix=$BUILDDIR/tmpinst || exit 1 -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -${MAKE} all install || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar xjf ../../download/sed-${SED_VERSION}.tar.bz2 || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR -tar xjf ../../download/gmp-${GMP_VERSION}.tar.bz2 || exit 1 -tar xjf ../../download/mpfr-${MPFR_VERSION}.tar.bz2 || exit 1 -tar xzf ../../download/mpc-${MPC_VERSION}.tar.gz || exit 1 - -# gcc 4.7.3 unpack-gcc.sh needs to be patched for OSX -# patch from : -# ( cd gnu && tar xf $top/$archive --use=`case $archive in *.gz|*.tgz) echo 'gzip';; *.bz2) echo 'bzip2';; *.xz) echo 'xz';; esac` && echo $archive >$top/s-sources ) -# to : -# ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) -echo "Patch unpack-gcc.sh" -$SED -i "s/\(cd gnu && tar x\)\([^-]*\)\([^&]*\)/\1j\2/" unpack-gcc.sh || 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 - -echo "Running unpack-gcc.sh" -PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source ../../download/gcc-${GCC_VERSION}.tar.bz2 || exit 1 - -# 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 - - -# copy stubify programs -cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - -echo "Building gmp" -cd $BUILDDIR/gmp-${GMP_VERSION}/ -# On some systems, building gmp will fail if CFLAGS is set. -# Unset CFLAGS during building gmp. -env -u CFLAGS ./configure --prefix=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpfr" -cd $BUILDDIR/mpfr-${MPFR_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp-build=$BUILDDIR/gmp-${GMP_VERSION} --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building mpc" -cd $BUILDDIR/mpc-${MPC_VERSION}/ -./configure --prefix=$BUILDDIR/tmpinst --with-gmp=$BUILDDIR/tmpinst --with-mpfr=$BUILDDIR/tmpinst --enable-static --disable-shared || exit 1 -${MAKE} all || exit 1 -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} check || exit 1 -fi -${MAKE} install || exit 1 - -echo "Building gcc" -cd $BUILDDIR/ - -mkdir djcross -cd djcross - -PATH="$BUILDDIR//tmpinst/bin:$PATH" \ -../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --disable-lto \ - --enable-libquadmath-support \ - --with-gmp=$BUILDDIR/tmpinst \ - --with-mpfr=$BUILDDIR/tmpinst \ - --with-mpc=$BUILDDIR/tmpinst \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - || exit 1 - -${MAKE} j=4 "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} install || exit 1 - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr205.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH make || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 +export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS}" -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +export GCC_EXTRA_CFLAGS="-std=gnu90" -echo "build-djgpp.sh done." +./script/build.sh From d8722a11cb56b0f153d0e38c186ea6dab9d20738 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 19:39:26 +0100 Subject: [PATCH 058/536] This reverts commit e0bd695eaf59ceb115a1dcf5840cbd477d9a3909. --- setenv/setenv | 1 - 1 file changed, 1 deletion(-) diff --git a/setenv/setenv b/setenv/setenv index 5c037a4..1b1b878 100644 --- a/setenv/setenv +++ b/setenv/setenv @@ -1,4 +1,3 @@ export PATH="$(cd "$(dirname "$0")"; pwd)"/i586-pc-msdosdjgpp/bin/:"$(cd "$(dirname "$0")"; pwd)"/bin/:$PATH export GCC_EXEC_PREFIX="$(cd "$(dirname "$0")"; pwd)"/lib/gcc/ export DJDIR="$(cd "$(dirname "$0")"; pwd)"/i586-pc-msdosdjgpp -${SHELL} From 2e9380b87da69186f39b104e551ccdfb40f2c95d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Jan 2018 19:41:33 +0100 Subject: [PATCH 059/536] update readme with instructions for mingw64. --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c1d80b..b5ab051 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,7 @@ Before running this script, you need to install these programs first : * makeinfo * patch * zlib header/library -* curl (for Cygwin/OSX/Linux/FreeBSD) -* wget (for MinGW) +* curl or wget * bash (for FreeBSD) Depending on your system, installation procedure maybe different. @@ -45,6 +44,12 @@ mingw-get update mingw-get install msys-unzip libz-dev msys-wget msys-bison msys-flex msys-patch ``` +MinGW64 : + +``` +pacman -Syuu base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-curl mingw-w64-x86_64-zlib unzip +``` + ### Configuration Default install location is /usr/local/djgpp. You can change install location by setting environment variable *DJGPP_PREFIX* : @@ -159,6 +164,7 @@ BASE_DIR/setenv.bat * FreeBSD-10.2 (64bit) * Cygwin (32bit Windows XP) * MinGW (32bit Windows XP) +* MinGW64 (64bit Windows 7) ### Thanks From a51c30d00d9155f3361f54d8db4a42eeff8e85de Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 25 Jan 2018 00:41:19 +0100 Subject: [PATCH 060/536] fix directory name resolving in setenv script. --- setenv/setenv | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setenv/setenv b/setenv/setenv index 1b1b878..804b299 100644 --- a/setenv/setenv +++ b/setenv/setenv @@ -1,3 +1,4 @@ -export PATH="$(cd "$(dirname "$0")"; pwd)"/i586-pc-msdosdjgpp/bin/:"$(cd "$(dirname "$0")"; pwd)"/bin/:$PATH -export GCC_EXEC_PREFIX="$(cd "$(dirname "$0")"; pwd)"/lib/gcc/ -export DJDIR="$(cd "$(dirname "$0")"; pwd)"/i586-pc-msdosdjgpp +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +export PATH="$DIR/i586-pc-msdosdjgpp/bin/:$DIR/bin/:$PATH" +export GCC_EXEC_PREFIX="$DIR/lib/gcc/" +export DJDIR="$DIR/i586-pc-msdosdjgpp" From 0b1d75275c8d1e5ad4fc293ab4b9b11974dfd629 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 25 Jan 2018 01:03:31 +0100 Subject: [PATCH 061/536] move binutils version signal file to architecture-specific directory. --- script/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/build.sh b/script/build.sh index 8d68e45..8d885cf 100644 --- a/script/build.sh +++ b/script/build.sh @@ -111,7 +111,7 @@ echo "Make build dir" mkdir -p build || exit 1 cd build -if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then +if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed ]; then # build binutils echo "Building binutils" rm -rf bnu${BINUTILS_VERSION}s @@ -149,8 +149,8 @@ if [ ! -e ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 cd ../../.. - rm ${DJGPP_PREFIX}/etc/binutils-*-installed - touch ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed # binutils done else echo "Current binutils version already installed, skipping." From 0fdbb679dbaa135001e3b1c9108cc344fd75fb77 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 25 Jan 2018 02:02:46 +0100 Subject: [PATCH 062/536] build GMP with --enable-fat. --- script/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/build.sh b/script/build.sh index 8d885cf..b2cbee4 100644 --- a/script/build.sh +++ b/script/build.sh @@ -296,6 +296,7 @@ if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PR --enable-libquadmath-support \ --enable-version-specific-runtime-libs \ --enable-languages=${ENABLE_LANGUAGES} \ + --enable-fat \ ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${DJGPP_PREFIX} > gcc-configure-prefix else From d27b10281bcdc66e73ef497b25ca5dc348caf35e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 25 Jan 2018 02:22:13 +0100 Subject: [PATCH 063/536] addition to incomplete commit 0b1d7527. --- script/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build.sh b/script/build.sh index b2cbee4..1606964 100644 --- a/script/build.sh +++ b/script/build.sh @@ -104,7 +104,7 @@ if ! [ -w $DJGPP_PREFIX ]; then exit 1 fi -mkdir -p ${DJGPP_PREFIX}/etc/ || exit 1 +mkdir -p ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/ || exit 1 # make build dir echo "Make build dir" @@ -154,7 +154,7 @@ if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-in # binutils done else echo "Current binutils version already installed, skipping." - echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/etc/binutils-${BINUTILS_VERSION}-installed" + echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed" sleep 5 fi From 58aa2d7f70b9aa41e9be64edc7593da905d34d73 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 27 Jan 2018 02:15:22 +0100 Subject: [PATCH 064/536] support gcc 7.3.0. --- script/7.3.0 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/7.3.0 diff --git a/script/7.3.0 b/script/7.3.0 new file mode 100644 index 0000000..3ce283f --- /dev/null +++ b/script/7.3.0 @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +export GCC_VERSION=7.3.0 +export GCC_VERSION_SHORT=7.30 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 + +# tarball location +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" + +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" + +./script/build.sh From 0136d82a07db54357b705399bfe53cbb8f35bac9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 27 Jan 2018 20:37:59 +0100 Subject: [PATCH 065/536] fixed bug introduced in 77be7730. --- script/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 1606964..8c7a3ca 100644 --- a/script/build.sh +++ b/script/build.sh @@ -121,7 +121,7 @@ if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-in cd gnu/binutils-* || exit # patch for binutils 2.27 - ([ ${BINUTILS_VERSION} == 227 ] && patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt) || exit 1 + [ ${BINUTILS_VERSION} == 227 ] && ( patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 ) # exec permission of some files are not set, fix it. for EXEC_FILE in install-sh missing; do From 5651d70094dd6197d3136064b4c50c54d9741aba Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 30 Jan 2018 03:42:13 +0100 Subject: [PATCH 066/536] set environment variables MANPATH and INFOPATH in setenv script. --- setenv/setenv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setenv/setenv b/setenv/setenv index 804b299..9b428c9 100644 --- a/setenv/setenv +++ b/setenv/setenv @@ -1,4 +1,6 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export PATH="$DIR/i586-pc-msdosdjgpp/bin/:$DIR/bin/:$PATH" export GCC_EXEC_PREFIX="$DIR/lib/gcc/" +export MANPATH="$DIR/share/man:$MANPATH" +export INFOPATH="$DIR/share/info:$INFOPATH" export DJDIR="$DIR/i586-pc-msdosdjgpp" From fe083edf4ab5b6be5372a47b4d8fbe34d5c9a136 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 05:18:50 +0100 Subject: [PATCH 067/536] renamed scripts to gcc-{version} --- script/{4.7.3 => gcc-4.7.3} | 0 script/{4.8.4 => gcc-4.8.4} | 0 script/{4.8.5 => gcc-4.8.5} | 0 script/{4.9.2 => gcc-4.9.2} | 0 script/{4.9.3 => gcc-4.9.3} | 0 script/{4.9.4 => gcc-4.9.4} | 0 script/{5.1.0 => gcc-5.1.0} | 0 script/{5.2.0 => gcc-5.2.0} | 0 script/{5.3.0 => gcc-5.3.0} | 0 script/{5.4.0 => gcc-5.4.0} | 0 script/{5.5.0 => gcc-5.5.0} | 0 script/{6.1.0 => gcc-6.1.0} | 0 script/{6.2.0 => gcc-6.2.0} | 0 script/{6.3.0 => gcc-6.3.0} | 0 script/{6.4.0 => gcc-6.4.0} | 0 script/{7.1.0 => gcc-7.1.0} | 0 script/{7.2.0 => gcc-7.2.0} | 0 script/{7.3.0 => gcc-7.3.0} | 0 18 files changed, 0 insertions(+), 0 deletions(-) rename script/{4.7.3 => gcc-4.7.3} (100%) rename script/{4.8.4 => gcc-4.8.4} (100%) rename script/{4.8.5 => gcc-4.8.5} (100%) rename script/{4.9.2 => gcc-4.9.2} (100%) rename script/{4.9.3 => gcc-4.9.3} (100%) rename script/{4.9.4 => gcc-4.9.4} (100%) rename script/{5.1.0 => gcc-5.1.0} (100%) rename script/{5.2.0 => gcc-5.2.0} (100%) rename script/{5.3.0 => gcc-5.3.0} (100%) rename script/{5.4.0 => gcc-5.4.0} (100%) rename script/{5.5.0 => gcc-5.5.0} (100%) rename script/{6.1.0 => gcc-6.1.0} (100%) rename script/{6.2.0 => gcc-6.2.0} (100%) rename script/{6.3.0 => gcc-6.3.0} (100%) rename script/{6.4.0 => gcc-6.4.0} (100%) rename script/{7.1.0 => gcc-7.1.0} (100%) rename script/{7.2.0 => gcc-7.2.0} (100%) rename script/{7.3.0 => gcc-7.3.0} (100%) diff --git a/script/4.7.3 b/script/gcc-4.7.3 similarity index 100% rename from script/4.7.3 rename to script/gcc-4.7.3 diff --git a/script/4.8.4 b/script/gcc-4.8.4 similarity index 100% rename from script/4.8.4 rename to script/gcc-4.8.4 diff --git a/script/4.8.5 b/script/gcc-4.8.5 similarity index 100% rename from script/4.8.5 rename to script/gcc-4.8.5 diff --git a/script/4.9.2 b/script/gcc-4.9.2 similarity index 100% rename from script/4.9.2 rename to script/gcc-4.9.2 diff --git a/script/4.9.3 b/script/gcc-4.9.3 similarity index 100% rename from script/4.9.3 rename to script/gcc-4.9.3 diff --git a/script/4.9.4 b/script/gcc-4.9.4 similarity index 100% rename from script/4.9.4 rename to script/gcc-4.9.4 diff --git a/script/5.1.0 b/script/gcc-5.1.0 similarity index 100% rename from script/5.1.0 rename to script/gcc-5.1.0 diff --git a/script/5.2.0 b/script/gcc-5.2.0 similarity index 100% rename from script/5.2.0 rename to script/gcc-5.2.0 diff --git a/script/5.3.0 b/script/gcc-5.3.0 similarity index 100% rename from script/5.3.0 rename to script/gcc-5.3.0 diff --git a/script/5.4.0 b/script/gcc-5.4.0 similarity index 100% rename from script/5.4.0 rename to script/gcc-5.4.0 diff --git a/script/5.5.0 b/script/gcc-5.5.0 similarity index 100% rename from script/5.5.0 rename to script/gcc-5.5.0 diff --git a/script/6.1.0 b/script/gcc-6.1.0 similarity index 100% rename from script/6.1.0 rename to script/gcc-6.1.0 diff --git a/script/6.2.0 b/script/gcc-6.2.0 similarity index 100% rename from script/6.2.0 rename to script/gcc-6.2.0 diff --git a/script/6.3.0 b/script/gcc-6.3.0 similarity index 100% rename from script/6.3.0 rename to script/gcc-6.3.0 diff --git a/script/6.4.0 b/script/gcc-6.4.0 similarity index 100% rename from script/6.4.0 rename to script/gcc-6.4.0 diff --git a/script/7.1.0 b/script/gcc-7.1.0 similarity index 100% rename from script/7.1.0 rename to script/gcc-7.1.0 diff --git a/script/7.2.0 b/script/gcc-7.2.0 similarity index 100% rename from script/7.2.0 rename to script/gcc-7.2.0 diff --git a/script/7.3.0 b/script/gcc-7.3.0 similarity index 100% rename from script/7.3.0 rename to script/gcc-7.3.0 From 18bc3c87be882c03d9f361b23e808ce3f26dc645 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 05:23:15 +0100 Subject: [PATCH 068/536] call build.sh from build-djgpp.sh --- build-djgpp.sh | 3 ++- script/gcc | 3 +++ script/gcc-4.7.3 | 2 -- script/gcc-4.8.4 | 2 -- script/gcc-4.8.5 | 2 -- script/gcc-4.9.2 | 2 -- script/gcc-4.9.3 | 2 -- script/gcc-4.9.4 | 2 -- script/gcc-5.1.0 | 2 -- script/gcc-5.2.0 | 2 -- script/gcc-5.3.0 | 2 -- script/gcc-5.4.0 | 2 -- script/gcc-5.5.0 | 2 -- script/gcc-6.1.0 | 2 -- script/gcc-6.2.0 | 2 -- script/gcc-6.3.0 | 2 -- script/gcc-6.4.0 | 2 -- script/gcc-7.1.0 | 2 -- script/gcc-7.2.0 | 2 -- script/gcc-7.3.0 | 2 -- 20 files changed, 5 insertions(+), 37 deletions(-) create mode 100644 script/gcc diff --git a/build-djgpp.sh b/build-djgpp.sh index 7f91558..fec76f8 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -43,4 +43,5 @@ export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSI export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" -./script/$BUILD_VER +source script/$BUILD_VER +./script/build.sh diff --git a/script/gcc b/script/gcc new file mode 100644 index 0000000..ac99cdd --- /dev/null +++ b/script/gcc @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source script/gcc-7.3.0 diff --git a/script/gcc-4.7.3 b/script/gcc-4.7.3 index 92b7aae..f256300 100755 --- a/script/gcc-4.7.3 +++ b/script/gcc-4.7.3 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS}" export GCC_EXTRA_CFLAGS="-std=gnu90" - -./script/build.sh diff --git a/script/gcc-4.8.4 b/script/gcc-4.8.4 index 201fbaf..6c55945 100755 --- a/script/gcc-4.8.4 +++ b/script/gcc-4.8.4 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" export GCC_EXTRA_CFLAGS="-std=gnu90" - -./script/build.sh diff --git a/script/gcc-4.8.5 b/script/gcc-4.8.5 index 4aca656..ecb8df6 100755 --- a/script/gcc-4.8.5 +++ b/script/gcc-4.8.5 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" export GCC_EXTRA_CFLAGS="-std=gnu90" - -./script/build.sh diff --git a/script/gcc-4.9.2 b/script/gcc-4.9.2 index d1fa62b..d760432 100755 --- a/script/gcc-4.9.2 +++ b/script/gcc-4.9.2 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" export GCC_EXTRA_CFLAGS="-std=gnu90" - -./script/build.sh diff --git a/script/gcc-4.9.3 b/script/gcc-4.9.3 index 4f77562..3310b9c 100755 --- a/script/gcc-4.9.3 +++ b/script/gcc-4.9.3 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" export GCC_EXTRA_CFLAGS="-std=gnu90" - -./script/build.sh diff --git a/script/gcc-4.9.4 b/script/gcc-4.9.4 index b31591c..a5e02f5 100755 --- a/script/gcc-4.9.4 +++ b/script/gcc-4.9.4 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--enable-lto \ ${GCC_CONFIGURE_OPTIONS}" export GCC_EXTRA_CFLAGS="-std=gnu90" - -./script/build.sh diff --git a/script/gcc-5.1.0 b/script/gcc-5.1.0 index de6400a..cb1f06a 100755 --- a/script/gcc-5.1.0 +++ b/script/gcc-5.1.0 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-5.2.0 b/script/gcc-5.2.0 index a6b6be2..9e7dd6b 100755 --- a/script/gcc-5.2.0 +++ b/script/gcc-5.2.0 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-5.3.0 b/script/gcc-5.3.0 index 2cc23ff..8de1cec 100755 --- a/script/gcc-5.3.0 +++ b/script/gcc-5.3.0 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-5.4.0 b/script/gcc-5.4.0 index c02b761..23ed87b 100755 --- a/script/gcc-5.4.0 +++ b/script/gcc-5.4.0 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-5.5.0 b/script/gcc-5.5.0 index 2ef3ada..dad661b 100755 --- a/script/gcc-5.5.0 +++ b/script/gcc-5.5.0 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-6.1.0 b/script/gcc-6.1.0 index 253206d..34a8778 100755 --- a/script/gcc-6.1.0 +++ b/script/gcc-6.1.0 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-6.2.0 b/script/gcc-6.2.0 index 9a8319d..de274e8 100755 --- a/script/gcc-6.2.0 +++ b/script/gcc-6.2.0 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-6.3.0 b/script/gcc-6.3.0 index d45235d..b49ebd1 100755 --- a/script/gcc-6.3.0 +++ b/script/gcc-6.3.0 @@ -13,5 +13,3 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-6.4.0 b/script/gcc-6.4.0 index dcc3345..7af2f1d 100755 --- a/script/gcc-6.4.0 +++ b/script/gcc-6.4.0 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ --enable-libstdcxx-filesystem-ts \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-7.1.0 b/script/gcc-7.1.0 index 0833d5f..a1c898f 100755 --- a/script/gcc-7.1.0 +++ b/script/gcc-7.1.0 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ --enable-libstdcxx-filesystem-ts \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-7.2.0 b/script/gcc-7.2.0 index f75d4ae..728bb7e 100644 --- a/script/gcc-7.2.0 +++ b/script/gcc-7.2.0 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ --enable-libstdcxx-filesystem-ts \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh diff --git a/script/gcc-7.3.0 b/script/gcc-7.3.0 index 3ce283f..75d3a2a 100644 --- a/script/gcc-7.3.0 +++ b/script/gcc-7.3.0 @@ -14,5 +14,3 @@ export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ --enable-libstdcxx-filesystem-ts \ ${GCC_CONFIGURE_OPTIONS}" - -./script/build.sh From eba536a22d7404de7fea3d8e299d1ed5dca77d20 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 05:26:01 +0100 Subject: [PATCH 069/536] integrate build.sh in build.djgpp.sh. --- build-djgpp.sh | 373 +++++++++++++++++++++++++++++++++++++++++++++++- script/build.sh | 372 ----------------------------------------------- 2 files changed, 372 insertions(+), 373 deletions(-) delete mode 100644 script/build.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index fec76f8..57cacd4 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -44,4 +44,375 @@ export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSI export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" source script/$BUILD_VER -./script/build.sh + +CC=gcc +CXX=g++ + +# use gmake under FreeBSD +if [ `uname` = "FreeBSD" ]; then + MAKE=gmake + CC=clang + CXX=clang++ +else + MAKE=make +fi + +export CC CXX CFLAGS MAKE + +# check required programs +REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" + +# MinGW doesn't have curl, so we use wget. +if ! which curl > /dev/null; then + USE_WGET=1 +fi + +# use curl or wget? +if [ ! -z $USE_WGET ]; then + REQ_PROG_LIST+=" wget" +else + REQ_PROG_LIST+=" curl" +fi + +for REQ_PROG in $REQ_PROG_LIST; do + if ! which $REQ_PROG > /dev/null; then + echo "$REQ_PROG not installed" + exit 1 + fi +done + +# check GNU sed is installed or not. +# It is for OSX, which doesn't ship with GNU sed. +if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then + echo GNU sed is not installed, need to download. + SED_VERSION=4.2.2 + SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" +else + SED_ARCHIVE="" +fi + +# check zlib is installed +if ! ${CC} test-zlib.c -o test-zlib -lz; then + echo "zlib not installed" + exit 1 +fi +rm test-zlib 2>/dev/null +rm test-zlib.exe 2>/dev/null + +DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" +# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. +OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} + +# download source files +ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE + $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" + +echo "Download source files..." +mkdir -p download || exit 1 +cd download + +for ARCHIVE in $ARCHIVE_LIST; do + FILE=`basename $ARCHIVE` + if ! [ -f $FILE ]; then + echo "Download $ARCHIVE ..." + if [ ! -z $USE_WGET ]; then + DL_CMD="wget -U firefox $ARCHIVE" + else + DL_CMD="curl -f $ARCHIVE -L -o $FILE" + fi + echo "Command : $DL_CMD" + if ! eval $DL_CMD; then + if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then + echo "$FILE maybe moved to deleted/ directory." + else + rm $FILE + echo "Download $ARCHIVE failed." + exit 1 + fi + fi + fi +done +cd .. + +# create target directory, check writable. +echo "Make prefix directory : $DJGPP_PREFIX" +mkdir -p $DJGPP_PREFIX + +if ! [ -d $DJGPP_PREFIX ]; then + echo "Unable to create prefix directory" + exit 1 +fi + +if ! [ -w $DJGPP_PREFIX ]; then + echo "prefix directory is not writable." + exit 1 +fi + +mkdir -p ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/ || exit 1 + +# make build dir +echo "Make build dir" +mkdir -p build || exit 1 +cd build + +if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed ]; then + # build binutils + echo "Building binutils" + rm -rf bnu${BINUTILS_VERSION}s + mkdir bnu${BINUTILS_VERSION}s + cd bnu${BINUTILS_VERSION}s + unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 + cd gnu/binutils-* || exit + + # patch for binutils 2.27 + [ ${BINUTILS_VERSION} == 227 ] && ( patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 ) + + # exec permission of some files are not set, fix it. + for EXEC_FILE in install-sh missing; do + echo "chmod a+x $EXEC_FILE" + chmod a+x $EXEC_FILE || exit 1 + done + + sh ./configure \ + --prefix=$DJGPP_PREFIX \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --disable-werror \ + --disable-nls \ + || exit 1 + + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 + ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 + fi + + ${MAKE} -j${MAKE_JOBS} install || exit 1 + + cd ../../.. + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed + # binutils done +else + echo "Current binutils version already installed, skipping." + echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed" + sleep 5 +fi + +# prepare djcrx +echo "Prepare djcrx" +mkdir djcrx${DJCRX_VERSION} +cd djcrx${DJCRX_VERSION} +unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 +patch -p1 -u < ../../patch/patch-djcrx${DJCRX_VERSION}.txt || exit 1 + +cd src/stub +${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 +${CC} -O2 ${CFLAGS} stubedit.c -o stubedit || exit 1 + +cd ../.. + +mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 +cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 +cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 +cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 +cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + +cd .. +# djcrx done + +# build gcc +tar -xavf $(ls -t ../download/djcross-gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 +cd djcross-gcc-${GCC_VERSION}/ + +BUILDDIR=`pwd` + +if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then + echo "Building autoconf" + cd $BUILDDIR + tar -xavf $(ls -t ../../download/autoconf-${AUTOCONF_VERSION}.tar.* | head -n 1) || exit 1 + cd autoconf-${AUTOCONF_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + rm ${BUILDDIR}/tmpinst/autoconf-*-built + touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built +else + echo "autoconf already built, skipping." +fi + +if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then + echo "Building automake" + cd $BUILDDIR + tar -xavf $(ls -t ../../download/automake-${AUTOMAKE_VERSION}.tar.* | head -n 1) || exit 1 + cd automake-${AUTOMAKE_VERSION}/ + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ${MAKE} all install || exit 1 + rm ${BUILDDIR}/tmpinst/automake-*-built + touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built +else + echo "automake already built, skipping." +fi + +# build GNU sed if needed. +SED=sed +if [ ! -z $SED_VERSION ]; then + echo "Building sed" + cd $BUILDDIR + tar -xavf $(ls -t ../../download/sed-${SED_VERSION}.tar.* | head -n 1) || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + SED=$BUILDDIR/tmpinst/bin/sed +fi + +cd $BUILDDIR + +if [ ! -e gcc-unpacked ]; then + echo "Patch unpack-gcc.sh" + + if [ ${GCC_VERSION} == "4.7.3" ]; then + # gcc 4.7.3 unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive --use=`case $archive in *.gz|*.tgz) echo 'gzip';; *.bz2) echo 'bzip2';; *.xz) echo 'xz';; esac` && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) + $SED -i "s/\(cd gnu && tar x\)\([^-]*\)\([^&]*\)/\1j\2/" unpack-gcc.sh || exit 1 + else + # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) + $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || exit 1 + fi + + 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 + + echo "Running unpack-gcc.sh" + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + + # 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 - + + # copy stubify programs + cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin + + cd $BUILDDIR/ + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gnu/gcc-${GCC_VERSION_SHORT} + ./contrib/download_prerequisites + cd - + + touch gcc-unpacked +else + echo "gcc already unpacked, skipping." +fi + +echo "Building gcc" + +mkdir -p djcross || exit 1 +cd djcross + +TEMP_CFLAGS="$CFLAGS" +export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + +if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then + ${MAKE} distclean + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --prefix=$DJGPP_PREFIX \ + --disable-nls \ + --enable-libquadmath-support \ + --enable-version-specific-runtime-libs \ + --enable-languages=${ENABLE_LANGUAGES} \ + --enable-fat \ + ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${DJGPP_PREFIX} > gcc-configure-prefix +else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" + sleep 5 +fi + +${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 + +${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + +export CFLAGS="$TEMP_CFLAGS" + +echo "Copy long name executables to short name." +( + cd $DJGPP_PREFIX || exit 1 + SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" + for SHORT_NAME in $SHORT_NAME_LIST; do + if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then + cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME + fi + done +) || exit 1 + +# gcc done + +# build djlsr (for dxegen / exe2coff) +echo "Prepare djlsr" +cd $BUILDDIR +cd .. +rm -rf djlsr${DJLSR_VERSION} +mkdir djlsr${DJLSR_VERSION} +cd djlsr${DJLSR_VERSION} +unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 +unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 +unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 +patch -p1 -u < ../../patch/patch-djlsr${DJLSR_VERSION}.txt || exit 1 +if [ "$CC" == "gcc" ]; then + echo "Building DXE tools." + cd src + PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 + cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + cd .. +else + echo "Building DXE tools requires gcc, skip." +fi +cd src/stub +${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 +cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 +cd ../../.. +# djlsr done + +# copy setenv script +(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 + +echo "Testing DJGPP." +cd $BUILDDIR +cd .. +echo "Use DJGPP to build a test C program." +$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 + +for x in $(echo $ENABLE_LANGUAGES | tr "," " ") +do + case $x in + c++) + echo "Use DJGPP to build a test C++ program." + $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 + ;; + esac +done + +echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" +echo "To remove downloaded source tarballs, use: rm -rf download/" + diff --git a/script/build.sh b/script/build.sh deleted file mode 100644 index 8c7a3ca..0000000 --- a/script/build.sh +++ /dev/null @@ -1,372 +0,0 @@ -#!/usr/bin/env bash - -CC=gcc -CXX=g++ - -# use gmake under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ -else - MAKE=make -fi - -export CC CXX CFLAGS MAKE - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if ! which curl > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX - -if ! [ -d $DJGPP_PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $DJGPP_PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -mkdir -p ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/ || exit 1 - -# make build dir -echo "Make build dir" -mkdir -p build || exit 1 -cd build - -if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed ]; then - # build binutils - echo "Building binutils" - rm -rf bnu${BINUTILS_VERSION}s - mkdir bnu${BINUTILS_VERSION}s - cd bnu${BINUTILS_VERSION}s - unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - cd gnu/binutils-* || exit - - # patch for binutils 2.27 - [ ${BINUTILS_VERSION} == 227 ] && ( patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 ) - - # exec permission of some files are not set, fix it. - for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 - done - - sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - - ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 - ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 - fi - - ${MAKE} -j${MAKE_JOBS} install || exit 1 - - cd ../../.. - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed - # binutils done -else - echo "Current binutils version already installed, skipping." - echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed" - sleep 5 -fi - -# prepare djcrx -echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} -unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx${DJCRX_VERSION}.txt || exit 1 - -cd src/stub -${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 -${CC} -O2 ${CFLAGS} stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done - -# build gcc -tar -xavf $(ls -t ../download/djcross-gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then - echo "Building autoconf" - cd $BUILDDIR - tar -xavf $(ls -t ../../download/autoconf-${AUTOCONF_VERSION}.tar.* | head -n 1) || exit 1 - cd autoconf-${AUTOCONF_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - rm ${BUILDDIR}/tmpinst/autoconf-*-built - touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built -else - echo "autoconf already built, skipping." -fi - -if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then - echo "Building automake" - cd $BUILDDIR - tar -xavf $(ls -t ../../download/automake-${AUTOMAKE_VERSION}.tar.* | head -n 1) || exit 1 - cd automake-${AUTOMAKE_VERSION}/ - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ${MAKE} all install || exit 1 - rm ${BUILDDIR}/tmpinst/automake-*-built - touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built -else - echo "automake already built, skipping." -fi - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar -xavf $(ls -t ../../download/sed-${SED_VERSION}.tar.* | head -n 1) || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR - -if [ ! -e gcc-unpacked ]; then - echo "Patch unpack-gcc.sh" - - if [ ${GCC_VERSION} == "4.7.3" ]; then - # gcc 4.7.3 unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive --use=`case $archive in *.gz|*.tgz) echo 'gzip';; *.bz2) echo 'bzip2';; *.xz) echo 'xz';; esac` && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) - $SED -i "s/\(cd gnu && tar x\)\([^-]*\)\([^&]*\)/\1j\2/" unpack-gcc.sh || exit 1 - else - # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) - $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || exit 1 - fi - - 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 - - echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 - - # 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 - - - # copy stubify programs - cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin - - cd $BUILDDIR/ - - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gnu/gcc-${GCC_VERSION_SHORT} - ./contrib/download_prerequisites - cd - - - touch gcc-unpacked -else - echo "gcc already unpacked, skipping." -fi - -echo "Building gcc" - -mkdir -p djcross || exit 1 -cd djcross - -TEMP_CFLAGS="$CFLAGS" -export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - -if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then - ${MAKE} distclean - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - --enable-fat \ - ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${DJGPP_PREFIX} > gcc-configure-prefix -else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" - sleep 5 -fi - -${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - -export CFLAGS="$TEMP_CFLAGS" - -echo "Copy long name executables to short name." -( - cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME - fi - done -) || exit 1 - -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd $BUILDDIR -cd .. -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr${DJLSR_VERSION}.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. -# djlsr done - -# copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 - -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 - -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done - -echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" -echo "To remove downloaded source tarballs, use: rm -rf download/" From ef1ae8f109a84a7d37916dbe59ed14532a9157f2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 05:49:49 +0100 Subject: [PATCH 070/536] allow building specific packages separately. --- build-djgpp.sh | 401 +++++++++++++++++++++-------------------- script/binutils | 3 + script/binutils-2.29.1 | 6 + 3 files changed, 212 insertions(+), 198 deletions(-) create mode 100644 script/binutils create mode 100644 script/binutils-2.29.1 diff --git a/build-djgpp.sh b/build-djgpp.sh index 57cacd4..9fc29cd 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -1,21 +1,5 @@ #!/usr/bin/env bash -BUILD_VER=$1 - -if [ -z $BUILD_VER ]; then - echo "Usage : $0 djgpp-version" - echo "Supported djgpp-version :" - for F in `(cd script/;echo *.*.*)`; do echo " "$F; done - exit 1 -fi - -if [ ! -x script/$BUILD_VER ]; then - echo "Unsupported version : $BUILD_VER" - exit 1 -fi - -echo "Building version : $BUILD_VER" - unset CDPATH # target directory @@ -35,15 +19,28 @@ export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" export DJCRX_VERSION=205 export DJLSR_VERSION=205 export DJDEV_VERSION=205 -export BINUTILS_VERSION=2291 # source tarball locations -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" -source script/$BUILD_VER +if [ -z $1 ]; then + echo "Usage: $0 [packages...]" + echo "Supported packages:" + for F in `(cd script/;echo *)`; do echo " "$F; done + exit 1 +fi + +while [ ! -z $1 ]; do + if [ ! -x script/$1 ]; then + echo "Unsupported package: $1" + exit 1 + fi + + source script/$1 + shift +done CC=gcc CXX=g++ @@ -99,9 +96,11 @@ fi rm test-zlib 2>/dev/null rm test-zlib.exe 2>/dev/null -DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" -# djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. -OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} +if [ ! -z ${GCC_VERSION} ]; then + DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" + # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. + OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} +fi # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE @@ -156,51 +155,53 @@ echo "Make build dir" mkdir -p build || exit 1 cd build -if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed ]; then - # build binutils - echo "Building binutils" - rm -rf bnu${BINUTILS_VERSION}s - mkdir bnu${BINUTILS_VERSION}s - cd bnu${BINUTILS_VERSION}s - unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - cd gnu/binutils-* || exit - - # patch for binutils 2.27 - [ ${BINUTILS_VERSION} == 227 ] && ( patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 ) - - # exec permission of some files are not set, fix it. - for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 - done - - sh ./configure \ - --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --disable-werror \ - --disable-nls \ - || exit 1 - - ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 - ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 +if [ ! -z ${BINUTILS_VERSION} ]; then + if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed ]; then + # build binutils + echo "Building binutils" + rm -rf bnu${BINUTILS_VERSION}s + mkdir bnu${BINUTILS_VERSION}s + cd bnu${BINUTILS_VERSION}s + unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 + cd gnu/binutils-* || exit + + # patch for binutils 2.27 + [ ${BINUTILS_VERSION} == 227 ] && ( patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 ) + + # exec permission of some files are not set, fix it. + for EXEC_FILE in install-sh missing; do + echo "chmod a+x $EXEC_FILE" + chmod a+x $EXEC_FILE || exit 1 + done + + sh ./configure \ + --prefix=$DJGPP_PREFIX \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --disable-werror \ + --disable-nls \ + || exit 1 + + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 + ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 + fi + + ${MAKE} -j${MAKE_JOBS} install || exit 1 + + cd ../../.. + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed + # binutils done + else + echo "Current binutils version already installed, skipping." + echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed" + sleep 5 fi - - ${MAKE} -j${MAKE_JOBS} install || exit 1 - - cd ../../.. - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed - # binutils done -else - echo "Current binutils version already installed, skipping." - echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed" - sleep 5 fi # prepare djcrx @@ -225,136 +226,138 @@ cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 cd .. # djcrx done -# build gcc -tar -xavf $(ls -t ../download/djcross-gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 -cd djcross-gcc-${GCC_VERSION}/ - -BUILDDIR=`pwd` - -if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then - echo "Building autoconf" - cd $BUILDDIR - tar -xavf $(ls -t ../../download/autoconf-${AUTOCONF_VERSION}.tar.* | head -n 1) || exit 1 - cd autoconf-${AUTOCONF_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - rm ${BUILDDIR}/tmpinst/autoconf-*-built - touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built -else - echo "autoconf already built, skipping." -fi - -if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then - echo "Building automake" - cd $BUILDDIR - tar -xavf $(ls -t ../../download/automake-${AUTOMAKE_VERSION}.tar.* | head -n 1) || exit 1 - cd automake-${AUTOMAKE_VERSION}/ - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ${MAKE} all install || exit 1 - rm ${BUILDDIR}/tmpinst/automake-*-built - touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built -else - echo "automake already built, skipping." -fi - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - tar -xavf $(ls -t ../../download/sed-${SED_VERSION}.tar.* | head -n 1) || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed -fi - -cd $BUILDDIR - -if [ ! -e gcc-unpacked ]; then - echo "Patch unpack-gcc.sh" +if [ ! -z ${GCC_VERSION} ]; then + # build gcc + tar -xavf $(ls -t ../download/djcross-gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + cd djcross-gcc-${GCC_VERSION}/ + + BUILDDIR=`pwd` - if [ ${GCC_VERSION} == "4.7.3" ]; then - # gcc 4.7.3 unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive --use=`case $archive in *.gz|*.tgz) echo 'gzip';; *.bz2) echo 'bzip2';; *.xz) echo 'xz';; esac` && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) - $SED -i "s/\(cd gnu && tar x\)\([^-]*\)\([^&]*\)/\1j\2/" unpack-gcc.sh || exit 1 + if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then + echo "Building autoconf" + cd $BUILDDIR + tar -xavf $(ls -t ../../download/autoconf-${AUTOCONF_VERSION}.tar.* | head -n 1) || exit 1 + cd autoconf-${AUTOCONF_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + rm ${BUILDDIR}/tmpinst/autoconf-*-built + touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built else - # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) - $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || exit 1 + echo "autoconf already built, skipping." fi - if [ `uname` = "FreeBSD" ]; then - # The --verbose option is not recognized by BSD patch - $SED -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1 + if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then + echo "Building automake" + cd $BUILDDIR + tar -xavf $(ls -t ../../download/automake-${AUTOMAKE_VERSION}.tar.* | head -n 1) || exit 1 + cd automake-${AUTOMAKE_VERSION}/ + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ${MAKE} all install || exit 1 + rm ${BUILDDIR}/tmpinst/automake-*-built + touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built + else + echo "automake already built, skipping." fi - echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + # build GNU sed if needed. + SED=sed + if [ ! -z $SED_VERSION ]; then + echo "Building sed" + cd $BUILDDIR + tar -xavf $(ls -t ../../download/sed-${SED_VERSION}.tar.* | head -n 1) || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + SED=$BUILDDIR/tmpinst/bin/sed + 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 - # copy stubify programs - cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin + if [ ! -e gcc-unpacked ]; then + echo "Patch unpack-gcc.sh" + + if [ ${GCC_VERSION} == "4.7.3" ]; then + # gcc 4.7.3 unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive --use=`case $archive in *.gz|*.tgz) echo 'gzip';; *.bz2) echo 'bzip2';; *.xz) echo 'xz';; esac` && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) + $SED -i "s/\(cd gnu && tar x\)\([^-]*\)\([^&]*\)/\1j\2/" unpack-gcc.sh || exit 1 + else + # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX + # patch from : + # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) + # to : + # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) + $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || exit 1 + fi + + 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 + + echo "Running unpack-gcc.sh" + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + + # 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 - + + # copy stubify programs + cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin + + cd $BUILDDIR/ + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gnu/gcc-${GCC_VERSION_SHORT} + ./contrib/download_prerequisites + cd - + + touch gcc-unpacked + else + echo "gcc already unpacked, skipping." + fi - cd $BUILDDIR/ + echo "Building gcc" - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gnu/gcc-${GCC_VERSION_SHORT} - ./contrib/download_prerequisites - cd - + mkdir -p djcross || exit 1 + cd djcross - touch gcc-unpacked -else - echo "gcc already unpacked, skipping." -fi - -echo "Building gcc" - -mkdir -p djcross || exit 1 -cd djcross - -TEMP_CFLAGS="$CFLAGS" -export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - -if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then - ${MAKE} distclean - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ - --prefix=$DJGPP_PREFIX \ - --disable-nls \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - --enable-fat \ - ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${DJGPP_PREFIX} > gcc-configure-prefix -else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" - sleep 5 + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + + if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then + ${MAKE} distclean + PATH="$BUILDDIR//tmpinst/bin:$PATH" \ + ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ + --target=i586-pc-msdosdjgpp \ + --program-prefix=i586-pc-msdosdjgpp- \ + --prefix=$DJGPP_PREFIX \ + --disable-nls \ + --enable-libquadmath-support \ + --enable-version-specific-runtime-libs \ + --enable-languages=${ENABLE_LANGUAGES} \ + --enable-fat \ + ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${DJGPP_PREFIX} > gcc-configure-prefix + else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 + + ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + + export CFLAGS="$TEMP_CFLAGS" fi -${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - -${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - -export CFLAGS="$TEMP_CFLAGS" - echo "Copy long name executables to short name." ( cd $DJGPP_PREFIX || exit 1 @@ -397,21 +400,23 @@ cd ../../.. # copy setenv script (cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 -echo "Testing DJGPP." -cd $BUILDDIR -cd .. -echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 - -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac -done +if [ ! -z ${GCC_VERSION} ]; then + echo "Testing DJGPP." + cd $BUILDDIR + cd .. + echo "Use DJGPP to build a test C program." + $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 + + for x in $(echo $ENABLE_LANGUAGES | tr "," " ") + do + case $x in + c++) + echo "Use DJGPP to build a test C++ program." + $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 + ;; + esac + done +fi echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" echo "To remove downloaded source tarballs, use: rm -rf download/" diff --git a/script/binutils b/script/binutils new file mode 100644 index 0000000..fcfadc7 --- /dev/null +++ b/script/binutils @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source script/binutils-2.29.1 diff --git a/script/binutils-2.29.1 b/script/binutils-2.29.1 new file mode 100644 index 0000000..900f0f2 --- /dev/null +++ b/script/binutils-2.29.1 @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +export BINUTILS_VERSION=2291 +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" + +export BINUTILS_CONFIGURE_OPTIONS="${BINUTILS_CONFIGURE_OPTIONS}" From 4a792088f08322450c7ccf98cc319ba36f471746 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 05:55:27 +0100 Subject: [PATCH 071/536] set executable bit on scripts (blame windows) --- script/binutils | 0 script/binutils-2.29.1 | 0 script/gcc | 0 script/gcc-7.2.0 | 0 script/gcc-7.3.0 | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 script/binutils mode change 100644 => 100755 script/binutils-2.29.1 mode change 100644 => 100755 script/gcc mode change 100644 => 100755 script/gcc-7.2.0 mode change 100644 => 100755 script/gcc-7.3.0 diff --git a/script/binutils b/script/binutils old mode 100644 new mode 100755 diff --git a/script/binutils-2.29.1 b/script/binutils-2.29.1 old mode 100644 new mode 100755 diff --git a/script/gcc b/script/gcc old mode 100644 new mode 100755 diff --git a/script/gcc-7.2.0 b/script/gcc-7.2.0 old mode 100644 new mode 100755 diff --git a/script/gcc-7.3.0 b/script/gcc-7.3.0 old mode 100644 new mode 100755 From 83f15ff46d4421ba229a313ffbdba1de71111003 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 05:59:28 +0100 Subject: [PATCH 072/536] allow user to specify CC/CXX/MAKE. --- build-djgpp.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 9fc29cd..c98a15b 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -42,16 +42,15 @@ while [ ! -z $1 ]; do shift done -CC=gcc -CXX=g++ - -# use gmake under FreeBSD +# use gmake/clang under FreeBSD if [ `uname` = "FreeBSD" ]; then - MAKE=gmake - CC=clang - CXX=clang++ + MAKE=${MAKE-gmake} + CC=${CC-clang} + CXX=${CXX-clang++} else - MAKE=make + MAKE=${MAKE-make} + CC=${CC-gcc} + CXX=${CXX-g++} fi export CC CXX CFLAGS MAKE From 5701f13ac7e979cb2caee1f40ee47c68a239288b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 06:00:31 +0100 Subject: [PATCH 073/536] remove unnecessary exports --- build-djgpp.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index c98a15b..8b1a3a5 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -3,27 +3,27 @@ unset CDPATH # target directory -export DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} +DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} # enabled languages #ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -export ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} +ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads -export MAKE_JOBS=${MAKE_JOBS-4} +MAKE_JOBS=${MAKE_JOBS-4} #DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" # source tarball versions -export DJCRX_VERSION=205 -export DJLSR_VERSION=205 -export DJDEV_VERSION=205 +DJCRX_VERSION=205 +DJLSR_VERSION=205 +DJDEV_VERSION=205 # source tarball locations -export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" +DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" +DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" +DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" if [ -z $1 ]; then echo "Usage: $0 [packages...]" From ad26b48ead137122354b790d132b89bc43dd629c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 06:19:43 +0100 Subject: [PATCH 074/536] allow user to review options before building. --- build-djgpp.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index 8b1a3a5..595fa50 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -55,6 +55,24 @@ fi export CC CXX CFLAGS MAKE +echo "You are about to build and install:" +[ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" +[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" +echo "" +echo "With the following options:" +echo " DJGPP_PREFIX=${DJGPP_PREFIX}" +echo " MAKE_JOBS=${MAKE_JOBS}" +if [ ! -z ${GCC_VERSION} ]; then + echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" + echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" +fi +if [ ! -z ${BINUTILS_VERSION} ]; then + echo " BINUTILS_CONFIGURE_OPTIONS=${BINUTILS_CONFIGURE_OPTIONS}" +fi +echo "" +echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." +read -s -n 1 + # check required programs REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" From b1a557db97e4208e71b572214aaa8b2d2b74f0fa Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 06:24:11 +0100 Subject: [PATCH 075/536] display more variables before building. --- build-djgpp.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 595fa50..4e23678 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -53,7 +53,7 @@ else CXX=${CXX-g++} fi -export CC CXX CFLAGS MAKE +export CC CXX MAKE echo "You are about to build and install:" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" @@ -61,13 +61,19 @@ echo "You are about to build and install:" echo "" echo "With the following options:" echo " DJGPP_PREFIX=${DJGPP_PREFIX}" +echo " CC=${CC}" +echo " CXX=${CXX}" +echo " CFLAGS=${CFLAGS}" +echo " CXXFLAGS=${CXXFLAGS}" +echo " LDFLAGS=${LDFLAGS}" +echo " MAKE=${MAKE}" echo " MAKE_JOBS=${MAKE_JOBS}" if [ ! -z ${GCC_VERSION} ]; then echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" fi if [ ! -z ${BINUTILS_VERSION} ]; then - echo " BINUTILS_CONFIGURE_OPTIONS=${BINUTILS_CONFIGURE_OPTIONS}" + echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" fi echo "" echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." From c926052cb374ea7afffa35a4aa993f3a86dd6846 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 06:28:28 +0100 Subject: [PATCH 076/536] add package scripts 'all' and 'default' --- script/all | 3 +++ script/default | 4 ++++ 2 files changed, 7 insertions(+) create mode 100755 script/all create mode 100755 script/default diff --git a/script/all b/script/all new file mode 100755 index 0000000..8b58ef6 --- /dev/null +++ b/script/all @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source script/default diff --git a/script/default b/script/default new file mode 100755 index 0000000..2a03a72 --- /dev/null +++ b/script/default @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +source script/binutils +source script/gcc From fccd7c305dcd0376b66384739166a224acbd29ab Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 06:51:17 +0100 Subject: [PATCH 077/536] fix directories --- build-djgpp.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 4e23678..a511ac6 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -25,6 +25,8 @@ DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" +BASE=`pwd` + if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" @@ -229,8 +231,8 @@ fi # prepare djcrx echo "Prepare djcrx" -mkdir djcrx${DJCRX_VERSION} -cd djcrx${DJCRX_VERSION} +mkdir -p ${BASE}/build/djcrx${DJCRX_VERSION} +cd ${BASE}/build/djcrx${DJCRX_VERSION} unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 patch -p1 -u < ../../patch/patch-djcrx${DJCRX_VERSION}.txt || exit 1 @@ -396,8 +398,7 @@ echo "Copy long name executables to short name." # build djlsr (for dxegen / exe2coff) echo "Prepare djlsr" -cd $BUILDDIR -cd .. +cd ${BASE}/build/ rm -rf djlsr${DJLSR_VERSION} mkdir djlsr${DJLSR_VERSION} cd djlsr${DJLSR_VERSION} @@ -417,11 +418,11 @@ fi cd src/stub ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ../../.. +cd ${BASE} # djlsr done # copy setenv script -(cd $BUILDDIR/../../setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 +(cd ${BASE}/setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 if [ ! -z ${GCC_VERSION} ]; then echo "Testing DJGPP." From d3d86b98a93bafeee3574ae9d5e2eaab0d907c0e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 07:00:53 +0100 Subject: [PATCH 078/536] move base djgpp library to package base --- build-djgpp.sh | 110 +++++++++++++++++++++++-------------------------- script/base | 11 +++++ script/default | 1 + 3 files changed, 64 insertions(+), 58 deletions(-) create mode 100755 script/base diff --git a/build-djgpp.sh b/build-djgpp.sh index a511ac6..a244ccd 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -15,16 +15,6 @@ MAKE_JOBS=${MAKE_JOBS-4} #DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" -# source tarball versions -DJCRX_VERSION=205 -DJLSR_VERSION=205 -DJDEV_VERSION=205 - -# source tarball locations -DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" - BASE=`pwd` if [ -z $1 ]; then @@ -229,27 +219,29 @@ if [ ! -z ${BINUTILS_VERSION} ]; then fi fi -# prepare djcrx -echo "Prepare djcrx" -mkdir -p ${BASE}/build/djcrx${DJCRX_VERSION} -cd ${BASE}/build/djcrx${DJCRX_VERSION} -unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 -patch -p1 -u < ../../patch/patch-djcrx${DJCRX_VERSION}.txt || exit 1 - -cd src/stub -${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 -${CC} -O2 ${CFLAGS} stubedit.c -o stubedit || exit 1 - -cd ../.. - -mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 -cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 -cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 -cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - -cd .. -# djcrx done +if [ ! -z ${DJCRX_VERSION} ]; then + # prepare djcrx + echo "Prepare djcrx" + mkdir -p ${BASE}/build/djcrx${DJCRX_VERSION} + cd ${BASE}/build/djcrx${DJCRX_VERSION} + unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 + patch -p1 -u < ../../patch/patch-djcrx${DJCRX_VERSION}.txt || exit 1 + + cd src/stub + ${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 + ${CC} -O2 ${CFLAGS} stubedit.c -o stubedit || exit 1 + + cd ../.. + + mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 + cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 + cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 + cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + + cd .. + # djcrx done +fi if [ ! -z ${GCC_VERSION} ]; then # build gcc @@ -383,6 +375,35 @@ if [ ! -z ${GCC_VERSION} ]; then export CFLAGS="$TEMP_CFLAGS" fi +# gcc done + +if [ ! -z ${DJLSR_VERSION} ]; then + # build djlsr (for dxegen / exe2coff) + echo "Prepare djlsr" + cd ${BASE}/build/ + rm -rf djlsr${DJLSR_VERSION} + mkdir djlsr${DJLSR_VERSION} + cd djlsr${DJLSR_VERSION} + unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 + unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 + unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 + patch -p1 -u < ../../patch/patch-djlsr${DJLSR_VERSION}.txt || exit 1 + if [ "$CC" == "gcc" ]; then + echo "Building DXE tools." + cd src + PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 + cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + cd .. + else + echo "Building DXE tools requires gcc, skip." + fi + cd src/stub + ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 + cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + cd ${BASE} + # djlsr done +fi + echo "Copy long name executables to short name." ( cd $DJGPP_PREFIX || exit 1 @@ -394,33 +415,6 @@ echo "Copy long name executables to short name." done ) || exit 1 -# gcc done - -# build djlsr (for dxegen / exe2coff) -echo "Prepare djlsr" -cd ${BASE}/build/ -rm -rf djlsr${DJLSR_VERSION} -mkdir djlsr${DJLSR_VERSION} -cd djlsr${DJLSR_VERSION} -unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 -unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 -patch -p1 -u < ../../patch/patch-djlsr${DJLSR_VERSION}.txt || exit 1 -if [ "$CC" == "gcc" ]; then - echo "Building DXE tools." - cd src - PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. -else - echo "Building DXE tools requires gcc, skip." -fi -cd src/stub -${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 -cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 -cd ${BASE} -# djlsr done - # copy setenv script (cd ${BASE}/setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 diff --git a/script/base b/script/base new file mode 100755 index 0000000..746d350 --- /dev/null +++ b/script/base @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# source tarball versions +export DJCRX_VERSION=205 +export DJLSR_VERSION=205 +export DJDEV_VERSION=205 + +# source tarball locations +export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" +export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" +export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" diff --git a/script/default b/script/default index 2a03a72..77f1e74 100755 --- a/script/default +++ b/script/default @@ -1,4 +1,5 @@ #!/usr/bin/env bash +source script/base source script/binutils source script/gcc From e697979d36585e2fee78867c380d1332df36ddb7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 07:12:58 +0100 Subject: [PATCH 079/536] also install long name versions of stubify/stubedit/exe2coff etc. --- build-djgpp.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index a244ccd..9137c88 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -48,6 +48,7 @@ fi export CC CXX MAKE echo "You are about to build and install:" +[ -z ${DJCRX_VERSION} ] || echo " - DJGPP base library ${DJCRX_VERSION}" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" [ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" echo "" @@ -228,16 +229,16 @@ if [ ! -z ${DJCRX_VERSION} ]; then patch -p1 -u < ../../patch/patch-djcrx${DJCRX_VERSION}.txt || exit 1 cd src/stub - ${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 - ${CC} -O2 ${CFLAGS} stubedit.c -o stubedit || exit 1 + ${CC} -O2 ${CFLAGS} stubify.c -o i586-pc-msdosdjgpp-stubify || exit 1 + ${CC} -O2 ${CFLAGS} stubedit.c -o i586-pc-msdosdjgpp-stubedit || exit 1 cd ../.. mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 - cp -p src/stub/stubify $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cp -p src/stub/stubedit $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + cp -p src/stub/i586-pc-msdosdjgpp-stubify $DJGPP_PREFIX/bin/ || exit 1 + cp -p src/stub/i586-pc-msdosdjgpp-stubedit $DJGPP_PREFIX/bin/ || exit 1 cd .. # djcrx done @@ -326,7 +327,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - # copy stubify programs - cp $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/stubify $BUILDDIR/tmpinst/bin + cp -p $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-stubify $BUILDDIR/tmpinst/bin/stubify cd $BUILDDIR/ @@ -392,14 +393,17 @@ if [ ! -z ${DJLSR_VERSION} ]; then echo "Building DXE tools." cd src PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 - cp dxe/dxegen dxe/dxe3gen dxe/dxe3res $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 - cd .. + cd dxe + cp -p dxegen $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-dxegen || exit 1 + cp -p dxe3gen $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-dxe3gen || exit 1 + cp -p dxe3res $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-dxe3res || exit 1 + cd ../.. else echo "Building DXE tools requires gcc, skip." fi cd src/stub ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 - cp -p exe2coff $DJGPP_PREFIX/i586-pc-msdosdjgpp/bin/ || exit 1 + cp -p exe2coff $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-exe2coff || exit 1 cd ${BASE} # djlsr done fi @@ -407,10 +411,10 @@ fi echo "Copy long name executables to short name." ( cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings" + SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then - cp bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME + cp -p bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME fi done ) || exit 1 From 706c0872917bba2ca8794220bca3d4ff6940ea31 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 07:23:36 +0100 Subject: [PATCH 080/536] use BINUTILS_CONFIGURE_OPTIONS --- build-djgpp.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index 9137c88..bba6dfa 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -196,6 +196,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then --program-prefix=i586-pc-msdosdjgpp- \ --disable-werror \ --disable-nls \ + ${BINUTILS_CONFIGURE_OPTIONS} \ || exit 1 ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 From 96568d02415cbccc369f64d21ea897f8a447528b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 07:45:13 +0100 Subject: [PATCH 081/536] added new package: gdb 8.0.1 --- build-djgpp.sh | 38 ++++++++++++++++++++++++++++++++++++-- script/all | 1 + script/gdb | 3 +++ script/gdb-8.0.1 | 4 ++++ 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 script/gdb create mode 100755 script/gdb-8.0.1 diff --git a/build-djgpp.sh b/build-djgpp.sh index bba6dfa..d492c8b 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -51,6 +51,7 @@ echo "You are about to build and install:" [ -z ${DJCRX_VERSION} ] || echo " - DJGPP base library ${DJCRX_VERSION}" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" [ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" +[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" echo "" echo "With the following options:" echo " DJGPP_PREFIX=${DJGPP_PREFIX}" @@ -68,6 +69,9 @@ fi if [ ! -z ${BINUTILS_VERSION} ]; then echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" fi +if [ ! -z ${GDB_VERSION} ]; then + echo " GDB_CONFIGURE_OPTIONS=`echo ${GDB_CONFIGURE_OPTIONS}`" +fi echo "" echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." read -s -n 1 @@ -121,7 +125,7 @@ fi # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE" + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE" echo "Download source files..." mkdir -p download || exit 1 @@ -409,10 +413,40 @@ if [ ! -z ${DJLSR_VERSION} ]; then # djlsr done fi +if [ ! -z ${GDB_VERSION} ]; then + if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed ]; then + cd ${BASE}/build + if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then + echo "Unpacking gdb." + tar -xavf $(ls -t ../download/gdb-${GDB_VERSION}.tar.* | head -n 1) || exit 1 + touch gdb-${GDB_VERSION}/gdb-unpacked + fi + rm -rf gdb-${GDB_VERSION}/build + mkdir -p gdb-${GDB_VERSION}/build + cd gdb-${GDB_VERSION}/build || exit 1 + echo "Building gdb." + ../configure \ + --prefix=${DJGPP_PREFIX} \ + --target=i586-pc-msdosdjgpp \ + --disable-werror \ + --disable-nls \ + ${GDB_CONFIGURE_OPTIONS} \ + || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed + else + echo "Current gdb version already installed, skipping." + echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed" + sleep 5 + fi +fi + echo "Copy long name executables to short name." ( cd $DJGPP_PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit" + SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then cp -p bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME diff --git a/script/all b/script/all index 8b58ef6..70731b8 100755 --- a/script/all +++ b/script/all @@ -1,3 +1,4 @@ #!/usr/bin/env bash source script/default +source script/gdb diff --git a/script/gdb b/script/gdb new file mode 100755 index 0000000..6cd8fce --- /dev/null +++ b/script/gdb @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source script/gdb-8.0.1 diff --git a/script/gdb-8.0.1 b/script/gdb-8.0.1 new file mode 100755 index 0000000..7f6c200 --- /dev/null +++ b/script/gdb-8.0.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GDB_VERSION=8.0.1 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From f1df212db1ecf6d38b4a03ec0462123cc9b65c11 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 07:48:51 +0100 Subject: [PATCH 082/536] copy long file name tools only if they exist. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index d492c8b..be09c40 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -448,7 +448,7 @@ echo "Copy long name executables to short name." cd $DJGPP_PREFIX || exit 1 SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-gcc ]; then + if [ -f bin/i586-pc-msdosdjgpp-$SHORT_NAME ]; then cp -p bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME fi done From 66baaeef5a6299d310946ce8e37653b549716eed Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 08:04:43 +0100 Subject: [PATCH 083/536] some minor tweaks --- build-djgpp.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index be09c40..e6b9b39 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -63,8 +63,8 @@ echo " LDFLAGS=${LDFLAGS}" echo " MAKE=${MAKE}" echo " MAKE_JOBS=${MAKE_JOBS}" if [ ! -z ${GCC_VERSION} ]; then - echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" + echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" fi if [ ! -z ${BINUTILS_VERSION} ]; then echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" @@ -452,7 +452,7 @@ echo "Copy long name executables to short name." cp -p bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME fi done -) || exit 1 +) # copy setenv script (cd ${BASE}/setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 @@ -475,6 +475,6 @@ if [ ! -z ${GCC_VERSION} ]; then done fi -echo "build-djgpp.sh done. To remove temporary build files, use: rm -rf build/" -echo "To remove downloaded source tarballs, use: rm -rf download/" - +echo "build-djgpp.sh done." +echo "To remove temporary build files, use: rm -rf build/" +echo "To remove downloaded source packages, use: rm -rf download/" From 0561f20ff4f50ae89b74c5bf1ac4e619f302f18c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 10:51:20 +0100 Subject: [PATCH 084/536] use a single variable DJGPP_VERSION for base packages. --- build-djgpp.sh | 28 ++++++++++++++-------------- script/base | 10 ++++------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index e6b9b39..9035cde 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -48,7 +48,7 @@ fi export CC CXX MAKE echo "You are about to build and install:" -[ -z ${DJCRX_VERSION} ] || echo " - DJGPP base library ${DJCRX_VERSION}" +[ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" [ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" [ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" @@ -225,13 +225,13 @@ if [ ! -z ${BINUTILS_VERSION} ]; then fi fi -if [ ! -z ${DJCRX_VERSION} ]; then +if [ ! -z ${DJGPP_VERSION} ]; then # prepare djcrx echo "Prepare djcrx" - mkdir -p ${BASE}/build/djcrx${DJCRX_VERSION} - cd ${BASE}/build/djcrx${DJCRX_VERSION} - unzip -o ../../download/djcrx${DJCRX_VERSION}.zip || exit 1 - patch -p1 -u < ../../patch/patch-djcrx${DJCRX_VERSION}.txt || exit 1 + mkdir -p ${BASE}/build/djcrx${DJGPP_VERSION} + cd ${BASE}/build/djcrx${DJGPP_VERSION} + unzip -o ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 + patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 cd src/stub ${CC} -O2 ${CFLAGS} stubify.c -o i586-pc-msdosdjgpp-stubify || exit 1 @@ -383,17 +383,17 @@ fi # gcc done -if [ ! -z ${DJLSR_VERSION} ]; then +if [ ! -z ${DJGPP_VERSION} ]; then # build djlsr (for dxegen / exe2coff) echo "Prepare djlsr" cd ${BASE}/build/ - rm -rf djlsr${DJLSR_VERSION} - mkdir djlsr${DJLSR_VERSION} - cd djlsr${DJLSR_VERSION} - unzip ../../download/djlsr${DJLSR_VERSION}.zip || exit 1 - unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*/*" || exit 1 - unzip -o ../../download/djdev${DJDEV_VERSION}.zip "include/*" || exit 1 - patch -p1 -u < ../../patch/patch-djlsr${DJLSR_VERSION}.txt || exit 1 + rm -rf djlsr${DJGPP_VERSION} + mkdir djlsr${DJGPP_VERSION} + cd djlsr${DJGPP_VERSION} + unzip ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 + unzip -o ../../download/djdev${DJGPP_VERSION}.zip "include/*/*" || exit 1 + unzip -o ../../download/djdev${DJGPP_VERSION}.zip "include/*" || exit 1 + patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 if [ "$CC" == "gcc" ]; then echo "Building DXE tools." cd src diff --git a/script/base b/script/base index 746d350..a279d74 100755 --- a/script/base +++ b/script/base @@ -1,11 +1,9 @@ #!/usr/bin/env bash # source tarball versions -export DJCRX_VERSION=205 -export DJLSR_VERSION=205 -export DJDEV_VERSION=205 +export DJGPP_VERSION=205 # source tarball locations -export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJCRX_VERSION}.zip" -export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJLSR_VERSION}.zip" -export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJDEV_VERSION}.zip" +export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJGPP_VERSION}.zip" +export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJGPP_VERSION}.zip" +export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJGPP_VERSION}.zip" From 2cc9196575cbcfb91c5d3ee8486baf09f04f8bae Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 11:11:10 +0100 Subject: [PATCH 085/536] unzip all djgpp packages in one directory. --- build-djgpp.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 9035cde..829f927 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -226,11 +226,13 @@ if [ ! -z ${BINUTILS_VERSION} ]; then fi if [ ! -z ${DJGPP_VERSION} ]; then - # prepare djcrx - echo "Prepare djcrx" - mkdir -p ${BASE}/build/djcrx${DJGPP_VERSION} - cd ${BASE}/build/djcrx${DJGPP_VERSION} + echo "Prepare djgpp" + mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} + cd ${BASE}/build/djgpp-${DJGPP_VERSION} || exit 1 + unzip -o ../../download/djdev${DJGPP_VERSION}.zip || exit 1 + unzip -o ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 unzip -o ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 + patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 cd src/stub @@ -246,7 +248,6 @@ if [ ! -z ${DJGPP_VERSION} ]; then cp -p src/stub/i586-pc-msdosdjgpp-stubedit $DJGPP_PREFIX/bin/ || exit 1 cd .. - # djcrx done fi if [ ! -z ${GCC_VERSION} ]; then @@ -385,15 +386,7 @@ fi if [ ! -z ${DJGPP_VERSION} ]; then # build djlsr (for dxegen / exe2coff) - echo "Prepare djlsr" - cd ${BASE}/build/ - rm -rf djlsr${DJGPP_VERSION} - mkdir djlsr${DJGPP_VERSION} - cd djlsr${DJGPP_VERSION} - unzip ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 - unzip -o ../../download/djdev${DJGPP_VERSION}.zip "include/*/*" || exit 1 - unzip -o ../../download/djdev${DJGPP_VERSION}.zip "include/*" || exit 1 - patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 + cd ${BASE}/build/djgpp-${DJGPP_VERSION} if [ "$CC" == "gcc" ]; then echo "Building DXE tools." cd src From 8516763e9b0091b1c0865043101f946414c4efac Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 11:47:42 +0100 Subject: [PATCH 086/536] build binutils like gcc (avoid unpacking and configuring, always run make & install) --- build-djgpp.sh | 87 ++++++++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 38 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 829f927..a6e9364 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -172,29 +172,33 @@ mkdir -p ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/ || exit 1 # make build dir echo "Make build dir" -mkdir -p build || exit 1 -cd build +mkdir -p ${BASE}/build +cd build || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then - if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed ]; then - # build binutils - echo "Building binutils" - rm -rf bnu${BINUTILS_VERSION}s - mkdir bnu${BINUTILS_VERSION}s - cd bnu${BINUTILS_VERSION}s + echo "Building binutils" + mkdir bnu${BINUTILS_VERSION}s + cd bnu${BINUTILS_VERSION}s + if [ ! -e binutils-unpacked ]; then unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - cd gnu/binutils-* || exit - + # patch for binutils 2.27 - [ ${BINUTILS_VERSION} == 227 ] && ( patch bfd/init.c ../../../../patch/patch-bnu27-bfd-init.txt || exit 1 ) - - # exec permission of some files are not set, fix it. - for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 - done - - sh ./configure \ + [ ${BINUTILS_VERSION} == 227 ] && (patch gnu/binutils-*/bfd/init.c ${BASE}/patch/patch-bnu27-bfd-init.txt || exit 1 ) + + touch binutils-unpacked + fi + cd gnu/binutils-* || exit 1 + + # exec permission of some files are not set, fix it. + for EXEC_FILE in install-sh missing; do + echo "chmod a+x $EXEC_FILE" + chmod a+x $EXEC_FILE || exit 1 + done + + mkdir build + cd build || exit 1 + if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${DJGPP_PREFIX}" ]; then + sh ../configure \ --prefix=$DJGPP_PREFIX \ --target=i586-pc-msdosdjgpp \ --program-prefix=i586-pc-msdosdjgpp- \ @@ -202,29 +206,28 @@ if [ ! -z ${BINUTILS_VERSION} ]; then --disable-nls \ ${BINUTILS_CONFIGURE_OPTIONS} \ || exit 1 - - ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 - ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 - fi - - ${MAKE} -j${MAKE_JOBS} install || exit 1 - - cd ../../.. - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed - # binutils done + echo ${DJGPP_PREFIX} > binutils-configure-prefix else - echo "Current binutils version already installed, skipping." - echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed" + echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi + + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 + ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 + fi + + ${MAKE} -j${MAKE_JOBS} install || exit 1 + + # binutils done fi +cd ${BASE}/build/ + if [ ! -z ${DJGPP_VERSION} ]; then echo "Prepare djgpp" mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} @@ -406,9 +409,10 @@ if [ ! -z ${DJGPP_VERSION} ]; then # djlsr done fi +cd ${BASE}/build + if [ ! -z ${GDB_VERSION} ]; then if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed ]; then - cd ${BASE}/build if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then echo "Unpacking gdb." tar -xavf $(ls -t ../download/gdb-${GDB_VERSION}.tar.* | head -n 1) || exit 1 @@ -426,7 +430,14 @@ if [ ! -z ${GDB_VERSION} ]; then ${GDB_CONFIGURE_OPTIONS} \ || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 + fi + ${MAKE} -j${MAKE_JOBS} install || exit 1 + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-*-installed touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed else From 7e521c9b334bef964bb20e3b58771fb74e1bbdb1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 11:52:41 +0100 Subject: [PATCH 087/536] same as last commit, but for gdb. --- build-djgpp.sh | 109 ++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 56 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index a6e9364..00b1d3a 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -29,7 +29,7 @@ while [ ! -z $1 ]; do echo "Unsupported package: $1" exit 1 fi - + source script/$1 shift done @@ -188,13 +188,13 @@ if [ ! -z ${BINUTILS_VERSION} ]; then touch binutils-unpacked fi cd gnu/binutils-* || exit 1 - + # exec permission of some files are not set, fix it. for EXEC_FILE in install-sh missing; do echo "chmod a+x $EXEC_FILE" chmod a+x $EXEC_FILE || exit 1 done - + mkdir build cd build || exit 1 if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${DJGPP_PREFIX}" ]; then @@ -211,18 +211,18 @@ if [ ! -z ${BINUTILS_VERSION} ]; then echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi - + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 - + if [ ! -z $MAKE_CHECK ]; then echo "Run ${MAKE} check" ${MAKE} -j${MAKE_JOBS} check || exit 1 fi - + ${MAKE} -j${MAKE_JOBS} install || exit 1 - + # binutils done fi @@ -237,19 +237,19 @@ if [ ! -z ${DJGPP_VERSION} ]; then unzip -o ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 - + cd src/stub ${CC} -O2 ${CFLAGS} stubify.c -o i586-pc-msdosdjgpp-stubify || exit 1 ${CC} -O2 ${CFLAGS} stubedit.c -o i586-pc-msdosdjgpp-stubedit || exit 1 - + cd ../.. - + mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 cp -p src/stub/i586-pc-msdosdjgpp-stubify $DJGPP_PREFIX/bin/ || exit 1 cp -p src/stub/i586-pc-msdosdjgpp-stubedit $DJGPP_PREFIX/bin/ || exit 1 - + cd .. fi @@ -257,9 +257,9 @@ if [ ! -z ${GCC_VERSION} ]; then # build gcc tar -xavf $(ls -t ../download/djcross-gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 cd djcross-gcc-${GCC_VERSION}/ - + BUILDDIR=`pwd` - + if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" cd $BUILDDIR @@ -272,7 +272,7 @@ if [ ! -z ${GCC_VERSION} ]; then else echo "autoconf already built, skipping." fi - + if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then echo "Building automake" cd $BUILDDIR @@ -287,7 +287,7 @@ if [ ! -z ${GCC_VERSION} ]; then else echo "automake already built, skipping." fi - + # build GNU sed if needed. SED=sed if [ ! -z $SED_VERSION ]; then @@ -299,12 +299,12 @@ if [ ! -z ${GCC_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} all install || exit 1 SED=$BUILDDIR/tmpinst/bin/sed fi - + cd $BUILDDIR - + if [ ! -e gcc-unpacked ]; then echo "Patch unpack-gcc.sh" - + if [ ${GCC_VERSION} == "4.7.3" ]; then # gcc 4.7.3 unpack-gcc.sh needs to be patched for OSX # patch from : @@ -320,45 +320,45 @@ if [ ! -z ${GCC_VERSION} ]; then # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || exit 1 fi - + 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 - + echo "Running unpack-gcc.sh" PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 - + # 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 - - + # copy stubify programs cp -p $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-stubify $BUILDDIR/tmpinst/bin/stubify - + cd $BUILDDIR/ - + # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" cd gnu/gcc-${GCC_VERSION_SHORT} ./contrib/download_prerequisites cd - - + touch gcc-unpacked else echo "gcc already unpacked, skipping." fi - + echo "Building gcc" - + mkdir -p djcross || exit 1 cd djcross - + TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - + if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then ${MAKE} distclean PATH="$BUILDDIR//tmpinst/bin:$PATH" \ @@ -377,11 +377,11 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" sleep 5 fi - + ${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - + ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - + export CFLAGS="$TEMP_CFLAGS" fi @@ -412,16 +412,16 @@ fi cd ${BASE}/build if [ ! -z ${GDB_VERSION} ]; then - if [ ! -e ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed ]; then - if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then - echo "Unpacking gdb." - tar -xavf $(ls -t ../download/gdb-${GDB_VERSION}.tar.* | head -n 1) || exit 1 - touch gdb-${GDB_VERSION}/gdb-unpacked - fi - rm -rf gdb-${GDB_VERSION}/build - mkdir -p gdb-${GDB_VERSION}/build - cd gdb-${GDB_VERSION}/build || exit 1 - echo "Building gdb." + if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then + echo "Unpacking gdb." + tar -xavf $(ls -t ../download/gdb-${GDB_VERSION}.tar.* | head -n 1) || exit 1 + touch gdb-${GDB_VERSION}/gdb-unpacked + fi + mkdir -p gdb-${GDB_VERSION}/build + cd gdb-${GDB_VERSION}/build || exit 1 + + echo "Building gdb." + if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${DJGPP_PREFIX}" ]; then ../configure \ --prefix=${DJGPP_PREFIX} \ --target=i586-pc-msdosdjgpp \ @@ -429,22 +429,19 @@ if [ ! -z ${GDB_VERSION} ]; then --disable-nls \ ${GDB_CONFIGURE_OPTIONS} \ || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 - fi - - ${MAKE} -j${MAKE_JOBS} install || exit 1 - - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed + echo ${DJGPP_PREFIX} > gdb-configure-prefix else - echo "Current gdb version already installed, skipping." - echo "To force a rebuild, use: rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed" + echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi + ${MAKE} -j${MAKE_JOBS} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 + fi + + ${MAKE} -j${MAKE_JOBS} install || exit 1 fi echo "Copy long name executables to short name." @@ -467,7 +464,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd .. echo "Use DJGPP to build a test C program." $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 - + for x in $(echo $ENABLE_LANGUAGES | tr "," " ") do case $x in From f2c2576db3e8c55a6c0bceafdb122f2d775a76a8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 11:54:24 +0100 Subject: [PATCH 088/536] always test gcc even if it wasnt recently built. --- build-djgpp.sh | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 00b1d3a..c49c7d2 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -458,23 +458,21 @@ echo "Copy long name executables to short name." # copy setenv script (cd ${BASE}/setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 -if [ ! -z ${GCC_VERSION} ]; then - echo "Testing DJGPP." - cd $BUILDDIR - cd .. - echo "Use DJGPP to build a test C program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || exit 1 - - for x in $(echo $ENABLE_LANGUAGES | tr "," " ") - do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || exit 1 - ;; - esac - done -fi +echo "Testing DJGPP." +cd $BUILDDIR +cd .. +echo "Use DJGPP to build a test C program." +$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || echo "FAILED: C" + +for x in $(echo $ENABLE_LANGUAGES | tr "," " ") +do + case $x in + c++) + echo "Use DJGPP to build a test C++ program." + $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || echo "FAILED: C++" + ;; + esac +done echo "build-djgpp.sh done." echo "To remove temporary build files, use: rm -rf build/" From ab45c6fc1d38fce1110215c6924112492019f76f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 12:13:02 +0100 Subject: [PATCH 089/536] some minor bug fixes --- build-djgpp.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index c49c7d2..a41e202 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -177,7 +177,7 @@ cd build || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" - mkdir bnu${BINUTILS_VERSION}s + mkdir -p bnu${BINUTILS_VERSION}s cd bnu${BINUTILS_VERSION}s if [ ! -e binutils-unpacked ]; then unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 @@ -195,10 +195,10 @@ if [ ! -z ${BINUTILS_VERSION} ]; then chmod a+x $EXEC_FILE || exit 1 done - mkdir build + mkdir -p build cd build || exit 1 if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${DJGPP_PREFIX}" ]; then - sh ../configure \ + ../configure \ --prefix=$DJGPP_PREFIX \ --target=i586-pc-msdosdjgpp \ --program-prefix=i586-pc-msdosdjgpp- \ @@ -374,7 +374,7 @@ if [ ! -z ${GCC_VERSION} ]; then ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${DJGPP_PREFIX} > gcc-configure-prefix else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf ${BUILDDIR}/djcross/" + echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi @@ -459,8 +459,7 @@ echo "Copy long name executables to short name." (cd ${BASE}/setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 echo "Testing DJGPP." -cd $BUILDDIR -cd .. +cd ${BASE}/build echo "Use DJGPP to build a test C program." $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || echo "FAILED: C" From 090d6873bb136dfd997e429394f7d58d28844fbb Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 1 Feb 2018 12:32:44 +0100 Subject: [PATCH 090/536] update readme. --- README.md | 57 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index b5ab051..34b9a97 100644 --- a/README.md +++ b/README.md @@ -70,42 +70,53 @@ Default number of parallel builds is 4. You can change this number by setting en MAKE_JOBS=8 ``` -To configure gcc with additional options, add your custom flags to environment variable *GCC_CONFIGURE_OPTIONS* : +To configure packages with additional options, add your custom flags to one of the following environment variables: ``` -GCC_CONFIGURE_OPTIONS="--enable-nls" +GCC_CONFIGURE_OPTIONS="--enable-feature" +GDB_CONFIGURE_OPTIONS="--enable-feature" +BINUTILS_CONFIGURE_OPTIONS="--enable-feature" ``` ### Building DJGPP compiler To build DJGPP, just run : -./build-djgpp.sh *djgpp-version* +./build-djgpp.sh [packages...] -Currently supported djgpp-version : +Currently supported packages : -* 4.7.3 -* 4.8.4 -* 4.8.5 -* 4.9.2 -* 4.9.3 -* 4.9.4 -* 5.1.0 -* 5.2.0 -* 5.3.0 -* 5.4.0 -* 5.5.0 -* 6.1.0 -* 6.2.0 -* 6.3.0 -* 6.4.0 -* 7.1.0 -* 7.2.0 +* gcc-4.7.3 +* gcc-4.8.4 +* gcc-4.8.5 +* gcc-4.9.2 +* gcc-4.9.3 +* gcc-4.9.4 +* gcc-5.1.0 +* gcc-5.2.0 +* gcc-5.3.0 +* gcc-5.4.0 +* gcc-5.5.0 +* gcc-6.1.0 +* gcc-6.2.0 +* gcc-6.3.0 +* gcc-6.4.0 +* gcc-7.1.0 +* gcc-7.2.0 +* gcc-7.3.0 +* binutils-2.29.1 +* gdb-8.0.1 -For example, to build DJGPP for gcc 7.2.0 : +For example, to build gcc 7.2.0 with the base library and latest binutils: ``` -./build-djgpp.sh 7.2.0 +./build-djgpp.sh base binutils gcc-7.2.0 +``` + +To install or upgrade all packages: + +``` +./build-djgpp.sh all ``` It will download all necessary files, build DJGPP compiler and binutils, and install it. From 94329a0b29ae6f7e4aafab96b0b7f45416133379 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 03:17:42 +0100 Subject: [PATCH 091/536] run make distclean before reconfigure. --- build-djgpp.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index a41e202..85a7a16 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -198,6 +198,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then mkdir -p build cd build || exit 1 if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${DJGPP_PREFIX}" ]; then + ${MAKE} distclean ../configure \ --prefix=$DJGPP_PREFIX \ --target=i586-pc-msdosdjgpp \ @@ -422,6 +423,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Building gdb." if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${DJGPP_PREFIX}" ]; then + ${MAKE} distclean ../configure \ --prefix=${DJGPP_PREFIX} \ --target=i586-pc-msdosdjgpp \ From bc2f9209b68719bf28575987011f9554fd657e9c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:05:09 +0100 Subject: [PATCH 092/536] update sed version to 4.4. --- build-djgpp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 85a7a16..7b96153 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -102,8 +102,8 @@ done # It is for OSX, which doesn't ship with GNU sed. if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then echo GNU sed is not installed, need to download. - SED_VERSION=4.2.2 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.bz2" + SED_VERSION=4.4 + SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.xz" else SED_ARCHIVE="" fi From c30b453f8b90a988be8d40c6390b45dd29fe2f8a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:14:13 +0100 Subject: [PATCH 093/536] download sed from ftpmirror.gnu.org --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 7b96153..cbcfe13 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -103,7 +103,7 @@ done if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then echo GNU sed is not installed, need to download. SED_VERSION=4.4 - SED_ARCHIVE="http://ftp.gnu.org/gnu/sed/sed-${SED_VERSION}.tar.xz" + SED_ARCHIVE="http://ftpmirror.gnu.org/sed/sed-${SED_VERSION}.tar.xz" else SED_ARCHIVE="" fi From 3d3e9dccc95772495f4da0170f8fc301d9dbff8e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 06:08:43 +0100 Subject: [PATCH 094/536] rename base package to base-2.05 --- script/base | 8 +------- script/base-2.05 | 9 +++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100755 script/base-2.05 diff --git a/script/base b/script/base index a279d74..37c5bf2 100755 --- a/script/base +++ b/script/base @@ -1,9 +1,3 @@ #!/usr/bin/env bash -# source tarball versions -export DJGPP_VERSION=205 - -# source tarball locations -export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJGPP_VERSION}.zip" -export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJGPP_VERSION}.zip" -export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJGPP_VERSION}.zip" +source script/base-2.05 diff --git a/script/base-2.05 b/script/base-2.05 new file mode 100755 index 0000000..a279d74 --- /dev/null +++ b/script/base-2.05 @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# source tarball versions +export DJGPP_VERSION=205 + +# source tarball locations +export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJGPP_VERSION}.zip" +export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJGPP_VERSION}.zip" +export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJGPP_VERSION}.zip" From 6080cdf69bb26eb4b5dd97c61eaa1f9c9525ffd4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 07:05:28 +0100 Subject: [PATCH 095/536] always remove and unpack dj* packages --- build-djgpp.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index cbcfe13..e3a0ece 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -231,6 +231,7 @@ cd ${BASE}/build/ if [ ! -z ${DJGPP_VERSION} ]; then echo "Prepare djgpp" + rm -rf ${BASE}/build/djgpp-${DJGPP_VERSION} mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} cd ${BASE}/build/djgpp-${DJGPP_VERSION} || exit 1 unzip -o ../../download/djdev${DJGPP_VERSION}.zip || exit 1 @@ -248,6 +249,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 + mkdir -p $DJGPP_PREFIX/bin || exit 1 cp -p src/stub/i586-pc-msdosdjgpp-stubify $DJGPP_PREFIX/bin/ || exit 1 cp -p src/stub/i586-pc-msdosdjgpp-stubedit $DJGPP_PREFIX/bin/ || exit 1 From 1501229160eebc87be4fd618174f40d2a04747c8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 06:06:32 +0100 Subject: [PATCH 096/536] place signal files to check which version of each package has been installed. --- build-djgpp.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index e3a0ece..3675566 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -224,6 +224,8 @@ if [ ! -z ${BINUTILS_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed # binutils done fi @@ -253,9 +255,12 @@ if [ ! -z ${DJGPP_VERSION} ]; then cp -p src/stub/i586-pc-msdosdjgpp-stubify $DJGPP_PREFIX/bin/ || exit 1 cp -p src/stub/i586-pc-msdosdjgpp-stubedit $DJGPP_PREFIX/bin/ || exit 1 - cd .. + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/djgpp-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/djgpp-${DJGPP_VERSION}-installed fi +cd ${BASE}/build/ + if [ ! -z ${GCC_VERSION} ]; then # build gcc tar -xavf $(ls -t ../download/djcross-gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 @@ -382,9 +387,11 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 - ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-${GCC_VERSION}-installed + export CFLAGS="$TEMP_CFLAGS" fi @@ -408,7 +415,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd src/stub ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 cp -p exe2coff $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-exe2coff || exit 1 - cd ${BASE} + # djlsr done fi @@ -446,6 +453,9 @@ if [ ! -z ${GDB_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} install || exit 1 + + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-${GCC_VERSION}-installed fi echo "Copy long name executables to short name." From 1e14674ca340732b962b513c23faf2f501d060c0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 06:51:09 +0100 Subject: [PATCH 097/536] added simple dependency management system --- build-djgpp.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index 3675566..022bd87 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -34,6 +34,38 @@ while [ ! -z $1 ]; do shift done +DEPS="" + +[ ! -z ${GCC_VERSION} ] && DEPS+=" base binutils" +[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " +[ ! -z ${GDB_VERSION} ] && DEPS+=" " +[ ! -z ${DJGPP_VERSION} ] && DEPS+=" " + +for DEP in ${DEPS}; do + case $DEP in + base) + [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/djgpp-*-installed 2> /dev/null`" ] \ + && [ -z ${DJGPP_VERSION} ] \ + && source script/base + ;; + binutils) + [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source script/binutils + ;; + gcc) + [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-*-installed 2> /dev/null`" ] \ + && [ -z ${GCC_VERSION} ] \ + && source script/gcc + ;; + gdb) + [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source script/gdb + ;; + esac +done + # use gmake/clang under FreeBSD if [ `uname` = "FreeBSD" ]; then MAKE=${MAKE-gmake} From 5c97aaa0f4d78022118c4fbd287701d98c252435 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 07:06:43 +0100 Subject: [PATCH 098/536] DXE tools depend on gcc. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 022bd87..5480f16 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -39,7 +39,7 @@ DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" base binutils" [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " [ ! -z ${GDB_VERSION} ] && DEPS+=" " -[ ! -z ${DJGPP_VERSION} ] && DEPS+=" " +[ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" for DEP in ${DEPS}; do case $DEP in From 4c40873ad6d73775cd8d2df422b10732b27bfa3a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 07:17:24 +0100 Subject: [PATCH 099/536] consider dxegen a separate package. --- build-djgpp.sh | 14 +++++++++++--- script/all | 1 + script/dxegen | 3 +++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 script/dxegen diff --git a/build-djgpp.sh b/build-djgpp.sh index 5480f16..bbbbd84 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -39,7 +39,8 @@ DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" base binutils" [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " [ ! -z ${GDB_VERSION} ] && DEPS+=" " -[ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" +[ ! -z ${DJGPP_VERSION} ] && DEPS+=" " +[ ! -z ${BUILD_DXEGEN} ] && DEPS+=" base binutils gcc" for DEP in ${DEPS}; do case $DEP in @@ -63,6 +64,11 @@ for DEP in ${DEPS}; do && [ -z ${GDB_VERSION} ] \ && source script/gdb ;; + dxegen) + [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/dxegen-installed 2> /dev/null`" ] \ + && [ -z ${BUILD_DXEGEN} ] \ + && source script/dxegen + ;; esac done @@ -84,6 +90,7 @@ echo "You are about to build and install:" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" [ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" [ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" +[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" echo "" echo "With the following options:" echo " DJGPP_PREFIX=${DJGPP_PREFIX}" @@ -263,7 +270,7 @@ fi cd ${BASE}/build/ -if [ ! -z ${DJGPP_VERSION} ]; then +if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then echo "Prepare djgpp" rm -rf ${BASE}/build/djgpp-${DJGPP_VERSION} mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} @@ -432,7 +439,7 @@ fi if [ ! -z ${DJGPP_VERSION} ]; then # build djlsr (for dxegen / exe2coff) cd ${BASE}/build/djgpp-${DJGPP_VERSION} - if [ "$CC" == "gcc" ]; then + if [ "$CC" == "gcc" ] && [ ! -z ${BUILD_DXEGEN} ]; then echo "Building DXE tools." cd src PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 @@ -441,6 +448,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then cp -p dxe3gen $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-dxe3gen || exit 1 cp -p dxe3res $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-dxe3res || exit 1 cd ../.. + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/dxegen-installed else echo "Building DXE tools requires gcc, skip." fi diff --git a/script/all b/script/all index 70731b8..1573dc8 100755 --- a/script/all +++ b/script/all @@ -1,4 +1,5 @@ #!/usr/bin/env bash source script/default +source script/dxegen source script/gdb diff --git a/script/dxegen b/script/dxegen new file mode 100755 index 0000000..2919cee --- /dev/null +++ b/script/dxegen @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +export BUILD_DXEGEN=yes From 47636bc959aa9610d63738dd61e79692b1a387d5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 07:19:56 +0100 Subject: [PATCH 100/536] always reinstall base library if other packages depend on it. --- build-djgpp.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index bbbbd84..48db911 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -45,8 +45,7 @@ DEPS="" for DEP in ${DEPS}; do case $DEP in base) - [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/djgpp-*-installed 2> /dev/null`" ] \ - && [ -z ${DJGPP_VERSION} ] \ + [ -z ${DJGPP_VERSION} ] \ && source script/base ;; binutils) From 32ede003242d96989d26cc0ea94c5beb2994573a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 07:51:15 +0100 Subject: [PATCH 101/536] fix gdb version signal files. --- build-djgpp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 48db911..ff2fecf 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -493,8 +493,8 @@ if [ ! -z ${GDB_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-${GCC_VERSION}-installed + rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-*-installed + touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed fi echo "Copy long name executables to short name." From e76657d258388764a7a35624d3441186ae5387df Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 08:56:10 +0100 Subject: [PATCH 102/536] remove *-configure-prefix files before doing make distclean. --- build-djgpp.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index ff2fecf..03cf906 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -236,6 +236,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then mkdir -p build cd build || exit 1 if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${DJGPP_PREFIX}" ]; then + rm binutils-configure-prefix ${MAKE} distclean ../configure \ --prefix=$DJGPP_PREFIX \ @@ -406,6 +407,7 @@ if [ ! -z ${GCC_VERSION} ]; then export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then + rm gcc-configure-prefix ${MAKE} distclean PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ @@ -471,6 +473,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Building gdb." if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${DJGPP_PREFIX}" ]; then + rm gdb-configure-prefix ${MAKE} distclean ../configure \ --prefix=${DJGPP_PREFIX} \ From e86c984962ecf49ef7b46bbf5f92ba1b2aab3ff4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:13:13 +0100 Subject: [PATCH 103/536] download GNU tar if not installed. --- build-djgpp.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 03cf906..1fe40d8 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -146,6 +146,15 @@ else SED_ARCHIVE="" fi +# check for GNU tar and download if necessary. +if ! tar --version 2>/dev/null |grep "GNU tar" > /dev/null ;then + echo GNU tar is not installed, need to download. + TAR_VERSION=latest + TAR_ARCHIVE="http://ftpmirror.gnu.org/tar/tar-${SED_VERSION}.tar.xz" +else + TAR_ARCHIVE="" +fi + # check zlib is installed if ! ${CC} test-zlib.c -o test-zlib -lz; then echo "zlib not installed" @@ -163,7 +172,7 @@ fi # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE" + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $TAR_ARCHIVE" echo "Download source files..." mkdir -p download || exit 1 From 3ecf070733ef0de6fb7c4ad3f93c3cb1886e814c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:16:11 +0100 Subject: [PATCH 104/536] fix TAR_VERSION --- build-djgpp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 1fe40d8..ffe5a2c 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -149,8 +149,8 @@ fi # check for GNU tar and download if necessary. if ! tar --version 2>/dev/null |grep "GNU tar" > /dev/null ;then echo GNU tar is not installed, need to download. - TAR_VERSION=latest - TAR_ARCHIVE="http://ftpmirror.gnu.org/tar/tar-${SED_VERSION}.tar.xz" + TAR_VERSION=1.30 + TAR_ARCHIVE="http://ftpmirror.gnu.org/tar/tar-${TAR_VERSION}.tar.xz" else TAR_ARCHIVE="" fi From 4a3b2587886d7f6b529439b3f761968fac636e14 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:19:19 +0100 Subject: [PATCH 105/536] build GNU tar. --- build-djgpp.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index ffe5a2c..9bcaf3b 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -222,6 +222,17 @@ echo "Make build dir" mkdir -p ${BASE}/build cd build || exit 1 +# build GNU tar if needed. +TAR=tar +if [ ! -z $TAR_VERSION ]; then + echo "Building tar" + tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 + cd tar-${TAR_VERSION}/ + ./configure --prefix=${BASE}/build/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + TAR=${BASE}/build/tmpinst/bin/tar +fi + if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" mkdir -p bnu${BINUTILS_VERSION}s From 2631023dbc2452043c9269c05e8bfeb261115aae Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:27:05 +0100 Subject: [PATCH 106/536] use GNU tar to unpack archives. --- build-djgpp.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 9bcaf3b..7dcf2fa 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -233,6 +233,11 @@ if [ ! -z $TAR_VERSION ]; then TAR=${BASE}/build/tmpinst/bin/tar fi +untar() +{ + ${TAR} -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1) +} + if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" mkdir -p bnu${BINUTILS_VERSION}s @@ -322,7 +327,7 @@ cd ${BASE}/build/ if [ ! -z ${GCC_VERSION} ]; then # build gcc - tar -xavf $(ls -t ../download/djcross-gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + untar djcross-gcc-${GCC_VERSION} || exit 1 cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` @@ -330,7 +335,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" cd $BUILDDIR - tar -xavf $(ls -t ../../download/autoconf-${AUTOCONF_VERSION}.tar.* | head -n 1) || exit 1 + untar autoconf-${AUTOCONF_VERSION} || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -343,7 +348,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then echo "Building automake" cd $BUILDDIR - tar -xavf $(ls -t ../../download/automake-${AUTOMAKE_VERSION}.tar.* | head -n 1) || exit 1 + untar automake-${AUTOMAKE_VERSION} || exit 1 cd automake-${AUTOMAKE_VERSION}/ PATH="$BUILDDIR//tmpinst/bin:$PATH" \ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 @@ -360,7 +365,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -z $SED_VERSION ]; then echo "Building sed" cd $BUILDDIR - tar -xavf $(ls -t ../../download/sed-${SED_VERSION}.tar.* | head -n 1) || exit 1 + untar sed-${SED_VERSION} || exit 1 cd sed-${SED_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -394,7 +399,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" @@ -485,7 +490,7 @@ cd ${BASE}/build if [ ! -z ${GDB_VERSION} ]; then if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then echo "Unpacking gdb." - tar -xavf $(ls -t ../download/gdb-${GDB_VERSION}.tar.* | head -n 1) || exit 1 + untar gdb-${GDB_VERSION} || exit 1 touch gdb-${GDB_VERSION}/gdb-unpacked fi mkdir -p gdb-${GDB_VERSION}/build From 26da7c0ecbddefc0f52e38167e9a267d03e70de8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:27:53 +0100 Subject: [PATCH 107/536] now that we use GNU tar, there is no need to patch unpack-gcc.sh anymore. --- build-djgpp.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 7dcf2fa..67a2bfc 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -377,22 +377,6 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-unpacked ]; then echo "Patch unpack-gcc.sh" - if [ ${GCC_VERSION} == "4.7.3" ]; then - # gcc 4.7.3 unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive --use=`case $archive in *.gz|*.tgz) echo 'gzip';; *.bz2) echo 'bzip2';; *.xz) echo 'xz';; esac` && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xjf $top/$archive && echo $archive >$top/s-sources ) - $SED -i "s/\(cd gnu && tar x\)\([^-]*\)\([^&]*\)/\1j\2/" unpack-gcc.sh || exit 1 - else - # gcc 4.8 or above unpack-gcc.sh needs to be patched for OSX - # patch from : - # ( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) - # to : - # ( cd gnu && tar xJf $top/$archive && echo $archive >$top/s-sources ) - $SED -i "s/\(cd gnu && tar x\)\(f [^ ]* \)\([^ ]* \)/\1a\2/" unpack-gcc.sh || exit 1 - fi - if [ `uname` = "FreeBSD" ]; then # The --verbose option is not recognized by BSD patch $SED -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1 From 4b92fb3f8a5ba69b45396870a9195adf0799be30 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:38:03 +0100 Subject: [PATCH 108/536] install sed in the same directory as tar. --- build-djgpp.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 67a2bfc..45cb286 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -220,7 +220,7 @@ mkdir -p ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/ || exit 1 # make build dir echo "Make build dir" mkdir -p ${BASE}/build -cd build || exit 1 +cd ${BASE}/build || exit 1 # build GNU tar if needed. TAR=tar @@ -238,6 +238,21 @@ untar() ${TAR} -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1) } +cd ${BASE}/build || exit 1 + +# build GNU sed if needed. +SED=sed +if [ ! -z $SED_VERSION ]; then + echo "Building sed" + untar sed-${SED_VERSION} || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=${BASE}/build/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + SED=${BASE}/build/tmpinst/bin/sed +fi + +cd ${BASE}/build || exit 1 + if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" mkdir -p bnu${BINUTILS_VERSION}s @@ -360,18 +375,6 @@ if [ ! -z ${GCC_VERSION} ]; then echo "automake already built, skipping." fi - # build GNU sed if needed. - SED=sed - if [ ! -z $SED_VERSION ]; then - echo "Building sed" - cd $BUILDDIR - untar sed-${SED_VERSION} || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - SED=$BUILDDIR/tmpinst/bin/sed - fi - cd $BUILDDIR if [ ! -e gcc-unpacked ]; then From 655c68bb2a10db5887f5e0daa8591d4ff401765c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:46:07 +0100 Subject: [PATCH 109/536] pass new PATH to sub-programs that may need tar/sed. --- build-djgpp.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 45cb286..1f301fe 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -352,8 +352,10 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR untar autoconf-${AUTOCONF_VERSION} || exit 1 cd autoconf-${AUTOCONF_VERSION}/ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 + PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + ${MAKE} -j${MAKE_JOBS} all install || exit 1 rm ${BUILDDIR}/tmpinst/autoconf-*-built touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built else @@ -365,10 +367,10 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR untar automake-${AUTOMAKE_VERSION} || exit 1 cd automake-${AUTOMAKE_VERSION}/ - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ${MAKE} all install || exit 1 + PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + ${MAKE} all install || exit 1 rm ${BUILDDIR}/tmpinst/automake-*-built touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built else @@ -386,7 +388,8 @@ if [ ! -z ${GCC_VERSION} ]; then fi echo "Running unpack-gcc.sh" - PATH="$BUILDDIR/tmpinst/bin:$PATH" sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" @@ -402,7 +405,8 @@ if [ ! -z ${GCC_VERSION} ]; then # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" cd gnu/gcc-${GCC_VERSION_SHORT} - ./contrib/download_prerequisites + PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + ./contrib/download_prerequisites cd - touch gcc-unpacked @@ -421,8 +425,8 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then rm gcc-configure-prefix ${MAKE} distclean - PATH="$BUILDDIR//tmpinst/bin:$PATH" \ - ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ + PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=i586-pc-msdosdjgpp \ --program-prefix=i586-pc-msdosdjgpp- \ --prefix=$DJGPP_PREFIX \ @@ -438,7 +442,7 @@ if [ ! -z ${GCC_VERSION} ]; then sleep 5 fi - ${MAKE} -j${MAKE_JOBS} "PATH=$BUILDDIR/tmpinst/bin:$PATH" || exit 1 + ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-*-installed From e4502fc6fd6fe3e6a379407e4a19470f0e2c28ef Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 04:51:15 +0100 Subject: [PATCH 110/536] only install tar/sed if they haven't been installed previously. --- build-djgpp.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 1f301fe..4b80fed 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -225,10 +225,13 @@ cd ${BASE}/build || exit 1 # build GNU tar if needed. TAR=tar if [ ! -z $TAR_VERSION ]; then - echo "Building tar" - tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 - cd tar-${TAR_VERSION}/ - ./configure --prefix=${BASE}/build/tmpinst || exit 1 + if [ ! -e ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed ]; then + echo "Building tar" + tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 + cd tar-${TAR_VERSION}/ + ./configure --prefix=${BASE}/build/tmpinst || exit 1 + touch ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed + fi ${MAKE} -j${MAKE_JOBS} all install || exit 1 TAR=${BASE}/build/tmpinst/bin/tar fi @@ -243,10 +246,13 @@ cd ${BASE}/build || exit 1 # build GNU sed if needed. SED=sed if [ ! -z $SED_VERSION ]; then - echo "Building sed" - untar sed-${SED_VERSION} || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=${BASE}/build/tmpinst || exit 1 + if [ ! -e ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed ]; then + echo "Building sed" + untar sed-${SED_VERSION} || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=${BASE}/build/tmpinst || exit 1 + touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed + fi ${MAKE} -j${MAKE_JOBS} all install || exit 1 SED=${BASE}/build/tmpinst/bin/sed fi From 65572751bf975c1921c93bc8e88e8598ddae56fe Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 05:35:55 +0100 Subject: [PATCH 111/536] make & install tar/sed in two steps. --- build-djgpp.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 4b80fed..3448d51 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -220,6 +220,7 @@ mkdir -p ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/ || exit 1 # make build dir echo "Make build dir" mkdir -p ${BASE}/build +mkdir -p ${BASE}/build/tmpinst cd ${BASE}/build || exit 1 # build GNU tar if needed. @@ -230,9 +231,10 @@ if [ ! -z $TAR_VERSION ]; then tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 cd tar-${TAR_VERSION}/ ./configure --prefix=${BASE}/build/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 touch ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed fi - ${MAKE} -j${MAKE_JOBS} all install || exit 1 TAR=${BASE}/build/tmpinst/bin/tar fi @@ -251,9 +253,10 @@ if [ ! -z $SED_VERSION ]; then untar sed-${SED_VERSION} || exit 1 cd sed-${SED_VERSION}/ ./configure --prefix=${BASE}/build/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed fi - ${MAKE} -j${MAKE_JOBS} all install || exit 1 SED=${BASE}/build/tmpinst/bin/sed fi From 3e312411608fd477f21aba582ef2601c55596ae6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 07:36:01 +0100 Subject: [PATCH 112/536] fixed typo --- build-djgpp.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 3448d51..535a798 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -361,9 +361,9 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR untar autoconf-${AUTOCONF_VERSION} || exit 1 cd autoconf-${AUTOCONF_VERSION}/ - PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ${MAKE} -j${MAKE_JOBS} all install || exit 1 rm ${BUILDDIR}/tmpinst/autoconf-*-built touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built @@ -376,9 +376,9 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR untar automake-${AUTOMAKE_VERSION} || exit 1 cd automake-${AUTOMAKE_VERSION}/ - PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ${MAKE} all install || exit 1 rm ${BUILDDIR}/tmpinst/automake-*-built touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built @@ -397,7 +397,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi echo "Running unpack-gcc.sh" - PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi @@ -414,7 +414,7 @@ if [ ! -z ${GCC_VERSION} ]; then # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" cd gnu/gcc-${GCC_VERSION_SHORT} - PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ./contrib/download_prerequisites cd - @@ -434,7 +434,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then rm gcc-configure-prefix ${MAKE} distclean - PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=i586-pc-msdosdjgpp \ --program-prefix=i586-pc-msdosdjgpp- \ @@ -451,7 +451,7 @@ if [ ! -z ${GCC_VERSION} ]; then sleep 5 fi - ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:${BASE/build/tmpinst/:$PATH" || exit 1 + ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-*-installed From d5bfb1ff6f03b279ea18e1b53568608dc3d5afaa Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 11:55:18 +0100 Subject: [PATCH 113/536] rename package base -> djgpp --- build-djgpp.sh | 8 ++++---- script/base | 3 --- script/default | 2 +- script/djgpp | 3 +++ script/{base-2.05 => djgpp-2.05} | 0 5 files changed, 8 insertions(+), 8 deletions(-) delete mode 100755 script/base create mode 100755 script/djgpp rename script/{base-2.05 => djgpp-2.05} (100%) diff --git a/build-djgpp.sh b/build-djgpp.sh index 535a798..7b072d1 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -36,17 +36,17 @@ done DEPS="" -[ ! -z ${GCC_VERSION} ] && DEPS+=" base binutils" +[ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " [ ! -z ${GDB_VERSION} ] && DEPS+=" " [ ! -z ${DJGPP_VERSION} ] && DEPS+=" " -[ ! -z ${BUILD_DXEGEN} ] && DEPS+=" base binutils gcc" +[ ! -z ${BUILD_DXEGEN} ] && DEPS+=" djgpp binutils gcc" for DEP in ${DEPS}; do case $DEP in - base) + djgpp) [ -z ${DJGPP_VERSION} ] \ - && source script/base + && source script/djgpp ;; binutils) [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed 2> /dev/null`" ] \ diff --git a/script/base b/script/base deleted file mode 100755 index 37c5bf2..0000000 --- a/script/base +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -source script/base-2.05 diff --git a/script/default b/script/default index 77f1e74..2bda8a9 100755 --- a/script/default +++ b/script/default @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source script/base +source script/djgpp source script/binutils source script/gcc diff --git a/script/djgpp b/script/djgpp new file mode 100755 index 0000000..f0dbd38 --- /dev/null +++ b/script/djgpp @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source script/djgpp-2.05 diff --git a/script/base-2.05 b/script/djgpp-2.05 similarity index 100% rename from script/base-2.05 rename to script/djgpp-2.05 From 2aeaa6ffbcea145349b3f6819b91abb14227ce59 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 12:00:24 +0100 Subject: [PATCH 114/536] replace i586-pc-msdosdjgpp with variable TARGET --- build-djgpp.sh | 72 ++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 7b072d1..c97d5b3 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -5,6 +5,8 @@ unset CDPATH # target directory DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} +TARGET="i586-pc-msdosdjgpp" + # enabled languages #ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} @@ -49,22 +51,22 @@ for DEP in ${DEPS}; do && source script/djgpp ;; binutils) - [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed 2> /dev/null`" ] \ + [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ && [ -z ${BINUTILS_VERSION} ] \ && source script/binutils ;; gcc) - [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-*-installed 2> /dev/null`" ] \ + [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ && [ -z ${GCC_VERSION} ] \ && source script/gcc ;; gdb) - [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-*-installed 2> /dev/null`" ] \ + [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ && [ -z ${GDB_VERSION} ] \ && source script/gdb ;; dxegen) - [ -z "`ls ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/dxegen-installed 2> /dev/null`" ] \ + [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ && [ -z ${BUILD_DXEGEN} ] \ && source script/dxegen ;; @@ -215,7 +217,7 @@ if ! [ -w $DJGPP_PREFIX ]; then exit 1 fi -mkdir -p ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/ || exit 1 +mkdir -p ${DJGPP_PREFIX}/${TARGET}/etc/ || exit 1 # make build dir echo "Make build dir" @@ -289,8 +291,8 @@ if [ ! -z ${BINUTILS_VERSION} ]; then ${MAKE} distclean ../configure \ --prefix=$DJGPP_PREFIX \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ + --target=${TARGET} \ + --program-prefix=${TARGET}- \ --disable-werror \ --disable-nls \ ${BINUTILS_CONFIGURE_OPTIONS} \ @@ -312,8 +314,8 @@ if [ ! -z ${BINUTILS_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/binutils-${BINUTILS_VERSION}-installed + rm ${DJGPP_PREFIX}/${TARGET}/etc/binutils-*-installed + touch ${DJGPP_PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed # binutils done fi @@ -331,20 +333,20 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 cd src/stub - ${CC} -O2 ${CFLAGS} stubify.c -o i586-pc-msdosdjgpp-stubify || exit 1 - ${CC} -O2 ${CFLAGS} stubedit.c -o i586-pc-msdosdjgpp-stubedit || exit 1 + ${CC} -O2 ${CFLAGS} stubify.c -o ${TARGET}-stubify || exit 1 + ${CC} -O2 ${CFLAGS} stubedit.c -o ${TARGET}-stubedit || exit 1 cd ../.. - mkdir -p $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include || exit 1 - cp -rp include/* $DJGPP_PREFIX/i586-pc-msdosdjgpp/sys-include/ || exit 1 - cp -rp lib $DJGPP_PREFIX/i586-pc-msdosdjgpp/ || exit 1 + mkdir -p $DJGPP_PREFIX/${TARGET}/sys-include || exit 1 + cp -rp include/* $DJGPP_PREFIX/${TARGET}/sys-include/ || exit 1 + cp -rp lib $DJGPP_PREFIX/${TARGET}/ || exit 1 mkdir -p $DJGPP_PREFIX/bin || exit 1 - cp -p src/stub/i586-pc-msdosdjgpp-stubify $DJGPP_PREFIX/bin/ || exit 1 - cp -p src/stub/i586-pc-msdosdjgpp-stubedit $DJGPP_PREFIX/bin/ || exit 1 + cp -p src/stub/${TARGET}-stubify $DJGPP_PREFIX/bin/ || exit 1 + cp -p src/stub/${TARGET}-stubedit $DJGPP_PREFIX/bin/ || exit 1 - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/djgpp-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/djgpp-${DJGPP_VERSION}-installed + rm ${DJGPP_PREFIX}/${TARGET}/etc/djgpp-*-installed + touch ${DJGPP_PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi cd ${BASE}/build/ @@ -407,7 +409,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - # copy stubify programs - cp -p $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-stubify $BUILDDIR/tmpinst/bin/stubify + cp -p $DJGPP_PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify cd $BUILDDIR/ @@ -436,8 +438,8 @@ if [ ! -z ${GCC_VERSION} ]; then ${MAKE} distclean PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=i586-pc-msdosdjgpp \ - --program-prefix=i586-pc-msdosdjgpp- \ + --target=${TARGET} \ + --program-prefix=${TARGET}- \ --prefix=$DJGPP_PREFIX \ --disable-nls \ --enable-libquadmath-support \ @@ -454,8 +456,8 @@ if [ ! -z ${GCC_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gcc-${GCC_VERSION}-installed + rm ${DJGPP_PREFIX}/${TARGET}/etc/gcc-*-installed + touch ${DJGPP_PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed export CFLAGS="$TEMP_CFLAGS" fi @@ -470,17 +472,17 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd src PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 cd dxe - cp -p dxegen $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-dxegen || exit 1 - cp -p dxe3gen $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-dxe3gen || exit 1 - cp -p dxe3res $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-dxe3res || exit 1 + cp -p dxegen $DJGPP_PREFIX/bin/${TARGET}-dxegen || exit 1 + cp -p dxe3gen $DJGPP_PREFIX/bin/${TARGET}-dxe3gen || exit 1 + cp -p dxe3res $DJGPP_PREFIX/bin/${TARGET}-dxe3res || exit 1 cd ../.. - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/dxegen-installed + touch ${DJGPP_PREFIX}/${TARGET}/etc/dxegen-installed else echo "Building DXE tools requires gcc, skip." fi cd src/stub ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 - cp -p exe2coff $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-exe2coff || exit 1 + cp -p exe2coff $DJGPP_PREFIX/bin/${TARGET}-exe2coff || exit 1 # djlsr done fi @@ -502,7 +504,7 @@ if [ ! -z ${GDB_VERSION} ]; then ${MAKE} distclean ../configure \ --prefix=${DJGPP_PREFIX} \ - --target=i586-pc-msdosdjgpp \ + --target=${TARGET} \ --disable-werror \ --disable-nls \ ${GDB_CONFIGURE_OPTIONS} \ @@ -521,8 +523,8 @@ if [ ! -z ${GDB_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 - rm ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-*-installed - touch ${DJGPP_PREFIX}/i586-pc-msdosdjgpp/etc/gdb-${GDB_VERSION}-installed + rm ${DJGPP_PREFIX}/${TARGET}/etc/gdb-*-installed + touch ${DJGPP_PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed fi echo "Copy long name executables to short name." @@ -530,8 +532,8 @@ echo "Copy long name executables to short name." cd $DJGPP_PREFIX || exit 1 SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/i586-pc-msdosdjgpp-$SHORT_NAME ]; then - cp -p bin/i586-pc-msdosdjgpp-$SHORT_NAME i586-pc-msdosdjgpp/bin/$SHORT_NAME + if [ -f bin/${TARGET}-$SHORT_NAME ]; then + cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME fi done ) @@ -542,14 +544,14 @@ echo "Copy long name executables to short name." echo "Testing DJGPP." cd ${BASE}/build echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-gcc ../hello.c -o hello || echo "FAILED: C" +$DJGPP_PREFIX/bin/${TARGET}-gcc ../hello.c -o hello || echo "FAILED: C" for x in $(echo $ENABLE_LANGUAGES | tr "," " ") do case $x in c++) echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/i586-pc-msdosdjgpp-c++ ../hello-cpp.cpp -o hello-cpp || echo "FAILED: C++" + $DJGPP_PREFIX/bin/${TARGET}-c++ ../hello-cpp.cpp -o hello-cpp || echo "FAILED: C++" ;; esac done From 95b662fb4b7a7428888e9d5985b31c2b429ff0e8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 12:04:15 +0100 Subject: [PATCH 115/536] move djgpp-specific packages to separate directory --- {script => djgpp}/all | 0 {script => djgpp}/binutils | 0 {script => djgpp}/binutils-2.29.1 | 0 {script => djgpp}/default | 0 {script => djgpp}/djgpp | 0 {script => djgpp}/djgpp-2.05 | 0 {script => djgpp}/dxegen | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename {script => djgpp}/all (100%) rename {script => djgpp}/binutils (100%) rename {script => djgpp}/binutils-2.29.1 (100%) rename {script => djgpp}/default (100%) rename {script => djgpp}/djgpp (100%) rename {script => djgpp}/djgpp-2.05 (100%) rename {script => djgpp}/dxegen (100%) diff --git a/script/all b/djgpp/all similarity index 100% rename from script/all rename to djgpp/all diff --git a/script/binutils b/djgpp/binutils similarity index 100% rename from script/binutils rename to djgpp/binutils diff --git a/script/binutils-2.29.1 b/djgpp/binutils-2.29.1 similarity index 100% rename from script/binutils-2.29.1 rename to djgpp/binutils-2.29.1 diff --git a/script/default b/djgpp/default similarity index 100% rename from script/default rename to djgpp/default diff --git a/script/djgpp b/djgpp/djgpp similarity index 100% rename from script/djgpp rename to djgpp/djgpp diff --git a/script/djgpp-2.05 b/djgpp/djgpp-2.05 similarity index 100% rename from script/djgpp-2.05 rename to djgpp/djgpp-2.05 diff --git a/script/dxegen b/djgpp/dxegen similarity index 100% rename from script/dxegen rename to djgpp/dxegen From 4d9d7dea53440a81905e485a692025ec67854bb4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 12:06:43 +0100 Subject: [PATCH 116/536] fix directory references --- build-djgpp.sh | 9 +++++---- djgpp/all | 4 ++-- djgpp/binutils | 2 +- djgpp/binutils-2.29.1 | 2 -- djgpp/default | 4 ++-- djgpp/djgpp | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index c97d5b3..3937d6c 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -22,7 +22,8 @@ BASE=`pwd` if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" - for F in `(cd script/;echo *)`; do echo " "$F; done + ls djgpp/ + ls script/ exit 1 fi @@ -32,7 +33,7 @@ while [ ! -z $1 ]; do exit 1 fi - source script/$1 + ([ -e djgpp/$1 ] && source djgpp/$1) || source script/$1 shift done @@ -48,12 +49,12 @@ for DEP in ${DEPS}; do case $DEP in djgpp) [ -z ${DJGPP_VERSION} ] \ - && source script/djgpp + && source djgpp/djgpp ;; binutils) [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ && [ -z ${BINUTILS_VERSION} ] \ - && source script/binutils + && source djgpp/binutils ;; gcc) [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ diff --git a/djgpp/all b/djgpp/all index 1573dc8..1c95f84 100755 --- a/djgpp/all +++ b/djgpp/all @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source script/default -source script/dxegen +source djgpp/default +source djgpp/dxegen source script/gdb diff --git a/djgpp/binutils b/djgpp/binutils index fcfadc7..7a5af26 100755 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source script/binutils-2.29.1 +source djgpp/binutils-2.29.1 diff --git a/djgpp/binutils-2.29.1 b/djgpp/binutils-2.29.1 index 900f0f2..899c926 100755 --- a/djgpp/binutils-2.29.1 +++ b/djgpp/binutils-2.29.1 @@ -2,5 +2,3 @@ export BINUTILS_VERSION=2291 export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" - -export BINUTILS_CONFIGURE_OPTIONS="${BINUTILS_CONFIGURE_OPTIONS}" diff --git a/djgpp/default b/djgpp/default index 2bda8a9..4d5545f 100755 --- a/djgpp/default +++ b/djgpp/default @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source script/djgpp -source script/binutils +source djgpp/djgpp +source djgpp/binutils source script/gcc diff --git a/djgpp/djgpp b/djgpp/djgpp index f0dbd38..1fe9a64 100755 --- a/djgpp/djgpp +++ b/djgpp/djgpp @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source script/djgpp-2.05 +source djgpp/djgpp-2.05 From 56b6c12a2ebef28fb1dc7ac5d9da349d95c04815 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 13:04:13 +0100 Subject: [PATCH 117/536] make target-specific build directories for binutils and gdb --- build-djgpp.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 3937d6c..9c958f9 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -285,8 +285,8 @@ if [ ! -z ${BINUTILS_VERSION} ]; then chmod a+x $EXEC_FILE || exit 1 done - mkdir -p build - cd build || exit 1 + mkdir -p build-${TARGET} + cd build-${TARGET} || exit 1 if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${DJGPP_PREFIX}" ]; then rm binutils-configure-prefix ${MAKE} distclean @@ -496,8 +496,8 @@ if [ ! -z ${GDB_VERSION} ]; then untar gdb-${GDB_VERSION} || exit 1 touch gdb-${GDB_VERSION}/gdb-unpacked fi - mkdir -p gdb-${GDB_VERSION}/build - cd gdb-${GDB_VERSION}/build || exit 1 + mkdir -p gdb-${GDB_VERSION}/build-${TARGET} + cd gdb-${GDB_VERSION}/build-${TARGET} || exit 1 echo "Building gdb." if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${DJGPP_PREFIX}" ]; then From 252d4576ad32880858df23092fbd9b3290600d3d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 13:06:12 +0100 Subject: [PATCH 118/536] rename DJGPP_PREFIX -> PREFIX --- build-djgpp.sh | 90 +++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 9c958f9..61d9ae7 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -3,7 +3,7 @@ unset CDPATH # target directory -DJGPP_PREFIX=${DJGPP_PREFIX-/usr/local/djgpp} +PREFIX=${PREFIX-/usr/local/djgpp} TARGET="i586-pc-msdosdjgpp" @@ -52,22 +52,22 @@ for DEP in ${DEPS}; do && source djgpp/djgpp ;; binutils) - [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ && [ -z ${BINUTILS_VERSION} ] \ && source djgpp/binutils ;; gcc) - [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ + [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ && [ -z ${GCC_VERSION} ] \ && source script/gcc ;; gdb) - [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ && [ -z ${GDB_VERSION} ] \ && source script/gdb ;; dxegen) - [ -z "`ls ${DJGPP_PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ + [ -z "`ls ${PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ && [ -z ${BUILD_DXEGEN} ] \ && source script/dxegen ;; @@ -95,7 +95,7 @@ echo "You are about to build and install:" [ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" echo "" echo "With the following options:" -echo " DJGPP_PREFIX=${DJGPP_PREFIX}" +echo " PREFIX=${PREFIX}" echo " CC=${CC}" echo " CXX=${CXX}" echo " CFLAGS=${CFLAGS}" @@ -205,20 +205,20 @@ done cd .. # create target directory, check writable. -echo "Make prefix directory : $DJGPP_PREFIX" -mkdir -p $DJGPP_PREFIX +echo "Make prefix directory : $PREFIX" +mkdir -p $PREFIX -if ! [ -d $DJGPP_PREFIX ]; then +if ! [ -d $PREFIX ]; then echo "Unable to create prefix directory" exit 1 fi -if ! [ -w $DJGPP_PREFIX ]; then +if ! [ -w $PREFIX ]; then echo "prefix directory is not writable." exit 1 fi -mkdir -p ${DJGPP_PREFIX}/${TARGET}/etc/ || exit 1 +mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 # make build dir echo "Make build dir" @@ -287,18 +287,18 @@ if [ ! -z ${BINUTILS_VERSION} ]; then mkdir -p build-${TARGET} cd build-${TARGET} || exit 1 - if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${DJGPP_PREFIX}" ]; then + if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${PREFIX}" ]; then rm binutils-configure-prefix ${MAKE} distclean ../configure \ - --prefix=$DJGPP_PREFIX \ + --prefix=$PREFIX \ --target=${TARGET} \ --program-prefix=${TARGET}- \ --disable-werror \ --disable-nls \ ${BINUTILS_CONFIGURE_OPTIONS} \ || exit 1 - echo ${DJGPP_PREFIX} > binutils-configure-prefix + echo ${PREFIX} > binutils-configure-prefix else echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 @@ -315,8 +315,8 @@ if [ ! -z ${BINUTILS_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 - rm ${DJGPP_PREFIX}/${TARGET}/etc/binutils-*-installed - touch ${DJGPP_PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed + rm ${PREFIX}/${TARGET}/etc/binutils-*-installed + touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed # binutils done fi @@ -339,15 +339,15 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then cd ../.. - mkdir -p $DJGPP_PREFIX/${TARGET}/sys-include || exit 1 - cp -rp include/* $DJGPP_PREFIX/${TARGET}/sys-include/ || exit 1 - cp -rp lib $DJGPP_PREFIX/${TARGET}/ || exit 1 - mkdir -p $DJGPP_PREFIX/bin || exit 1 - cp -p src/stub/${TARGET}-stubify $DJGPP_PREFIX/bin/ || exit 1 - cp -p src/stub/${TARGET}-stubedit $DJGPP_PREFIX/bin/ || exit 1 + mkdir -p $PREFIX/${TARGET}/sys-include || exit 1 + cp -rp include/* $PREFIX/${TARGET}/sys-include/ || exit 1 + cp -rp lib $PREFIX/${TARGET}/ || exit 1 + mkdir -p $PREFIX/bin || exit 1 + cp -p src/stub/${TARGET}-stubify $PREFIX/bin/ || exit 1 + cp -p src/stub/${TARGET}-stubedit $PREFIX/bin/ || exit 1 - rm ${DJGPP_PREFIX}/${TARGET}/etc/djgpp-*-installed - touch ${DJGPP_PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed + rm ${PREFIX}/${TARGET}/etc/djgpp-*-installed + touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi cd ${BASE}/build/ @@ -410,7 +410,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - # copy stubify programs - cp -p $DJGPP_PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify + cp -p $PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify cd $BUILDDIR/ @@ -434,21 +434,21 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${DJGPP_PREFIX}" ]; then + if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${PREFIX}" ]; then rm gcc-configure-prefix ${MAKE} distclean PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=${TARGET} \ --program-prefix=${TARGET}- \ - --prefix=$DJGPP_PREFIX \ + --prefix=$PREFIX \ --disable-nls \ --enable-libquadmath-support \ --enable-version-specific-runtime-libs \ --enable-languages=${ENABLE_LANGUAGES} \ --enable-fat \ ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${DJGPP_PREFIX} > gcc-configure-prefix + echo ${PREFIX} > gcc-configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 @@ -457,8 +457,8 @@ if [ ! -z ${GCC_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - rm ${DJGPP_PREFIX}/${TARGET}/etc/gcc-*-installed - touch ${DJGPP_PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + rm ${PREFIX}/${TARGET}/etc/gcc-*-installed + touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed export CFLAGS="$TEMP_CFLAGS" fi @@ -471,19 +471,19 @@ if [ ! -z ${DJGPP_VERSION} ]; then if [ "$CC" == "gcc" ] && [ ! -z ${BUILD_DXEGEN} ]; then echo "Building DXE tools." cd src - PATH=$DJGPP_PREFIX/bin/:$PATH ${MAKE} || exit 1 + PATH=$PREFIX/bin/:$PATH ${MAKE} || exit 1 cd dxe - cp -p dxegen $DJGPP_PREFIX/bin/${TARGET}-dxegen || exit 1 - cp -p dxe3gen $DJGPP_PREFIX/bin/${TARGET}-dxe3gen || exit 1 - cp -p dxe3res $DJGPP_PREFIX/bin/${TARGET}-dxe3res || exit 1 + cp -p dxegen $PREFIX/bin/${TARGET}-dxegen || exit 1 + cp -p dxe3gen $PREFIX/bin/${TARGET}-dxe3gen || exit 1 + cp -p dxe3res $PREFIX/bin/${TARGET}-dxe3res || exit 1 cd ../.. - touch ${DJGPP_PREFIX}/${TARGET}/etc/dxegen-installed + touch ${PREFIX}/${TARGET}/etc/dxegen-installed else echo "Building DXE tools requires gcc, skip." fi cd src/stub ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 - cp -p exe2coff $DJGPP_PREFIX/bin/${TARGET}-exe2coff || exit 1 + cp -p exe2coff $PREFIX/bin/${TARGET}-exe2coff || exit 1 # djlsr done fi @@ -500,17 +500,17 @@ if [ ! -z ${GDB_VERSION} ]; then cd gdb-${GDB_VERSION}/build-${TARGET} || exit 1 echo "Building gdb." - if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${DJGPP_PREFIX}" ]; then + if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${PREFIX}" ]; then rm gdb-configure-prefix ${MAKE} distclean ../configure \ - --prefix=${DJGPP_PREFIX} \ + --prefix=${PREFIX} \ --target=${TARGET} \ --disable-werror \ --disable-nls \ ${GDB_CONFIGURE_OPTIONS} \ || exit 1 - echo ${DJGPP_PREFIX} > gdb-configure-prefix + echo ${PREFIX} > gdb-configure-prefix else echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 @@ -524,13 +524,13 @@ if [ ! -z ${GDB_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 - rm ${DJGPP_PREFIX}/${TARGET}/etc/gdb-*-installed - touch ${DJGPP_PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed + rm ${PREFIX}/${TARGET}/etc/gdb-*-installed + touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed fi echo "Copy long name executables to short name." ( - cd $DJGPP_PREFIX || exit 1 + cd $PREFIX || exit 1 SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/${TARGET}-$SHORT_NAME ]; then @@ -540,19 +540,19 @@ echo "Copy long name executables to short name." ) # copy setenv script -(cd ${BASE}/setenv/ && ./copyfile.sh $DJGPP_PREFIX) || exit 1 +(cd ${BASE}/setenv/ && ./copyfile.sh $PREFIX) || exit 1 echo "Testing DJGPP." cd ${BASE}/build echo "Use DJGPP to build a test C program." -$DJGPP_PREFIX/bin/${TARGET}-gcc ../hello.c -o hello || echo "FAILED: C" +$PREFIX/bin/${TARGET}-gcc ../hello.c -o hello || echo "FAILED: C" for x in $(echo $ENABLE_LANGUAGES | tr "," " ") do case $x in c++) echo "Use DJGPP to build a test C++ program." - $DJGPP_PREFIX/bin/${TARGET}-c++ ../hello-cpp.cpp -o hello-cpp || echo "FAILED: C++" + $PREFIX/bin/${TARGET}-c++ ../hello-cpp.cpp -o hello-cpp || echo "FAILED: C++" ;; esac done From 192ce5a7b185e2aac26c289e93d49bdf4f8d51af Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 13:06:47 +0100 Subject: [PATCH 119/536] rename directory script -> common --- {script => common}/gcc | 0 {script => common}/gcc-4.7.3 | 0 {script => common}/gcc-4.8.4 | 0 {script => common}/gcc-4.8.5 | 0 {script => common}/gcc-4.9.2 | 0 {script => common}/gcc-4.9.3 | 0 {script => common}/gcc-4.9.4 | 0 {script => common}/gcc-5.1.0 | 0 {script => common}/gcc-5.2.0 | 0 {script => common}/gcc-5.3.0 | 0 {script => common}/gcc-5.4.0 | 0 {script => common}/gcc-5.5.0 | 0 {script => common}/gcc-6.1.0 | 0 {script => common}/gcc-6.2.0 | 0 {script => common}/gcc-6.3.0 | 0 {script => common}/gcc-6.4.0 | 0 {script => common}/gcc-7.1.0 | 0 {script => common}/gcc-7.2.0 | 0 {script => common}/gcc-7.3.0 | 0 {script => common}/gdb | 0 {script => common}/gdb-8.0.1 | 0 21 files changed, 0 insertions(+), 0 deletions(-) rename {script => common}/gcc (100%) rename {script => common}/gcc-4.7.3 (100%) rename {script => common}/gcc-4.8.4 (100%) rename {script => common}/gcc-4.8.5 (100%) rename {script => common}/gcc-4.9.2 (100%) rename {script => common}/gcc-4.9.3 (100%) rename {script => common}/gcc-4.9.4 (100%) rename {script => common}/gcc-5.1.0 (100%) rename {script => common}/gcc-5.2.0 (100%) rename {script => common}/gcc-5.3.0 (100%) rename {script => common}/gcc-5.4.0 (100%) rename {script => common}/gcc-5.5.0 (100%) rename {script => common}/gcc-6.1.0 (100%) rename {script => common}/gcc-6.2.0 (100%) rename {script => common}/gcc-6.3.0 (100%) rename {script => common}/gcc-6.4.0 (100%) rename {script => common}/gcc-7.1.0 (100%) rename {script => common}/gcc-7.2.0 (100%) rename {script => common}/gcc-7.3.0 (100%) rename {script => common}/gdb (100%) rename {script => common}/gdb-8.0.1 (100%) diff --git a/script/gcc b/common/gcc similarity index 100% rename from script/gcc rename to common/gcc diff --git a/script/gcc-4.7.3 b/common/gcc-4.7.3 similarity index 100% rename from script/gcc-4.7.3 rename to common/gcc-4.7.3 diff --git a/script/gcc-4.8.4 b/common/gcc-4.8.4 similarity index 100% rename from script/gcc-4.8.4 rename to common/gcc-4.8.4 diff --git a/script/gcc-4.8.5 b/common/gcc-4.8.5 similarity index 100% rename from script/gcc-4.8.5 rename to common/gcc-4.8.5 diff --git a/script/gcc-4.9.2 b/common/gcc-4.9.2 similarity index 100% rename from script/gcc-4.9.2 rename to common/gcc-4.9.2 diff --git a/script/gcc-4.9.3 b/common/gcc-4.9.3 similarity index 100% rename from script/gcc-4.9.3 rename to common/gcc-4.9.3 diff --git a/script/gcc-4.9.4 b/common/gcc-4.9.4 similarity index 100% rename from script/gcc-4.9.4 rename to common/gcc-4.9.4 diff --git a/script/gcc-5.1.0 b/common/gcc-5.1.0 similarity index 100% rename from script/gcc-5.1.0 rename to common/gcc-5.1.0 diff --git a/script/gcc-5.2.0 b/common/gcc-5.2.0 similarity index 100% rename from script/gcc-5.2.0 rename to common/gcc-5.2.0 diff --git a/script/gcc-5.3.0 b/common/gcc-5.3.0 similarity index 100% rename from script/gcc-5.3.0 rename to common/gcc-5.3.0 diff --git a/script/gcc-5.4.0 b/common/gcc-5.4.0 similarity index 100% rename from script/gcc-5.4.0 rename to common/gcc-5.4.0 diff --git a/script/gcc-5.5.0 b/common/gcc-5.5.0 similarity index 100% rename from script/gcc-5.5.0 rename to common/gcc-5.5.0 diff --git a/script/gcc-6.1.0 b/common/gcc-6.1.0 similarity index 100% rename from script/gcc-6.1.0 rename to common/gcc-6.1.0 diff --git a/script/gcc-6.2.0 b/common/gcc-6.2.0 similarity index 100% rename from script/gcc-6.2.0 rename to common/gcc-6.2.0 diff --git a/script/gcc-6.3.0 b/common/gcc-6.3.0 similarity index 100% rename from script/gcc-6.3.0 rename to common/gcc-6.3.0 diff --git a/script/gcc-6.4.0 b/common/gcc-6.4.0 similarity index 100% rename from script/gcc-6.4.0 rename to common/gcc-6.4.0 diff --git a/script/gcc-7.1.0 b/common/gcc-7.1.0 similarity index 100% rename from script/gcc-7.1.0 rename to common/gcc-7.1.0 diff --git a/script/gcc-7.2.0 b/common/gcc-7.2.0 similarity index 100% rename from script/gcc-7.2.0 rename to common/gcc-7.2.0 diff --git a/script/gcc-7.3.0 b/common/gcc-7.3.0 similarity index 100% rename from script/gcc-7.3.0 rename to common/gcc-7.3.0 diff --git a/script/gdb b/common/gdb similarity index 100% rename from script/gdb rename to common/gdb diff --git a/script/gdb-8.0.1 b/common/gdb-8.0.1 similarity index 100% rename from script/gdb-8.0.1 rename to common/gdb-8.0.1 From 63a84e97b0cf55990184970b6c22111aaec134fd Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 13:21:59 +0100 Subject: [PATCH 120/536] split up common parts into separate scripts. --- build-djgpp.sh | 265 +-------------------------------------- script/build-binutils.sh | 32 +++++ script/build-gdb.sh | 37 ++++++ script/build-tools.sh | 38 ++++++ script/stage1.sh | 152 ++++++++++++++++++++++ 5 files changed, 264 insertions(+), 260 deletions(-) create mode 100644 script/build-binutils.sh create mode 100644 script/build-gdb.sh create mode 100644 script/build-tools.sh create mode 100644 script/stage1.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index 61d9ae7..6432a4d 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -28,7 +28,7 @@ if [ -z $1 ]; then fi while [ ! -z $1 ]; do - if [ ! -x script/$1 ]; then + if [ ! -x djgpp/$1 ] && [ ! -x script/$1 ]; then echo "Unsupported package: $1" exit 1 fi @@ -74,196 +74,9 @@ for DEP in ${DEPS}; do esac done -# use gmake/clang under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=${MAKE-gmake} - CC=${CC-clang} - CXX=${CXX-clang++} -else - MAKE=${MAKE-make} - CC=${CC-gcc} - CXX=${CXX-g++} -fi - -export CC CXX MAKE - -echo "You are about to build and install:" -[ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" -[ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" -[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" -[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" -[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" -echo "" -echo "With the following options:" -echo " PREFIX=${PREFIX}" -echo " CC=${CC}" -echo " CXX=${CXX}" -echo " CFLAGS=${CFLAGS}" -echo " CXXFLAGS=${CXXFLAGS}" -echo " LDFLAGS=${LDFLAGS}" -echo " MAKE=${MAKE}" -echo " MAKE_JOBS=${MAKE_JOBS}" -if [ ! -z ${GCC_VERSION} ]; then - echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" - echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${BINUTILS_VERSION} ]; then - echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${GDB_VERSION} ]; then - echo " GDB_CONFIGURE_OPTIONS=`echo ${GDB_CONFIGURE_OPTIONS}`" -fi -echo "" -echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." -read -s -n 1 - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if ! which curl > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.4 - SED_ARCHIVE="http://ftpmirror.gnu.org/sed/sed-${SED_VERSION}.tar.xz" -else - SED_ARCHIVE="" -fi - -# check for GNU tar and download if necessary. -if ! tar --version 2>/dev/null |grep "GNU tar" > /dev/null ;then - echo GNU tar is not installed, need to download. - TAR_VERSION=1.30 - TAR_ARCHIVE="http://ftpmirror.gnu.org/tar/tar-${TAR_VERSION}.tar.xz" -else - TAR_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -if [ ! -z ${GCC_VERSION} ]; then - DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" - # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. - OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} -fi - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $TAR_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -# create target directory, check writable. -echo "Make prefix directory : $PREFIX" -mkdir -p $PREFIX +source script/stage1.sh -if ! [ -d $PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - -mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 - -# make build dir -echo "Make build dir" -mkdir -p ${BASE}/build -mkdir -p ${BASE}/build/tmpinst -cd ${BASE}/build || exit 1 - -# build GNU tar if needed. -TAR=tar -if [ ! -z $TAR_VERSION ]; then - if [ ! -e ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed ]; then - echo "Building tar" - tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 - cd tar-${TAR_VERSION}/ - ./configure --prefix=${BASE}/build/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || exit 1 - touch ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed - fi - TAR=${BASE}/build/tmpinst/bin/tar -fi - -untar() -{ - ${TAR} -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1) -} - -cd ${BASE}/build || exit 1 - -# build GNU sed if needed. -SED=sed -if [ ! -z $SED_VERSION ]; then - if [ ! -e ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed ]; then - echo "Building sed" - untar sed-${SED_VERSION} || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=${BASE}/build/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || exit 1 - touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed - fi - SED=${BASE}/build/tmpinst/bin/sed -fi - -cd ${BASE}/build || exit 1 +source script/build-tools.sh if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" @@ -285,39 +98,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then chmod a+x $EXEC_FILE || exit 1 done - mkdir -p build-${TARGET} - cd build-${TARGET} || exit 1 - if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${PREFIX}" ]; then - rm binutils-configure-prefix - ${MAKE} distclean - ../configure \ - --prefix=$PREFIX \ - --target=${TARGET} \ - --program-prefix=${TARGET}- \ - --disable-werror \ - --disable-nls \ - ${BINUTILS_CONFIGURE_OPTIONS} \ - || exit 1 - echo ${PREFIX} > binutils-configure-prefix - else - echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - - ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 - ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 - fi - - ${MAKE} -j${MAKE_JOBS} install || exit 1 - - rm ${PREFIX}/${TARGET}/etc/binutils-*-installed - touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed - # binutils done + source script/build-binutils.sh fi cd ${BASE}/build/ @@ -490,43 +271,7 @@ fi cd ${BASE}/build -if [ ! -z ${GDB_VERSION} ]; then - if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then - echo "Unpacking gdb." - untar gdb-${GDB_VERSION} || exit 1 - touch gdb-${GDB_VERSION}/gdb-unpacked - fi - mkdir -p gdb-${GDB_VERSION}/build-${TARGET} - cd gdb-${GDB_VERSION}/build-${TARGET} || exit 1 - - echo "Building gdb." - if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${PREFIX}" ]; then - rm gdb-configure-prefix - ${MAKE} distclean - ../configure \ - --prefix=${PREFIX} \ - --target=${TARGET} \ - --disable-werror \ - --disable-nls \ - ${GDB_CONFIGURE_OPTIONS} \ - || exit 1 - echo ${PREFIX} > gdb-configure-prefix - else - echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 - fi - - ${MAKE} -j${MAKE_JOBS} install || exit 1 - - rm ${PREFIX}/${TARGET}/etc/gdb-*-installed - touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed -fi +source script/build-gdb.sh echo "Copy long name executables to short name." ( diff --git a/script/build-binutils.sh b/script/build-binutils.sh new file mode 100644 index 0000000..f229441 --- /dev/null +++ b/script/build-binutils.sh @@ -0,0 +1,32 @@ +mkdir -p build-${TARGET} +cd build-${TARGET} || exit 1 +if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${PREFIX}" ]; then + rm binutils-configure-prefix + ${MAKE} distclean + ../configure \ + --prefix=$PREFIX \ + --target=${TARGET} \ + --program-prefix=${TARGET}- \ + --disable-werror \ + --disable-nls \ + ${BINUTILS_CONFIGURE_OPTIONS} \ + || exit 1 + echo ${PREFIX} > binutils-configure-prefix +else + echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 +fi + +${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 +${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 +${MAKE} -j${MAKE_JOBS} || exit 1 + +if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 +fi + +${MAKE} -j${MAKE_JOBS} install || exit 1 + +rm ${PREFIX}/${TARGET}/etc/binutils-*-installed +touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh new file mode 100644 index 0000000..6126dea --- /dev/null +++ b/script/build-gdb.sh @@ -0,0 +1,37 @@ +if [ ! -z ${GDB_VERSION} ]; then + if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then + echo "Unpacking gdb." + untar gdb-${GDB_VERSION} || exit 1 + touch gdb-${GDB_VERSION}/gdb-unpacked + fi + mkdir -p gdb-${GDB_VERSION}/build-${TARGET} + cd gdb-${GDB_VERSION}/build-${TARGET} || exit 1 + + echo "Building gdb." + if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${PREFIX}" ]; then + rm gdb-configure-prefix + ${MAKE} distclean + ../configure \ + --prefix=${PREFIX} \ + --target=${TARGET} \ + --disable-werror \ + --disable-nls \ + ${GDB_CONFIGURE_OPTIONS} \ + || exit 1 + echo ${PREFIX} > gdb-configure-prefix + else + echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + ${MAKE} -j${MAKE_JOBS} || exit 1 + + if [ ! -z $MAKE_CHECK ]; then + echo "Run ${MAKE} check" + ${MAKE} -j${MAKE_JOBS} check || exit 1 + fi + + ${MAKE} -j${MAKE_JOBS} install || exit 1 + + rm ${PREFIX}/${TARGET}/etc/gdb-*-installed + touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed +fi diff --git a/script/build-tools.sh b/script/build-tools.sh new file mode 100644 index 0000000..dcf2a14 --- /dev/null +++ b/script/build-tools.sh @@ -0,0 +1,38 @@ +# build GNU tar if needed. +TAR=tar +if [ ! -z $TAR_VERSION ]; then + if [ ! -e ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed ]; then + echo "Building tar" + tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 + cd tar-${TAR_VERSION}/ + ./configure --prefix=${BASE}/build/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 + touch ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed + fi + TAR=${BASE}/build/tmpinst/bin/tar +fi + +untar() +{ + ${TAR} -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1) +} + +cd ${BASE}/build || exit 1 + +# build GNU sed if needed. +SED=sed +if [ ! -z $SED_VERSION ]; then + if [ ! -e ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed ]; then + echo "Building sed" + untar sed-${SED_VERSION} || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=${BASE}/build/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 + touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed + fi + SED=${BASE}/build/tmpinst/bin/sed +fi + +cd ${BASE}/build || exit 1 diff --git a/script/stage1.sh b/script/stage1.sh new file mode 100644 index 0000000..1900c34 --- /dev/null +++ b/script/stage1.sh @@ -0,0 +1,152 @@ +# use gmake/clang under FreeBSD +if [ `uname` = "FreeBSD" ]; then + MAKE=${MAKE-gmake} + CC=${CC-clang} + CXX=${CXX-clang++} +else + MAKE=${MAKE-make} + CC=${CC-gcc} + CXX=${CXX-g++} +fi + +export CC CXX MAKE + +echo "You are about to build and install:" +[ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" +[ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" +[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" +[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" +[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" +echo "" +echo "With the following options:" +echo " TARGET=${TARGET}" +echo " PREFIX=${PREFIX}" +echo " CC=${CC}" +echo " CXX=${CXX}" +echo " CFLAGS=${CFLAGS}" +echo " CXXFLAGS=${CXXFLAGS}" +echo " LDFLAGS=${LDFLAGS}" +echo " MAKE=${MAKE}" +echo " MAKE_JOBS=${MAKE_JOBS}" +if [ ! -z ${GCC_VERSION} ]; then + echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" + echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${BINUTILS_VERSION} ]; then + echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${GDB_VERSION} ]; then + echo " GDB_CONFIGURE_OPTIONS=`echo ${GDB_CONFIGURE_OPTIONS}`" +fi +echo "" +echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." +read -s -n 1 + +# check required programs +REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" + +# MinGW doesn't have curl, so we use wget. +if ! which curl > /dev/null; then + USE_WGET=1 +fi + +# use curl or wget? +if [ ! -z $USE_WGET ]; then + REQ_PROG_LIST+=" wget" +else + REQ_PROG_LIST+=" curl" +fi + +for REQ_PROG in $REQ_PROG_LIST; do + if ! which $REQ_PROG > /dev/null; then + echo "$REQ_PROG not installed" + exit 1 + fi +done + +# check GNU sed is installed or not. +# It is for OSX, which doesn't ship with GNU sed. +if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then + echo GNU sed is not installed, need to download. + SED_VERSION=4.4 + SED_ARCHIVE="http://ftpmirror.gnu.org/sed/sed-${SED_VERSION}.tar.xz" +else + SED_ARCHIVE="" +fi + +# check for GNU tar and download if necessary. +if ! tar --version 2>/dev/null |grep "GNU tar" > /dev/null ;then + echo GNU tar is not installed, need to download. + TAR_VERSION=1.30 + TAR_ARCHIVE="http://ftpmirror.gnu.org/tar/tar-${TAR_VERSION}.tar.xz" +else + TAR_ARCHIVE="" +fi + +# check zlib is installed +if ! ${CC} test-zlib.c -o test-zlib -lz; then + echo "zlib not installed" + exit 1 +fi +rm test-zlib 2>/dev/null +rm test-zlib.exe 2>/dev/null + +if [ ! -z ${GCC_VERSION} ]; then + DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" + # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. + OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} +fi + +# download source files +ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE + $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $TAR_ARCHIVE" + +echo "Download source files..." +mkdir -p download || exit 1 +cd download + +for ARCHIVE in $ARCHIVE_LIST; do + FILE=`basename $ARCHIVE` + if ! [ -f $FILE ]; then + echo "Download $ARCHIVE ..." + if [ ! -z $USE_WGET ]; then + DL_CMD="wget -U firefox $ARCHIVE" + else + DL_CMD="curl -f $ARCHIVE -L -o $FILE" + fi + echo "Command : $DL_CMD" + if ! eval $DL_CMD; then + if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then + echo "$FILE maybe moved to deleted/ directory." + else + rm $FILE + echo "Download $ARCHIVE failed." + exit 1 + fi + fi + fi +done +cd .. + +# create target directory, check writable. +echo "Make prefix directory : $PREFIX" +mkdir -p $PREFIX + +if ! [ -d $PREFIX ]; then + echo "Unable to create prefix directory" + exit 1 +fi + +if ! [ -w $PREFIX ]; then + echo "prefix directory is not writable." + exit 1 +fi + +mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 + +# make build dir +echo "Make build dir" +mkdir -p ${BASE}/build +mkdir -p ${BASE}/build/tmpinst +cd ${BASE}/build || exit 1 From 5350f2a19352e6e712851dbce2f14e26456e835a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 13:42:11 +0100 Subject: [PATCH 121/536] more script splitting --- build-djgpp.sh | 35 ++-------------------------------- script/{stage1.sh => begin.sh} | 0 script/finalize.sh | 33 ++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 33 deletions(-) rename script/{stage1.sh => begin.sh} (100%) create mode 100644 script/finalize.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index 6432a4d..ec2be50 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -74,7 +74,7 @@ for DEP in ${DEPS}; do esac done -source script/stage1.sh +source script/begin.sh source script/build-tools.sh @@ -273,35 +273,4 @@ cd ${BASE}/build source script/build-gdb.sh -echo "Copy long name executables to short name." -( - cd $PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/${TARGET}-$SHORT_NAME ]; then - cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME - fi - done -) - -# copy setenv script -(cd ${BASE}/setenv/ && ./copyfile.sh $PREFIX) || exit 1 - -echo "Testing DJGPP." -cd ${BASE}/build -echo "Use DJGPP to build a test C program." -$PREFIX/bin/${TARGET}-gcc ../hello.c -o hello || echo "FAILED: C" - -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Use DJGPP to build a test C++ program." - $PREFIX/bin/${TARGET}-c++ ../hello-cpp.cpp -o hello-cpp || echo "FAILED: C++" - ;; - esac -done - -echo "build-djgpp.sh done." -echo "To remove temporary build files, use: rm -rf build/" -echo "To remove downloaded source packages, use: rm -rf download/" +source script/finalize.sh diff --git a/script/stage1.sh b/script/begin.sh similarity index 100% rename from script/stage1.sh rename to script/begin.sh diff --git a/script/finalize.sh b/script/finalize.sh new file mode 100644 index 0000000..1360cc8 --- /dev/null +++ b/script/finalize.sh @@ -0,0 +1,33 @@ +echo "Copy long name executables to short name." +( + cd $PREFIX || exit 1 + SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" + for SHORT_NAME in $SHORT_NAME_LIST; do + if [ -f bin/${TARGET}-$SHORT_NAME ]; then + cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME + fi + done +) + +# copy setenv script +(cd ${BASE}/setenv/ && ./copyfile.sh $PREFIX) || exit 1 + +cd ${BASE}/build + +for x in $(echo $ENABLE_LANGUAGES | tr "," " ") +do + case $x in + c++) + echo "Testing C++ compiler: " + ($PREFIX/bin/${TARGET}-c++ ../hello-cpp.cpp -o hello-cpp && echo "PASS") || echo "FAIL" + ;; + c) + echo "Testing C compiler: " + ($PREFIX/bin/${TARGET}-gcc ../hello.c -o hello && echo "PASS") || echo "FAIL" + ;; + esac +done + +echo "Done." +echo "To remove temporary build files, use: rm -rf build/" +echo "To remove downloaded source packages, use: rm -rf download/" From def63d899d0c06685ff19c56494164e8c968ea6f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 13:45:38 +0100 Subject: [PATCH 122/536] copy build-djgpp.sh -> build-newlib.sh --- build-newlib.sh | 276 +++++++++++++++++++++++++++++++++++++++ script/begin.sh | 0 script/build-binutils.sh | 0 script/build-gdb.sh | 0 script/build-tools.sh | 0 script/finalize.sh | 0 6 files changed, 276 insertions(+) create mode 100755 build-newlib.sh mode change 100644 => 100755 script/begin.sh mode change 100644 => 100755 script/build-binutils.sh mode change 100644 => 100755 script/build-gdb.sh mode change 100644 => 100755 script/build-tools.sh mode change 100644 => 100755 script/finalize.sh diff --git a/build-newlib.sh b/build-newlib.sh new file mode 100755 index 0000000..ec2be50 --- /dev/null +++ b/build-newlib.sh @@ -0,0 +1,276 @@ +#!/usr/bin/env bash + +unset CDPATH + +# target directory +PREFIX=${PREFIX-/usr/local/djgpp} + +TARGET="i586-pc-msdosdjgpp" + +# enabled languages +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} +ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} + +# number of parallel build threads +MAKE_JOBS=${MAKE_JOBS-4} + +#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" +export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" + +BASE=`pwd` + +if [ -z $1 ]; then + echo "Usage: $0 [packages...]" + echo "Supported packages:" + ls djgpp/ + ls script/ + exit 1 +fi + +while [ ! -z $1 ]; do + if [ ! -x djgpp/$1 ] && [ ! -x script/$1 ]; then + echo "Unsupported package: $1" + exit 1 + fi + + ([ -e djgpp/$1 ] && source djgpp/$1) || source script/$1 + shift +done + +DEPS="" + +[ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" +[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " +[ ! -z ${GDB_VERSION} ] && DEPS+=" " +[ ! -z ${DJGPP_VERSION} ] && DEPS+=" " +[ ! -z ${BUILD_DXEGEN} ] && DEPS+=" djgpp binutils gcc" + +for DEP in ${DEPS}; do + case $DEP in + djgpp) + [ -z ${DJGPP_VERSION} ] \ + && source djgpp/djgpp + ;; + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source djgpp/binutils + ;; + gcc) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ + && [ -z ${GCC_VERSION} ] \ + && source script/gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source script/gdb + ;; + dxegen) + [ -z "`ls ${PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ + && [ -z ${BUILD_DXEGEN} ] \ + && source script/dxegen + ;; + esac +done + +source script/begin.sh + +source script/build-tools.sh + +if [ ! -z ${BINUTILS_VERSION} ]; then + echo "Building binutils" + mkdir -p bnu${BINUTILS_VERSION}s + cd bnu${BINUTILS_VERSION}s + if [ ! -e binutils-unpacked ]; then + unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 + + # patch for binutils 2.27 + [ ${BINUTILS_VERSION} == 227 ] && (patch gnu/binutils-*/bfd/init.c ${BASE}/patch/patch-bnu27-bfd-init.txt || exit 1 ) + + touch binutils-unpacked + fi + cd gnu/binutils-* || exit 1 + + # exec permission of some files are not set, fix it. + for EXEC_FILE in install-sh missing; do + echo "chmod a+x $EXEC_FILE" + chmod a+x $EXEC_FILE || exit 1 + done + + source script/build-binutils.sh +fi + +cd ${BASE}/build/ + +if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then + echo "Prepare djgpp" + rm -rf ${BASE}/build/djgpp-${DJGPP_VERSION} + mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} + cd ${BASE}/build/djgpp-${DJGPP_VERSION} || exit 1 + unzip -o ../../download/djdev${DJGPP_VERSION}.zip || exit 1 + unzip -o ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 + unzip -o ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 + patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 + patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 + + cd src/stub + ${CC} -O2 ${CFLAGS} stubify.c -o ${TARGET}-stubify || exit 1 + ${CC} -O2 ${CFLAGS} stubedit.c -o ${TARGET}-stubedit || exit 1 + + cd ../.. + + mkdir -p $PREFIX/${TARGET}/sys-include || exit 1 + cp -rp include/* $PREFIX/${TARGET}/sys-include/ || exit 1 + cp -rp lib $PREFIX/${TARGET}/ || exit 1 + mkdir -p $PREFIX/bin || exit 1 + cp -p src/stub/${TARGET}-stubify $PREFIX/bin/ || exit 1 + cp -p src/stub/${TARGET}-stubedit $PREFIX/bin/ || exit 1 + + rm ${PREFIX}/${TARGET}/etc/djgpp-*-installed + touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed +fi + +cd ${BASE}/build/ + +if [ ! -z ${GCC_VERSION} ]; then + # build gcc + untar djcross-gcc-${GCC_VERSION} || exit 1 + cd djcross-gcc-${GCC_VERSION}/ + + BUILDDIR=`pwd` + + if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then + echo "Building autoconf" + cd $BUILDDIR + untar autoconf-${AUTOCONF_VERSION} || exit 1 + cd autoconf-${AUTOCONF_VERSION}/ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + ${MAKE} -j${MAKE_JOBS} all install || exit 1 + rm ${BUILDDIR}/tmpinst/autoconf-*-built + touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built + else + echo "autoconf already built, skipping." + fi + + if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then + echo "Building automake" + cd $BUILDDIR + untar automake-${AUTOMAKE_VERSION} || exit 1 + cd automake-${AUTOMAKE_VERSION}/ + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + ${MAKE} all install || exit 1 + rm ${BUILDDIR}/tmpinst/automake-*-built + touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built + else + echo "automake already built, skipping." + fi + + cd $BUILDDIR + + if [ ! -e gcc-unpacked ]; then + echo "Patch unpack-gcc.sh" + + 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 + + echo "Running unpack-gcc.sh" + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + + # 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 - + + # copy stubify programs + cp -p $PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify + + cd $BUILDDIR/ + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gnu/gcc-${GCC_VERSION_SHORT} + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + ./contrib/download_prerequisites + cd - + + touch gcc-unpacked + else + echo "gcc already unpacked, skipping." + fi + + echo "Building gcc" + + mkdir -p djcross || exit 1 + cd djcross + + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + + if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${PREFIX}" ]; then + rm gcc-configure-prefix + ${MAKE} distclean + PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ + --target=${TARGET} \ + --program-prefix=${TARGET}- \ + --prefix=$PREFIX \ + --disable-nls \ + --enable-libquadmath-support \ + --enable-version-specific-runtime-libs \ + --enable-languages=${ENABLE_LANGUAGES} \ + --enable-fat \ + ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${PREFIX} > gcc-configure-prefix + else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" || exit 1 + ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + + rm ${PREFIX}/${TARGET}/etc/gcc-*-installed + touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + + export CFLAGS="$TEMP_CFLAGS" +fi + +# gcc done + +if [ ! -z ${DJGPP_VERSION} ]; then + # build djlsr (for dxegen / exe2coff) + cd ${BASE}/build/djgpp-${DJGPP_VERSION} + if [ "$CC" == "gcc" ] && [ ! -z ${BUILD_DXEGEN} ]; then + echo "Building DXE tools." + cd src + PATH=$PREFIX/bin/:$PATH ${MAKE} || exit 1 + cd dxe + cp -p dxegen $PREFIX/bin/${TARGET}-dxegen || exit 1 + cp -p dxe3gen $PREFIX/bin/${TARGET}-dxe3gen || exit 1 + cp -p dxe3res $PREFIX/bin/${TARGET}-dxe3res || exit 1 + cd ../.. + touch ${PREFIX}/${TARGET}/etc/dxegen-installed + else + echo "Building DXE tools requires gcc, skip." + fi + cd src/stub + ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 + cp -p exe2coff $PREFIX/bin/${TARGET}-exe2coff || exit 1 + + # djlsr done +fi + +cd ${BASE}/build + +source script/build-gdb.sh + +source script/finalize.sh diff --git a/script/begin.sh b/script/begin.sh old mode 100644 new mode 100755 diff --git a/script/build-binutils.sh b/script/build-binutils.sh old mode 100644 new mode 100755 diff --git a/script/build-gdb.sh b/script/build-gdb.sh old mode 100644 new mode 100755 diff --git a/script/build-tools.sh b/script/build-tools.sh old mode 100644 new mode 100755 diff --git a/script/finalize.sh b/script/finalize.sh old mode 100644 new mode 100755 From 9c25dbd7a37909c7f9bf692f5fa1a138bad8a6b7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 14:02:02 +0100 Subject: [PATCH 123/536] some work on build-newlib.sh --- build-newlib.sh | 203 +++++++++--------------------------------------- script/begin.sh | 9 ++- 2 files changed, 43 insertions(+), 169 deletions(-) diff --git a/build-newlib.sh b/build-newlib.sh index ec2be50..5db3772 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -3,9 +3,7 @@ unset CDPATH # target directory -PREFIX=${PREFIX-/usr/local/djgpp} - -TARGET="i586-pc-msdosdjgpp" +PREFIX=${PREFIX-/usr/local/cross} # enabled languages #ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} @@ -14,51 +12,46 @@ ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads MAKE_JOBS=${MAKE_JOBS-4} -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" - BASE=`pwd` if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" - ls djgpp/ + ls newlib/ ls script/ exit 1 fi while [ ! -z $1 ]; do - if [ ! -x djgpp/$1 ] && [ ! -x script/$1 ]; then + if [ ! -x newlib/$1 ] && [ ! -x script/$1 ]; then echo "Unsupported package: $1" exit 1 fi - ([ -e djgpp/$1 ] && source djgpp/$1) || source script/$1 + ([ -e newlib/$1 ] && source newlib/$1) || source script/$1 shift done DEPS="" -[ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" +[ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " [ ! -z ${GDB_VERSION} ] && DEPS+=" " -[ ! -z ${DJGPP_VERSION} ] && DEPS+=" " -[ ! -z ${BUILD_DXEGEN} ] && DEPS+=" djgpp binutils gcc" +[ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" for DEP in ${DEPS}; do case $DEP in - djgpp) + newlib) [ -z ${DJGPP_VERSION} ] \ - && source djgpp/djgpp + && source newlib/newlib ;; binutils) [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ && [ -z ${BINUTILS_VERSION} ] \ - && source djgpp/binutils + && source newlib/binutils ;; gcc) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ - && [ -z ${GCC_VERSION} ] \ + [ -z ${GCC_VERSION} ] \ && source script/gcc ;; gdb) @@ -66,11 +59,6 @@ for DEP in ${DEPS}; do && [ -z ${GDB_VERSION} ] \ && source script/gdb ;; - dxegen) - [ -z "`ls ${PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ - && [ -z ${BUILD_DXEGEN} ] \ - && source script/dxegen - ;; esac done @@ -80,124 +68,25 @@ source script/build-tools.sh if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" - mkdir -p bnu${BINUTILS_VERSION}s - cd bnu${BINUTILS_VERSION}s - if [ ! -e binutils-unpacked ]; then - unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - - # patch for binutils 2.27 - [ ${BINUTILS_VERSION} == 227 ] && (patch gnu/binutils-*/bfd/init.c ${BASE}/patch/patch-bnu27-bfd-init.txt || exit 1 ) - + if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + untar binutils-${BINUTILS_VERSION} || exit 1 touch binutils-unpacked fi - cd gnu/binutils-* || exit 1 - - # exec permission of some files are not set, fix it. - for EXEC_FILE in install-sh missing; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 - done + + cd binutils-${BINUTILS_VERSION} || exit 1 source script/build-binutils.sh fi cd ${BASE}/build/ -if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then - echo "Prepare djgpp" - rm -rf ${BASE}/build/djgpp-${DJGPP_VERSION} - mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} - cd ${BASE}/build/djgpp-${DJGPP_VERSION} || exit 1 - unzip -o ../../download/djdev${DJGPP_VERSION}.zip || exit 1 - unzip -o ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 - unzip -o ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 - patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 - patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 - - cd src/stub - ${CC} -O2 ${CFLAGS} stubify.c -o ${TARGET}-stubify || exit 1 - ${CC} -O2 ${CFLAGS} stubedit.c -o ${TARGET}-stubedit || exit 1 - - cd ../.. - - mkdir -p $PREFIX/${TARGET}/sys-include || exit 1 - cp -rp include/* $PREFIX/${TARGET}/sys-include/ || exit 1 - cp -rp lib $PREFIX/${TARGET}/ || exit 1 - mkdir -p $PREFIX/bin || exit 1 - cp -p src/stub/${TARGET}-stubify $PREFIX/bin/ || exit 1 - cp -p src/stub/${TARGET}-stubedit $PREFIX/bin/ || exit 1 - - rm ${PREFIX}/${TARGET}/etc/djgpp-*-installed - touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed -fi - -cd ${BASE}/build/ - if [ ! -z ${GCC_VERSION} ]; then - # build gcc - untar djcross-gcc-${GCC_VERSION} || exit 1 - cd djcross-gcc-${GCC_VERSION}/ - - BUILDDIR=`pwd` - - if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then - echo "Building autoconf" - cd $BUILDDIR - untar autoconf-${AUTOCONF_VERSION} || exit 1 - cd autoconf-${AUTOCONF_VERSION}/ - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ - ${MAKE} -j${MAKE_JOBS} all install || exit 1 - rm ${BUILDDIR}/tmpinst/autoconf-*-built - touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built - else - echo "autoconf already built, skipping." - fi - - if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then - echo "Building automake" - cd $BUILDDIR - untar automake-${AUTOMAKE_VERSION} || exit 1 - cd automake-${AUTOMAKE_VERSION}/ - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ - ${MAKE} all install || exit 1 - rm ${BUILDDIR}/tmpinst/automake-*-built - touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built - else - echo "automake already built, skipping." - fi - - cd $BUILDDIR - - if [ ! -e gcc-unpacked ]; then - echo "Patch unpack-gcc.sh" - - 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 - - echo "Running unpack-gcc.sh" - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ - sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 - - # 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 - - - # copy stubify programs - cp -p $PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify - - cd $BUILDDIR/ + if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then + untar gcc-${GCC_VERSION} # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" - cd gnu/gcc-${GCC_VERSION_SHORT} + cd gcc-${GCC_VERSION}/ PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ./contrib/download_prerequisites cd - @@ -206,11 +95,13 @@ if [ ! -z ${GCC_VERSION} ]; then else echo "gcc already unpacked, skipping." fi + + cd gcc-${GCC_VERSION}/ echo "Building gcc" - mkdir -p djcross || exit 1 - cd djcross + mkdir -p build-${TARGET} + cd build-${TARGET} || exit 1 TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" @@ -218,25 +109,24 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${PREFIX}" ]; then rm gcc-configure-prefix ${MAKE} distclean - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ - ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=${TARGET} \ - --program-prefix=${TARGET}- \ - --prefix=$PREFIX \ - --disable-nls \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - --enable-fat \ - ${GCC_CONFIGURE_OPTIONS} || exit 1 + PATH="${BASE}/build/tmpinst/:$PATH" \ + ../configure \ + --target=${TARGET} \ + --prefix=${PREFIX} \ + --disable-nls \ + --enable-libquadmath-support \ + --enable-version-specific-runtime-libs \ + --enable-languages=${ENABLE_LANGUAGES} \ + --enable-fat \ + ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${PREFIX} > gcc-configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi - ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" || exit 1 - ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${MAKE} -j${MAKE_JOBS} PATH="${BASE}/build/tmpinst/:$PATH" || exit 1 + ${MAKE} -j${MAKE_JOBS} PATH="${BASE}/build/tmpinst/:$PATH" install-strip || exit 1 rm ${PREFIX}/${TARGET}/etc/gcc-*-installed touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed @@ -244,29 +134,12 @@ if [ ! -z ${GCC_VERSION} ]; then export CFLAGS="$TEMP_CFLAGS" fi -# gcc done - -if [ ! -z ${DJGPP_VERSION} ]; then - # build djlsr (for dxegen / exe2coff) - cd ${BASE}/build/djgpp-${DJGPP_VERSION} - if [ "$CC" == "gcc" ] && [ ! -z ${BUILD_DXEGEN} ]; then - echo "Building DXE tools." - cd src - PATH=$PREFIX/bin/:$PATH ${MAKE} || exit 1 - cd dxe - cp -p dxegen $PREFIX/bin/${TARGET}-dxegen || exit 1 - cp -p dxe3gen $PREFIX/bin/${TARGET}-dxe3gen || exit 1 - cp -p dxe3res $PREFIX/bin/${TARGET}-dxe3res || exit 1 - cd ../.. - touch ${PREFIX}/${TARGET}/etc/dxegen-installed - else - echo "Building DXE tools requires gcc, skip." - fi - cd src/stub - ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 - cp -p exe2coff $PREFIX/bin/${TARGET}-exe2coff || exit 1 +if [ ! -z ${NEWLIB_VERSION} ]; then + #TODO build newlib +fi - # djlsr done +if [ ! -z ${GCC_VERSION} ]; then + #TODO build gcc stage2 fi cd ${BASE}/build diff --git a/script/begin.sh b/script/begin.sh index 1900c34..54deda7 100755 --- a/script/begin.sh +++ b/script/begin.sh @@ -12,11 +12,12 @@ fi export CC CXX MAKE echo "You are about to build and install:" -[ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" +[ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" +[ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" -[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" -[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" -[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" +[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" +[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" +[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" echo "" echo "With the following options:" echo " TARGET=${TARGET}" From ce70baf58be05daa9250748d6eb209841083a301 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 14:13:16 +0100 Subject: [PATCH 124/536] add newlib packages --- newlib/binutils | 1 + newlib/binutils-2.29.1 | 2 ++ newlib/binutils-2.30 | 2 ++ newlib/newlib | 3 +++ newlib/newlib-3.0.0 | 2 ++ script/begin.sh | 3 ++- 6 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 newlib/binutils create mode 100755 newlib/binutils-2.29.1 create mode 100755 newlib/binutils-2.30 create mode 100755 newlib/newlib create mode 100755 newlib/newlib-3.0.0 diff --git a/newlib/binutils b/newlib/binutils new file mode 100755 index 0000000..0cb35a8 --- /dev/null +++ b/newlib/binutils @@ -0,0 +1 @@ +source newlib/binutils-2.30 diff --git a/newlib/binutils-2.29.1 b/newlib/binutils-2.29.1 new file mode 100755 index 0000000..2b36981 --- /dev/null +++ b/newlib/binutils-2.29.1 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.29.1 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/newlib/binutils-2.30 b/newlib/binutils-2.30 new file mode 100755 index 0000000..4e2678c --- /dev/null +++ b/newlib/binutils-2.30 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.30 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/newlib/newlib b/newlib/newlib new file mode 100755 index 0000000..6a82881 --- /dev/null +++ b/newlib/newlib @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source newlib/newlib-3.0.0 diff --git a/newlib/newlib-3.0.0 b/newlib/newlib-3.0.0 new file mode 100755 index 0000000..73db25f --- /dev/null +++ b/newlib/newlib-3.0.0 @@ -0,0 +1,2 @@ +NEWLIB_VERSION=3.0.0 +NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/script/begin.sh b/script/begin.sh index 54deda7..c8104c4 100755 --- a/script/begin.sh +++ b/script/begin.sh @@ -101,7 +101,8 @@ fi # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $TAR_ARCHIVE" + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $TAR_ARCHIVE + $NEWLIB_ARCHIVE" echo "Download source files..." mkdir -p download || exit 1 From 8786d875e412c1c52bdb7faed83ec8a563030a1b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 14:26:24 +0100 Subject: [PATCH 125/536] generate setenv script based on TARGET --- script/finalize.sh | 12 ++++++++++-- setenv/copyfile.sh | 13 ------------- setenv/setenv | 6 ------ setenv/setenv.bat | 4 ---- 4 files changed, 10 insertions(+), 25 deletions(-) delete mode 100755 setenv/copyfile.sh delete mode 100644 setenv/setenv delete mode 100644 setenv/setenv.bat diff --git a/script/finalize.sh b/script/finalize.sh index 1360cc8..38a86f5 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -9,8 +9,16 @@ echo "Copy long name executables to short name." done ) -# copy setenv script -(cd ${BASE}/setenv/ && ./copyfile.sh $PREFIX) || exit 1 +echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${PREFIX}/setenv-${TARGET} +echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${PREFIX}/setenv-${TARGET} +echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${PREFIX}/setenv-${TARGET} +echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${PREFIX}/setenv-${TARGET} +echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${PREFIX}/setenv-${TARGET} + +echo "@echo off" >> ${PREFIX}/setenv-${TARGET}.bat +echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${PREFIX}/setenv-${TARGET}.bat +echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${PREFIX}/setenv-${TARGET}.bat +echo "set DJDIR=%~dp0${TARGET}" >> ${PREFIX}/setenv-${TARGET}.bat cd ${BASE}/build diff --git a/setenv/copyfile.sh b/setenv/copyfile.sh deleted file mode 100755 index 7fb8d72..0000000 --- a/setenv/copyfile.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -if [ -z $1 ]; then - echo "Missing target directory." - exit 1 -fi - -echo "Copy setenv script" -cp setenv $1/ -if uname|grep "^MINGW" > /dev/null; then - cp setenv.bat $1/ -elif uname|grep "^CYGWIN" > /dev/null; then - cp setenv.bat $1/ -fi diff --git a/setenv/setenv b/setenv/setenv deleted file mode 100644 index 9b428c9..0000000 --- a/setenv/setenv +++ /dev/null @@ -1,6 +0,0 @@ -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -export PATH="$DIR/i586-pc-msdosdjgpp/bin/:$DIR/bin/:$PATH" -export GCC_EXEC_PREFIX="$DIR/lib/gcc/" -export MANPATH="$DIR/share/man:$MANPATH" -export INFOPATH="$DIR/share/info:$INFOPATH" -export DJDIR="$DIR/i586-pc-msdosdjgpp" diff --git a/setenv/setenv.bat b/setenv/setenv.bat deleted file mode 100644 index 044a9b3..0000000 --- a/setenv/setenv.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -PATH=%~dp0i586-pc-msdosdjgpp\bin;%~dp0bin;%PATH% -set GCC_EXEC_PREFIX=%~dp0lib\gcc\ -set DJDIR=%~dp0i586-pc-msdosdjgpp From 4055282041e286894fdc80753cf47dbb52b70da8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 14:32:38 +0100 Subject: [PATCH 126/536] add tempinst directory to global PATH. --- build-djgpp.sh | 15 ++++++--------- build-newlib.sh | 15 ++++++--------- script/begin.sh | 1 - script/build-tools.sh | 3 +++ 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index ec2be50..b4da80a 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -145,9 +145,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR untar autoconf-${AUTOCONF_VERSION} || exit 1 cd autoconf-${AUTOCONF_VERSION}/ - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ ${MAKE} -j${MAKE_JOBS} all install || exit 1 rm ${BUILDDIR}/tmpinst/autoconf-*-built touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built @@ -160,9 +158,9 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR untar automake-${AUTOMAKE_VERSION} || exit 1 cd automake-${AUTOMAKE_VERSION}/ - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ ${MAKE} all install || exit 1 rm ${BUILDDIR}/tmpinst/automake-*-built touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built @@ -181,7 +179,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi echo "Running unpack-gcc.sh" - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi @@ -198,8 +196,7 @@ if [ ! -z ${GCC_VERSION} ]; then # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" cd gnu/gcc-${GCC_VERSION_SHORT} - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ - ./contrib/download_prerequisites + ./contrib/download_prerequisites cd - touch gcc-unpacked @@ -218,7 +215,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${PREFIX}" ]; then rm gcc-configure-prefix ${MAKE} distclean - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ + PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ --target=${TARGET} \ --program-prefix=${TARGET}- \ @@ -235,7 +232,7 @@ if [ ! -z ${GCC_VERSION} ]; then sleep 5 fi - ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" || exit 1 + ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:$PATH" || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${PREFIX}/${TARGET}/etc/gcc-*-installed diff --git a/build-newlib.sh b/build-newlib.sh index 5db3772..ce93dcf 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -42,7 +42,7 @@ DEPS="" for DEP in ${DEPS}; do case $DEP in newlib) - [ -z ${DJGPP_VERSION} ] \ + [ -z ${NEWLIB_VERSION} ] \ && source newlib/newlib ;; binutils) @@ -87,11 +87,9 @@ if [ ! -z ${GCC_VERSION} ]; then # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" cd gcc-${GCC_VERSION}/ - PATH="${BUILDDIR}/tmpinst/bin:${BASE}/build/tmpinst/:$PATH" \ - ./contrib/download_prerequisites - cd - - + ./contrib/download_prerequisites touch gcc-unpacked + cd - else echo "gcc already unpacked, skipping." fi @@ -109,8 +107,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${PREFIX}" ]; then rm gcc-configure-prefix ${MAKE} distclean - PATH="${BASE}/build/tmpinst/:$PATH" \ - ../configure \ + ../configure \ --target=${TARGET} \ --prefix=${PREFIX} \ --disable-nls \ @@ -125,8 +122,8 @@ if [ ! -z ${GCC_VERSION} ]; then sleep 5 fi - ${MAKE} -j${MAKE_JOBS} PATH="${BASE}/build/tmpinst/:$PATH" || exit 1 - ${MAKE} -j${MAKE_JOBS} PATH="${BASE}/build/tmpinst/:$PATH" install-strip || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${PREFIX}/${TARGET}/etc/gcc-*-installed touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed diff --git a/script/begin.sh b/script/begin.sh index c8104c4..5ba5b45 100755 --- a/script/begin.sh +++ b/script/begin.sh @@ -150,5 +150,4 @@ mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 # make build dir echo "Make build dir" mkdir -p ${BASE}/build -mkdir -p ${BASE}/build/tmpinst cd ${BASE}/build || exit 1 diff --git a/script/build-tools.sh b/script/build-tools.sh index dcf2a14..97b6fdb 100755 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -1,3 +1,6 @@ +mkdir -p ${BASE}/build/tmpinst +export PATH="${BASE}/build/tmpinst/:$PATH" + # build GNU tar if needed. TAR=tar if [ ! -z $TAR_VERSION ]; then From c40a388a45c5c7fe38c01c9cdd549bfc8ee3600b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 17:41:15 +0100 Subject: [PATCH 127/536] more work on supporting newlib... --- build-djgpp.sh | 30 +++++++------ build-newlib.sh | 93 +++++++++++++++++++++++++++++++--------- common/gcc | 2 +- common/gdb | 2 +- djgpp/all | 2 +- djgpp/default | 2 +- newlib/all | 6 +++ newlib/binutils | 2 + newlib/binutils-2.29.1 | 2 + newlib/binutils-2.30 | 2 + newlib/common | 6 +++ newlib/newlib-3.0.0 | 2 + script/begin.sh | 4 +- script/build-binutils.sh | 12 +++--- script/build-tools.sh | 6 +-- 15 files changed, 125 insertions(+), 48 deletions(-) create mode 100755 newlib/all create mode 100755 newlib/common diff --git a/build-djgpp.sh b/build-djgpp.sh index b4da80a..c79813f 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -23,17 +23,17 @@ if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" ls djgpp/ - ls script/ + ls common/ exit 1 fi while [ ! -z $1 ]; do - if [ ! -x djgpp/$1 ] && [ ! -x script/$1 ]; then + if [ ! -x djgpp/$1 ] && [ ! -x common/$1 ]; then echo "Unsupported package: $1" exit 1 fi - ([ -e djgpp/$1 ] && source djgpp/$1) || source script/$1 + [ -e djgpp/$1 ] && source djgpp/$1 || source common/$1 shift done @@ -59,24 +59,26 @@ for DEP in ${DEPS}; do gcc) [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ && [ -z ${GCC_VERSION} ] \ - && source script/gcc + && source common/gcc ;; gdb) [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ && [ -z ${GDB_VERSION} ] \ - && source script/gdb + && source common/gdb ;; dxegen) [ -z "`ls ${PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ && [ -z ${BUILD_DXEGEN} ] \ - && source script/dxegen + && source djgpp/dxegen ;; esac done -source script/begin.sh +source ${BASE}/script/begin.sh -source script/build-tools.sh +source ${BASE}/script/build-tools.sh + +cd ${BASE}/build/ || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" @@ -98,10 +100,10 @@ if [ ! -z ${BINUTILS_VERSION} ]; then chmod a+x $EXEC_FILE || exit 1 done - source script/build-binutils.sh + source ${BASE}/script/build-binutils.sh fi -cd ${BASE}/build/ +cd ${BASE}/build/ || exit 1 if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then echo "Prepare djgpp" @@ -206,8 +208,8 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Building gcc" - mkdir -p djcross || exit 1 - cd djcross + mkdir -p djcross + cd djcross || exit 1 TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" @@ -268,6 +270,6 @@ fi cd ${BASE}/build -source script/build-gdb.sh +source ${BASE}/script/build-gdb.sh -source script/finalize.sh +source ${BASE}/script/finalize.sh diff --git a/build-newlib.sh b/build-newlib.sh index ce93dcf..ba585b9 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -2,6 +2,12 @@ unset CDPATH +debug() +{ + echo $1 + read -s -n 1 +} + # target directory PREFIX=${PREFIX-/usr/local/cross} @@ -14,21 +20,26 @@ MAKE_JOBS=${MAKE_JOBS-4} BASE=`pwd` +if [ -z ${TARGET} ]; then + echo "Please specify a target with: export TARGET=..." + exit 1 +fi + if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" ls newlib/ - ls script/ + ls common/ exit 1 fi while [ ! -z $1 ]; do - if [ ! -x newlib/$1 ] && [ ! -x script/$1 ]; then + if [ ! -x newlib/$1 ] && [ ! -x common/$1 ]; then echo "Unsupported package: $1" exit 1 fi - ([ -e newlib/$1 ] && source newlib/$1) || source script/$1 + [ -e newlib/$1 ] && source newlib/$1 || source common/$1 shift done @@ -52,19 +63,21 @@ for DEP in ${DEPS}; do ;; gcc) [ -z ${GCC_VERSION} ] \ - && source script/gcc + && source common/gcc ;; gdb) [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ && [ -z ${GDB_VERSION} ] \ - && source script/gdb + && source common/gdb ;; esac done -source script/begin.sh +source ${BASE}/script/begin.sh -source script/build-tools.sh +source ${BASE}/script/build-tools.sh + +cd ${BASE}/build/ || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" @@ -75,11 +88,16 @@ if [ ! -z ${BINUTILS_VERSION} ]; then cd binutils-${BINUTILS_VERSION} || exit 1 - source script/build-binutils.sh + source ${BASE}/script/build-binutils.sh fi cd ${BASE}/build/ +if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then + untar newlib-${NEWLIB_VERSION} + touch newlib-${NEWLIB_VERSION}/newlib-unpacked +fi + if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then untar gcc-${GCC_VERSION} @@ -93,19 +111,17 @@ if [ ! -z ${GCC_VERSION} ]; then else echo "gcc already unpacked, skipping." fi - - cd gcc-${GCC_VERSION}/ echo "Building gcc" - mkdir -p build-${TARGET} - cd build-${TARGET} || exit 1 + mkdir -p gcc-${GCC_VERSION}/build-${TARGET} + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${PREFIX}" ]; then - rm gcc-configure-prefix + if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then + rm configure-prefix ${MAKE} distclean ../configure \ --target=${TARGET} \ @@ -115,32 +131,67 @@ if [ ! -z ${GCC_VERSION} ]; then --enable-version-specific-runtime-libs \ --enable-languages=${ENABLE_LANGUAGES} \ --enable-fat \ + --with-newlib \ ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${PREFIX} > gcc-configure-prefix + echo ${PREFIX} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi + debug "gcc configured." ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + debug "gcc built." + ${MAKE} -j${MAKE_JOBS} install || exit 1 - rm ${PREFIX}/${TARGET}/etc/gcc-*-installed - touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + debug "gcc installed." export CFLAGS="$TEMP_CFLAGS" fi +cd ${BASE}/build/ + if [ ! -z ${NEWLIB_VERSION} ]; then #TODO build newlib + mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} + cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 + if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then + rm configure-prefix + ${MAKE} distclean + ../configure \ + --prefix=${PREFIX} \ + --target=${TARGET} \ + ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 + echo ${PREFIX} > configure-prefix + else + echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + debug "newlib configured." + + ${MAKE} -j${MAKE_JOBS} || exit 1 + debug "newlib built." + ${MAKE} -j${MAKE_JOBS} install || exit 1 + + debug "newlib installed." fi +cd ${BASE}/build/ + if [ ! -z ${GCC_VERSION} ]; then - #TODO build gcc stage2 + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + ${MAKE} -j${MAKE_JOBS} || exit 1 + debug "gcc built." + ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + debug "gcc installed." + + rm ${PREFIX}/${TARGET}/etc/gcc-*-installed + touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed fi cd ${BASE}/build -source script/build-gdb.sh +source ${BASE}/script/build-gdb.sh -source script/finalize.sh +source ${BASE}/script/finalize.sh diff --git a/common/gcc b/common/gcc index ac99cdd..9cae180 100755 --- a/common/gcc +++ b/common/gcc @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source script/gcc-7.3.0 +source common/gcc-7.3.0 diff --git a/common/gdb b/common/gdb index 6cd8fce..f9bd37d 100755 --- a/common/gdb +++ b/common/gdb @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source script/gdb-8.0.1 +source common/gdb-8.0.1 diff --git a/djgpp/all b/djgpp/all index 1c95f84..41810fe 100755 --- a/djgpp/all +++ b/djgpp/all @@ -2,4 +2,4 @@ source djgpp/default source djgpp/dxegen -source script/gdb +source common/gdb diff --git a/djgpp/default b/djgpp/default index 4d5545f..9d5336f 100755 --- a/djgpp/default +++ b/djgpp/default @@ -2,4 +2,4 @@ source djgpp/djgpp source djgpp/binutils -source script/gcc +source common/gcc diff --git a/newlib/all b/newlib/all new file mode 100755 index 0000000..3b10e52 --- /dev/null +++ b/newlib/all @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +source newlib/newlib +source newlib/binutils +source common/gcc +source common/gdb diff --git a/newlib/binutils b/newlib/binutils index 0cb35a8..78136a3 100755 --- a/newlib/binutils +++ b/newlib/binutils @@ -1 +1,3 @@ +#!/usr/bin/env bash + source newlib/binutils-2.30 diff --git a/newlib/binutils-2.29.1 b/newlib/binutils-2.29.1 index 2b36981..5625d2f 100755 --- a/newlib/binutils-2.29.1 +++ b/newlib/binutils-2.29.1 @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + BINUTILS_VERSION=2.29.1 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/newlib/binutils-2.30 b/newlib/binutils-2.30 index 4e2678c..78221f5 100755 --- a/newlib/binutils-2.30 +++ b/newlib/binutils-2.30 @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + BINUTILS_VERSION=2.30 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/newlib/common b/newlib/common new file mode 100755 index 0000000..3b10e52 --- /dev/null +++ b/newlib/common @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +source newlib/newlib +source newlib/binutils +source common/gcc +source common/gdb diff --git a/newlib/newlib-3.0.0 b/newlib/newlib-3.0.0 index 73db25f..80f7f67 100755 --- a/newlib/newlib-3.0.0 +++ b/newlib/newlib-3.0.0 @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + NEWLIB_VERSION=3.0.0 NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/script/begin.sh b/script/begin.sh index 5ba5b45..c4cbdef 100755 --- a/script/begin.sh +++ b/script/begin.sh @@ -39,6 +39,9 @@ fi if [ ! -z ${GDB_VERSION} ]; then echo " GDB_CONFIGURE_OPTIONS=`echo ${GDB_CONFIGURE_OPTIONS}`" fi +if [ ! -z ${NEWLIB_VERSION} ]; then + echo " NEWLIB_CONFIGURE_OPTIONS=`echo ${NEWLIB_CONFIGURE_OPTIONS}`" +fi echo "" echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." read -s -n 1 @@ -150,4 +153,3 @@ mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 # make build dir echo "Make build dir" mkdir -p ${BASE}/build -cd ${BASE}/build || exit 1 diff --git a/script/build-binutils.sh b/script/build-binutils.sh index f229441..51f752a 100755 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -1,7 +1,7 @@ mkdir -p build-${TARGET} cd build-${TARGET} || exit 1 -if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = "${PREFIX}" ]; then - rm binutils-configure-prefix +if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then + rm configure-prefix ${MAKE} distclean ../configure \ --prefix=$PREFIX \ @@ -11,14 +11,16 @@ if [ ! -e binutils-configure-prefix ] || [ ! `cat binutils-configure-prefix` = " --disable-nls \ ${BINUTILS_CONFIGURE_OPTIONS} \ || exit 1 - echo ${PREFIX} > binutils-configure-prefix + echo ${PREFIX} > configure-prefix else echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi -${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 -${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 +if [ ${TARGET} == "i586-pc-msdosdjgpp" ]; then + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 + ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 +fi ${MAKE} -j${MAKE_JOBS} || exit 1 if [ ! -z $MAKE_CHECK ]; then diff --git a/script/build-tools.sh b/script/build-tools.sh index 97b6fdb..4a26b78 100755 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -1,5 +1,7 @@ mkdir -p ${BASE}/build/tmpinst -export PATH="${BASE}/build/tmpinst/:$PATH" +export PATH="${BASE}/build/tmpinst:$PATH" + +cd ${BASE}/build/ || exit 1 # build GNU tar if needed. TAR=tar @@ -37,5 +39,3 @@ if [ ! -z $SED_VERSION ]; then fi SED=${BASE}/build/tmpinst/bin/sed fi - -cd ${BASE}/build || exit 1 From b1c5e2d7876adf0ce066eff72dc55e803e1c2c90 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 3 Feb 2018 19:02:44 +0100 Subject: [PATCH 128/536] added build-glibc.sh --- build-glibc.sh | 142 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 build-glibc.sh diff --git a/build-glibc.sh b/build-glibc.sh new file mode 100644 index 0000000..82dd130 --- /dev/null +++ b/build-glibc.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash + +unset CDPATH + +debug() +{ + echo $1 + read -s -n 1 +} + +# target directory +PREFIX=${PREFIX-/usr/local/cross} + +# enabled languages +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} +ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} + +# number of parallel build threads +MAKE_JOBS=${MAKE_JOBS-4} + +BASE=`pwd` + +if [ -z ${TARGET} ]; then + echo "Please specify a target with: export TARGET=..." + exit 1 +fi + +if [ -z $1 ]; then + echo "Usage: $0 [packages...]" + echo "Supported packages:" + ls newlib/ + ls common/ + exit 1 +fi + +while [ ! -z $1 ]; do + if [ ! -x newlib/$1 ] && [ ! -x common/$1 ]; then + echo "Unsupported package: $1" + exit 1 + fi + + [ -e newlib/$1 ] && source newlib/$1 || source common/$1 + shift +done + +DEPS="" + +[ ! -z ${GCC_VERSION} ] && DEPS+=" binutils" +[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " +[ ! -z ${GDB_VERSION} ] && DEPS+=" " + +for DEP in ${DEPS}; do + case $DEP in + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source newlib/binutils + ;; + gcc) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ + && [ -z ${GCC_VERSION} ] \ + && source common/gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source common/gdb + ;; + esac +done + +source ${BASE}/script/begin.sh + +source ${BASE}/script/build-tools.sh + +cd ${BASE}/build/ || exit 1 + +if [ ! -z ${BINUTILS_VERSION} ]; then + echo "Building binutils" + if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + untar binutils-${BINUTILS_VERSION} || exit 1 + touch binutils-${BINUTILS_VERSION}/binutils-unpacked + fi + + cd binutils-${BINUTILS_VERSION} || exit 1 + + source ${BASE}/script/build-binutils.sh +fi + +cd ${BASE}/build/ + +if [ ! -z ${GCC_VERSION} ]; then + if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then + untar gcc-${GCC_VERSION} + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gcc-${GCC_VERSION}/ + ./contrib/download_prerequisites + touch gcc-unpacked + cd - + else + echo "gcc already unpacked, skipping." + fi + + echo "Building gcc" + + mkdir -p gcc-${GCC_VERSION}/build-${TARGET} + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + + if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then + rm configure-prefix + ${MAKE} distclean + ../configure \ + --target=${TARGET} \ + --prefix=${PREFIX} \ + --disable-nls \ + --enable-libquadmath-support \ + --enable-version-specific-runtime-libs \ + --enable-languages=${ENABLE_LANGUAGES} \ + --enable-fat \ + ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${PREFIX} > configure-prefix + else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 + + export CFLAGS="$TEMP_CFLAGS" +fi + +cd ${BASE}/build + +source ${BASE}/script/build-gdb.sh + +source ${BASE}/script/finalize.sh From 32b54091df936ec2bcd7c82bb51194dc6100424d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 10:48:20 +0100 Subject: [PATCH 129/536] more work on supporting newlib and glibc based cross compilers. --- build-djgpp.sh | 37 +++++++++++-------- build-glibc.sh | 33 ++++++++++------- build-newlib.sh | 78 ++++++++++++++++++++-------------------- script/begin.sh | 2 ++ script/build-binutils.sh | 20 +++++------ script/build-gdb.sh | 19 +++++----- 6 files changed, 102 insertions(+), 87 deletions(-) mode change 100644 => 100755 build-glibc.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index c79813f..40457a6 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -17,6 +17,21 @@ MAKE_JOBS=${MAKE_JOBS-4} #DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" +BINUTILS_CONFIGURE_OPTIONS="--disable-werror + --disable-nls + ${BINUTILS_CONFIGURE_OPTIONS}" + +GCC_CONFIGURE_OPTIONS="--disable-nls + --enable-libquadmath-support + --enable-version-specific-runtime-libs + --enable-fat + ${GCC_CONFIGURE_OPTIONS}" + + +GDB_CONFIGURE_OPTIONS="--disable-werror + --disable-nls + ${GDB_CONFIGURE_OPTIONS}" + BASE=`pwd` if [ -z $1 ]; then @@ -213,22 +228,16 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} + --enable-languages=${ENABLE_LANGUAGES}" + GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" - if [ ! -e gcc-configure-prefix ] || [ ! `cat gcc-configure-prefix` = "${PREFIX}" ]; then - rm gcc-configure-prefix - ${MAKE} distclean + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GCC_CONFIGURE_OPTIONS}" ]; then + cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ - ../gnu/gcc-${GCC_VERSION_SHORT}/configure \ - --target=${TARGET} \ - --program-prefix=${TARGET}- \ - --prefix=$PREFIX \ - --disable-nls \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - --enable-fat \ - ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${PREFIX} > gcc-configure-prefix + ../gnu/gcc-${GCC_VERSION_SHORT}/configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 diff --git a/build-glibc.sh b/build-glibc.sh old mode 100644 new mode 100755 index 82dd130..5bb6688 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -18,6 +18,20 @@ ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads MAKE_JOBS=${MAKE_JOBS-4} +BINUTILS_CONFIGURE_OPTIONS="--disable-werror + --disable-nls + ${BINUTILS_CONFIGURE_OPTIONS}" + +GCC_CONFIGURE_OPTIONS="--disable-nls + --enable-libquadmath-support + --enable-version-specific-runtime-libs + --enable-fat + ${GCC_CONFIGURE_OPTIONS}" + +GDB_CONFIGURE_OPTIONS="--disable-werror + --disable-nls + ${GDB_CONFIGURE_OPTIONS}" + BASE=`pwd` if [ -z ${TARGET} ]; then @@ -111,18 +125,13 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} + --enable-languages=${ENABLE_LANGUAGES}" + GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" + if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then - rm configure-prefix - ${MAKE} distclean - ../configure \ - --target=${TARGET} \ - --prefix=${PREFIX} \ - --disable-nls \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - --enable-fat \ - ${GCC_CONFIGURE_OPTIONS} || exit 1 + cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${PREFIX} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" @@ -130,7 +139,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 export CFLAGS="$TEMP_CFLAGS" fi diff --git a/build-newlib.sh b/build-newlib.sh index ba585b9..daa9877 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -18,6 +18,22 @@ ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads MAKE_JOBS=${MAKE_JOBS-4} + +BINUTILS_CONFIGURE_OPTIONS="--disable-werror + --disable-nls + ${BINUTILS_CONFIGURE_OPTIONS}" + +GCC_CONFIGURE_OPTIONS="--disable-nls + --enable-libquadmath-support + --enable-version-specific-runtime-libs + --enable-fat + ${GCC_CONFIGURE_OPTIONS}" + +GDB_CONFIGURE_OPTIONS="--disable-werror + --disable-nls + ${GDB_CONFIGURE_OPTIONS}" + + BASE=`pwd` if [ -z ${TARGET} ]; then @@ -85,9 +101,8 @@ if [ ! -z ${BINUTILS_VERSION} ]; then untar binutils-${BINUTILS_VERSION} || exit 1 touch binutils-unpacked fi - - cd binutils-${BINUTILS_VERSION} || exit 1 + cd binutils-${BINUTILS_VERSION} || exit 1 source ${BASE}/script/build-binutils.sh fi @@ -95,6 +110,8 @@ cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then untar newlib-${NEWLIB_VERSION} + mkdir -p ${PREFIX}/${TARGET}/sys-include/ + cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 touch newlib-${NEWLIB_VERSION}/newlib-unpacked fi @@ -119,32 +136,23 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - - if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then - rm configure-prefix - ${MAKE} distclean - ../configure \ - --target=${TARGET} \ - --prefix=${PREFIX} \ - --disable-nls \ - --enable-libquadmath-support \ - --enable-version-specific-runtime-libs \ - --enable-languages=${ENABLE_LANGUAGES} \ - --enable-fat \ - --with-newlib \ - ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${PREFIX} > configure-prefix + + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} + --enable-languages=${ENABLE_LANGUAGES} + --with-newlib" + GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then + cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi - debug "gcc configured." - - ${MAKE} -j${MAKE_JOBS} || exit 1 - debug "gcc built." - ${MAKE} -j${MAKE_JOBS} install || exit 1 - debug "gcc installed." + ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 export CFLAGS="$TEMP_CFLAGS" fi @@ -152,28 +160,24 @@ fi cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ]; then - #TODO build newlib mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 - if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then - rm configure-prefix - ${MAKE} distclean - ../configure \ - --prefix=${PREFIX} \ - --target=${TARGET} \ - ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 - echo ${PREFIX} > configure-prefix + + NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" + NEWLIB_CONFIGURE_OPTIONS="`echo ${NEWLIB_CONFIGURE_OPTIONS}`" + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then + cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 + echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi - debug "newlib configured." ${MAKE} -j${MAKE_JOBS} || exit 1 - debug "newlib built." + ${MAKE} -j${MAKE_JOBS} install || \ ${MAKE} -j${MAKE_JOBS} install || exit 1 - - debug "newlib installed." fi cd ${BASE}/build/ @@ -182,9 +186,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 - debug "gcc built." ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - debug "gcc installed." rm ${PREFIX}/${TARGET}/etc/gcc-*-installed touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed diff --git a/script/begin.sh b/script/begin.sh index c4cbdef..b5909f2 100755 --- a/script/begin.sh +++ b/script/begin.sh @@ -150,6 +150,8 @@ fi mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 +export PATH="${PREFIX}/bin:$PATH" + # make build dir echo "Make build dir" mkdir -p ${BASE}/build diff --git a/script/build-binutils.sh b/script/build-binutils.sh index 51f752a..86375a8 100755 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -1,17 +1,13 @@ mkdir -p build-${TARGET} cd build-${TARGET} || exit 1 -if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then - rm configure-prefix - ${MAKE} distclean - ../configure \ - --prefix=$PREFIX \ - --target=${TARGET} \ - --program-prefix=${TARGET}- \ - --disable-werror \ - --disable-nls \ - ${BINUTILS_CONFIGURE_OPTIONS} \ - || exit 1 - echo ${PREFIX} > configure-prefix + +BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" +BINUTILS_CONFIGURE_OPTIONS="`echo ${BINUTILS_CONFIGURE_OPTIONS}`" + +if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${BINUTILS_CONFIGURE_OPTIONS}" ]; then + cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + ../configure ${BINUTILS_CONFIGURE_OPTIONS} || exit 1 + echo ${BINUTILS_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 6126dea..782ccbf 100755 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -8,17 +8,14 @@ if [ ! -z ${GDB_VERSION} ]; then cd gdb-${GDB_VERSION}/build-${TARGET} || exit 1 echo "Building gdb." - if [ ! -e gdb-configure-prefix ] || [ ! `cat gdb-configure-prefix` = "${PREFIX}" ]; then - rm gdb-configure-prefix - ${MAKE} distclean - ../configure \ - --prefix=${PREFIX} \ - --target=${TARGET} \ - --disable-werror \ - --disable-nls \ - ${GDB_CONFIGURE_OPTIONS} \ - || exit 1 - echo ${PREFIX} > gdb-configure-prefix + + GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" + GDB_CONFIGURE_OPTIONS="`echo ${GDB_CONFIGURE_OPTIONS}`" + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then + cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + ../configure ${GDB_CONFIGURE_OPTIONS} || exit 1 + echo ${GDB_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 From eef97cc70fbacd2f634262d843373cdc86a00aa2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 11:08:06 +0100 Subject: [PATCH 130/536] added build-ia16.sh --- build-ia16.sh | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++ ia16/gcc | 8 ++ ia16/newlib | 3 + 3 files changed, 208 insertions(+) create mode 100755 build-ia16.sh create mode 100755 ia16/gcc create mode 100755 ia16/newlib diff --git a/build-ia16.sh b/build-ia16.sh new file mode 100755 index 0000000..40b5d4b --- /dev/null +++ b/build-ia16.sh @@ -0,0 +1,197 @@ +#!/usr/bin/env bash + +unset CDPATH + +# target directory +PREFIX=${PREFIX-/usr/local/ia16} + +# enabled languages +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} +ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} + +# number of parallel build threads +MAKE_JOBS=${MAKE_JOBS-4} + +TARGET="ia16-none-elf" + +BINUTILS_CONFIGURE_OPTIONS="--disable-werror + --disable-nls + ${BINUTILS_CONFIGURE_OPTIONS}" + +GCC_CONFIGURE_OPTIONS="--disable-nls + --enable-libquadmath-support + --enable-version-specific-runtime-libs + --enable-fat + ${GCC_CONFIGURE_OPTIONS}" + +GDB_CONFIGURE_OPTIONS="--disable-werror + --disable-nls + ${GDB_CONFIGURE_OPTIONS}" + + +BASE=`pwd` + +if [ -z ${TARGET} ]; then + echo "Please specify a target with: export TARGET=..." + exit 1 +fi + +if [ -z $1 ]; then + echo "Usage: $0 [packages...]" + echo "Supported packages:" + ls ia16/ + ls common/ + exit 1 +fi + +while [ ! -z $1 ]; do + if [ ! -x ia16/$1 ]; then + echo "Unsupported package: $1" + exit 1 + fi + + [ -e ia16/$1 ] && source ia16/$1 || source common/$1 + shift +done + +DEPS="" + +[ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" +[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " +[ ! -z ${GDB_VERSION} ] && DEPS+=" " +[ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" + +for DEP in ${DEPS}; do + case $DEP in + newlib) + [ -z ${NEWLIB_VERSION} ] \ + && source ia16/newlib + ;; + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source newlib/binutils + ;; + gcc) + [ -z ${GCC_VERSION} ] \ + && source common/gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source common/gdb + ;; + esac +done + +source ${BASE}/script/begin.sh + +source ${BASE}/script/build-tools.sh + +cd ${BASE}/build/ || exit 1 + +git clone https://github.com/tkchia/gcc-ia16.git --depth 1 --branch gcc-6_3_0-ia16-tkchia +git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia + +if [ ! -z ${BINUTILS_VERSION} ]; then + echo "Building binutils" + if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + untar binutils-${BINUTILS_VERSION} || exit 1 + touch binutils-unpacked + fi + + cd binutils-${BINUTILS_VERSION} || exit 1 + source ${BASE}/script/build-binutils.sh +fi + +cd ${BASE}/build/ + +if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then + untar newlib-${NEWLIB_VERSION} + mkdir -p ${PREFIX}/${TARGET}/sys-include/ + cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + touch newlib-${NEWLIB_VERSION}/newlib-unpacked +fi + +if [ ! -z ${GCC_VERSION} ]; then + if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then + untar gcc-${GCC_VERSION} + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gcc-${GCC_VERSION}/ + ./contrib/download_prerequisites + touch gcc-unpacked + cd - + else + echo "gcc already unpacked, skipping." + fi + + echo "Building gcc" + + mkdir -p gcc-${GCC_VERSION}/build-${TARGET} + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} + --enable-languages=${ENABLE_LANGUAGES} + --with-newlib" + GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then + cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 + + export CFLAGS="$TEMP_CFLAGS" +fi + +cd ${BASE}/build/ + +if [ ! -z ${NEWLIB_VERSION} ]; then + mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} + cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 + + NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" + NEWLIB_CONFIGURE_OPTIONS="`echo ${NEWLIB_CONFIGURE_OPTIONS}`" + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then + cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 + echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || \ + ${MAKE} -j${MAKE_JOBS} install || exit 1 +fi + +cd ${BASE}/build/ + +if [ ! -z ${GCC_VERSION} ]; then + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + + rm ${PREFIX}/${TARGET}/etc/gcc-*-installed + touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed +fi + +cd ${BASE}/build + +source ${BASE}/script/build-gdb.sh + +source ${BASE}/script/finalize.sh diff --git a/ia16/gcc b/ia16/gcc new file mode 100755 index 0000000..205f249 --- /dev/null +++ b/ia16/gcc @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +export GCC_VERSION="ia16" + +export GCC_CONFIGURE_OPTIONS="--disable-plugin + --enable-lto + --disable-libstdcxx-dual-abi + ${GCC_CONFIGURE_OPTIONS}" diff --git a/ia16/newlib b/ia16/newlib new file mode 100755 index 0000000..4632a86 --- /dev/null +++ b/ia16/newlib @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +NEWLIB_VERSION="ia16" From 7494c306fda10d865291bc49cdf6df0f2984d866 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 11:12:25 +0100 Subject: [PATCH 131/536] only download djcross package when building djgpp. --- build-djgpp.sh | 6 ++++++ script/begin.sh | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 40457a6..528a0c9 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -89,6 +89,12 @@ for DEP in ${DEPS}; do esac done +if [ ! -z ${GCC_VERSION} ]; then + DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" + # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. + OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} +fi + source ${BASE}/script/begin.sh source ${BASE}/script/build-tools.sh diff --git a/script/begin.sh b/script/begin.sh index b5909f2..5a9daf6 100755 --- a/script/begin.sh +++ b/script/begin.sh @@ -95,12 +95,6 @@ fi rm test-zlib 2>/dev/null rm test-zlib.exe 2>/dev/null -if [ ! -z ${GCC_VERSION} ]; then - DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" - # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. - OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} -fi - # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE From 1378a1eceddf534758cdd11805e120d12302c2c6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 11:48:10 +0100 Subject: [PATCH 132/536] fixed a bug in clearing the build dir on reconfigure. added tmpinst directory to global path. --- build-djgpp.sh | 11 +++++------ build-glibc.sh | 2 +- build-ia16.sh | 14 ++++++++++---- build-newlib.sh | 4 ++-- ia16/binutils | 3 +++ script/build-binutils.sh | 2 +- script/build-gdb.sh | 2 +- 7 files changed, 23 insertions(+), 15 deletions(-) create mode 100755 ia16/binutils diff --git a/build-djgpp.sh b/build-djgpp.sh index 528a0c9..fc1b691 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -162,6 +162,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` + export PATH="${BUILDDIR}/tmpinst/bin:$PATH" if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" @@ -202,8 +203,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi echo "Running unpack-gcc.sh" - PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ - sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" @@ -240,16 +240,15 @@ if [ ! -z ${GCC_VERSION} ]; then GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GCC_CONFIGURE_OPTIONS}" ]; then - cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 - PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ - ../gnu/gcc-${GCC_VERSION_SHORT}/configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + rm -rf * + ../gnu/gcc-${GCC_VERSION_SHORT}/configure ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi - ${MAKE} -j${MAKE_JOBS} PATH="${BUILDDIR}/tmpinst/bin:$PATH" || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${PREFIX}/${TARGET}/etc/gcc-*-installed diff --git a/build-glibc.sh b/build-glibc.sh index 5bb6688..5db436e 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -130,7 +130,7 @@ if [ ! -z ${GCC_VERSION} ]; then GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then - cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + rm -rf * ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${PREFIX} > configure-prefix else diff --git a/build-ia16.sh b/build-ia16.sh index 40b5d4b..7f651b5 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -90,8 +90,14 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 -git clone https://github.com/tkchia/gcc-ia16.git --depth 1 --branch gcc-6_3_0-ia16-tkchia -git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia +[ -d gcc-ia16 ] || git clone https://github.com/tkchia/gcc-ia16.git --depth 1 --branch gcc-6_3_0-ia16-tkchia +cd gcc-ia16 && git pull && cd .. || exit 1 + +[ -d newlib-ia16 ] || git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia +cd newlib-ia16 && git pull && cd .. || exit 1 + +#[ -d binutils-ia16 ] || git clone https://github.com/crtc-demos/binutils-ia16.git --depth 1 --branch master +#cd binutils-ia16 && git pull && cd .. || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" @@ -141,7 +147,7 @@ if [ ! -z ${GCC_VERSION} ]; then GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then - cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + rm -rf * ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else @@ -165,7 +171,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then NEWLIB_CONFIGURE_OPTIONS="`echo ${NEWLIB_CONFIGURE_OPTIONS}`" if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then - cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + rm -rf * ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix else diff --git a/build-newlib.sh b/build-newlib.sh index daa9877..d64ae40 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -143,7 +143,7 @@ if [ ! -z ${GCC_VERSION} ]; then GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then - cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + rm -rf * ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else @@ -167,7 +167,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then NEWLIB_CONFIGURE_OPTIONS="`echo ${NEWLIB_CONFIGURE_OPTIONS}`" if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then - cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + rm -rf * ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix else diff --git a/ia16/binutils b/ia16/binutils new file mode 100755 index 0000000..bd6f94b --- /dev/null +++ b/ia16/binutils @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +BINUTILS_VERSION="ia16" diff --git a/script/build-binutils.sh b/script/build-binutils.sh index 86375a8..c65ca7c 100755 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -5,7 +5,7 @@ BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" BINUTILS_CONFIGURE_OPTIONS="`echo ${BINUTILS_CONFIGURE_OPTIONS}`" if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${BINUTILS_CONFIGURE_OPTIONS}" ]; then - cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + rm -rf * ../configure ${BINUTILS_CONFIGURE_OPTIONS} || exit 1 echo ${BINUTILS_CONFIGURE_OPTIONS} > configure-prefix else diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 782ccbf..01ce400 100755 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -13,7 +13,7 @@ if [ ! -z ${GDB_VERSION} ]; then GDB_CONFIGURE_OPTIONS="`echo ${GDB_CONFIGURE_OPTIONS}`" if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then - cd .. && rm -rf build-${TARGET}/ && cd - || exit 1 + rm -rf * ../configure ${GDB_CONFIGURE_OPTIONS} || exit 1 echo ${GDB_CONFIGURE_OPTIONS} > configure-prefix else From d011f08da7ee0c6985dc00b35b0c52a043e9418d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 11:55:44 +0100 Subject: [PATCH 133/536] don't untar non-existent files. --- build-ia16.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-ia16.sh b/build-ia16.sh index 7f651b5..670f72b 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -113,7 +113,7 @@ fi cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then - untar newlib-${NEWLIB_VERSION} + #untar newlib-${NEWLIB_VERSION} mkdir -p ${PREFIX}/${TARGET}/sys-include/ cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 touch newlib-${NEWLIB_VERSION}/newlib-unpacked @@ -121,7 +121,7 @@ fi if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then - untar gcc-${GCC_VERSION} + #untar gcc-${GCC_VERSION} # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" From ac07ea242e149b445fb6b3264a9f5bc46b4f78fa Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 12:50:08 +0100 Subject: [PATCH 134/536] patch a bug in gcc-ia16 that breaks building on gcc 7. --- build-ia16.sh | 6 +++++- patch/patch-gcc-ia16.txt | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 patch/patch-gcc-ia16.txt diff --git a/build-ia16.sh b/build-ia16.sh index 670f72b..3107f9a 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -91,7 +91,11 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 [ -d gcc-ia16 ] || git clone https://github.com/tkchia/gcc-ia16.git --depth 1 --branch gcc-6_3_0-ia16-tkchia -cd gcc-ia16 && git pull && cd .. || exit 1 +cd gcc-ia16 +git reset --hard HEAD +git pull || exit 1 +patch -p1 -u < ${BASE}/patch/patch-gcc-ia16.txt +cd .. [ -d newlib-ia16 ] || git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia cd newlib-ia16 && git pull && cd .. || exit 1 diff --git a/patch/patch-gcc-ia16.txt b/patch/patch-gcc-ia16.txt new file mode 100644 index 0000000..63ff951 --- /dev/null +++ b/patch/patch-gcc-ia16.txt @@ -0,0 +1,13 @@ +diff --git a/gcc/ubsan.c b/gcc/ubsan.c +index 56637d8f0..109382498 100644 +--- a/gcc/ubsan.c ++++ b/gcc/ubsan.c +@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc) + + expanded_location xloc = expand_location (loc); + if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0 +- || xloc.file == '\0' || xloc.file[0] == '\xff' ++ || xloc.file[0] == '\0' || xloc.file[0] == '\xff' + || xloc.file[1] == '\xff') + return false; + From cb557ad64ab80a4d6993f60316774c3453cc2158 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 12:52:49 +0100 Subject: [PATCH 135/536] include the correct gcc version file in ia16 --- build-ia16.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-ia16.sh b/build-ia16.sh index 3107f9a..5ea4def 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -74,7 +74,7 @@ for DEP in ${DEPS}; do ;; gcc) [ -z ${GCC_VERSION} ] \ - && source common/gcc + && source ia16/gcc ;; gdb) [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ From 051b445ef4d3e5dfb6c8e89cbfa1e4360dcf246e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 12:53:06 +0100 Subject: [PATCH 136/536] build the most recent binutils for ia16 --- ia16/binutils | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ia16/binutils b/ia16/binutils index bd6f94b..68ed9df 100755 --- a/ia16/binutils +++ b/ia16/binutils @@ -1,3 +1,4 @@ #!/usr/bin/env bash -BINUTILS_VERSION="ia16" +#BINUTILS_VERSION="ia16" +source newlib/binutils From 544e810ba5c15757b8a7f3a53aedac98bc06def5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 12:54:09 +0100 Subject: [PATCH 137/536] install to /usr/local/cross by default. --- build-djgpp.sh | 2 +- build-ia16.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index fc1b691..81b38f9 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -3,7 +3,7 @@ unset CDPATH # target directory -PREFIX=${PREFIX-/usr/local/djgpp} +PREFIX=${PREFIX-/usr/local/cross} TARGET="i586-pc-msdosdjgpp" diff --git a/build-ia16.sh b/build-ia16.sh index 5ea4def..abd2e48 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -3,7 +3,7 @@ unset CDPATH # target directory -PREFIX=${PREFIX-/usr/local/ia16} +PREFIX=${PREFIX-/usr/local/cross} # enabled languages #ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} From f9b35730fe34c7cfa2aa830d083117fba338ac9e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 12:55:40 +0100 Subject: [PATCH 138/536] addition to incomplete commit 051b445e --- build-ia16.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-ia16.sh b/build-ia16.sh index abd2e48..1a0bb56 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -70,7 +70,7 @@ for DEP in ${DEPS}; do binutils) [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ && [ -z ${BINUTILS_VERSION} ] \ - && source newlib/binutils + && source ia16/binutils ;; gcc) [ -z ${GCC_VERSION} ] \ From 4d065c1b0d4b0de93a4c897beb340fe4c935796a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 14:11:44 +0100 Subject: [PATCH 139/536] newlib-ia16: build libnosys first and patch libgloss makefile, so it doesn't break when it fails to create a symlink. for some reason this doesn't work on my mingw. the symlink is created but ln always returns failure. --- build-ia16.sh | 10 +++++++--- patch/patch-newlib-ia16.txt | 13 +++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 patch/patch-newlib-ia16.txt diff --git a/build-ia16.sh b/build-ia16.sh index 1a0bb56..98b92a0 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -40,7 +40,6 @@ if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" ls ia16/ - ls common/ exit 1 fi @@ -50,7 +49,7 @@ while [ ! -z $1 ]; do exit 1 fi - [ -e ia16/$1 ] && source ia16/$1 || source common/$1 + [ -e ia16/$1 ] && source ia16/$1 shift done @@ -98,7 +97,11 @@ patch -p1 -u < ${BASE}/patch/patch-gcc-ia16.txt cd .. [ -d newlib-ia16 ] || git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia -cd newlib-ia16 && git pull && cd .. || exit 1 +cd newlib-ia16 +git reset --hard HEAD +git pull || exit 1 +patch -p1 -u < ${BASE}/patch/patch-newlib-ia16.txt +cd .. #[ -d binutils-ia16 ] || git clone https://github.com/crtc-demos/binutils-ia16.git --depth 1 --branch master #cd binutils-ia16 && git pull && cd .. || exit 1 @@ -183,6 +186,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then sleep 5 fi + ${MAKE} -C ${TARGET}/libgloss/libnosys libnosys.a || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 ${MAKE} -j${MAKE_JOBS} install || \ ${MAKE} -j${MAKE_JOBS} install || exit 1 diff --git a/patch/patch-newlib-ia16.txt b/patch/patch-newlib-ia16.txt new file mode 100644 index 0000000..4e754ac --- /dev/null +++ b/patch/patch-newlib-ia16.txt @@ -0,0 +1,13 @@ +diff --git a/libgloss/ia16/Makefile.in b/libgloss/ia16/Makefile.in +index ec1db6e..932757a 100644 +--- a/libgloss/ia16/Makefile.in ++++ b/libgloss/ia16/Makefile.in +@@ -193,7 +193,7 @@ dos-write.o: dos-write.S call-cvt.h + # matter whether libnosys.a is built yet when the rule is executed. + libnosys.a: + rm -f $@ +- ln -s ../libnosys/libnosys.a ++ -ln -s ../libnosys/libnosys.a + + $(DOS_TINY_BSP) : $(DOS_TINY_OBJS) + $(AR) rcs $@ $+ From 9d3d8830a345ab79631d73a3414121a2e0f27b1f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 14:49:23 +0100 Subject: [PATCH 140/536] change default configure options for ia16 --- build-ia16.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-ia16.sh b/build-ia16.sh index 98b92a0..7f33962 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -19,8 +19,6 @@ BINUTILS_CONFIGURE_OPTIONS="--disable-werror ${BINUTILS_CONFIGURE_OPTIONS}" GCC_CONFIGURE_OPTIONS="--disable-nls - --enable-libquadmath-support - --enable-version-specific-runtime-libs --enable-fat ${GCC_CONFIGURE_OPTIONS}" @@ -28,6 +26,9 @@ GDB_CONFIGURE_OPTIONS="--disable-werror --disable-nls ${GDB_CONFIGURE_OPTIONS}" +NEWLIB_CONFIGURE_OPTIONS="--enable-newlib-nano-malloc + --disable-newlib-multithread + ${NEWLIB_CONFIGURE_OPTIONS}" BASE=`pwd` From 68e133802c308a9b14b40780021f2a823486ac0e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 15:33:59 +0100 Subject: [PATCH 141/536] build ia16-elf instead of ia16-none-elf. build newlib with -mseparate-code-segment -D_IEEE_LIBM (as in tkchia/build-ia16) --- build-ia16.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-ia16.sh b/build-ia16.sh index 7f33962..0fea8ea 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -12,7 +12,7 @@ ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads MAKE_JOBS=${MAKE_JOBS-4} -TARGET="ia16-none-elf" +TARGET="ia16-elf" BINUTILS_CONFIGURE_OPTIONS="--disable-werror --disable-nls @@ -180,7 +180,8 @@ if [ ! -z ${NEWLIB_VERSION} ]; then if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then rm -rf * - ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 + CFLAGS_FOR_TARGET='-O2 -mseparate-code-segment -D_IEEE_LIBM' \ + ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" From 57cfce1bdbd3dc176a771f419564a552b4f31871 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 15:35:01 +0100 Subject: [PATCH 142/536] let make build libnosys, instead of building manually. --- build-ia16.sh | 3 +-- patch/patch-newlib-ia16.txt | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build-ia16.sh b/build-ia16.sh index 0fea8ea..00ffb32 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -187,8 +187,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi - - ${MAKE} -C ${TARGET}/libgloss/libnosys libnosys.a || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 ${MAKE} -j${MAKE_JOBS} install || \ ${MAKE} -j${MAKE_JOBS} install || exit 1 diff --git a/patch/patch-newlib-ia16.txt b/patch/patch-newlib-ia16.txt index 4e754ac..43e9f25 100644 --- a/patch/patch-newlib-ia16.txt +++ b/patch/patch-newlib-ia16.txt @@ -1,13 +1,15 @@ diff --git a/libgloss/ia16/Makefile.in b/libgloss/ia16/Makefile.in -index ec1db6e..932757a 100644 +index ec1db6e..9dea739 100644 --- a/libgloss/ia16/Makefile.in +++ b/libgloss/ia16/Makefile.in -@@ -193,7 +193,7 @@ dos-write.o: dos-write.S call-cvt.h +@@ -192,8 +192,9 @@ dos-write.o: dos-write.S call-cvt.h + # when running the testsuite. By using a symbolic link, it does not # matter whether libnosys.a is built yet when the rule is executed. libnosys.a: ++ $(MAKE) -C ../libnosys/ libnosys.a rm -f $@ - ln -s ../libnosys/libnosys.a -+ -ln -s ../libnosys/libnosys.a ++ ln -s ../libnosys/libnosys.a $@ $(DOS_TINY_BSP) : $(DOS_TINY_OBJS) $(AR) rcs $@ $+ From 5862784298179a4591d12f8f4ca606b227a7a0b2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 16:33:19 +0100 Subject: [PATCH 143/536] fail if patch fails. --- build-ia16.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-ia16.sh b/build-ia16.sh index 00ffb32..e2ae7ea 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -94,14 +94,14 @@ cd ${BASE}/build/ || exit 1 cd gcc-ia16 git reset --hard HEAD git pull || exit 1 -patch -p1 -u < ${BASE}/patch/patch-gcc-ia16.txt +patch -p1 -u < ${BASE}/patch/patch-gcc-ia16.txt || exit 1 cd .. [ -d newlib-ia16 ] || git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia cd newlib-ia16 git reset --hard HEAD git pull || exit 1 -patch -p1 -u < ${BASE}/patch/patch-newlib-ia16.txt +patch -p1 -u < ${BASE}/patch/patch-newlib-ia16.txt || exit 1 cd .. #[ -d binutils-ia16 ] || git clone https://github.com/crtc-demos/binutils-ia16.git --depth 1 --branch master From bf5c799eee08ea2d51a376d26b2c6cdd0e1054d6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 16:35:00 +0100 Subject: [PATCH 144/536] move common parts between build-newlib and build-ia16 to a single file. --- build-ia16.sh | 91 +------------------------------------- build-newlib.sh | 88 +----------------------------------- script/build-gdb.sh | 2 + script/build-newlib-gcc.sh | 85 +++++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 176 deletions(-) create mode 100755 script/build-newlib-gcc.sh diff --git a/build-ia16.sh b/build-ia16.sh index e2ae7ea..1ee6f96 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -26,7 +26,7 @@ GDB_CONFIGURE_OPTIONS="--disable-werror --disable-nls ${GDB_CONFIGURE_OPTIONS}" -NEWLIB_CONFIGURE_OPTIONS="--enable-newlib-nano-malloc +NEWLIB_CONFIGURE_OPTIONS="--enable-newlib-nano-malloc --disable-newlib-multithread ${NEWLIB_CONFIGURE_OPTIONS}" @@ -118,94 +118,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then source ${BASE}/script/build-binutils.sh fi -cd ${BASE}/build/ - -if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then - #untar newlib-${NEWLIB_VERSION} - mkdir -p ${PREFIX}/${TARGET}/sys-include/ - cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 - touch newlib-${NEWLIB_VERSION}/newlib-unpacked -fi - -if [ ! -z ${GCC_VERSION} ]; then - if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then - #untar gcc-${GCC_VERSION} - - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gcc-${GCC_VERSION}/ - ./contrib/download_prerequisites - touch gcc-unpacked - cd - - else - echo "gcc already unpacked, skipping." - fi - - echo "Building gcc" - - mkdir -p gcc-${GCC_VERSION}/build-${TARGET} - cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - - TEMP_CFLAGS="$CFLAGS" - export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} - --enable-languages=${ENABLE_LANGUAGES} - --with-newlib" - GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" - - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then - rm -rf * - ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix - else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - - ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 - ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 - - export CFLAGS="$TEMP_CFLAGS" -fi - -cd ${BASE}/build/ - -if [ ! -z ${NEWLIB_VERSION} ]; then - mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} - cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 - - NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" - NEWLIB_CONFIGURE_OPTIONS="`echo ${NEWLIB_CONFIGURE_OPTIONS}`" - - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then - rm -rf * - CFLAGS_FOR_TARGET='-O2 -mseparate-code-segment -D_IEEE_LIBM' \ - ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 - echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix - else - echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || \ - ${MAKE} -j${MAKE_JOBS} install || exit 1 -fi - -cd ${BASE}/build/ - -if [ ! -z ${GCC_VERSION} ]; then - cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - - rm ${PREFIX}/${TARGET}/etc/gcc-*-installed - touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed -fi - -cd ${BASE}/build +source ${BASE}/script/build-newlib-gcc.sh source ${BASE}/script/build-gdb.sh diff --git a/build-newlib.sh b/build-newlib.sh index d64ae40..1233ad5 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -106,93 +106,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then source ${BASE}/script/build-binutils.sh fi -cd ${BASE}/build/ - -if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then - untar newlib-${NEWLIB_VERSION} - mkdir -p ${PREFIX}/${TARGET}/sys-include/ - cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 - touch newlib-${NEWLIB_VERSION}/newlib-unpacked -fi - -if [ ! -z ${GCC_VERSION} ]; then - if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then - untar gcc-${GCC_VERSION} - - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gcc-${GCC_VERSION}/ - ./contrib/download_prerequisites - touch gcc-unpacked - cd - - else - echo "gcc already unpacked, skipping." - fi - - echo "Building gcc" - - mkdir -p gcc-${GCC_VERSION}/build-${TARGET} - cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - - TEMP_CFLAGS="$CFLAGS" - export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} - --enable-languages=${ENABLE_LANGUAGES} - --with-newlib" - GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" - - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then - rm -rf * - ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix - else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - - ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 - ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 - - export CFLAGS="$TEMP_CFLAGS" -fi - -cd ${BASE}/build/ - -if [ ! -z ${NEWLIB_VERSION} ]; then - mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} - cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 - - NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" - NEWLIB_CONFIGURE_OPTIONS="`echo ${NEWLIB_CONFIGURE_OPTIONS}`" - - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then - rm -rf * - ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 - echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix - else - echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || \ - ${MAKE} -j${MAKE_JOBS} install || exit 1 -fi - -cd ${BASE}/build/ - -if [ ! -z ${GCC_VERSION} ]; then - cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - - rm ${PREFIX}/${TARGET}/etc/gcc-*-installed - touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed -fi - -cd ${BASE}/build +source ${BASE}/script/build-newlib-gcc.sh source ${BASE}/script/build-gdb.sh diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 01ce400..402eccd 100755 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -1,3 +1,5 @@ +cd ${BASE}/build + if [ ! -z ${GDB_VERSION} ]; then if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then echo "Unpacking gdb." diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh new file mode 100755 index 0000000..39f0393 --- /dev/null +++ b/script/build-newlib-gcc.sh @@ -0,0 +1,85 @@ +cd ${BASE}/build/ + +if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then + untar newlib-${NEWLIB_VERSION} + mkdir -p ${PREFIX}/${TARGET}/sys-include/ + cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + touch newlib-${NEWLIB_VERSION}/newlib-unpacked +fi + +if [ ! -z ${GCC_VERSION} ]; then + if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then + untar gcc-${GCC_VERSION} + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gcc-${GCC_VERSION}/ + ./contrib/download_prerequisites + touch gcc-unpacked + cd - + else + echo "gcc already unpacked, skipping." + fi + + echo "Building gcc" + + mkdir -p gcc-${GCC_VERSION}/build-${TARGET} + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} + --enable-languages=${ENABLE_LANGUAGES} + --with-newlib" + GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then + rm -rf * + ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 + + export CFLAGS="$TEMP_CFLAGS" +fi + +cd ${BASE}/build/ + +if [ ! -z ${NEWLIB_VERSION} ]; then + mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} + cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 + + NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" + NEWLIB_CONFIGURE_OPTIONS="`echo ${NEWLIB_CONFIGURE_OPTIONS}`" + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then + rm -rf * + ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 + echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || \ + ${MAKE} -j${MAKE_JOBS} install || exit 1 +fi + +cd ${BASE}/build/ + +if [ ! -z ${GCC_VERSION} ]; then + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + + rm ${PREFIX}/${TARGET}/etc/gcc-*-installed + touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed +fi From 27daac8ac69f24edd62be514283cf2be7b8578fd Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 16:41:01 +0100 Subject: [PATCH 145/536] add variable INGORE_DEPENDENCIES to avoid dependency check. --- build-djgpp.sh | 70 +++++++++++++++++++++++++------------------------ build-glibc.sh | 48 +++++++++++++++++---------------- build-ia16.sh | 60 ++++++++++++++++++++++-------------------- build-newlib.sh | 56 ++++++++++++++++++++------------------- 4 files changed, 121 insertions(+), 113 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 81b38f9..615d9dc 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -54,40 +54,42 @@ done DEPS="" -[ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" -[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " -[ ! -z ${GDB_VERSION} ] && DEPS+=" " -[ ! -z ${DJGPP_VERSION} ] && DEPS+=" " -[ ! -z ${BUILD_DXEGEN} ] && DEPS+=" djgpp binutils gcc" - -for DEP in ${DEPS}; do - case $DEP in - djgpp) - [ -z ${DJGPP_VERSION} ] \ - && source djgpp/djgpp - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source djgpp/binutils - ;; - gcc) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ - && [ -z ${GCC_VERSION} ] \ - && source common/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - dxegen) - [ -z "`ls ${PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ - && [ -z ${BUILD_DXEGEN} ] \ - && source djgpp/dxegen - ;; - esac -done +if [ -z ${IGNORE_DEPENDENCIES} ]; then + [ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" + [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " + [ ! -z ${GDB_VERSION} ] && DEPS+=" " + [ ! -z ${DJGPP_VERSION} ] && DEPS+=" " + [ ! -z ${BUILD_DXEGEN} ] && DEPS+=" djgpp binutils gcc" + + for DEP in ${DEPS}; do + case $DEP in + djgpp) + [ -z ${DJGPP_VERSION} ] \ + && source djgpp/djgpp + ;; + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source djgpp/binutils + ;; + gcc) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ + && [ -z ${GCC_VERSION} ] \ + && source common/gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source common/gdb + ;; + dxegen) + [ -z "`ls ${PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ + && [ -z ${BUILD_DXEGEN} ] \ + && source djgpp/dxegen + ;; + esac + done +fi if [ ! -z ${GCC_VERSION} ]; then DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" diff --git a/build-glibc.sh b/build-glibc.sh index 5db436e..4fe8bac 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -59,29 +59,31 @@ done DEPS="" -[ ! -z ${GCC_VERSION} ] && DEPS+=" binutils" -[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " -[ ! -z ${GDB_VERSION} ] && DEPS+=" " - -for DEP in ${DEPS}; do - case $DEP in - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source newlib/binutils - ;; - gcc) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ - && [ -z ${GCC_VERSION} ] \ - && source common/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - esac -done +if [ -z ${IGNORE_DEPENDENCIES} ]; then + [ ! -z ${GCC_VERSION} ] && DEPS+=" binutils" + [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " + [ ! -z ${GDB_VERSION} ] && DEPS+=" " + + for DEP in ${DEPS}; do + case $DEP in + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source newlib/binutils + ;; + gcc) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ + && [ -z ${GCC_VERSION} ] \ + && source common/gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source common/gdb + ;; + esac + done +fi source ${BASE}/script/begin.sh diff --git a/build-ia16.sh b/build-ia16.sh index 1ee6f96..8828ff7 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -54,35 +54,37 @@ while [ ! -z $1 ]; do shift done -DEPS="" - -[ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" -[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " -[ ! -z ${GDB_VERSION} ] && DEPS+=" " -[ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" - -for DEP in ${DEPS}; do - case $DEP in - newlib) - [ -z ${NEWLIB_VERSION} ] \ - && source ia16/newlib - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source ia16/binutils - ;; - gcc) - [ -z ${GCC_VERSION} ] \ - && source ia16/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - esac -done +if [ -z ${IGNORE_DEPENDENCIES} ]; then + DEPS="" + + [ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" + [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " + [ ! -z ${GDB_VERSION} ] && DEPS+=" " + [ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" + + for DEP in ${DEPS}; do + case $DEP in + newlib) + [ -z ${NEWLIB_VERSION} ] \ + && source ia16/newlib + ;; + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source ia16/binutils + ;; + gcc) + [ -z ${GCC_VERSION} ] \ + && source ia16/gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source common/gdb + ;; + esac + done +fi source ${BASE}/script/begin.sh diff --git a/build-newlib.sh b/build-newlib.sh index 1233ad5..d81f583 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -61,33 +61,35 @@ done DEPS="" -[ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" -[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " -[ ! -z ${GDB_VERSION} ] && DEPS+=" " -[ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" - -for DEP in ${DEPS}; do - case $DEP in - newlib) - [ -z ${NEWLIB_VERSION} ] \ - && source newlib/newlib - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source newlib/binutils - ;; - gcc) - [ -z ${GCC_VERSION} ] \ - && source common/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - esac -done +if [ -z ${IGNORE_DEPENDENCIES} ]; then + [ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" + [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " + [ ! -z ${GDB_VERSION} ] && DEPS+=" " + [ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" + + for DEP in ${DEPS}; do + case $DEP in + newlib) + [ -z ${NEWLIB_VERSION} ] \ + && source newlib/newlib + ;; + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source newlib/binutils + ;; + gcc) + [ -z ${GCC_VERSION} ] \ + && source common/gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source common/gdb + ;; + esac + done +fi source ${BASE}/script/begin.sh From 0aab24f6734e19323d9976c62e094f8a4c57f3d5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 16:53:15 +0100 Subject: [PATCH 146/536] installing gcc fails sometimes. try again if it does. --- script/build-newlib-gcc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 39f0393..1ce9d19 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -78,6 +78,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install-strip || \ ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${PREFIX}/${TARGET}/etc/gcc-*-installed From eb10b942aa70200ac0d16f211c20ddeaa2dc6d17 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 16:54:41 +0100 Subject: [PATCH 147/536] show value of IGNORE_DEPENDENCIES. --- script/begin.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/begin.sh b/script/begin.sh index 5a9daf6..f2e5124 100755 --- a/script/begin.sh +++ b/script/begin.sh @@ -20,6 +20,7 @@ echo "You are about to build and install:" [ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" echo "" echo "With the following options:" +[ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" echo " TARGET=${TARGET}" echo " PREFIX=${PREFIX}" echo " CC=${CC}" From 1b23e1bd99a41b0f84a9023375c03f92f85c3eb9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 17:03:56 +0100 Subject: [PATCH 148/536] move common variables and functions to script/functions.sh. fix tmpinst path and don't use SED/TAR variables. chmod -x on all files in script/, since these aren't meant to be run separately. --- build-djgpp.sh | 18 +++--------------- build-glibc.sh | 20 +------------------- build-ia16.sh | 14 +------------- build-newlib.sh | 22 +--------------------- script/begin.sh | 0 script/build-binutils.sh | 0 script/build-gdb.sh | 0 script/build-newlib-gcc.sh | 0 script/build-tools.sh | 11 +---------- script/finalize.sh | 0 script/functions.sh | 18 ++++++++++++++++++ 11 files changed, 25 insertions(+), 78 deletions(-) mode change 100755 => 100644 script/begin.sh mode change 100755 => 100644 script/build-binutils.sh mode change 100755 => 100644 script/build-gdb.sh mode change 100755 => 100644 script/build-newlib-gcc.sh mode change 100755 => 100644 script/build-tools.sh mode change 100755 => 100644 script/finalize.sh create mode 100644 script/functions.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index 615d9dc..558a2ef 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -1,19 +1,9 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -PREFIX=${PREFIX-/usr/local/cross} +source script/functions.sh TARGET="i586-pc-msdosdjgpp" -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -# number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-4} - #DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" @@ -32,8 +22,6 @@ GDB_CONFIGURE_OPTIONS="--disable-werror --disable-nls ${GDB_CONFIGURE_OPTIONS}" -BASE=`pwd` - if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" @@ -201,7 +189,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ `uname` = "FreeBSD" ]; then # The --verbose option is not recognized by BSD patch - $SED -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1 + sed -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1 fi echo "Running unpack-gcc.sh" @@ -210,7 +198,7 @@ if [ ! -z ${GCC_VERSION} ]; then # 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 + sed -i "s/[^^]@\(\(tex\)\|\(end\)\)/\n@\1/g" gcc.texi || exit 1 cd - # copy stubify programs diff --git a/build-glibc.sh b/build-glibc.sh index 4fe8bac..1dc8b6b 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -1,22 +1,6 @@ #!/usr/bin/env bash -unset CDPATH - -debug() -{ - echo $1 - read -s -n 1 -} - -# target directory -PREFIX=${PREFIX-/usr/local/cross} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -# number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-4} +source script/functions.sh BINUTILS_CONFIGURE_OPTIONS="--disable-werror --disable-nls @@ -32,8 +16,6 @@ GDB_CONFIGURE_OPTIONS="--disable-werror --disable-nls ${GDB_CONFIGURE_OPTIONS}" -BASE=`pwd` - if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." exit 1 diff --git a/build-ia16.sh b/build-ia16.sh index 8828ff7..0b94c60 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -1,16 +1,6 @@ #!/usr/bin/env bash -unset CDPATH - -# target directory -PREFIX=${PREFIX-/usr/local/cross} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -# number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-4} +source script/functions.sh TARGET="ia16-elf" @@ -30,8 +20,6 @@ NEWLIB_CONFIGURE_OPTIONS="--enable-newlib-nano-malloc --disable-newlib-multithread ${NEWLIB_CONFIGURE_OPTIONS}" -BASE=`pwd` - if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." exit 1 diff --git a/build-newlib.sh b/build-newlib.sh index d81f583..693d72d 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -1,23 +1,6 @@ #!/usr/bin/env bash -unset CDPATH - -debug() -{ - echo $1 - read -s -n 1 -} - -# target directory -PREFIX=${PREFIX-/usr/local/cross} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -# number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-4} - +source script/functions.sh BINUTILS_CONFIGURE_OPTIONS="--disable-werror --disable-nls @@ -33,9 +16,6 @@ GDB_CONFIGURE_OPTIONS="--disable-werror --disable-nls ${GDB_CONFIGURE_OPTIONS}" - -BASE=`pwd` - if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." exit 1 diff --git a/script/begin.sh b/script/begin.sh old mode 100755 new mode 100644 diff --git a/script/build-binutils.sh b/script/build-binutils.sh old mode 100755 new mode 100644 diff --git a/script/build-gdb.sh b/script/build-gdb.sh old mode 100755 new mode 100644 diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh old mode 100755 new mode 100644 diff --git a/script/build-tools.sh b/script/build-tools.sh old mode 100755 new mode 100644 index 4a26b78..aee7fc8 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -1,10 +1,9 @@ mkdir -p ${BASE}/build/tmpinst -export PATH="${BASE}/build/tmpinst:$PATH" +export PATH="${BASE}/build/tmpinst/bin:$PATH" cd ${BASE}/build/ || exit 1 # build GNU tar if needed. -TAR=tar if [ ! -z $TAR_VERSION ]; then if [ ! -e ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed ]; then echo "Building tar" @@ -15,18 +14,11 @@ if [ ! -z $TAR_VERSION ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 touch ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed fi - TAR=${BASE}/build/tmpinst/bin/tar fi -untar() -{ - ${TAR} -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1) -} - cd ${BASE}/build || exit 1 # build GNU sed if needed. -SED=sed if [ ! -z $SED_VERSION ]; then if [ ! -e ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed ]; then echo "Building sed" @@ -37,5 +29,4 @@ if [ ! -z $SED_VERSION ]; then ${MAKE} -j${MAKE_JOBS} install || exit 1 touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed fi - SED=${BASE}/build/tmpinst/bin/sed fi diff --git a/script/finalize.sh b/script/finalize.sh old mode 100755 new mode 100644 diff --git a/script/functions.sh b/script/functions.sh new file mode 100644 index 0000000..59d57b4 --- /dev/null +++ b/script/functions.sh @@ -0,0 +1,18 @@ +unset CDPATH + +BASE=`pwd` + +# target directory +PREFIX=${PREFIX-/usr/local/cross} + +# enabled languages +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} +ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} + +# number of parallel build threads +MAKE_JOBS=${MAKE_JOBS-4} + +untar() +{ + tar -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1) +} From 5612900163ed30c57bddc4b0f4fec825c443b8cc Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 17:37:01 +0100 Subject: [PATCH 149/536] added some useful functions: strip_whitespace() and prepend() --- build-djgpp.sh | 28 +++++++++++++--------------- build-glibc.sh | 23 ++++++++++------------- build-ia16.sh | 20 ++++++++------------ build-newlib.sh | 23 ++++++++++------------- script/build-binutils.sh | 2 +- script/build-gdb.sh | 2 +- script/build-newlib-gcc.sh | 4 ++-- script/finalize.sh | 2 -- script/functions.sh | 9 +++++---- 9 files changed, 50 insertions(+), 63 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 558a2ef..e5bdc4f 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -7,20 +7,17 @@ TARGET="i586-pc-msdosdjgpp" #DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" -BINUTILS_CONFIGURE_OPTIONS="--disable-werror - --disable-nls - ${BINUTILS_CONFIGURE_OPTIONS}" +prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" -GCC_CONFIGURE_OPTIONS="--disable-nls - --enable-libquadmath-support - --enable-version-specific-runtime-libs - --enable-fat - ${GCC_CONFIGURE_OPTIONS}" +prepend GCC_CONFIGURE_OPTIONS "--disable-nls + --enable-libquadmath-support + --enable-version-specific-runtime-libs + --enable-fat" -GDB_CONFIGURE_OPTIONS="--disable-werror - --disable-nls - ${GDB_CONFIGURE_OPTIONS}" +prepend GDB_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" if [ -z $1 ]; then echo "Usage: $0 [packages...]" @@ -172,9 +169,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR untar automake-${AUTOMAKE_VERSION} || exit 1 cd automake-${AUTOMAKE_VERSION}/ - PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ - ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - PATH="${BUILDDIR}/tmpinst/bin:$PATH" \ + ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} all install || exit 1 rm ${BUILDDIR}/tmpinst/automake-*-built touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built @@ -227,7 +222,7 @@ if [ ! -z ${GCC_VERSION} ]; then GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} --enable-languages=${ENABLE_LANGUAGES}" - GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" + strip_whitespace GCC_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GCC_CONFIGURE_OPTIONS}" ]; then rm -rf * @@ -277,3 +272,6 @@ cd ${BASE}/build source ${BASE}/script/build-gdb.sh source ${BASE}/script/finalize.sh + +echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${PREFIX}/setenv-${TARGET} +echo "set DJDIR=%~dp0${TARGET}" >> ${PREFIX}/setenv-${TARGET}.bat diff --git a/build-glibc.sh b/build-glibc.sh index 1dc8b6b..b495c94 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -2,19 +2,16 @@ source script/functions.sh -BINUTILS_CONFIGURE_OPTIONS="--disable-werror - --disable-nls - ${BINUTILS_CONFIGURE_OPTIONS}" - -GCC_CONFIGURE_OPTIONS="--disable-nls - --enable-libquadmath-support - --enable-version-specific-runtime-libs - --enable-fat - ${GCC_CONFIGURE_OPTIONS}" - -GDB_CONFIGURE_OPTIONS="--disable-werror - --disable-nls - ${GDB_CONFIGURE_OPTIONS}" +prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" + +prepend GCC_CONFIGURE_OPTIONS "--disable-nls + --enable-libquadmath-support + --enable-version-specific-runtime-libs + --enable-fat" + +prepend GDB_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." diff --git a/build-ia16.sh b/build-ia16.sh index 0b94c60..44e9439 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -4,21 +4,17 @@ source script/functions.sh TARGET="ia16-elf" -BINUTILS_CONFIGURE_OPTIONS="--disable-werror - --disable-nls - ${BINUTILS_CONFIGURE_OPTIONS}" +prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" -GCC_CONFIGURE_OPTIONS="--disable-nls - --enable-fat - ${GCC_CONFIGURE_OPTIONS}" +prepend GCC_CONFIGURE_OPTIONS "--disable-nls + --enable-fat" -GDB_CONFIGURE_OPTIONS="--disable-werror - --disable-nls - ${GDB_CONFIGURE_OPTIONS}" +prepend GDB_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" -NEWLIB_CONFIGURE_OPTIONS="--enable-newlib-nano-malloc - --disable-newlib-multithread - ${NEWLIB_CONFIGURE_OPTIONS}" +prepend NEWLIB_CONFIGURE_OPTIONS "--enable-newlib-nano-malloc + --disable-newlib-multithread" if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." diff --git a/build-newlib.sh b/build-newlib.sh index 693d72d..7c15ec2 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -2,19 +2,16 @@ source script/functions.sh -BINUTILS_CONFIGURE_OPTIONS="--disable-werror - --disable-nls - ${BINUTILS_CONFIGURE_OPTIONS}" - -GCC_CONFIGURE_OPTIONS="--disable-nls - --enable-libquadmath-support - --enable-version-specific-runtime-libs - --enable-fat - ${GCC_CONFIGURE_OPTIONS}" - -GDB_CONFIGURE_OPTIONS="--disable-werror - --disable-nls - ${GDB_CONFIGURE_OPTIONS}" +prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" + +prepend GCC_CONFIGURE_OPTIONS "--disable-nls + --enable-libquadmath-support + --enable-version-specific-runtime-libs + --enable-fat" + +prepend GDB_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." diff --git a/script/build-binutils.sh b/script/build-binutils.sh index c65ca7c..1d6be6c 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -2,7 +2,7 @@ mkdir -p build-${TARGET} cd build-${TARGET} || exit 1 BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" -BINUTILS_CONFIGURE_OPTIONS="`echo ${BINUTILS_CONFIGURE_OPTIONS}`" +strip_whitespace BINUTILS_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${BINUTILS_CONFIGURE_OPTIONS}" ]; then rm -rf * diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 402eccd..df894ed 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -12,7 +12,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Building gdb." GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" - GDB_CONFIGURE_OPTIONS="`echo ${GDB_CONFIGURE_OPTIONS}`" + strip_whitespace GDB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then rm -rf * diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 1ce9d19..edd3e95 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -32,7 +32,7 @@ if [ ! -z ${GCC_VERSION} ]; then GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} --enable-languages=${ENABLE_LANGUAGES} --with-newlib" - GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" + strip_whitespace GCC_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then rm -rf * @@ -56,7 +56,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" - NEWLIB_CONFIGURE_OPTIONS="`echo ${NEWLIB_CONFIGURE_OPTIONS}`" + strip_whitespace NEWLIB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then rm -rf * diff --git a/script/finalize.sh b/script/finalize.sh index 38a86f5..37511a7 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -13,12 +13,10 @@ echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${PREF echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${PREFIX}/setenv-${TARGET} echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${PREFIX}/setenv-${TARGET} echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${PREFIX}/setenv-${TARGET} -echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${PREFIX}/setenv-${TARGET} echo "@echo off" >> ${PREFIX}/setenv-${TARGET}.bat echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${PREFIX}/setenv-${TARGET}.bat echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${PREFIX}/setenv-${TARGET}.bat -echo "set DJDIR=%~dp0${TARGET}" >> ${PREFIX}/setenv-${TARGET}.bat cd ${BASE}/build diff --git a/script/functions.sh b/script/functions.sh index 59d57b4..acabeff 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -12,7 +12,8 @@ ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads MAKE_JOBS=${MAKE_JOBS-4} -untar() -{ - tar -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1) -} +untar() { tar -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1); } + +strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } + +prepend() { eval "$1=\"$2 ${!1}\""; } From 56f0bd32990e9fc8ba33b4c1ffcb0c28461423cd Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 20:07:26 +0100 Subject: [PATCH 150/536] allow running 'make check' for gcc and newlib. --- build-djgpp.sh | 2 +- build-glibc.sh | 1 + script/build-binutils.sh | 7 +------ script/build-gdb.sh | 7 +------ script/build-newlib-gcc.sh | 2 ++ 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index e5bdc4f..6d84a0c 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -15,7 +15,6 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-version-specific-runtime-libs --enable-fat" - prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls" @@ -234,6 +233,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${PREFIX}/${TARGET}/etc/gcc-*-installed diff --git a/build-glibc.sh b/build-glibc.sh index b495c94..788843d 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -120,6 +120,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 export CFLAGS="$TEMP_CFLAGS" diff --git a/script/build-binutils.sh b/script/build-binutils.sh index 1d6be6c..c861674 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -18,12 +18,7 @@ if [ ${TARGET} == "i586-pc-msdosdjgpp" ]; then ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 fi ${MAKE} -j${MAKE_JOBS} || exit 1 - -if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 -fi - +[ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 ${MAKE} -j${MAKE_JOBS} install || exit 1 rm ${PREFIX}/${TARGET}/etc/binutils-*-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index df894ed..3f331e0 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -23,12 +23,7 @@ if [ ! -z ${GDB_VERSION} ]; then sleep 5 fi ${MAKE} -j${MAKE_JOBS} || exit 1 - - if [ ! -z $MAKE_CHECK ]; then - echo "Run ${MAKE} check" - ${MAKE} -j${MAKE_JOBS} check || exit 1 - fi - + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 ${MAKE} -j${MAKE_JOBS} install || exit 1 rm ${PREFIX}/${TARGET}/etc/gdb-*-installed diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index edd3e95..b90a67d 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -68,6 +68,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 ${MAKE} -j${MAKE_JOBS} install || \ ${MAKE} -j${MAKE_JOBS} install || exit 1 fi @@ -78,6 +79,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 ${MAKE} -j${MAKE_JOBS} install-strip || \ ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 From 1bfb2801b2b96e884b67f75ba92ff6b4ee75edea Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 20:25:08 +0100 Subject: [PATCH 151/536] save test results to log files. --- build-djgpp.sh | 2 +- build-glibc.sh | 2 +- script/begin.sh | 5 +++-- script/build-binutils.sh | 2 +- script/build-gdb.sh | 2 +- script/build-newlib-gcc.sh | 4 ++-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 6d84a0c..8a481a3 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -233,7 +233,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget -s check | tee ${BASE}/tests/gcc.log ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${PREFIX}/${TARGET}/etc/gcc-*-installed diff --git a/build-glibc.sh b/build-glibc.sh index 788843d..37f7b36 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -120,7 +120,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gcc.log ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 export CFLAGS="$TEMP_CFLAGS" diff --git a/script/begin.sh b/script/begin.sh index f2e5124..a5ee604 100644 --- a/script/begin.sh +++ b/script/begin.sh @@ -30,6 +30,7 @@ echo " CXXFLAGS=${CXXFLAGS}" echo " LDFLAGS=${LDFLAGS}" echo " MAKE=${MAKE}" echo " MAKE_JOBS=${MAKE_JOBS}" +echo " MAKE_CHECK=${MAKE_CHECK}" if [ ! -z ${GCC_VERSION} ]; then echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" @@ -147,6 +148,6 @@ mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 export PATH="${PREFIX}/bin:$PATH" -# make build dir -echo "Make build dir" +rm -rf ${BASE}/tests +mkdir -p ${BASE}/tests mkdir -p ${BASE}/build diff --git a/script/build-binutils.sh b/script/build-binutils.sh index c861674..cdbd140 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -18,7 +18,7 @@ if [ ${TARGET} == "i586-pc-msdosdjgpp" ]; then ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 fi ${MAKE} -j${MAKE_JOBS} || exit 1 -[ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 +[ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/binutils.log ${MAKE} -j${MAKE_JOBS} install || exit 1 rm ${PREFIX}/${TARGET}/etc/binutils-*-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 3f331e0..57c1262 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -23,7 +23,7 @@ if [ ! -z ${GDB_VERSION} ]; then sleep 5 fi ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gdb.log ${MAKE} -j${MAKE_JOBS} install || exit 1 rm ${PREFIX}/${TARGET}/etc/gdb-*-installed diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index b90a67d..a13fa77 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -68,7 +68,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/newlib.log ${MAKE} -j${MAKE_JOBS} install || \ ${MAKE} -j${MAKE_JOBS} install || exit 1 fi @@ -79,7 +79,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget check || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gcc.log ${MAKE} -j${MAKE_JOBS} install-strip || \ ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 From ecae4cc025e2df7f247877c8a1d261b1ded7e701 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 19:19:32 +0100 Subject: [PATCH 152/536] added new variable HOST --- build-djgpp.sh | 4 ++-- build-glibc.sh | 2 +- script/begin.sh | 18 +++++------------- script/build-binutils.sh | 2 +- script/build-gdb.sh | 2 +- script/build-newlib-gcc.sh | 4 ++-- script/functions.sh | 24 ++++++++++++++++++++++++ 7 files changed, 36 insertions(+), 20 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 8a481a3..3bc20ce 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -219,11 +219,11 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} --enable-languages=${ENABLE_LANGUAGES}" strip_whitespace GCC_CONFIGURE_OPTIONS - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GCC_CONFIGURE_OPTIONS}" ]; then + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then rm -rf * ../gnu/gcc-${GCC_VERSION_SHORT}/configure ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix diff --git a/build-glibc.sh b/build-glibc.sh index 37f7b36..eb36515 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -106,7 +106,7 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} --enable-languages=${ENABLE_LANGUAGES}" GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" diff --git a/script/begin.sh b/script/begin.sh index a5ee604..baae998 100644 --- a/script/begin.sh +++ b/script/begin.sh @@ -1,16 +1,3 @@ -# use gmake/clang under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=${MAKE-gmake} - CC=${CC-clang} - CXX=${CXX-clang++} -else - MAKE=${MAKE-make} - CC=${CC-gcc} - CXX=${CXX-g++} -fi - -export CC CXX MAKE - echo "You are about to build and install:" [ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" [ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" @@ -22,6 +9,7 @@ echo "" echo "With the following options:" [ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" echo " TARGET=${TARGET}" +echo " HOST=${HOST}" echo " PREFIX=${PREFIX}" echo " CC=${CC}" echo " CXX=${CXX}" @@ -31,6 +19,10 @@ echo " LDFLAGS=${LDFLAGS}" echo " MAKE=${MAKE}" echo " MAKE_JOBS=${MAKE_JOBS}" echo " MAKE_CHECK=${MAKE_CHECK}" +if [ ! -z ${HOST} ]; then + echo " HOST_CC=`echo ${HOST_CC}`" + echo " HOST_CXX=`echo ${HOST_CXX}`" +fi if [ ! -z ${GCC_VERSION} ]; then echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" diff --git a/script/build-binutils.sh b/script/build-binutils.sh index cdbd140..80cd0b5 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -1,7 +1,7 @@ mkdir -p build-${TARGET} cd build-${TARGET} || exit 1 -BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" +BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG}" strip_whitespace BINUTILS_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${BINUTILS_CONFIGURE_OPTIONS}" ]; then diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 57c1262..3190939 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -11,7 +11,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Building gdb." - GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" + GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG}" strip_whitespace GDB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index a13fa77..1307986 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -29,7 +29,7 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} --enable-languages=${ENABLE_LANGUAGES} --with-newlib" strip_whitespace GCC_CONFIGURE_OPTIONS @@ -55,7 +55,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 - NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX}" + NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG}" strip_whitespace NEWLIB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then diff --git a/script/functions.sh b/script/functions.sh index acabeff..0cb21e3 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -12,6 +12,30 @@ ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads MAKE_JOBS=${MAKE_JOBS-4} +# use gmake/clang under FreeBSD +if [ `uname` = "FreeBSD" ]; then + MAKE=${MAKE-gmake} + CC=${CC-clang} + CXX=${CXX-clang++} +else + MAKE=${MAKE-make} + CC=${CC-gcc} + CXX=${CXX-g++} +fi + +export CC CXX MAKE + +if [ ! -z ${HOST} ]; then + HOST_FLAG="--host=${HOST}" + IGNORE_DEPENDENCIES=yes + HOST_CC=${HOST_CC-$HOST-$CC} + HOST_CXX=${HOST_CXX-$HOST-$CXX} +else + HOST_FLAG="" + HOST_CC=${CC} + HOST_CXX=${CXX} +fi + untar() { tar -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1); } strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } From 6750ebbc70156436b9fb1f7700cd79ef9dbf3a87 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 4 Feb 2018 19:24:39 +0100 Subject: [PATCH 153/536] build stubify/exe2coff with HOST_CC --- build-djgpp.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 3bc20ce..9121d02 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -124,8 +124,10 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 cd src/stub - ${CC} -O2 ${CFLAGS} stubify.c -o ${TARGET}-stubify || exit 1 - ${CC} -O2 ${CFLAGS} stubedit.c -o ${TARGET}-stubedit || exit 1 + ${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 + ${CC} -O2 ${CFLAGS} stubedit.c -o stubedit || exit 1 + ${HOST_CC} -O2 ${CFLAGS} stubify.c -o ${TARGET}-stubify || exit 1 + ${HOST_CC} -O2 ${CFLAGS} stubedit.c -o ${TARGET}-stubedit || exit 1 cd ../.. @@ -196,7 +198,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - # copy stubify programs - cp -p $PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify + cp -p $PREFIX/bin/stubify $BUILDDIR/tmpinst/bin/ cd $BUILDDIR/ @@ -261,7 +263,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Building DXE tools requires gcc, skip." fi cd src/stub - ${CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 + ${HOST_CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 cp -p exe2coff $PREFIX/bin/${TARGET}-exe2coff || exit 1 # djlsr done From b75466f7ad8dd3309d2f91fe11c45b9fea1607b7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Feb 2018 07:17:46 +0100 Subject: [PATCH 154/536] emit --build= flag if set in environment. --- build-djgpp.sh | 2 +- build-glibc.sh | 2 +- script/begin.sh | 1 + script/build-binutils.sh | 2 +- script/build-gdb.sh | 2 +- script/build-newlib-gcc.sh | 4 ++-- script/functions.sh | 1 + 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 9121d02..ba7cd66 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -221,7 +221,7 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES}" strip_whitespace GCC_CONFIGURE_OPTIONS diff --git a/build-glibc.sh b/build-glibc.sh index eb36515..3a9b28c 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -106,7 +106,7 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES}" GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" diff --git a/script/begin.sh b/script/begin.sh index baae998..746e3b8 100644 --- a/script/begin.sh +++ b/script/begin.sh @@ -10,6 +10,7 @@ echo "With the following options:" [ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" echo " TARGET=${TARGET}" echo " HOST=${HOST}" +echo " BUILD=${BUILD}" echo " PREFIX=${PREFIX}" echo " CC=${CC}" echo " CXX=${CXX}" diff --git a/script/build-binutils.sh b/script/build-binutils.sh index 80cd0b5..21ec49d 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -1,7 +1,7 @@ mkdir -p build-${TARGET} cd build-${TARGET} || exit 1 -BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG}" +BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" strip_whitespace BINUTILS_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${BINUTILS_CONFIGURE_OPTIONS}" ]; then diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 3190939..96858a1 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -11,7 +11,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Building gdb." - GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG}" + GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" strip_whitespace GDB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 1307986..9bd9791 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -29,7 +29,7 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES} --with-newlib" strip_whitespace GCC_CONFIGURE_OPTIONS @@ -55,7 +55,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 - NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG}" + NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" strip_whitespace NEWLIB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then diff --git a/script/functions.sh b/script/functions.sh index 0cb21e3..cc80ab2 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -25,6 +25,7 @@ fi export CC CXX MAKE +[ ! -z ${BUILD} ] && BUILD_FLAG="--build=${BUILD}" if [ ! -z ${HOST} ]; then HOST_FLAG="--host=${HOST}" IGNORE_DEPENDENCIES=yes From 1342773041fcc353d225974cf3a533af8a6b37db Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Feb 2018 07:19:21 +0100 Subject: [PATCH 155/536] renamed script files. --- script/{begin.sh => download.sh} | 0 script/{functions.sh => init.sh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename script/{begin.sh => download.sh} (100%) rename script/{functions.sh => init.sh} (100%) diff --git a/script/begin.sh b/script/download.sh similarity index 100% rename from script/begin.sh rename to script/download.sh diff --git a/script/functions.sh b/script/init.sh similarity index 100% rename from script/functions.sh rename to script/init.sh From ce746335ee517ee563ff0dc17e0346afa547eb84 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Feb 2018 07:27:03 +0100 Subject: [PATCH 156/536] use a separate flag MAKE_CHECK_GCC to enable running test suites on gcc. --- build-djgpp.sh | 2 +- build-glibc.sh | 4 ++-- script/build-newlib-gcc.sh | 2 +- script/download.sh | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index ba7cd66..96443fd 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -235,7 +235,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -Otarget -s check | tee ${BASE}/tests/gcc.log + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 rm ${PREFIX}/${TARGET}/etc/gcc-*-installed diff --git a/build-glibc.sh b/build-glibc.sh index 3a9b28c..0a6bf1c 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -108,7 +108,7 @@ if [ ! -z ${GCC_VERSION} ]; then GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES}" - GCC_CONFIGURE_OPTIONS="`echo ${GCC_CONFIGURE_OPTIONS}`" + strip_whitespace GCC_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then rm -rf * @@ -120,7 +120,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gcc.log + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 export CFLAGS="$TEMP_CFLAGS" diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 9bd9791..348f936 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -79,7 +79,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gcc.log + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log ${MAKE} -j${MAKE_JOBS} install-strip || \ ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 diff --git a/script/download.sh b/script/download.sh index 746e3b8..ab2ff2e 100644 --- a/script/download.sh +++ b/script/download.sh @@ -20,6 +20,7 @@ echo " LDFLAGS=${LDFLAGS}" echo " MAKE=${MAKE}" echo " MAKE_JOBS=${MAKE_JOBS}" echo " MAKE_CHECK=${MAKE_CHECK}" +echo " MAKE_CHECK_GCC=${MAKE_CHECK_GCC}" if [ ! -z ${HOST} ]; then echo " HOST_CC=`echo ${HOST_CC}`" echo " HOST_CXX=`echo ${HOST_CXX}`" From e0866f2ac8533a9a00a513df0a24f856875a3642 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Feb 2018 18:16:45 +0100 Subject: [PATCH 157/536] remove ia16 patches since they have been merged in git. --- build-ia16.sh | 2 -- patch/patch-gcc-ia16.txt | 13 ------------- patch/patch-newlib-ia16.txt | 15 --------------- 3 files changed, 30 deletions(-) delete mode 100644 patch/patch-gcc-ia16.txt delete mode 100644 patch/patch-newlib-ia16.txt diff --git a/build-ia16.sh b/build-ia16.sh index 44e9439..ad6683a 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -80,14 +80,12 @@ cd ${BASE}/build/ || exit 1 cd gcc-ia16 git reset --hard HEAD git pull || exit 1 -patch -p1 -u < ${BASE}/patch/patch-gcc-ia16.txt || exit 1 cd .. [ -d newlib-ia16 ] || git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia cd newlib-ia16 git reset --hard HEAD git pull || exit 1 -patch -p1 -u < ${BASE}/patch/patch-newlib-ia16.txt || exit 1 cd .. #[ -d binutils-ia16 ] || git clone https://github.com/crtc-demos/binutils-ia16.git --depth 1 --branch master diff --git a/patch/patch-gcc-ia16.txt b/patch/patch-gcc-ia16.txt deleted file mode 100644 index 63ff951..0000000 --- a/patch/patch-gcc-ia16.txt +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/gcc/ubsan.c b/gcc/ubsan.c -index 56637d8f0..109382498 100644 ---- a/gcc/ubsan.c -+++ b/gcc/ubsan.c -@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc) - - expanded_location xloc = expand_location (loc); - if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0 -- || xloc.file == '\0' || xloc.file[0] == '\xff' -+ || xloc.file[0] == '\0' || xloc.file[0] == '\xff' - || xloc.file[1] == '\xff') - return false; - diff --git a/patch/patch-newlib-ia16.txt b/patch/patch-newlib-ia16.txt deleted file mode 100644 index 43e9f25..0000000 --- a/patch/patch-newlib-ia16.txt +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/libgloss/ia16/Makefile.in b/libgloss/ia16/Makefile.in -index ec1db6e..9dea739 100644 ---- a/libgloss/ia16/Makefile.in -+++ b/libgloss/ia16/Makefile.in -@@ -192,8 +192,9 @@ dos-write.o: dos-write.S call-cvt.h - # when running the testsuite. By using a symbolic link, it does not - # matter whether libnosys.a is built yet when the rule is executed. - libnosys.a: -+ $(MAKE) -C ../libnosys/ libnosys.a - rm -f $@ -- ln -s ../libnosys/libnosys.a -+ ln -s ../libnosys/libnosys.a $@ - - $(DOS_TINY_BSP) : $(DOS_TINY_OBJS) - $(AR) rcs $@ $+ From 92ae068d309698a9666ce1528026a40aaf4cb1e9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 9 Feb 2018 13:32:45 +0100 Subject: [PATCH 158/536] addition to incomplete commit 13427730. --- build-djgpp.sh | 4 ++-- build-glibc.sh | 4 ++-- build-ia16.sh | 4 ++-- build-newlib.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 96443fd..0274af1 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source script/functions.sh +source script/init.sh TARGET="i586-pc-msdosdjgpp" @@ -81,7 +81,7 @@ if [ ! -z ${GCC_VERSION} ]; then OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} fi -source ${BASE}/script/begin.sh +source ${BASE}/script/download.sh source ${BASE}/script/build-tools.sh diff --git a/build-glibc.sh b/build-glibc.sh index 0a6bf1c..098626f 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source script/functions.sh +source script/init.sh prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror --disable-nls" @@ -64,7 +64,7 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then done fi -source ${BASE}/script/begin.sh +source ${BASE}/script/download.sh source ${BASE}/script/build-tools.sh diff --git a/build-ia16.sh b/build-ia16.sh index ad6683a..1e66076 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source script/functions.sh +source script/init.sh TARGET="ia16-elf" @@ -70,7 +70,7 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then done fi -source ${BASE}/script/begin.sh +source ${BASE}/script/download.sh source ${BASE}/script/build-tools.sh diff --git a/build-newlib.sh b/build-newlib.sh index 7c15ec2..ca08e92 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source script/functions.sh +source script/init.sh prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror --disable-nls" @@ -68,7 +68,7 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then done fi -source ${BASE}/script/begin.sh +source ${BASE}/script/download.sh source ${BASE}/script/build-tools.sh From 3f5886d6ee0227f8b3a9c272e655d06487cd22bd Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 9 Feb 2018 13:43:13 +0100 Subject: [PATCH 159/536] query number of processors for MAKE_JOBS (I hope this is portable) --- script/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/init.sh b/script/init.sh index cc80ab2..a5fdd2f 100644 --- a/script/init.sh +++ b/script/init.sh @@ -10,7 +10,7 @@ PREFIX=${PREFIX-/usr/local/cross} ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-4} +MAKE_JOBS=${MAKE_JOBS-`nproc --all`} # use gmake/clang under FreeBSD if [ `uname` = "FreeBSD" ]; then From 9b26aeb7b8fbfdb7b857de6f05b4b7076ff1fd9e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 9 Feb 2018 14:20:37 +0100 Subject: [PATCH 160/536] support gdb 8.1 --- common/gdb | 2 +- common/gdb-8.1 | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 common/gdb-8.1 diff --git a/common/gdb b/common/gdb index f9bd37d..7dcc2f7 100755 --- a/common/gdb +++ b/common/gdb @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source common/gdb-8.0.1 +source common/gdb-8.1 diff --git a/common/gdb-8.1 b/common/gdb-8.1 new file mode 100644 index 0000000..1e8ab24 --- /dev/null +++ b/common/gdb-8.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GDB_VERSION=8.1 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From 81282db6217eb49d2c8f3a573b2b7d6dd96e58ce Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 9 Feb 2018 15:52:04 +0100 Subject: [PATCH 161/536] install mpfr after building gcc, and use it to build gdb. --- build-djgpp.sh | 1 + script/build-gdb.sh | 1 + script/build-newlib-gcc.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index 0274af1..225a95e 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -237,6 +237,7 @@ if [ ! -z ${GCC_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${MAKE} -j${MAKE_JOBS} -C mpfr install rm ${PREFIX}/${TARGET}/etc/gcc-*-installed touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 96858a1..4729daa 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -12,6 +12,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Building gdb." GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" + [ -e ${PREFIX}/lib/libmpfr.a ] && GDB_CONFIGURE_OPTIONS+=" --with-mpfr=${PREFIX}" strip_whitespace GDB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 348f936..30fdbf3 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -82,6 +82,7 @@ if [ ! -z ${GCC_VERSION} ]; then [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log ${MAKE} -j${MAKE_JOBS} install-strip || \ ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${MAKE} -j${MAKE_JOBS} -C mpfr install rm ${PREFIX}/${TARGET}/etc/gcc-*-installed touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed From 4538352291a858f86b50b6ebdde408bc12775bb9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 9 Feb 2018 15:55:49 +0100 Subject: [PATCH 162/536] set exec bit on gdb-8.1 script --- common/gdb-8.1 | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 common/gdb-8.1 diff --git a/common/gdb-8.1 b/common/gdb-8.1 old mode 100644 new mode 100755 From 714a95f41d65402ec5243d67189d796fe7c2c2c2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 12 Feb 2018 13:11:01 +0100 Subject: [PATCH 163/536] support gdb 8.0 and 7.12.1 --- common/gdb-7.12.1 | 4 ++++ common/gdb-8.0 | 4 ++++ 2 files changed, 8 insertions(+) create mode 100755 common/gdb-7.12.1 create mode 100755 common/gdb-8.0 diff --git a/common/gdb-7.12.1 b/common/gdb-7.12.1 new file mode 100755 index 0000000..ec01823 --- /dev/null +++ b/common/gdb-7.12.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GDB_VERSION=7.12.1 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.0 b/common/gdb-8.0 new file mode 100755 index 0000000..2303dfe --- /dev/null +++ b/common/gdb-8.0 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GDB_VERSION=8.0 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From 0c75e74f837799c10545e6ebfec29f828196e886 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 12 Feb 2018 13:11:23 +0100 Subject: [PATCH 164/536] build gdb with --with-system-readline. --- build-djgpp.sh | 5 +++-- build-glibc.sh | 5 +++-- build-ia16.sh | 3 ++- build-newlib.sh | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 225a95e..18ac4c7 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -15,8 +15,9 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-version-specific-runtime-libs --enable-fat" -prepend GDB_CONFIGURE_OPTIONS "--disable-werror - --disable-nls" +prepend GDB_CONFIGURE_OPTIONS "--disable-werror + --disable-nls + --with-system-readline" if [ -z $1 ]; then echo "Usage: $0 [packages...]" diff --git a/build-glibc.sh b/build-glibc.sh index 098626f..87f096a 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -10,8 +10,9 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-version-specific-runtime-libs --enable-fat" -prepend GDB_CONFIGURE_OPTIONS "--disable-werror - --disable-nls" +prepend GDB_CONFIGURE_OPTIONS "--disable-werror + --disable-nls + --with-system-readline" if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." diff --git a/build-ia16.sh b/build-ia16.sh index 1e66076..ae79e1b 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -11,7 +11,8 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-fat" prepend GDB_CONFIGURE_OPTIONS "--disable-werror - --disable-nls" + --disable-nls + --with-system-readline" prepend NEWLIB_CONFIGURE_OPTIONS "--enable-newlib-nano-malloc --disable-newlib-multithread" diff --git a/build-newlib.sh b/build-newlib.sh index ca08e92..7987dfd 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -11,7 +11,8 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-fat" prepend GDB_CONFIGURE_OPTIONS "--disable-werror - --disable-nls" + --disable-nls + --with-system-readline" if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." From 2e2942ace47bb2f92969a12567eddb83ee120749 Mon Sep 17 00:00:00 2001 From: jwt27 Date: Wed, 14 Feb 2018 02:24:43 +0100 Subject: [PATCH 165/536] Update README.md --- README.md | 111 +++++++++++++++++++++--------------------------------- 1 file changed, 43 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 34b9a97..4c794a6 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,8 @@ -## Building DJGPP cross compiler on Windows, Mac OSX, Linux and FreeBSD. +## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. -build-djgpp : Build DJGPP cross compiler and binutils on Windows (MinGW/Cygwin), Mac OSX, Linux and FreeBSD. +### Requirements -### Prebuilt binary files - -If you don't want build DJGPP by yourself, you can download prebuilt DJGPP binary files for MinGW, OSX and Linux from GitHub Release page. - -### Requirement - -Before running this script, you need to install these programs first : +Before running this script, you need to install these programs first: * g++ * gcc @@ -52,111 +46,91 @@ pacman -Syuu base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-curl mingw-w ### Configuration -Default install location is /usr/local/djgpp. You can change install location by setting environment variable *DJGPP_PREFIX* : - -``` -DJGPP_PREFIX=/usr/local/my-djgpp +Several environment variables control the build process. Usually you only need to specify `TARGET`. Here is the full list: ``` +# Primary build options: +TARGET= # Target duplet or triplet. +PREFIX= # Install location. +ENABLE_LANGUAGES= # Comma-separated list of languages to build compilers for. -Default support language is C and C++. You can change supported languages by setting environment variable *ENABLE_LANGUAGES* : +# Advanced build options: +MAKE_JOBS= # Number of parallel build threads (auto-detected) +GCC_CONFIGURE_OPTIONS= # Extra options to pass to gcc's ./configure +BINUTILS_CONFIGURE_OPTIONS= # Same, for binutils +GDB_CONFIGURE_OPTIONS= # Same, for gdb +NEWLIB_CONFIGURE_OPTIONS= # Same, for newlib -``` -ENABLE_LANGUAGES=c,c++,f95,objc,obj-c++ +# Misc. +HOST= # The platform you are building for, when building a cross-cross compiler +BUILD= # The platform you are building on (auto-detected) +MAKE_CHECK= # Run test suites on built programs. +MAKE_CHECK_GCC= # Run gcc test suites. ``` -Default number of parallel builds is 4. You can change this number by setting environment variable *MAKE_JOBS* : +### Building +Pick the script you want to use: ``` -MAKE_JOBS=8 +build-glibc.sh # builds a toolchain with glibc (gcc's default standard library) +build-djgpp.sh # builds a toolchain with the djgpp standard library (fixed TARGET: i586-pc-msdosdjgpp) +build-newlib.sh # builds a toolchain with the newlib standard library +build-ia16.sh # builds a toolchain with the newlib standard library (fixed TARGET: ia16-elf) ``` -To configure packages with additional options, add your custom flags to one of the following environment variables: - -``` -GCC_CONFIGURE_OPTIONS="--enable-feature" -GDB_CONFIGURE_OPTIONS="--enable-feature" -BINUTILS_CONFIGURE_OPTIONS="--enable-feature" +To build DJGPP, just run: ``` - -### Building DJGPP compiler - -To build DJGPP, just run : - ./build-djgpp.sh [packages...] +``` +Run with no arguments to see a list of supported packages and versions. -Currently supported packages : - -* gcc-4.7.3 -* gcc-4.8.4 -* gcc-4.8.5 -* gcc-4.9.2 -* gcc-4.9.3 -* gcc-4.9.4 -* gcc-5.1.0 -* gcc-5.2.0 -* gcc-5.3.0 -* gcc-5.4.0 -* gcc-5.5.0 -* gcc-6.1.0 -* gcc-6.2.0 -* gcc-6.3.0 -* gcc-6.4.0 -* gcc-7.1.0 -* gcc-7.2.0 -* gcc-7.3.0 -* binutils-2.29.1 -* gdb-8.0.1 - -For example, to build gcc 7.2.0 with the base library and latest binutils: - +For example, to build gcc 7.2.0 with the djgpp base library and latest binutils: ``` ./build-djgpp.sh base binutils gcc-7.2.0 ``` To install or upgrade all packages: - ``` ./build-djgpp.sh all ``` It will download all necessary files, build DJGPP compiler and binutils, and install it. -### Using DJGPP compiler +### Using -There are 2 methods to run the compiler (*BASE_DIR* is your DJGPP install location). +There are 2 methods to run the compiler (`$PREFIX` and `$TARGET` here are the variables you used to build). -* Use compiler full name : +* Use compiler full name: ``` -BASE_DIR/bin/i586-pc-msdosdjgpp-g++ hello.cpp +$PREFIX/bin/$TARGET-g++ hello.cpp ``` * Or, use compiler short name, you have to change environment variables. -If you are using Linux : +If you are using Linux: ``` -export PATH=BASE_DIR/i586-pc-msdosdjgpp/bin/:$PATH -export GCC_EXEC_PREFIX=BASE_DIR/lib/gcc/ +export PATH=$PREFIX/$TARGET/bin/:$PATH +export GCC_EXEC_PREFIX=$PREFIX/lib/gcc/ g++ hello.cpp ``` Or, run : ``` -source BASE_DIR/setenv +source $PREFIX/setenv-$TARGET ``` If you are using Windows command prompt : ``` -PATH=BASE_DIR/i586-pc-msdosdjgpp/bin;%PATH% -set GCC_EXEC_PREFIX=BASE_DIR/lib/gcc/ +PATH=$PREFIX/$TARGET/bin;%PATH% +set GCC_EXEC_PREFIX=$PREFIX/lib/gcc/ g++ hello.cpp ``` Or, run : ``` -BASE_DIR/setenv.bat +$PREFIX/setenv-$TARGET.bat ``` ### Supported DJGPP Utilities @@ -179,6 +153,7 @@ BASE_DIR/setenv.bat ### Thanks -This script is based on spec file from DJGPP source rpm files by Andris Pavenis : - +These scripts are based on Andrew Wu's build-djgpp script: + +Which in turn is based on spec file from DJGPP source rpm files by Andris Pavenis: From ba044eaa921113ceefa718248dd9a252c3270203 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Mar 2018 01:59:46 +0100 Subject: [PATCH 166/536] support binutils 2.30 for djgpp --- djgpp/binutils-2.29.1 | 2 +- djgpp/binutils-2.30 | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 djgpp/binutils-2.30 diff --git a/djgpp/binutils-2.29.1 b/djgpp/binutils-2.29.1 index 899c926..279db25 100755 --- a/djgpp/binutils-2.29.1 +++ b/djgpp/binutils-2.29.1 @@ -1,4 +1,4 @@ #!/usr/bin/env bash export BINUTILS_VERSION=2291 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/binutils-2.30 b/djgpp/binutils-2.30 new file mode 100755 index 0000000..db18fd6 --- /dev/null +++ b/djgpp/binutils-2.30 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export BINUTILS_VERSION=230 +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" From e4c94283b848164765dd0117463942204c16ec75 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 7 May 2018 15:49:03 +0200 Subject: [PATCH 167/536] added gcc 8.1.0 --- common/gcc-8.1.0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 common/gcc-8.1.0 diff --git a/common/gcc-8.1.0 b/common/gcc-8.1.0 new file mode 100755 index 0000000..d9ef61c --- /dev/null +++ b/common/gcc-8.1.0 @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +export GCC_VERSION=8.1.0 +export GCC_VERSION_SHORT=8.10 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 + +# tarball location +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" + +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" From 3c25e04b5ab260703dd176df31f54320f962f413 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 28 May 2018 08:19:27 +0200 Subject: [PATCH 168/536] fixed passing gcc source file to unpack-gcc.sh, which needs a relative path --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 18ac4c7..679a0b6 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -190,7 +190,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi echo "Running unpack-gcc.sh" - sh unpack-gcc.sh --no-djgpp-source $(ls -t ${BASE}/download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" From 419bdcc2b24dc52c38dbbadb01cd21ed7af8d521 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 21 Jun 2018 10:42:35 +0200 Subject: [PATCH 169/536] build binutils 2.3 by default for djgpp --- djgpp/binutils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djgpp/binutils b/djgpp/binutils index 7a5af26..f149fc3 100755 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source djgpp/binutils-2.29.1 +source djgpp/binutils-2.30 From 4818bbd84efc3e42dbbd184dba0a8dbcef607d75 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 21 Jun 2018 12:29:51 +0200 Subject: [PATCH 170/536] wipe newlib build directory when rebuilding gcc. --- script/build-newlib-gcc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 30fdbf3..59fadbc 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -36,6 +36,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then rm -rf * + rm -rf ${BASE}/build/newlib-${NEWLIB_VERSION}/build-${TARGET}/* ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else From 2895329189d922784f0eaaf6b1763a61de111835 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 7 May 2018 15:50:24 +0200 Subject: [PATCH 171/536] set gcc 8.1.0 as default. --- common/gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/gcc b/common/gcc index 9cae180..999a90d 100755 --- a/common/gcc +++ b/common/gcc @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source common/gcc-7.3.0 +source common/gcc-8.1.0 From 8bdbc506ca08ae93ca397899a68d65209220a65f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 26 Jul 2018 13:50:04 +0200 Subject: [PATCH 172/536] added gcc 8.2.0 --- common/gcc-8.2.0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 common/gcc-8.2.0 diff --git a/common/gcc-8.2.0 b/common/gcc-8.2.0 new file mode 100755 index 0000000..5140e87 --- /dev/null +++ b/common/gcc-8.2.0 @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +export GCC_VERSION=8.2.0 +export GCC_VERSION_SHORT=8.20 +export AUTOCONF_VERSION=2.64 +export AUTOMAKE_VERSION=1.11.6 + +# tarball location +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" + +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" From e4da2d43714dcc9aed7addc50ea0c5da10513234 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 26 Jul 2018 15:28:31 +0200 Subject: [PATCH 173/536] don't enable std::filesystem by default, except for glibc targets. this currently fails to build on djgpp, possibly others as well. --- build-glibc.sh | 3 ++- common/gcc-8.2.0 | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-glibc.sh b/build-glibc.sh index 87f096a..754c20c 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -8,7 +8,8 @@ prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-libquadmath-support --enable-version-specific-runtime-libs - --enable-fat" + --enable-fat + --enable-libstdcxx-filesystem-ts" prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls diff --git a/common/gcc-8.2.0 b/common/gcc-8.2.0 index 5140e87..896ca09 100755 --- a/common/gcc-8.2.0 +++ b/common/gcc-8.2.0 @@ -12,5 +12,4 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ - --enable-libstdcxx-filesystem-ts \ ${GCC_CONFIGURE_OPTIONS}" From de80832bfa69e627de3559f492e8ac09f541737a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 26 Jul 2018 15:40:30 +0200 Subject: [PATCH 174/536] added binutils 2.31 and 2.31.1, set the latter as default. --- newlib/binutils | 2 +- newlib/binutils-2.31 | 4 ++++ newlib/binutils-2.31.1 | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 newlib/binutils-2.31 create mode 100755 newlib/binutils-2.31.1 diff --git a/newlib/binutils b/newlib/binutils index 78136a3..bcd66cc 100755 --- a/newlib/binutils +++ b/newlib/binutils @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source newlib/binutils-2.30 +source newlib/binutils-2.31.1 diff --git a/newlib/binutils-2.31 b/newlib/binutils-2.31 new file mode 100755 index 0000000..3366281 --- /dev/null +++ b/newlib/binutils-2.31 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +BINUTILS_VERSION=2.31 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/newlib/binutils-2.31.1 b/newlib/binutils-2.31.1 new file mode 100755 index 0000000..8165efe --- /dev/null +++ b/newlib/binutils-2.31.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +BINUTILS_VERSION=2.31.1 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" From e21c8f5fa4afb02a60d26c07487efad8b37752c5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 26 Jul 2018 15:54:35 +0200 Subject: [PATCH 175/536] added newer release snapshots of newlib, and set the most recent as default. --- newlib/newlib | 2 +- newlib/newlib-3.0.0.20180226 | 4 ++++ newlib/newlib-3.0.0.20180720 | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 newlib/newlib-3.0.0.20180226 create mode 100755 newlib/newlib-3.0.0.20180720 diff --git a/newlib/newlib b/newlib/newlib index 6a82881..5018d9d 100755 --- a/newlib/newlib +++ b/newlib/newlib @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source newlib/newlib-3.0.0 +source newlib/newlib-3.0.0.20180720 diff --git a/newlib/newlib-3.0.0.20180226 b/newlib/newlib-3.0.0.20180226 new file mode 100755 index 0000000..d66ff0d --- /dev/null +++ b/newlib/newlib-3.0.0.20180226 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +NEWLIB_VERSION=3.0.0.20180226 +NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.0.0.20180720 b/newlib/newlib-3.0.0.20180720 new file mode 100755 index 0000000..d5702e7 --- /dev/null +++ b/newlib/newlib-3.0.0.20180720 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +NEWLIB_VERSION=3.0.0.20180720 +NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" From 33bdfcb372d416702202e6310cfaa0aca21d7444 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 26 Jul 2018 21:35:43 +0200 Subject: [PATCH 176/536] copy -g++ executable to -g++-. --- script/finalize.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/finalize.sh b/script/finalize.sh index 37511a7..80da8c3 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -7,6 +7,7 @@ echo "Copy long name executables to short name." cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME fi done + cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} ) echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${PREFIX}/setenv-${TARGET} From b65b13a7d2e490623a1aa448dc6b644d713848f6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 30 Jul 2018 16:40:48 +0200 Subject: [PATCH 177/536] Revert "don't enable std::filesystem by default, except for glibc targets. this currently fails to build on djgpp, possibly others as well." This reverts commit e4da2d43714dcc9aed7addc50ea0c5da10513234. --- build-glibc.sh | 3 +-- common/gcc-8.2.0 | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-glibc.sh b/build-glibc.sh index 754c20c..87f096a 100755 --- a/build-glibc.sh +++ b/build-glibc.sh @@ -8,8 +8,7 @@ prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-libquadmath-support --enable-version-specific-runtime-libs - --enable-fat - --enable-libstdcxx-filesystem-ts" + --enable-fat" prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls diff --git a/common/gcc-8.2.0 b/common/gcc-8.2.0 index 896ca09..5140e87 100755 --- a/common/gcc-8.2.0 +++ b/common/gcc-8.2.0 @@ -12,4 +12,5 @@ export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ + --enable-libstdcxx-filesystem-ts \ ${GCC_CONFIGURE_OPTIONS}" From 9334a753aab169823880f84bad4aa22e56ac43f4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 30 Jul 2018 16:41:46 +0200 Subject: [PATCH 178/536] download djcross package directly from Andris Pavenis' web site. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 679a0b6..cf7920c 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -77,7 +77,7 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then fi if [ ! -z ${GCC_VERSION} ]; then - DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" + DJCROSS_GCC_ARCHIVE="http://ap1.pp.fi/djgpp/gcc/${GCC_VERSION}/rpm/djcross-gcc-${GCC_VERSION}.tar.bz2" # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} fi From 0e782d9b5117e878cf9a68a2602c7aa1b80eef7d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 30 Jul 2018 16:42:21 +0200 Subject: [PATCH 179/536] set gcc 8.2.0 as default. --- common/gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/gcc b/common/gcc index 999a90d..fd45de0 100755 --- a/common/gcc +++ b/common/gcc @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source common/gcc-8.1.0 +source common/gcc-8.2.0 From 03486febb5e6fa79aec3eacc5f1a6cce8c54413f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 30 Jul 2018 16:53:56 +0200 Subject: [PATCH 180/536] apply experimental patch to fix '-flto -g' for djgpp. --- build-djgpp.sh | 3 ++ patch/patch-djgpp-gcc-8.1.0.txt | 81 +++++++++++++++++++++++++++++++++ patch/patch-djgpp-gcc-8.2.0.txt | 81 +++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 patch/patch-djgpp-gcc-8.1.0.txt create mode 100644 patch/patch-djgpp-gcc-8.2.0.txt diff --git a/build-djgpp.sh b/build-djgpp.sh index cf7920c..7eaf713 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -207,6 +207,9 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Downloading gcc dependencies" cd gnu/gcc-${GCC_VERSION_SHORT} ./contrib/download_prerequisites + + # apply extra patches if necessary + [ -e ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt ] && patch -p 1 -u -i ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt cd - touch gcc-unpacked diff --git a/patch/patch-djgpp-gcc-8.1.0.txt b/patch/patch-djgpp-gcc-8.1.0.txt new file mode 100644 index 0000000..60de2f0 --- /dev/null +++ b/patch/patch-djgpp-gcc-8.1.0.txt @@ -0,0 +1,81 @@ +diff --git a/gcc/config/i386/djgpp.c b/gcc/config/i386/djgpp.c +index f168eed6f06..d187c3a7452 100644 +--- a/gcc/config/i386/djgpp.c ++++ b/gcc/config/i386/djgpp.c +@@ -47,3 +47,20 @@ i386_djgpp_asm_named_section(const char *name, unsigned int flags, + + fprintf (asm_out_file, "\t.section\t%s,\"%s\"\n", name, flagchars); + } ++ ++/* Kludge because of missing COFF support for early LTO debug. */ ++ ++static enum debug_info_levels saved_debug_info_level; ++ ++void ++i386_djgpp_asm_lto_start (void) ++{ ++ saved_debug_info_level = debug_info_level; ++ debug_info_level = DINFO_LEVEL_NONE; ++} ++ ++void ++i386_djgpp_asm_lto_end (void) ++{ ++ debug_info_level = saved_debug_info_level; ++} +diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h +index 01774cea4d6..dd8c71b833a 100644 +--- a/gcc/config/i386/djgpp.h ++++ b/gcc/config/i386/djgpp.h +@@ -157,8 +157,19 @@ along with GCC; see the file COPYING3. If not see + #undef MAKE_DECL_ONE_ONLY + #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) + ++#undef TARGET_COFF ++#define TARGET_COFF 1 ++ ++/* Kludge because of missing COFF support for early LTO debug. */ ++#undef TARGET_ASM_LTO_START ++#define TARGET_ASM_LTO_START i386_djgpp_asm_lto_start ++#undef TARGET_ASM_LTO_END ++#define TARGET_ASM_LTO_END i386_djgpp_asm_lto_end ++ + /* Function protypes for gcc/i386/djgpp.c */ + + void + i386_djgpp_asm_named_section(const char *name, unsigned int flags, + tree decl); ++void i386_djgpp_asm_lto_start (void); ++void i386_djgpp_asm_lto_end (void); +diff --git a/gcc/defaults.h b/gcc/defaults.h +index 78a08a33f12..9035b333be8 100644 +--- a/gcc/defaults.h ++++ b/gcc/defaults.h +@@ -1282,6 +1282,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define TARGET_PECOFF 0 + #endif + ++#ifndef TARGET_COFF ++#define TARGET_COFF 0 ++#endif ++ + #ifndef EH_RETURN_HANDLER_RTX + #define EH_RETURN_HANDLER_RTX NULL + #endif +diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c +index 8377cbc5dd1..c75aadbaa2c 100644 +--- a/gcc/dwarf2out.c ++++ b/gcc/dwarf2out.c +@@ -31938,10 +31938,10 @@ dwarf2out_early_finish (const char *filename) + + /* Do not generate DWARF assembler now when not producing LTO bytecode. */ + if ((!flag_generate_lto && !flag_generate_offload) +- /* FIXME: Disable debug info generation for PE-COFF targets since the ++ /* FIXME: Disable debug info generation for (PE-)COFF targets since the + copy_lto_debug_sections operation of the simple object support in + libiberty is not implemented for them yet. */ +- || TARGET_PECOFF) ++ || TARGET_PECOFF || TARGET_COFF) + return; + + /* Now as we are going to output for LTO initialize sections and labels diff --git a/patch/patch-djgpp-gcc-8.2.0.txt b/patch/patch-djgpp-gcc-8.2.0.txt new file mode 100644 index 0000000..60de2f0 --- /dev/null +++ b/patch/patch-djgpp-gcc-8.2.0.txt @@ -0,0 +1,81 @@ +diff --git a/gcc/config/i386/djgpp.c b/gcc/config/i386/djgpp.c +index f168eed6f06..d187c3a7452 100644 +--- a/gcc/config/i386/djgpp.c ++++ b/gcc/config/i386/djgpp.c +@@ -47,3 +47,20 @@ i386_djgpp_asm_named_section(const char *name, unsigned int flags, + + fprintf (asm_out_file, "\t.section\t%s,\"%s\"\n", name, flagchars); + } ++ ++/* Kludge because of missing COFF support for early LTO debug. */ ++ ++static enum debug_info_levels saved_debug_info_level; ++ ++void ++i386_djgpp_asm_lto_start (void) ++{ ++ saved_debug_info_level = debug_info_level; ++ debug_info_level = DINFO_LEVEL_NONE; ++} ++ ++void ++i386_djgpp_asm_lto_end (void) ++{ ++ debug_info_level = saved_debug_info_level; ++} +diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h +index 01774cea4d6..dd8c71b833a 100644 +--- a/gcc/config/i386/djgpp.h ++++ b/gcc/config/i386/djgpp.h +@@ -157,8 +157,19 @@ along with GCC; see the file COPYING3. If not see + #undef MAKE_DECL_ONE_ONLY + #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) + ++#undef TARGET_COFF ++#define TARGET_COFF 1 ++ ++/* Kludge because of missing COFF support for early LTO debug. */ ++#undef TARGET_ASM_LTO_START ++#define TARGET_ASM_LTO_START i386_djgpp_asm_lto_start ++#undef TARGET_ASM_LTO_END ++#define TARGET_ASM_LTO_END i386_djgpp_asm_lto_end ++ + /* Function protypes for gcc/i386/djgpp.c */ + + void + i386_djgpp_asm_named_section(const char *name, unsigned int flags, + tree decl); ++void i386_djgpp_asm_lto_start (void); ++void i386_djgpp_asm_lto_end (void); +diff --git a/gcc/defaults.h b/gcc/defaults.h +index 78a08a33f12..9035b333be8 100644 +--- a/gcc/defaults.h ++++ b/gcc/defaults.h +@@ -1282,6 +1282,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define TARGET_PECOFF 0 + #endif + ++#ifndef TARGET_COFF ++#define TARGET_COFF 0 ++#endif ++ + #ifndef EH_RETURN_HANDLER_RTX + #define EH_RETURN_HANDLER_RTX NULL + #endif +diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c +index 8377cbc5dd1..c75aadbaa2c 100644 +--- a/gcc/dwarf2out.c ++++ b/gcc/dwarf2out.c +@@ -31938,10 +31938,10 @@ dwarf2out_early_finish (const char *filename) + + /* Do not generate DWARF assembler now when not producing LTO bytecode. */ + if ((!flag_generate_lto && !flag_generate_offload) +- /* FIXME: Disable debug info generation for PE-COFF targets since the ++ /* FIXME: Disable debug info generation for (PE-)COFF targets since the + copy_lto_debug_sections operation of the simple object support in + libiberty is not implemented for them yet. */ +- || TARGET_PECOFF) ++ || TARGET_PECOFF || TARGET_COFF) + return; + + /* Now as we are going to output for LTO initialize sections and labels From df0ad8699fa80da3a3e30840c33ad54174214e22 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 30 Jul 2018 17:24:18 +0200 Subject: [PATCH 181/536] list latest package versions in readme. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 4c794a6..bb91756 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ ## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. +### Current package versions, as of 2018-07-30: + +* gcc 8.2.0 +* binutils 2.31.1 +# gdb 8.1 +* djgpp 2.05 +* newlib 3.0.0.20180720 + ### Requirements Before running this script, you need to install these programs first: From 503fb4582ea9aaae4b5c526b1e4f44cb63316b67 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 30 Jul 2018 17:25:30 +0200 Subject: [PATCH 182/536] fix typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb91756..8d3fa02 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * gcc 8.2.0 * binutils 2.31.1 -# gdb 8.1 +* gdb 8.1 * djgpp 2.05 * newlib 3.0.0.20180720 From 560be2bdb49be9522cc2eb3bba02b5cfcacffecb Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 31 Jul 2018 17:58:05 +0200 Subject: [PATCH 183/536] added gdb 8.1.1 --- README.md | 4 ++-- common/gdb | 2 +- common/gdb-8.1.1 | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100755 common/gdb-8.1.1 diff --git a/README.md b/README.md index 8d3fa02..72be091 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ ## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. -### Current package versions, as of 2018-07-30: +### Current package versions, as of 2018-07-31: * gcc 8.2.0 * binutils 2.31.1 -* gdb 8.1 +* gdb 8.1.1 * djgpp 2.05 * newlib 3.0.0.20180720 diff --git a/common/gdb b/common/gdb index 7dcc2f7..51d5be1 100755 --- a/common/gdb +++ b/common/gdb @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source common/gdb-8.1 +source common/gdb-8.1.1 diff --git a/common/gdb-8.1.1 b/common/gdb-8.1.1 new file mode 100755 index 0000000..9746af3 --- /dev/null +++ b/common/gdb-8.1.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GDB_VERSION=8.1.1 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From a8b3e194289c4f29dc820a30c0b5a4bd52de30d9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 1 Aug 2018 19:32:53 +0200 Subject: [PATCH 184/536] added binutils 2.31.1 for djgpp. --- djgpp/binutils | 2 +- djgpp/binutils-2.30 | 2 +- djgpp/binutils-2.31.1 | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 djgpp/binutils-2.31.1 diff --git a/djgpp/binutils b/djgpp/binutils index f149fc3..c281341 100755 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source djgpp/binutils-2.30 +source djgpp/binutils-2.31.1 diff --git a/djgpp/binutils-2.30 b/djgpp/binutils-2.30 index db18fd6..9f3d65f 100755 --- a/djgpp/binutils-2.30 +++ b/djgpp/binutils-2.30 @@ -1,4 +1,4 @@ #!/usr/bin/env bash export BINUTILS_VERSION=230 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/binutils-2.31.1 b/djgpp/binutils-2.31.1 new file mode 100755 index 0000000..4b7d0e3 --- /dev/null +++ b/djgpp/binutils-2.31.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export BINUTILS_VERSION=2311 +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" From 10fc673b35d4756b58ed86eeb830a5a8808612eb Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 18:17:02 +0200 Subject: [PATCH 185/536] remove build-glibc.sh for now, as it is unfinished. --- build-glibc.sh | 134 ------------------------------------------------- 1 file changed, 134 deletions(-) delete mode 100755 build-glibc.sh diff --git a/build-glibc.sh b/build-glibc.sh deleted file mode 100755 index 87f096a..0000000 --- a/build-glibc.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env bash - -source script/init.sh - -prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror - --disable-nls" - -prepend GCC_CONFIGURE_OPTIONS "--disable-nls - --enable-libquadmath-support - --enable-version-specific-runtime-libs - --enable-fat" - -prepend GDB_CONFIGURE_OPTIONS "--disable-werror - --disable-nls - --with-system-readline" - -if [ -z ${TARGET} ]; then - echo "Please specify a target with: export TARGET=..." - exit 1 -fi - -if [ -z $1 ]; then - echo "Usage: $0 [packages...]" - echo "Supported packages:" - ls newlib/ - ls common/ - exit 1 -fi - -while [ ! -z $1 ]; do - if [ ! -x newlib/$1 ] && [ ! -x common/$1 ]; then - echo "Unsupported package: $1" - exit 1 - fi - - [ -e newlib/$1 ] && source newlib/$1 || source common/$1 - shift -done - -DEPS="" - -if [ -z ${IGNORE_DEPENDENCIES} ]; then - [ ! -z ${GCC_VERSION} ] && DEPS+=" binutils" - [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " - [ ! -z ${GDB_VERSION} ] && DEPS+=" " - - for DEP in ${DEPS}; do - case $DEP in - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source newlib/binutils - ;; - gcc) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ - && [ -z ${GCC_VERSION} ] \ - && source common/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - esac - done -fi - -source ${BASE}/script/download.sh - -source ${BASE}/script/build-tools.sh - -cd ${BASE}/build/ || exit 1 - -if [ ! -z ${BINUTILS_VERSION} ]; then - echo "Building binutils" - if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then - untar binutils-${BINUTILS_VERSION} || exit 1 - touch binutils-${BINUTILS_VERSION}/binutils-unpacked - fi - - cd binutils-${BINUTILS_VERSION} || exit 1 - - source ${BASE}/script/build-binutils.sh -fi - -cd ${BASE}/build/ - -if [ ! -z ${GCC_VERSION} ]; then - if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then - untar gcc-${GCC_VERSION} - - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gcc-${GCC_VERSION}/ - ./contrib/download_prerequisites - touch gcc-unpacked - cd - - else - echo "gcc already unpacked, skipping." - fi - - echo "Building gcc" - - mkdir -p gcc-${GCC_VERSION}/build-${TARGET} - cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - - TEMP_CFLAGS="$CFLAGS" - export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} - --enable-languages=${ENABLE_LANGUAGES}" - strip_whitespace GCC_CONFIGURE_OPTIONS - - if [ ! -e configure-prefix ] || [ ! `cat configure-prefix` = "${PREFIX}" ]; then - rm -rf * - ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${PREFIX} > configure-prefix - else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log - ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - - export CFLAGS="$TEMP_CFLAGS" -fi - -cd ${BASE}/build - -source ${BASE}/script/build-gdb.sh - -source ${BASE}/script/finalize.sh From f32d5baaf7b654c895dda93e74c14b871b3f6ed3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 17:39:12 +0200 Subject: [PATCH 186/536] check for write access to PREFIX directory before doing anything. --- script/download.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/script/download.sh b/script/download.sh index ab2ff2e..d2f71c7 100644 --- a/script/download.sh +++ b/script/download.sh @@ -1,3 +1,17 @@ +# create target directory, check writable. +echo "Make prefix directory : $PREFIX" +mkdir -p $PREFIX + +if ! [ -d $PREFIX ]; then + echo "Unable to create prefix directory" + exit 1 +fi + +if ! [ -w $PREFIX ]; then + echo "prefix directory is not writable." + exit 1 +fi + echo "You are about to build and install:" [ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" [ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" @@ -124,20 +138,6 @@ for ARCHIVE in $ARCHIVE_LIST; do done cd .. -# create target directory, check writable. -echo "Make prefix directory : $PREFIX" -mkdir -p $PREFIX - -if ! [ -d $PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 export PATH="${PREFIX}/bin:$PATH" From 3677051f9ad8371299c5fe54a0f19e1d7d77bdeb Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 17:58:52 +0200 Subject: [PATCH 187/536] use sudo on write access to PREFIX, where root privilege may be necessary. --- build-djgpp.sh | 36 ++++++++++++++++++------------------ script/build-binutils.sh | 6 +++--- script/build-gdb.sh | 6 +++--- script/build-newlib-gcc.sh | 20 ++++++++++---------- script/download.sh | 29 +++++++++++++---------------- script/finalize.sh | 18 +++++++++--------- script/init.sh | 2 ++ 7 files changed, 58 insertions(+), 59 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 7eaf713..a76ce0f 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -132,15 +132,15 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then cd ../.. - mkdir -p $PREFIX/${TARGET}/sys-include || exit 1 - cp -rp include/* $PREFIX/${TARGET}/sys-include/ || exit 1 - cp -rp lib $PREFIX/${TARGET}/ || exit 1 - mkdir -p $PREFIX/bin || exit 1 - cp -p src/stub/${TARGET}-stubify $PREFIX/bin/ || exit 1 - cp -p src/stub/${TARGET}-stubedit $PREFIX/bin/ || exit 1 - - rm ${PREFIX}/${TARGET}/etc/djgpp-*-installed - touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed + ${SUDO} mkdir -p $PREFIX/${TARGET}/sys-include || exit 1 + ${SUDO} cp -rp include/* $PREFIX/${TARGET}/sys-include/ || exit 1 + ${SUDO} cp -rp lib $PREFIX/${TARGET}/ || exit 1 + ${SUDO} mkdir -p $PREFIX/bin || exit 1 + ${SUDO} cp -p src/stub/${TARGET}-stubify $PREFIX/bin/ || exit 1 + ${SUDO} cp -p src/stub/${TARGET}-stubedit $PREFIX/bin/ || exit 1 + + ${SUDO} rm ${PREFIX}/${TARGET}/etc/djgpp-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi cd ${BASE}/build/ @@ -199,7 +199,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - # copy stubify programs - cp -p $PREFIX/bin/stubify $BUILDDIR/tmpinst/bin/ + ${SUDO} cp -p $PREFIX/bin/stubify $BUILDDIR/tmpinst/bin/ cd $BUILDDIR/ @@ -240,8 +240,8 @@ if [ ! -z ${GCC_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log - ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${MAKE} -j${MAKE_JOBS} -C mpfr install + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install rm ${PREFIX}/${TARGET}/etc/gcc-*-installed touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed @@ -259,9 +259,9 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd src PATH=$PREFIX/bin/:$PATH ${MAKE} || exit 1 cd dxe - cp -p dxegen $PREFIX/bin/${TARGET}-dxegen || exit 1 - cp -p dxe3gen $PREFIX/bin/${TARGET}-dxe3gen || exit 1 - cp -p dxe3res $PREFIX/bin/${TARGET}-dxe3res || exit 1 + ${SUDO} cp -p dxegen $PREFIX/bin/${TARGET}-dxegen || exit 1 + ${SUDO} cp -p dxe3gen $PREFIX/bin/${TARGET}-dxe3gen || exit 1 + ${SUDO} cp -p dxe3res $PREFIX/bin/${TARGET}-dxe3res || exit 1 cd ../.. touch ${PREFIX}/${TARGET}/etc/dxegen-installed else @@ -269,7 +269,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then fi cd src/stub ${HOST_CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 - cp -p exe2coff $PREFIX/bin/${TARGET}-exe2coff || exit 1 + ${SUDO} cp -p exe2coff $PREFIX/bin/${TARGET}-exe2coff || exit 1 # djlsr done fi @@ -280,5 +280,5 @@ source ${BASE}/script/build-gdb.sh source ${BASE}/script/finalize.sh -echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${PREFIX}/setenv-${TARGET} -echo "set DJDIR=%~dp0${TARGET}" >> ${PREFIX}/setenv-${TARGET}.bat +${SUDO} echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${PREFIX}/setenv-${TARGET} +${SUDO} echo "set DJDIR=%~dp0${TARGET}" >> ${PREFIX}/setenv-${TARGET}.bat diff --git a/script/build-binutils.sh b/script/build-binutils.sh index 21ec49d..9ef4b96 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -19,7 +19,7 @@ if [ ${TARGET} == "i586-pc-msdosdjgpp" ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/binutils.log -${MAKE} -j${MAKE_JOBS} install || exit 1 +${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 -rm ${PREFIX}/${TARGET}/etc/binutils-*-installed -touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed +${SUDO} rm ${PREFIX}/${TARGET}/etc/binutils-*-installed +${SUDO} touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 4729daa..42ba61f 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -25,8 +25,8 @@ if [ ! -z ${GDB_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gdb.log - ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 - rm ${PREFIX}/${TARGET}/etc/gdb-*-installed - touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed + ${SUDO} rm ${PREFIX}/${TARGET}/etc/gdb-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed fi diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 59fadbc..1264811 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -2,8 +2,8 @@ cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then untar newlib-${NEWLIB_VERSION} - mkdir -p ${PREFIX}/${TARGET}/sys-include/ - cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + ${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ + ${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 touch newlib-${NEWLIB_VERSION}/newlib-unpacked fi @@ -45,7 +45,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 - ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 export CFLAGS="$TEMP_CFLAGS" fi @@ -70,8 +70,8 @@ if [ ! -z ${NEWLIB_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/newlib.log - ${MAKE} -j${MAKE_JOBS} install || \ - ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || \ + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 fi cd ${BASE}/build/ @@ -81,10 +81,10 @@ if [ ! -z ${GCC_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log - ${MAKE} -j${MAKE_JOBS} install-strip || \ - ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${MAKE} -j${MAKE_JOBS} -C mpfr install + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install - rm ${PREFIX}/${TARGET}/etc/gcc-*-installed - touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + ${SUDO} rm ${PREFIX}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed fi diff --git a/script/download.sh b/script/download.sh index d2f71c7..6cec9f2 100644 --- a/script/download.sh +++ b/script/download.sh @@ -1,17 +1,3 @@ -# create target directory, check writable. -echo "Make prefix directory : $PREFIX" -mkdir -p $PREFIX - -if ! [ -d $PREFIX ]; then - echo "Unable to create prefix directory" - exit 1 -fi - -if ! [ -w $PREFIX ]; then - echo "prefix directory is not writable." - exit 1 -fi - echo "You are about to build and install:" [ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" [ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" @@ -52,10 +38,23 @@ fi if [ ! -z ${NEWLIB_VERSION} ]; then echo " NEWLIB_CONFIGURE_OPTIONS=`echo ${NEWLIB_CONFIGURE_OPTIONS}`" fi +echo "" + +mkdir -p ${PREFIX} + +if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then + echo "WARNING: no write access to ${PREFIX}." + echo "You may need to enter your sudo password several times during the build process." + SUDO=sudo +fi + echo "" echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." read -s -n 1 +${SUDO} mkdir -p ${PREFIX} || exit 1 +${SUDO} mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 + # check required programs REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" @@ -138,8 +137,6 @@ for ARCHIVE in $ARCHIVE_LIST; do done cd .. -mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 - export PATH="${PREFIX}/bin:$PATH" rm -rf ${BASE}/tests diff --git a/script/finalize.sh b/script/finalize.sh index 80da8c3..d28755e 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -4,20 +4,20 @@ echo "Copy long name executables to short name." SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/${TARGET}-$SHORT_NAME ]; then - cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME + ${SUDO} cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME fi done - cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} + ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} ) -echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${PREFIX}/setenv-${TARGET} -echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${PREFIX}/setenv-${TARGET} -echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${PREFIX}/setenv-${TARGET} -echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${PREFIX}/setenv-${TARGET} +${SUDO} echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${PREFIX}/setenv-${TARGET} +${SUDO} echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${PREFIX}/setenv-${TARGET} +${SUDO} echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${PREFIX}/setenv-${TARGET} +${SUDO} echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${PREFIX}/setenv-${TARGET} -echo "@echo off" >> ${PREFIX}/setenv-${TARGET}.bat -echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${PREFIX}/setenv-${TARGET}.bat -echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${PREFIX}/setenv-${TARGET}.bat +${SUDO} echo "@echo off" >> ${PREFIX}/setenv-${TARGET}.bat +${SUDO} echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${PREFIX}/setenv-${TARGET}.bat +${SUDO} echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${PREFIX}/setenv-${TARGET}.bat cd ${BASE}/build diff --git a/script/init.sh b/script/init.sh index a5fdd2f..72b0ea0 100644 --- a/script/init.sh +++ b/script/init.sh @@ -12,6 +12,8 @@ ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads MAKE_JOBS=${MAKE_JOBS-`nproc --all`} +SUDO= + # use gmake/clang under FreeBSD if [ `uname` = "FreeBSD" ]; then MAKE=${MAKE-gmake} From d494accc606183df21cc682b304e4aeb58c9ee20 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 18:03:34 +0200 Subject: [PATCH 188/536] removed one unnecessary sudo. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index a76ce0f..2c374b4 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -199,7 +199,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - # copy stubify programs - ${SUDO} cp -p $PREFIX/bin/stubify $BUILDDIR/tmpinst/bin/ + cp -p $PREFIX/bin/stubify $BUILDDIR/tmpinst/bin/ cd $BUILDDIR/ From 6ff17c58bbba6391d86c6c44f82e40e5f66db3e2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 19:08:54 +0200 Subject: [PATCH 189/536] create PREFIX directory only if it doesn't exist already. do so after downloading. --- script/download.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/download.sh b/script/download.sh index 6cec9f2..092dd60 100644 --- a/script/download.sh +++ b/script/download.sh @@ -52,9 +52,6 @@ echo "" echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." read -s -n 1 -${SUDO} mkdir -p ${PREFIX} || exit 1 -${SUDO} mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 - # check required programs REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" @@ -137,6 +134,10 @@ for ARCHIVE in $ARCHIVE_LIST; do done cd .. +echo "Creating install directory: ${PREFIX}" +[ -d ${PREFIX} ] || ${SUDO} mkdir -p ${PREFIX} || exit 1 +[ -d ${PREFIX}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 + export PATH="${PREFIX}/bin:$PATH" rm -rf ${BASE}/tests From 5035ce3e4269df4fc69004e195aa48f9aa145ddf Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 19:10:42 +0200 Subject: [PATCH 190/536] chmod +x configure for djgpp's binutils. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 2c374b4..6e4a913 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -103,7 +103,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then cd gnu/binutils-* || exit 1 # exec permission of some files are not set, fix it. - for EXEC_FILE in install-sh missing; do + for EXEC_FILE in install-sh missing configure; do echo "chmod a+x $EXEC_FILE" chmod a+x $EXEC_FILE || exit 1 done From 021ed78e81146799dd3bf64caa2e5e1dcf59056f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 19:40:28 +0200 Subject: [PATCH 191/536] fixed copying stubify from wrong directory. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 6e4a913..cbdbf6c 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -199,7 +199,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - # copy stubify programs - cp -p $PREFIX/bin/stubify $BUILDDIR/tmpinst/bin/ + cp -p ${BASE}/build/djgpp-${DJGPP_VERSION}/src/stub/stubify $BUILDDIR/tmpinst/bin/ cd $BUILDDIR/ From 61eb6fd65a7318fc826352c32ccae16649cd9ca6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 20:10:27 +0200 Subject: [PATCH 192/536] generate setenv script in a temporary file before copying to install directory. --- script/finalize.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index d28755e..af3715e 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -10,14 +10,17 @@ echo "Copy long name executables to short name." ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} ) -${SUDO} echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${PREFIX}/setenv-${TARGET} -${SUDO} echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${PREFIX}/setenv-${TARGET} -${SUDO} echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${PREFIX}/setenv-${TARGET} -${SUDO} echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${PREFIX}/setenv-${TARGET} +echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${BASE}/build/setenv-${TARGET} +echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${BASE}/build/setenv-${TARGET} +echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${BASE}/build/setenv-${TARGET} +echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${BASE}/build/setenv-${TARGET} -${SUDO} echo "@echo off" >> ${PREFIX}/setenv-${TARGET}.bat -${SUDO} echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${PREFIX}/setenv-${TARGET}.bat -${SUDO} echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${PREFIX}/setenv-${TARGET}.bat +echo "@echo off" > ${BASE}/build/setenv-${TARGET}.bat +echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${BASE}/build/setenv-${TARGET}.bat +echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${BASE}/build/setenv-${TARGET}.bat + +${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ +cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null cd ${BASE}/build From 76c3ec915689c86b96b0c563712d23ff5c16f144 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 15 Aug 2018 20:36:00 +0200 Subject: [PATCH 193/536] write DJDIR to setenv script before installing in PREFIX. --- build-djgpp.sh | 3 --- script/finalize.sh | 13 +++++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index cbdbf6c..25540d8 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -279,6 +279,3 @@ cd ${BASE}/build source ${BASE}/script/build-gdb.sh source ${BASE}/script/finalize.sh - -${SUDO} echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${PREFIX}/setenv-${TARGET} -${SUDO} echo "set DJDIR=%~dp0${TARGET}" >> ${PREFIX}/setenv-${TARGET}.bat diff --git a/script/finalize.sh b/script/finalize.sh index af3715e..d7f1e35 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -10,15 +10,20 @@ echo "Copy long name executables to short name." ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} ) -echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${BASE}/build/setenv-${TARGET} -echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${BASE}/build/setenv-${TARGET} -echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${BASE}/build/setenv-${TARGET} -echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${BASE}/build/setenv-${TARGET} +echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${BASE}/build/setenv-${TARGET} +echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${BASE}/build/setenv-${TARGET} +echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${BASE}/build/setenv-${TARGET} +echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${BASE}/build/setenv-${TARGET} echo "@echo off" > ${BASE}/build/setenv-${TARGET}.bat echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${BASE}/build/setenv-${TARGET}.bat echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${BASE}/build/setenv-${TARGET}.bat +if [ ! -z ${DJGPP_VERSION} ]; then + echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${BASE}/build/setenv-${TARGET} + echo "set DJDIR=%~dp0${TARGET}" >> ${BASE}/build/setenv-${TARGET}.bat +fi + ${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null From 1ab1cb7cd2aeb93cef709c41d840a40722fd2ba5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 16 Aug 2018 20:31:36 +0200 Subject: [PATCH 194/536] added gitattributes file. --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6164ec3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +* eol=lf From 45789e64e28411839bb0987da17caedc8256d064 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 16 Aug 2018 20:43:02 +0200 Subject: [PATCH 195/536] normalize line endings --- script/build-binutils.sh | 50 +++---- script/build-gdb.sh | 64 ++++---- script/build-newlib-gcc.sh | 180 +++++++++++------------ script/build-tools.sh | 64 ++++---- script/download.sh | 290 ++++++++++++++++++------------------- script/finalize.sh | 96 ++++++------ script/init.sh | 92 ++++++------ 7 files changed, 418 insertions(+), 418 deletions(-) mode change 100644 => 100755 script/build-binutils.sh mode change 100644 => 100755 script/build-gdb.sh mode change 100644 => 100755 script/build-newlib-gcc.sh mode change 100644 => 100755 script/build-tools.sh mode change 100644 => 100755 script/download.sh mode change 100644 => 100755 script/finalize.sh mode change 100644 => 100755 script/init.sh diff --git a/script/build-binutils.sh b/script/build-binutils.sh old mode 100644 new mode 100755 index 9ef4b96..94265c7 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -1,25 +1,25 @@ -mkdir -p build-${TARGET} -cd build-${TARGET} || exit 1 - -BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" -strip_whitespace BINUTILS_CONFIGURE_OPTIONS - -if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${BINUTILS_CONFIGURE_OPTIONS}" ]; then - rm -rf * - ../configure ${BINUTILS_CONFIGURE_OPTIONS} || exit 1 - echo ${BINUTILS_CONFIGURE_OPTIONS} > configure-prefix -else - echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 -fi - -if [ ${TARGET} == "i586-pc-msdosdjgpp" ]; then - ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 - ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 -fi -${MAKE} -j${MAKE_JOBS} || exit 1 -[ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/binutils.log -${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 - -${SUDO} rm ${PREFIX}/${TARGET}/etc/binutils-*-installed -${SUDO} touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed +mkdir -p build-${TARGET} +cd build-${TARGET} || exit 1 + +BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" +strip_whitespace BINUTILS_CONFIGURE_OPTIONS + +if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${BINUTILS_CONFIGURE_OPTIONS}" ]; then + rm -rf * + ../configure ${BINUTILS_CONFIGURE_OPTIONS} || exit 1 + echo ${BINUTILS_CONFIGURE_OPTIONS} > configure-prefix +else + echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 +fi + +if [ ${TARGET} == "i586-pc-msdosdjgpp" ]; then + ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 + ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 +fi +${MAKE} -j${MAKE_JOBS} || exit 1 +[ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/binutils.log +${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + +${SUDO} rm ${PREFIX}/${TARGET}/etc/binutils-*-installed +${SUDO} touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh old mode 100644 new mode 100755 index 42ba61f..1fd3f5a --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -1,32 +1,32 @@ -cd ${BASE}/build - -if [ ! -z ${GDB_VERSION} ]; then - if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then - echo "Unpacking gdb." - untar gdb-${GDB_VERSION} || exit 1 - touch gdb-${GDB_VERSION}/gdb-unpacked - fi - mkdir -p gdb-${GDB_VERSION}/build-${TARGET} - cd gdb-${GDB_VERSION}/build-${TARGET} || exit 1 - - echo "Building gdb." - - GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" - [ -e ${PREFIX}/lib/libmpfr.a ] && GDB_CONFIGURE_OPTIONS+=" --with-mpfr=${PREFIX}" - strip_whitespace GDB_CONFIGURE_OPTIONS - - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then - rm -rf * - ../configure ${GDB_CONFIGURE_OPTIONS} || exit 1 - echo ${GDB_CONFIGURE_OPTIONS} > configure-prefix - else - echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gdb.log - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 - - ${SUDO} rm ${PREFIX}/${TARGET}/etc/gdb-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed -fi +cd ${BASE}/build + +if [ ! -z ${GDB_VERSION} ]; then + if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then + echo "Unpacking gdb." + untar gdb-${GDB_VERSION} || exit 1 + touch gdb-${GDB_VERSION}/gdb-unpacked + fi + mkdir -p gdb-${GDB_VERSION}/build-${TARGET} + cd gdb-${GDB_VERSION}/build-${TARGET} || exit 1 + + echo "Building gdb." + + GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" + [ -e ${PREFIX}/lib/libmpfr.a ] && GDB_CONFIGURE_OPTIONS+=" --with-mpfr=${PREFIX}" + strip_whitespace GDB_CONFIGURE_OPTIONS + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then + rm -rf * + ../configure ${GDB_CONFIGURE_OPTIONS} || exit 1 + echo ${GDB_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gdb.log + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + + ${SUDO} rm ${PREFIX}/${TARGET}/etc/gdb-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed +fi diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh old mode 100644 new mode 100755 index 1264811..e8a9eb1 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -1,90 +1,90 @@ -cd ${BASE}/build/ - -if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then - untar newlib-${NEWLIB_VERSION} - ${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ - ${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 - touch newlib-${NEWLIB_VERSION}/newlib-unpacked -fi - -if [ ! -z ${GCC_VERSION} ]; then - if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then - untar gcc-${GCC_VERSION} - - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gcc-${GCC_VERSION}/ - ./contrib/download_prerequisites - touch gcc-unpacked - cd - - else - echo "gcc already unpacked, skipping." - fi - - echo "Building gcc" - - mkdir -p gcc-${GCC_VERSION}/build-${TARGET} - cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - - TEMP_CFLAGS="$CFLAGS" - export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - - GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} - --enable-languages=${ENABLE_LANGUAGES} - --with-newlib" - strip_whitespace GCC_CONFIGURE_OPTIONS - - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then - rm -rf * - rm -rf ${BASE}/build/newlib-${NEWLIB_VERSION}/build-${TARGET}/* - ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 - echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix - else - echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - - ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 - - export CFLAGS="$TEMP_CFLAGS" -fi - -cd ${BASE}/build/ - -if [ ! -z ${NEWLIB_VERSION} ]; then - mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} - cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 - - NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" - strip_whitespace NEWLIB_CONFIGURE_OPTIONS - - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then - rm -rf * - ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 - echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix - else - echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 - fi - - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/newlib.log - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || \ - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 -fi - -cd ${BASE}/build/ - -if [ ! -z ${GCC_VERSION} ]; then - cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install - - ${SUDO} rm ${PREFIX}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed -fi +cd ${BASE}/build/ + +if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then + untar newlib-${NEWLIB_VERSION} + ${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ + ${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + touch newlib-${NEWLIB_VERSION}/newlib-unpacked +fi + +if [ ! -z ${GCC_VERSION} ]; then + if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then + untar gcc-${GCC_VERSION} + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gcc-${GCC_VERSION}/ + ./contrib/download_prerequisites + touch gcc-unpacked + cd - + else + echo "gcc already unpacked, skipping." + fi + + echo "Building gcc" + + mkdir -p gcc-${GCC_VERSION}/build-${TARGET} + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} + --enable-languages=${ENABLE_LANGUAGES} + --with-newlib" + strip_whitespace GCC_CONFIGURE_OPTIONS + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then + rm -rf * + rm -rf ${BASE}/build/newlib-${NEWLIB_VERSION}/build-${TARGET}/* + ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 + + export CFLAGS="$TEMP_CFLAGS" +fi + +cd ${BASE}/build/ + +if [ ! -z ${NEWLIB_VERSION} ]; then + mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} + cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 + + NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" + strip_whitespace NEWLIB_CONFIGURE_OPTIONS + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then + rm -rf * + ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 + echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/newlib.log + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || \ + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 +fi + +cd ${BASE}/build/ + +if [ ! -z ${GCC_VERSION} ]; then + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install + + ${SUDO} rm ${PREFIX}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed +fi diff --git a/script/build-tools.sh b/script/build-tools.sh old mode 100644 new mode 100755 index aee7fc8..27c9362 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -1,32 +1,32 @@ -mkdir -p ${BASE}/build/tmpinst -export PATH="${BASE}/build/tmpinst/bin:$PATH" - -cd ${BASE}/build/ || exit 1 - -# build GNU tar if needed. -if [ ! -z $TAR_VERSION ]; then - if [ ! -e ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed ]; then - echo "Building tar" - tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 - cd tar-${TAR_VERSION}/ - ./configure --prefix=${BASE}/build/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || exit 1 - touch ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed - fi -fi - -cd ${BASE}/build || exit 1 - -# build GNU sed if needed. -if [ ! -z $SED_VERSION ]; then - if [ ! -e ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed ]; then - echo "Building sed" - untar sed-${SED_VERSION} || exit 1 - cd sed-${SED_VERSION}/ - ./configure --prefix=${BASE}/build/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || exit 1 - touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed - fi -fi +mkdir -p ${BASE}/build/tmpinst +export PATH="${BASE}/build/tmpinst/bin:$PATH" + +cd ${BASE}/build/ || exit 1 + +# build GNU tar if needed. +if [ ! -z $TAR_VERSION ]; then + if [ ! -e ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed ]; then + echo "Building tar" + tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 + cd tar-${TAR_VERSION}/ + ./configure --prefix=${BASE}/build/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 + touch ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed + fi +fi + +cd ${BASE}/build || exit 1 + +# build GNU sed if needed. +if [ ! -z $SED_VERSION ]; then + if [ ! -e ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed ]; then + echo "Building sed" + untar sed-${SED_VERSION} || exit 1 + cd sed-${SED_VERSION}/ + ./configure --prefix=${BASE}/build/tmpinst || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} install || exit 1 + touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed + fi +fi diff --git a/script/download.sh b/script/download.sh old mode 100644 new mode 100755 index 092dd60..f83acae --- a/script/download.sh +++ b/script/download.sh @@ -1,145 +1,145 @@ -echo "You are about to build and install:" -[ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" -[ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" -[ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" -[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" -[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" -[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" -echo "" -echo "With the following options:" -[ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" -echo " TARGET=${TARGET}" -echo " HOST=${HOST}" -echo " BUILD=${BUILD}" -echo " PREFIX=${PREFIX}" -echo " CC=${CC}" -echo " CXX=${CXX}" -echo " CFLAGS=${CFLAGS}" -echo " CXXFLAGS=${CXXFLAGS}" -echo " LDFLAGS=${LDFLAGS}" -echo " MAKE=${MAKE}" -echo " MAKE_JOBS=${MAKE_JOBS}" -echo " MAKE_CHECK=${MAKE_CHECK}" -echo " MAKE_CHECK_GCC=${MAKE_CHECK_GCC}" -if [ ! -z ${HOST} ]; then - echo " HOST_CC=`echo ${HOST_CC}`" - echo " HOST_CXX=`echo ${HOST_CXX}`" -fi -if [ ! -z ${GCC_VERSION} ]; then - echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" - echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${BINUTILS_VERSION} ]; then - echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${GDB_VERSION} ]; then - echo " GDB_CONFIGURE_OPTIONS=`echo ${GDB_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${NEWLIB_VERSION} ]; then - echo " NEWLIB_CONFIGURE_OPTIONS=`echo ${NEWLIB_CONFIGURE_OPTIONS}`" -fi -echo "" - -mkdir -p ${PREFIX} - -if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then - echo "WARNING: no write access to ${PREFIX}." - echo "You may need to enter your sudo password several times during the build process." - SUDO=sudo -fi - -echo "" -echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." -read -s -n 1 - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" - -# MinGW doesn't have curl, so we use wget. -if ! which curl > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.4 - SED_ARCHIVE="http://ftpmirror.gnu.org/sed/sed-${SED_VERSION}.tar.xz" -else - SED_ARCHIVE="" -fi - -# check for GNU tar and download if necessary. -if ! tar --version 2>/dev/null |grep "GNU tar" > /dev/null ;then - echo GNU tar is not installed, need to download. - TAR_VERSION=1.30 - TAR_ARCHIVE="http://ftpmirror.gnu.org/tar/tar-${TAR_VERSION}.tar.xz" -else - TAR_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - -# download source files -ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE - $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $TAR_ARCHIVE - $NEWLIB_ARCHIVE" - -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." - else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 - fi - fi - fi -done -cd .. - -echo "Creating install directory: ${PREFIX}" -[ -d ${PREFIX} ] || ${SUDO} mkdir -p ${PREFIX} || exit 1 -[ -d ${PREFIX}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 - -export PATH="${PREFIX}/bin:$PATH" - -rm -rf ${BASE}/tests -mkdir -p ${BASE}/tests -mkdir -p ${BASE}/build +echo "You are about to build and install:" +[ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" +[ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" +[ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" +[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" +[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" +[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" +echo "" +echo "With the following options:" +[ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" +echo " TARGET=${TARGET}" +echo " HOST=${HOST}" +echo " BUILD=${BUILD}" +echo " PREFIX=${PREFIX}" +echo " CC=${CC}" +echo " CXX=${CXX}" +echo " CFLAGS=${CFLAGS}" +echo " CXXFLAGS=${CXXFLAGS}" +echo " LDFLAGS=${LDFLAGS}" +echo " MAKE=${MAKE}" +echo " MAKE_JOBS=${MAKE_JOBS}" +echo " MAKE_CHECK=${MAKE_CHECK}" +echo " MAKE_CHECK_GCC=${MAKE_CHECK_GCC}" +if [ ! -z ${HOST} ]; then + echo " HOST_CC=`echo ${HOST_CC}`" + echo " HOST_CXX=`echo ${HOST_CXX}`" +fi +if [ ! -z ${GCC_VERSION} ]; then + echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" + echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${BINUTILS_VERSION} ]; then + echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${GDB_VERSION} ]; then + echo " GDB_CONFIGURE_OPTIONS=`echo ${GDB_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${NEWLIB_VERSION} ]; then + echo " NEWLIB_CONFIGURE_OPTIONS=`echo ${NEWLIB_CONFIGURE_OPTIONS}`" +fi +echo "" + +mkdir -p ${PREFIX} + +if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then + echo "WARNING: no write access to ${PREFIX}." + echo "You may need to enter your sudo password several times during the build process." + SUDO=sudo +fi + +echo "" +echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." +read -s -n 1 + +# check required programs +REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" + +# MinGW doesn't have curl, so we use wget. +if ! which curl > /dev/null; then + USE_WGET=1 +fi + +# use curl or wget? +if [ ! -z $USE_WGET ]; then + REQ_PROG_LIST+=" wget" +else + REQ_PROG_LIST+=" curl" +fi + +for REQ_PROG in $REQ_PROG_LIST; do + if ! which $REQ_PROG > /dev/null; then + echo "$REQ_PROG not installed" + exit 1 + fi +done + +# check GNU sed is installed or not. +# It is for OSX, which doesn't ship with GNU sed. +if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then + echo GNU sed is not installed, need to download. + SED_VERSION=4.4 + SED_ARCHIVE="http://ftpmirror.gnu.org/sed/sed-${SED_VERSION}.tar.xz" +else + SED_ARCHIVE="" +fi + +# check for GNU tar and download if necessary. +if ! tar --version 2>/dev/null |grep "GNU tar" > /dev/null ;then + echo GNU tar is not installed, need to download. + TAR_VERSION=1.30 + TAR_ARCHIVE="http://ftpmirror.gnu.org/tar/tar-${TAR_VERSION}.tar.xz" +else + TAR_ARCHIVE="" +fi + +# check zlib is installed +if ! ${CC} test-zlib.c -o test-zlib -lz; then + echo "zlib not installed" + exit 1 +fi +rm test-zlib 2>/dev/null +rm test-zlib.exe 2>/dev/null + +# download source files +ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE + $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $TAR_ARCHIVE + $NEWLIB_ARCHIVE" + +echo "Download source files..." +mkdir -p download || exit 1 +cd download + +for ARCHIVE in $ARCHIVE_LIST; do + FILE=`basename $ARCHIVE` + if ! [ -f $FILE ]; then + echo "Download $ARCHIVE ..." + if [ ! -z $USE_WGET ]; then + DL_CMD="wget -U firefox $ARCHIVE" + else + DL_CMD="curl -f $ARCHIVE -L -o $FILE" + fi + echo "Command : $DL_CMD" + if ! eval $DL_CMD; then + if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then + echo "$FILE maybe moved to deleted/ directory." + else + rm $FILE + echo "Download $ARCHIVE failed." + exit 1 + fi + fi + fi +done +cd .. + +echo "Creating install directory: ${PREFIX}" +[ -d ${PREFIX} ] || ${SUDO} mkdir -p ${PREFIX} || exit 1 +[ -d ${PREFIX}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 + +export PATH="${PREFIX}/bin:$PATH" + +rm -rf ${BASE}/tests +mkdir -p ${BASE}/tests +mkdir -p ${BASE}/build diff --git a/script/finalize.sh b/script/finalize.sh old mode 100644 new mode 100755 index d7f1e35..e7edcf3 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -1,48 +1,48 @@ -echo "Copy long name executables to short name." -( - cd $PREFIX || exit 1 - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/${TARGET}-$SHORT_NAME ]; then - ${SUDO} cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME - fi - done - ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} -) - -echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${BASE}/build/setenv-${TARGET} -echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${BASE}/build/setenv-${TARGET} -echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${BASE}/build/setenv-${TARGET} -echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${BASE}/build/setenv-${TARGET} - -echo "@echo off" > ${BASE}/build/setenv-${TARGET}.bat -echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${BASE}/build/setenv-${TARGET}.bat -echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${BASE}/build/setenv-${TARGET}.bat - -if [ ! -z ${DJGPP_VERSION} ]; then - echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${BASE}/build/setenv-${TARGET} - echo "set DJDIR=%~dp0${TARGET}" >> ${BASE}/build/setenv-${TARGET}.bat -fi - -${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ -cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null - -cd ${BASE}/build - -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Testing C++ compiler: " - ($PREFIX/bin/${TARGET}-c++ ../hello-cpp.cpp -o hello-cpp && echo "PASS") || echo "FAIL" - ;; - c) - echo "Testing C compiler: " - ($PREFIX/bin/${TARGET}-gcc ../hello.c -o hello && echo "PASS") || echo "FAIL" - ;; - esac -done - -echo "Done." -echo "To remove temporary build files, use: rm -rf build/" -echo "To remove downloaded source packages, use: rm -rf download/" +echo "Copy long name executables to short name." +( + cd $PREFIX || exit 1 + SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" + for SHORT_NAME in $SHORT_NAME_LIST; do + if [ -f bin/${TARGET}-$SHORT_NAME ]; then + ${SUDO} cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME + fi + done + ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} +) + +echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${BASE}/build/setenv-${TARGET} +echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${BASE}/build/setenv-${TARGET} +echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${BASE}/build/setenv-${TARGET} +echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${BASE}/build/setenv-${TARGET} + +echo "@echo off" > ${BASE}/build/setenv-${TARGET}.bat +echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${BASE}/build/setenv-${TARGET}.bat +echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${BASE}/build/setenv-${TARGET}.bat + +if [ ! -z ${DJGPP_VERSION} ]; then + echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${BASE}/build/setenv-${TARGET} + echo "set DJDIR=%~dp0${TARGET}" >> ${BASE}/build/setenv-${TARGET}.bat +fi + +${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ +cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null + +cd ${BASE}/build + +for x in $(echo $ENABLE_LANGUAGES | tr "," " ") +do + case $x in + c++) + echo "Testing C++ compiler: " + ($PREFIX/bin/${TARGET}-c++ ../hello-cpp.cpp -o hello-cpp && echo "PASS") || echo "FAIL" + ;; + c) + echo "Testing C compiler: " + ($PREFIX/bin/${TARGET}-gcc ../hello.c -o hello && echo "PASS") || echo "FAIL" + ;; + esac +done + +echo "Done." +echo "To remove temporary build files, use: rm -rf build/" +echo "To remove downloaded source packages, use: rm -rf download/" diff --git a/script/init.sh b/script/init.sh old mode 100644 new mode 100755 index 72b0ea0..b4d453b --- a/script/init.sh +++ b/script/init.sh @@ -1,46 +1,46 @@ -unset CDPATH - -BASE=`pwd` - -# target directory -PREFIX=${PREFIX-/usr/local/cross} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - -# number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-`nproc --all`} - -SUDO= - -# use gmake/clang under FreeBSD -if [ `uname` = "FreeBSD" ]; then - MAKE=${MAKE-gmake} - CC=${CC-clang} - CXX=${CXX-clang++} -else - MAKE=${MAKE-make} - CC=${CC-gcc} - CXX=${CXX-g++} -fi - -export CC CXX MAKE - -[ ! -z ${BUILD} ] && BUILD_FLAG="--build=${BUILD}" -if [ ! -z ${HOST} ]; then - HOST_FLAG="--host=${HOST}" - IGNORE_DEPENDENCIES=yes - HOST_CC=${HOST_CC-$HOST-$CC} - HOST_CXX=${HOST_CXX-$HOST-$CXX} -else - HOST_FLAG="" - HOST_CC=${CC} - HOST_CXX=${CXX} -fi - -untar() { tar -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1); } - -strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } - -prepend() { eval "$1=\"$2 ${!1}\""; } +unset CDPATH + +BASE=`pwd` + +# target directory +PREFIX=${PREFIX-/usr/local/cross} + +# enabled languages +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} +ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} + +# number of parallel build threads +MAKE_JOBS=${MAKE_JOBS-`nproc --all`} + +SUDO= + +# use gmake/clang under FreeBSD +if [ `uname` = "FreeBSD" ]; then + MAKE=${MAKE-gmake} + CC=${CC-clang} + CXX=${CXX-clang++} +else + MAKE=${MAKE-make} + CC=${CC-gcc} + CXX=${CXX-g++} +fi + +export CC CXX MAKE + +[ ! -z ${BUILD} ] && BUILD_FLAG="--build=${BUILD}" +if [ ! -z ${HOST} ]; then + HOST_FLAG="--host=${HOST}" + IGNORE_DEPENDENCIES=yes + HOST_CC=${HOST_CC-$HOST-$CC} + HOST_CXX=${HOST_CXX-$HOST-$CXX} +else + HOST_FLAG="" + HOST_CC=${CC} + HOST_CXX=${CXX} +fi + +untar() { tar -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1); } + +strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } + +prepend() { eval "$1=\"$2 ${!1}\""; } From b3dbe1eccd1928ec328f490e3dd276499c9e9748 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 16 Aug 2018 04:05:08 +0200 Subject: [PATCH 196/536] make djgpp TARGET adjustable. --- build-djgpp.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 25540d8..df8128a 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -2,7 +2,10 @@ source script/init.sh -TARGET="i586-pc-msdosdjgpp" +case $TARGET in +*-msdosdjgpp) ;; +*) TARGET="i586-pc-msdosdjgpp" ;; +esac #DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" From 57925201a02582d5c190c29edad758a9f622fdfc Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 31 Aug 2018 16:42:15 +0200 Subject: [PATCH 197/536] added newlib-3.0.0.20180802. --- README.md | 4 ++-- newlib/newlib-3.0.0.20180802 | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 newlib/newlib-3.0.0.20180802 diff --git a/README.md b/README.md index 72be091..8c8fcf0 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ ## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. -### Current package versions, as of 2018-07-31: +### Current package versions, as of 2018-08-31: * gcc 8.2.0 * binutils 2.31.1 * gdb 8.1.1 * djgpp 2.05 -* newlib 3.0.0.20180720 +* newlib 3.0.0.20180802 ### Requirements diff --git a/newlib/newlib-3.0.0.20180802 b/newlib/newlib-3.0.0.20180802 new file mode 100755 index 0000000..cfbb8d8 --- /dev/null +++ b/newlib/newlib-3.0.0.20180802 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +NEWLIB_VERSION=3.0.0.20180802 +NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" From 68bf1370edc16059e4b84de9d266c5a916ac5b6b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Sep 2018 17:22:35 +0200 Subject: [PATCH 198/536] added gdb 8.2. --- README.md | 4 ++-- common/gdb | 2 +- common/gdb-8.2 | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100755 common/gdb-8.2 diff --git a/README.md b/README.md index 8c8fcf0..41f303c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ ## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. -### Current package versions, as of 2018-08-31: +### Current package versions, as of 2018-09-06: * gcc 8.2.0 * binutils 2.31.1 -* gdb 8.1.1 +* gdb 8.2 * djgpp 2.05 * newlib 3.0.0.20180802 diff --git a/common/gdb b/common/gdb index 51d5be1..01a8ce6 100755 --- a/common/gdb +++ b/common/gdb @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source common/gdb-8.1.1 +source common/gdb-8.2 diff --git a/common/gdb-8.2 b/common/gdb-8.2 new file mode 100755 index 0000000..4d6abab --- /dev/null +++ b/common/gdb-8.2 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GDB_VERSION=8.2 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From 431f8a3d4cd23689d15d2792ff0e7d5d722562d6 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Mon, 29 Oct 2018 02:35:42 +0300 Subject: [PATCH 199/536] build-djgpp.sh: fix some permission problems This fixes the following: rm: cannot remove '/usr/local/cross/i586-pc-msdosdjgpp/etc/gcc-8.2.0-installed': Permission denied touch: cannot touch '/usr/local/cross/i586-pc-msdosdjgpp/etc/gcc-8.2.0-installed': Permission denied --- build-djgpp.sh | 6 +++--- script/build-binutils.sh | 2 +- script/build-gdb.sh | 2 +- script/build-newlib-gcc.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index df8128a..0a9b20f 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -142,7 +142,7 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then ${SUDO} cp -p src/stub/${TARGET}-stubify $PREFIX/bin/ || exit 1 ${SUDO} cp -p src/stub/${TARGET}-stubedit $PREFIX/bin/ || exit 1 - ${SUDO} rm ${PREFIX}/${TARGET}/etc/djgpp-*-installed + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/djgpp-*-installed ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi @@ -246,8 +246,8 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install - rm ${PREFIX}/${TARGET}/etc/gcc-*-installed - touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed export CFLAGS="$TEMP_CFLAGS" fi diff --git a/script/build-binutils.sh b/script/build-binutils.sh index 94265c7..7173f95 100755 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -21,5 +21,5 @@ ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/binutils.log ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 -${SUDO} rm ${PREFIX}/${TARGET}/etc/binutils-*-installed +${SUDO} rm -f ${PREFIX}/${TARGET}/etc/binutils-*-installed ${SUDO} touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 1fd3f5a..f472e2c 100755 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -27,6 +27,6 @@ if [ ! -z ${GDB_VERSION} ]; then [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gdb.log ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 - ${SUDO} rm ${PREFIX}/${TARGET}/etc/gdb-*-installed + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gdb-*-installed ${SUDO} touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed fi diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index e8a9eb1..b2f8116 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -85,6 +85,6 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install - ${SUDO} rm ${PREFIX}/${TARGET}/etc/gcc-*-installed + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed fi From 895673881ea4b3a66de95b929bbd7a8563465b0b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 23 Feb 2019 18:51:05 +0100 Subject: [PATCH 200/536] added newlib 3.1.0 --- README.md | 4 ++-- newlib/newlib | 2 +- newlib/newlib-3.1.0 | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100755 newlib/newlib-3.1.0 diff --git a/README.md b/README.md index 41f303c..7818799 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ ## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. -### Current package versions, as of 2018-09-06: +### Current package versions, as of 2019-02-23: * gcc 8.2.0 * binutils 2.31.1 * gdb 8.2 * djgpp 2.05 -* newlib 3.0.0.20180802 +* newlib 3.1.0 ### Requirements diff --git a/newlib/newlib b/newlib/newlib index 5018d9d..01ecd10 100755 --- a/newlib/newlib +++ b/newlib/newlib @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source newlib/newlib-3.0.0.20180720 +source newlib/newlib-3.1.0 diff --git a/newlib/newlib-3.1.0 b/newlib/newlib-3.1.0 new file mode 100755 index 0000000..242d179 --- /dev/null +++ b/newlib/newlib-3.1.0 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +NEWLIB_VERSION=3.1.0 +NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" From 326f1a4bb099b7cb7cbf5c6bfd357afe1e459479 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 23 Feb 2019 18:53:22 +0100 Subject: [PATCH 201/536] added gdb 8.2.1 --- README.md | 2 +- common/gdb | 3 ++- common/gdb-8.2.1 | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100755 common/gdb-8.2.1 diff --git a/README.md b/README.md index 7818799..f219daf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * gcc 8.2.0 * binutils 2.31.1 -* gdb 8.2 +* gdb 8.2.1 * djgpp 2.05 * newlib 3.1.0 diff --git a/common/gdb b/common/gdb index 01a8ce6..da2fb5b 100755 --- a/common/gdb +++ b/common/gdb @@ -1,3 +1,4 @@ #!/usr/bin/env bash -source common/gdb-8.2 +source common/gdb-8.2.1 + diff --git a/common/gdb-8.2.1 b/common/gdb-8.2.1 new file mode 100755 index 0000000..54a9c56 --- /dev/null +++ b/common/gdb-8.2.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GDB_VERSION=8.2.1 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From 5cc9bde4e1d1cfb1e4ba8a926e5a7a9b743966a2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 23 Feb 2019 18:55:53 +0100 Subject: [PATCH 202/536] added gcc 8.3 --- README.md | 4 ++-- common/gcc | 2 +- common/gcc-8.3.0 | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100755 common/gcc-8.3.0 diff --git a/README.md b/README.md index f219daf..d4147e4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ ## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. -### Current package versions, as of 2019-02-23: +### Current package versions, as of 2019-03-05: -* gcc 8.2.0 +* gcc 8.3.0 * binutils 2.31.1 * gdb 8.2.1 * djgpp 2.05 diff --git a/common/gcc b/common/gcc index fd45de0..f775ab1 100755 --- a/common/gcc +++ b/common/gcc @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source common/gcc-8.2.0 +source common/gcc-8.3.0 diff --git a/common/gcc-8.3.0 b/common/gcc-8.3.0 new file mode 100755 index 0000000..21078f2 --- /dev/null +++ b/common/gcc-8.3.0 @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +export GCC_VERSION=8.3.0 +export GCC_VERSION_SHORT=8.30 +export AUTOCONF_VERSION=2.69 +export AUTOMAKE_VERSION=1.15.1 + +# tarball location +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" + +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" From 6f1ef751f87b798b6e09c4a758e75da5cf886831 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 23 Feb 2019 18:55:25 +0100 Subject: [PATCH 203/536] added binutils 2.32 --- README.md | 2 +- newlib/binutils | 2 +- newlib/binutils-2.32 | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 newlib/binutils-2.32 diff --git a/README.md b/README.md index d4147e4..76400f2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ### Current package versions, as of 2019-03-05: * gcc 8.3.0 -* binutils 2.31.1 +* binutils 2.32 (2.31.1 for djgpp) * gdb 8.2.1 * djgpp 2.05 * newlib 3.1.0 diff --git a/newlib/binutils b/newlib/binutils index bcd66cc..6b3e5ff 100755 --- a/newlib/binutils +++ b/newlib/binutils @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source newlib/binutils-2.31.1 +source newlib/binutils-2.32 diff --git a/newlib/binutils-2.32 b/newlib/binutils-2.32 new file mode 100755 index 0000000..1b727d8 --- /dev/null +++ b/newlib/binutils-2.32 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +BINUTILS_VERSION=2.32 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" From 606215c6374dfd9270e14a3272d2d228414e3798 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 26 May 2019 17:58:45 +0200 Subject: [PATCH 204/536] added djgpp binutils 2.32 --- djgpp/binutils | 2 +- djgpp/binutils-2.31.1 | 2 +- djgpp/binutils-2.32 | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 djgpp/binutils-2.32 diff --git a/djgpp/binutils b/djgpp/binutils index c281341..e27ec74 100755 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source djgpp/binutils-2.31.1 +source djgpp/binutils-2.32 diff --git a/djgpp/binutils-2.31.1 b/djgpp/binutils-2.31.1 index 4b7d0e3..d124c0b 100755 --- a/djgpp/binutils-2.31.1 +++ b/djgpp/binutils-2.31.1 @@ -1,4 +1,4 @@ #!/usr/bin/env bash export BINUTILS_VERSION=2311 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/binutils-2.32 b/djgpp/binutils-2.32 new file mode 100755 index 0000000..ad3bbda --- /dev/null +++ b/djgpp/binutils-2.32 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export BINUTILS_VERSION=232 +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" From e8ec86cfbba1ed98bf17abd6731b13d96b72495d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 26 May 2019 18:17:16 +0200 Subject: [PATCH 205/536] added gdb 8.3 --- common/gdb | 2 +- common/gdb-8.3 | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 common/gdb-8.3 diff --git a/common/gdb b/common/gdb index da2fb5b..e810503 100755 --- a/common/gdb +++ b/common/gdb @@ -1,4 +1,4 @@ #!/usr/bin/env bash -source common/gdb-8.2.1 +source common/gdb-8.3 diff --git a/common/gdb-8.3 b/common/gdb-8.3 new file mode 100755 index 0000000..5db2b42 --- /dev/null +++ b/common/gdb-8.3 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GDB_VERSION=8.3 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From 27f3af74240c0386140e4edebe02f8cab2d1b66c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 26 May 2019 18:22:54 +0200 Subject: [PATCH 206/536] update versions in readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 76400f2..59212d3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ ## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. -### Current package versions, as of 2019-03-05: +### Current package versions, as of 2019-05-26: * gcc 8.3.0 -* binutils 2.32 (2.31.1 for djgpp) -* gdb 8.2.1 +* binutils 2.32 +* gdb 8.3 * djgpp 2.05 * newlib 3.1.0 From 22b358e7897057b95445553b3265fe1d746f23b0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 26 May 2019 19:31:32 +0200 Subject: [PATCH 207/536] apply memalign patch for djlsr205 (github issue #5) --- patch/patch-djlsr205.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/patch/patch-djlsr205.txt b/patch/patch-djlsr205.txt index 6274348..d4ad333 100644 --- a/patch/patch-djlsr205.txt +++ b/patch/patch-djlsr205.txt @@ -158,3 +158,26 @@ diff -ur djlsr205-orig/src/stub/exe2coff.c djlsr205/src/stub/exe2coff.c static void exe2aout(char *fname) + +--- x/src/libc/ansi/stdlib/nmalloc.c ++++ x/src/libc/ansi/stdlib/nmalloc.c +@@ -1145,6 +1145,7 @@ + return nmalloc(szneed); /* EXIT */ + } + else if ((minit = nmalloc(szneed + XTRA))) { ++ m = MEMBLKp(minit); + /* alignment >= 2*ALIGN and power of 2 if here */ + misalign = (ulong)minit % alignment; + DBGPRTM(" misalignment = %d", misalign); +@@ -1154,9 +1155,10 @@ + } + else { + /* two or more chunks to release */ +- /* for now, just return NULL and have a leak */ + DBGPRTM(" Complex case, release multiple chunks"); + DBGEOLN; ++ nfree(PTR(split(&m, alignment - misalign))); ++ return nrealloc(PTR(m), size); + } + } /* alignment > ALIGN */ + } /* valid parameters */ From 85dd121284e4cbd3a3c5dad1bb0e700c33f050e0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 27 May 2019 18:23:35 +0200 Subject: [PATCH 208/536] added gcc 9.1.0 --- README.md | 2 +- build-djgpp.sh | 4 ++-- common/gcc | 2 +- common/gcc-8.2.0 | 2 ++ common/gcc-9.1.0 | 15 +++++++++++++++ 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100755 common/gcc-9.1.0 diff --git a/README.md b/README.md index 59212d3..339cce9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Current package versions, as of 2019-05-26: -* gcc 8.3.0 +* gcc 9.1.0 * binutils 2.32 * gdb 8.3 * djgpp 2.05 diff --git a/build-djgpp.sh b/build-djgpp.sh index df8128a..18f5962 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -79,8 +79,8 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then done fi -if [ ! -z ${GCC_VERSION} ]; then - DJCROSS_GCC_ARCHIVE="http://ap1.pp.fi/djgpp/gcc/${GCC_VERSION}/rpm/djcross-gcc-${GCC_VERSION}.tar.bz2" +if [ ! -z ${GCC_VERSION} ] && [ -z ${DJCROSS_GCC_ARCHIVE} ]; then + DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} fi diff --git a/common/gcc b/common/gcc index f775ab1..5e59c16 100755 --- a/common/gcc +++ b/common/gcc @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source common/gcc-8.3.0 +source common/gcc-9.1.0 diff --git a/common/gcc-8.2.0 b/common/gcc-8.2.0 index 5140e87..d558fe0 100755 --- a/common/gcc-8.2.0 +++ b/common/gcc-8.2.0 @@ -10,6 +10,8 @@ export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VE export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +export DJCROSS_GCC_ARCHIVE="http://ap1.pp.fi/djgpp/gcc/${GCC_VERSION}/rpm/djcross-gcc-${GCC_VERSION}.tar.bz2" + export GCC_CONFIGURE_OPTIONS="--disable-plugin \ --enable-lto \ --enable-libstdcxx-filesystem-ts \ diff --git a/common/gcc-9.1.0 b/common/gcc-9.1.0 new file mode 100755 index 0000000..ef66f3a --- /dev/null +++ b/common/gcc-9.1.0 @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +export GCC_VERSION=9.1.0 +export GCC_VERSION_SHORT=9.10 +export AUTOCONF_VERSION=2.69 +export AUTOMAKE_VERSION=1.15.1 + +# tarball location +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" + +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" From 0f46727dc9b0ed3fe79b10bd269873d932dbc860 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 28 May 2019 01:39:16 +0200 Subject: [PATCH 209/536] Revert "apply memalign patch for djlsr205 (github issue #5)" This reverts commit 22b358e7897057b95445553b3265fe1d746f23b0. --- patch/patch-djlsr205.txt | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/patch/patch-djlsr205.txt b/patch/patch-djlsr205.txt index d4ad333..6274348 100644 --- a/patch/patch-djlsr205.txt +++ b/patch/patch-djlsr205.txt @@ -158,26 +158,3 @@ diff -ur djlsr205-orig/src/stub/exe2coff.c djlsr205/src/stub/exe2coff.c static void exe2aout(char *fname) - ---- x/src/libc/ansi/stdlib/nmalloc.c -+++ x/src/libc/ansi/stdlib/nmalloc.c -@@ -1145,6 +1145,7 @@ - return nmalloc(szneed); /* EXIT */ - } - else if ((minit = nmalloc(szneed + XTRA))) { -+ m = MEMBLKp(minit); - /* alignment >= 2*ALIGN and power of 2 if here */ - misalign = (ulong)minit % alignment; - DBGPRTM(" misalignment = %d", misalign); -@@ -1154,9 +1155,10 @@ - } - else { - /* two or more chunks to release */ -- /* for now, just return NULL and have a leak */ - DBGPRTM(" Complex case, release multiple chunks"); - DBGEOLN; -+ nfree(PTR(split(&m, alignment - misalign))); -+ return nrealloc(PTR(m), size); - } - } /* alignment > ALIGN */ - } /* valid parameters */ From f6f836e68e711ac621844fb8a9e0545c5fea26de Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Jun 2019 18:04:47 +0200 Subject: [PATCH 210/536] select tar decompression option based on file extension, avoid relying on GNU tar's automatic detection. solution for github issue #3. --- build-djgpp.sh | 8 ++++---- build-ia16.sh | 2 +- build-newlib.sh | 2 +- script/build-gdb.sh | 2 +- script/build-newlib-gcc.sh | 4 ++-- script/build-tools.sh | 17 +---------------- script/download.sh | 12 +----------- script/init.sh | 13 ++++++++++++- 8 files changed, 23 insertions(+), 37 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index fbfde73..0b2108b 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -150,7 +150,7 @@ cd ${BASE}/build/ if [ ! -z ${GCC_VERSION} ]; then # build gcc - untar djcross-gcc-${GCC_VERSION} || exit 1 + untar ${DJCROSS_GCC_ARCHIVE} || exit 1 cd djcross-gcc-${GCC_VERSION}/ BUILDDIR=`pwd` @@ -159,7 +159,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built ]; then echo "Building autoconf" cd $BUILDDIR - untar autoconf-${AUTOCONF_VERSION} || exit 1 + untar ${AUTOCONF_ARCHIVE} || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} all install || exit 1 @@ -172,7 +172,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built ]; then echo "Building automake" cd $BUILDDIR - untar automake-${AUTOMAKE_VERSION} || exit 1 + untar ${AUTOMAKE_ARCHIVE} || exit 1 cd automake-${AUTOMAKE_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 ${MAKE} all install || exit 1 @@ -193,7 +193,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi echo "Running unpack-gcc.sh" - sh unpack-gcc.sh --no-djgpp-source $(ls -t ../../download/gcc-${GCC_VERSION}.tar.* | head -n 1) || exit 1 + sh unpack-gcc.sh --no-djgpp-source ../../download/$(basename ${GCC_ARCHIVE}) || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" diff --git a/build-ia16.sh b/build-ia16.sh index ae79e1b..42334c4 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -95,7 +95,7 @@ cd .. if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then - untar binutils-${BINUTILS_VERSION} || exit 1 + untar ${BINUTILS_ARCHIVE} || exit 1 touch binutils-unpacked fi diff --git a/build-newlib.sh b/build-newlib.sh index 7987dfd..469eff6 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -78,7 +78,7 @@ cd ${BASE}/build/ || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then - untar binutils-${BINUTILS_VERSION} || exit 1 + untar ${BINUTILS_ARCHIVE} || exit 1 touch binutils-unpacked fi diff --git a/script/build-gdb.sh b/script/build-gdb.sh index f472e2c..545cd30 100755 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -3,7 +3,7 @@ cd ${BASE}/build if [ ! -z ${GDB_VERSION} ]; then if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then echo "Unpacking gdb." - untar gdb-${GDB_VERSION} || exit 1 + untar ${GDB_ARCHIVE} || exit 1 touch gdb-${GDB_VERSION}/gdb-unpacked fi mkdir -p gdb-${GDB_VERSION}/build-${TARGET} diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index b2f8116..d3b4e6b 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -1,7 +1,7 @@ cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then - untar newlib-${NEWLIB_VERSION} + untar ${NEWLIB_ARCHIVE} ${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ ${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 touch newlib-${NEWLIB_VERSION}/newlib-unpacked @@ -9,7 +9,7 @@ fi if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then - untar gcc-${GCC_VERSION} + untar ${GCC_ARCHIVE} # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" diff --git a/script/build-tools.sh b/script/build-tools.sh index 27c9362..ef9253d 100755 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -1,28 +1,13 @@ mkdir -p ${BASE}/build/tmpinst export PATH="${BASE}/build/tmpinst/bin:$PATH" -cd ${BASE}/build/ || exit 1 - -# build GNU tar if needed. -if [ ! -z $TAR_VERSION ]; then - if [ ! -e ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed ]; then - echo "Building tar" - tar -xJvf ${BASE}/download/tar-${TAR_VERSION}.tar.xz || exit 1 - cd tar-${TAR_VERSION}/ - ./configure --prefix=${BASE}/build/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || exit 1 - touch ${BASE}/build/tmpinst/tar-${TAR_VERSION}-installed - fi -fi - cd ${BASE}/build || exit 1 # build GNU sed if needed. if [ ! -z $SED_VERSION ]; then if [ ! -e ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed ]; then echo "Building sed" - untar sed-${SED_VERSION} || exit 1 + untar ${SED_ARCHIVE} || exit 1 cd sed-${SED_VERSION}/ ./configure --prefix=${BASE}/build/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 diff --git a/script/download.sh b/script/download.sh index f83acae..1cb9a28 100755 --- a/script/download.sh +++ b/script/download.sh @@ -84,15 +84,6 @@ else SED_ARCHIVE="" fi -# check for GNU tar and download if necessary. -if ! tar --version 2>/dev/null |grep "GNU tar" > /dev/null ;then - echo GNU tar is not installed, need to download. - TAR_VERSION=1.30 - TAR_ARCHIVE="http://ftpmirror.gnu.org/tar/tar-${TAR_VERSION}.tar.xz" -else - TAR_ARCHIVE="" -fi - # check zlib is installed if ! ${CC} test-zlib.c -o test-zlib -lz; then echo "zlib not installed" @@ -104,8 +95,7 @@ rm test-zlib.exe 2>/dev/null # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $TAR_ARCHIVE - $NEWLIB_ARCHIVE" + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $NEWLIB_ARCHIVE" echo "Download source files..." mkdir -p download || exit 1 diff --git a/script/init.sh b/script/init.sh index b4d453b..69354ad 100755 --- a/script/init.sh +++ b/script/init.sh @@ -39,7 +39,18 @@ else HOST_CXX=${CXX} fi -untar() { tar -xavf $(ls -t ${BASE}/download/$1.tar.* | head -n 1); } +untar() +{ + local file=$(basename $1) + local ext=${file##*.} + local param="-a" + case $ext in + xz) param="-J" ;; + bz2) param="-j" ;; + gz) param="-z" ;; + esac + tar -x ${param} -f ${BASE}/download/${file} +} strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } From b2fb8516713a8c2544071638309e6fa769ca2caf Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Jun 2019 21:38:14 +0200 Subject: [PATCH 211/536] write setenv scripts in one go. --- script/finalize.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index e7edcf3..25eb30c 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -10,14 +10,18 @@ echo "Copy long name executables to short name." ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} ) -echo "export PATH=\"${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH\"" > ${BASE}/build/setenv-${TARGET} -echo "export GCC_EXEC_PREFIX=\"${PREFIX}/lib/gcc/\"" >> ${BASE}/build/setenv-${TARGET} -echo "export MANPATH=\"${PREFIX}/share/man:\$MANPATH\"" >> ${BASE}/build/setenv-${TARGET} -echo "export INFOPATH=\"${PREFIX}/share/info:\$INFOPATH\"" >> ${BASE}/build/setenv-${TARGET} +cat << STOP > ${BASE}/build/setenv-${TARGET} +export PATH="${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH" +export GCC_EXEC_PREFIX="${PREFIX}/lib/gcc/" +export MANPATH="${PREFIX}/share/man:\$MANPATH" +export INFOPATH="${PREFIX}/share/info:\$INFOPATH" +STOP -echo "@echo off" > ${BASE}/build/setenv-${TARGET}.bat -echo "PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH%" >> ${BASE}/build/setenv-${TARGET}.bat -echo "set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\" >> ${BASE}/build/setenv-${TARGET}.bat +cat << STOP > ${BASE}/build/setenv-${TARGET}.bat +@echo off +PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH% +set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\ +STOP if [ ! -z ${DJGPP_VERSION} ]; then echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${BASE}/build/setenv-${TARGET} From e6ae9a2af2ac844daea34cef144298631a1eebb3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Jun 2019 21:47:33 +0200 Subject: [PATCH 212/536] determine if DJDIR is needed by checking TARGET, instead of DJGPP_VERSION. this writes the correct setenv script when building tools separately. --- script/finalize.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 25eb30c..e5914a1 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -23,10 +23,12 @@ PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH% set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\ STOP -if [ ! -z ${DJGPP_VERSION} ]; then +case $TARGET in +*-msdosdjgpp) echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${BASE}/build/setenv-${TARGET} echo "set DJDIR=%~dp0${TARGET}" >> ${BASE}/build/setenv-${TARGET}.bat -fi + ;; +esac ${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null From 946f986ff5e253fe7dce3faa50339be92fe79fac Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Jun 2019 18:16:55 +0200 Subject: [PATCH 213/536] add upgrade notes section in readme. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 339cce9..5223b07 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ ## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. +### Upgrade notes: + +* 2019-06-06: `master` is now the default branch again. + ### Current package versions, as of 2019-05-26: * gcc 9.1.0 From 98884480e9297580adf4ba27d540da2a25e16512 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 24 Jun 2019 18:03:16 +0200 Subject: [PATCH 214/536] http archive at delorie.com seems to have disappeared. now using mirrorservice.org instead. --- build-djgpp.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 0b2108b..0e1c036 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -7,8 +7,7 @@ case $TARGET in *) TARGET="i586-pc-msdosdjgpp" ;; esac -#DJGPP_DOWNLOAD_BASE="ftp://ftp.delorie.com/pub" -export DJGPP_DOWNLOAD_BASE="http://www.delorie.com/pub" +export DJGPP_DOWNLOAD_BASE="http://www.mirrorservice.org/sites/ftp.delorie.com/pub" prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror --disable-nls" From f0cdd22921a1834c19e5c9253e1a769196505e49 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 24 Jun 2019 18:03:40 +0200 Subject: [PATCH 215/536] build std::filesystem for djgpp by default. --- build-djgpp.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 0e1c036..fed565a 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -15,7 +15,8 @@ prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-libquadmath-support --enable-version-specific-runtime-libs - --enable-fat" + --enable-fat + --enable-libstdcxx-filesystem-ts" prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls From 285b3ff3d6a0c4303b0f64ec489621b4bc466960 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 24 Jun 2019 20:43:21 +0200 Subject: [PATCH 216/536] install info files for djgpp. --- build-djgpp.sh | 9 ++++++--- script/finalize.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index fed565a..4f560ef 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -121,9 +121,9 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then rm -rf ${BASE}/build/djgpp-${DJGPP_VERSION} mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} cd ${BASE}/build/djgpp-${DJGPP_VERSION} || exit 1 - unzip -o ../../download/djdev${DJGPP_VERSION}.zip || exit 1 - unzip -o ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 - unzip -o ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 + unzip -u ../../download/djdev${DJGPP_VERSION}.zip || exit 1 + unzip -u ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 + unzip -u ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 @@ -142,6 +142,9 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then ${SUDO} cp -p src/stub/${TARGET}-stubify $PREFIX/bin/ || exit 1 ${SUDO} cp -p src/stub/${TARGET}-stubedit $PREFIX/bin/ || exit 1 + ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/info + ${SUDO} cp -pf info/* ${PREFIX}/${TARGET}/share/info/ + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/djgpp-*-installed ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi diff --git a/script/finalize.sh b/script/finalize.sh index e5914a1..a4cf740 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -14,7 +14,7 @@ cat << STOP > ${BASE}/build/setenv-${TARGET} export PATH="${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH" export GCC_EXEC_PREFIX="${PREFIX}/lib/gcc/" export MANPATH="${PREFIX}/share/man:\$MANPATH" -export INFOPATH="${PREFIX}/share/info:\$INFOPATH" +export INFOPATH="${PREFIX}/${TARGET}/share/info:${PREFIX}/share/info:\$INFOPATH" STOP cat << STOP > ${BASE}/build/setenv-${TARGET}.bat From ee321ec4b5447a7f26556dabe1ab22b08fff5dc9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 6 Jul 2019 19:13:51 +0200 Subject: [PATCH 217/536] use sysctl if nproc is not available. --- script/init.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/init.sh b/script/init.sh index 69354ad..9f78fd9 100755 --- a/script/init.sh +++ b/script/init.sh @@ -10,7 +10,11 @@ PREFIX=${PREFIX-/usr/local/cross} ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} # number of parallel build threads -MAKE_JOBS=${MAKE_JOBS-`nproc --all`} +if nproc > /dev/null 2>&1 ; then + MAKE_JOBS=${MAKE_JOBS-`nproc --all`} +else + MAKE_JOBS=${MAKE_JOBS-`sysctl -n hw.physicalcpu`} +fi SUDO= From bdbc411cbaf554561a75ec9ebc988a0f561f82a8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 6 Jul 2019 19:15:13 +0200 Subject: [PATCH 218/536] don't use --with-system-readline to build gdb. --- build-djgpp.sh | 3 +-- build-ia16.sh | 3 +-- build-newlib.sh | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 4f560ef..d8a761f 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -19,8 +19,7 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-libstdcxx-filesystem-ts" prepend GDB_CONFIGURE_OPTIONS "--disable-werror - --disable-nls - --with-system-readline" + --disable-nls" if [ -z $1 ]; then echo "Usage: $0 [packages...]" diff --git a/build-ia16.sh b/build-ia16.sh index 42334c4..100b90e 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -11,8 +11,7 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-fat" prepend GDB_CONFIGURE_OPTIONS "--disable-werror - --disable-nls - --with-system-readline" + --disable-nls" prepend NEWLIB_CONFIGURE_OPTIONS "--enable-newlib-nano-malloc --disable-newlib-multithread" diff --git a/build-newlib.sh b/build-newlib.sh index 469eff6..a5e5839 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -11,8 +11,7 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls --enable-fat" prepend GDB_CONFIGURE_OPTIONS "--disable-werror - --disable-nls - --with-system-readline" + --disable-nls" if [ -z ${TARGET} ]; then echo "Please specify a target with: export TARGET=..." From 29022cc3f11a37078fa62aa125e083b5b70b7c4f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 6 Jul 2019 19:29:09 +0200 Subject: [PATCH 219/536] unzip: overwrite files without prompting --- build-djgpp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index d8a761f..3e2f275 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -120,9 +120,9 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then rm -rf ${BASE}/build/djgpp-${DJGPP_VERSION} mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} cd ${BASE}/build/djgpp-${DJGPP_VERSION} || exit 1 - unzip -u ../../download/djdev${DJGPP_VERSION}.zip || exit 1 - unzip -u ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 - unzip -u ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 + unzip -uo ../../download/djdev${DJGPP_VERSION}.zip || exit 1 + unzip -uo ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 + unzip -uo ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 From 9c036a2ac252b6fa3038642f406a9283a4479fb2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Jul 2019 05:50:31 +0200 Subject: [PATCH 220/536] added support for avr toolchain. the utilities avrdude/avarice/simulavr are untested, I can't build these on mingw. --- README.md | 23 +++-- avr/all | 9 ++ avr/avarice | 3 + avr/avarice-2.13 | 4 + avr/avr-libc | 3 + avr/avr-libc-2.0.0 | 5 + avr/avrdude | 3 + avr/avrdude-6.3 | 4 + avr/simulavr | 3 + avr/simulavr-git | 3 + binutils/binutils | 3 + {newlib => binutils}/binutils-2.29.1 | 0 {newlib => binutils}/binutils-2.30 | 0 {newlib => binutils}/binutils-2.31 | 0 {newlib => binutils}/binutils-2.31.1 | 0 {newlib => binutils}/binutils-2.32 | 0 build-avr.sh | 149 +++++++++++++++++++++++++++ build-ia16.sh | 13 ++- build-newlib.sh | 16 +-- newlib/binutils | 3 - newlib/common | 6 -- script/build-avr-gcc.sh | 97 +++++++++++++++++ script/download.sh | 12 ++- script/finalize.sh | 2 +- 24 files changed, 329 insertions(+), 32 deletions(-) create mode 100755 avr/all create mode 100755 avr/avarice create mode 100755 avr/avarice-2.13 create mode 100755 avr/avr-libc create mode 100755 avr/avr-libc-2.0.0 create mode 100755 avr/avrdude create mode 100755 avr/avrdude-6.3 create mode 100755 avr/simulavr create mode 100755 avr/simulavr-git create mode 100755 binutils/binutils rename {newlib => binutils}/binutils-2.29.1 (100%) rename {newlib => binutils}/binutils-2.30 (100%) rename {newlib => binutils}/binutils-2.31 (100%) rename {newlib => binutils}/binutils-2.31.1 (100%) rename {newlib => binutils}/binutils-2.32 (100%) create mode 100755 build-avr.sh delete mode 100755 newlib/binutils delete mode 100755 newlib/common create mode 100755 script/build-avr-gcc.sh diff --git a/README.md b/README.md index 5223b07..8ee7009 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,13 @@ * djgpp 2.05 * newlib 3.1.0 +### Tested targets: + +* *-pc-msdosdjgpp +* ia16 +* arm-eabi +* avr + ### Requirements Before running this script, you need to install these programs first: @@ -114,7 +121,8 @@ There are 2 methods to run the compiler (`$PREFIX` and `$TARGET` here are the va * Use compiler full name: ``` -$PREFIX/bin/$TARGET-g++ hello.cpp +export PATH=$PREFIX/bin/:$PATH +$TARGET-g++ hello.cpp ``` * Or, use compiler short name, you have to change environment variables. @@ -146,6 +154,7 @@ $PREFIX/setenv-$TARGET.bat ``` ### Supported DJGPP Utilities + * dxe3gen * dxe3res * dxegen @@ -153,15 +162,11 @@ $PREFIX/setenv-$TARGET.bat * stubedit * stubify -### Successful build +### Supported AVR utilities -* OSX 10.12.5 -* Debian 7 (32bit) -* Ubuntu 12 (64bit) -* FreeBSD-10.2 (64bit) -* Cygwin (32bit Windows XP) -* MinGW (32bit Windows XP) -* MinGW64 (64bit Windows 7) +* avrdude +* avarice +* simulavr ### Thanks diff --git a/avr/all b/avr/all new file mode 100755 index 0000000..8a183f8 --- /dev/null +++ b/avr/all @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +source avr/avr-libc +source avr/binutils +source common/gcc +source common/gdb +source avr/avrdude +source avr/avarice +source avr/simulavr diff --git a/avr/avarice b/avr/avarice new file mode 100755 index 0000000..d140d6e --- /dev/null +++ b/avr/avarice @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source avr/avarice-2.13 diff --git a/avr/avarice-2.13 b/avr/avarice-2.13 new file mode 100755 index 0000000..e868091 --- /dev/null +++ b/avr/avarice-2.13 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +AVARICE_VERSION=2.13 +AVARICE_ARCHIVE=https://downloads.sourceforge.net/project/avarice/avarice/avarice-2.13/avarice-2.13.tar.bz2 diff --git a/avr/avr-libc b/avr/avr-libc new file mode 100755 index 0000000..0058efc --- /dev/null +++ b/avr/avr-libc @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source avr/avr-libc-2.0.0 diff --git a/avr/avr-libc-2.0.0 b/avr/avr-libc-2.0.0 new file mode 100755 index 0000000..e268a38 --- /dev/null +++ b/avr/avr-libc-2.0.0 @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +AVRLIBC_VERSION=2.0.0 +AVRLIBC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 +AVRLIBC_DOC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-manpages-2.0.0.tar.bz2 diff --git a/avr/avrdude b/avr/avrdude new file mode 100755 index 0000000..8993932 --- /dev/null +++ b/avr/avrdude @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source avr/avrdude-6.3 diff --git a/avr/avrdude-6.3 b/avr/avrdude-6.3 new file mode 100755 index 0000000..a2c9678 --- /dev/null +++ b/avr/avrdude-6.3 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +AVRDUDE_VERSION=6.3 +AVRDUDE_ARCHIVE=http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3.tar.gz diff --git a/avr/simulavr b/avr/simulavr new file mode 100755 index 0000000..0addf39 --- /dev/null +++ b/avr/simulavr @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source avr/simulavr-git diff --git a/avr/simulavr-git b/avr/simulavr-git new file mode 100755 index 0000000..8b56e8f --- /dev/null +++ b/avr/simulavr-git @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +SIMULAVR_VERSION=git diff --git a/binutils/binutils b/binutils/binutils new file mode 100755 index 0000000..34418e3 --- /dev/null +++ b/binutils/binutils @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +source binutils/binutils-2.32 diff --git a/newlib/binutils-2.29.1 b/binutils/binutils-2.29.1 similarity index 100% rename from newlib/binutils-2.29.1 rename to binutils/binutils-2.29.1 diff --git a/newlib/binutils-2.30 b/binutils/binutils-2.30 similarity index 100% rename from newlib/binutils-2.30 rename to binutils/binutils-2.30 diff --git a/newlib/binutils-2.31 b/binutils/binutils-2.31 similarity index 100% rename from newlib/binutils-2.31 rename to binutils/binutils-2.31 diff --git a/newlib/binutils-2.31.1 b/binutils/binutils-2.31.1 similarity index 100% rename from newlib/binutils-2.31.1 rename to binutils/binutils-2.31.1 diff --git a/newlib/binutils-2.32 b/binutils/binutils-2.32 similarity index 100% rename from newlib/binutils-2.32 rename to binutils/binutils-2.32 diff --git a/build-avr.sh b/build-avr.sh new file mode 100755 index 0000000..2b1133b --- /dev/null +++ b/build-avr.sh @@ -0,0 +1,149 @@ +#!/usr/bin/env bash + +source script/init.sh + +TARGET="avr" + +prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" + +prepend GCC_CONFIGURE_OPTIONS "--disable-nls + --enable-version-specific-runtime-libs + --enable-fat" + +prepend GDB_CONFIGURE_OPTIONS "--disable-werror + --disable-nls" + +prepend AVRLIBC_CONFIGURE_OPTIONS "--enable-device-lib" + +if [ -z $1 ]; then + echo "Usage: $0 [packages...]" + echo "Supported packages:" + ls avr/ + ls binutils/ + ls common/ + exit 1 +fi + +while [ ! -z $1 ]; do + if [ -e avr/$1 ]; then + source avr/$1 + elif [ -e binutils/$1 ]; then + source binutils/$1 + elif [ -e common/$1 ]; then + source common/$1 + else + echo "Unsupported package: $1" + exit 1 + fi + shift +done + +DEPS="" + +if [ -z ${IGNORE_DEPENDENCIES} ]; then + [ ! -z ${GCC_VERSION} ] && DEPS+=" avr-libc binutils" + [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " + [ ! -z ${GDB_VERSION} ] && DEPS+=" " + [ ! -z ${AVRLIBC_VERSION} ] && DEPS+=" gcc binutils" + [ ! -z ${AVRDUDE_VERSION} ] && DEPS+=" " + [ ! -z ${AVARICE_VERSION} ] && DEPS+=" " + [ ! -z ${SIMULAVR_VERSION} ] && DEPS+=" " + + for DEP in ${DEPS}; do + case $DEP in + avr-libc) + [ -z ${AVRLIBC_VERSION} ] \ + && source avr/avr-libc + ;; + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && source binutils/binutils + ;; + gcc) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ + && [ -z ${GCC_VERSION} ] \ + && source common/gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && source common/gdb + ;; + esac + done +fi + +source ${BASE}/script/download.sh + +source ${BASE}/script/build-tools.sh + +cd ${BASE}/build/ || exit 1 + +if [ ! -z ${SIMULAVR_VERSION} ]; then + [ -d simulavr ] || git clone https://git.savannah.nongnu.org/git/simulavr.git --depth 1 --branch master + cd simulavr + git reset --hard HEAD + git pull || exit 1 + cd .. +fi + +if [ ! -z ${BINUTILS_VERSION} ]; then + echo "Building binutils" + if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + untar ${BINUTILS_ARCHIVE} || exit 1 + touch binutils-${BINUTILS_VERSION}/binutils-unpacked + fi + + cd binutils-${BINUTILS_VERSION} || exit 1 + source ${BASE}/script/build-binutils.sh +fi + +source ${BASE}/script/build-avr-gcc.sh + +if [ ! -z ${SIMULAVR_VERSION} ]; then + echo "Building SimulAVR" + cd simulavr/ || exit 1 + ./bootstrap || exit 1 + #mkdir -p build-avr/ + #cd build-avr/ || exit 1 + make distclean + ./configure --prefix=${PREFIX} || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/simulavr.log + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + cd ${BASE}/build/ || exit 1 +fi + +if [ ! -z ${AVARICE_VERSION} ]; then + echo "Building AVaRICE" + untar ${AVARICE_ARCHIVE} + cd avarice-${AVARICE_VERSION} + mkdir -p build-avr/ + cd build-avr/ || exit 1 + rm -rf * + ../configure --prefix=${PREFIX} || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avarice.log + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + cd ${BASE}/build/ || exit 1 +fi + +if [ ! -z ${AVRDUDE_VERSION} ]; then + echo "Building AVRDUDE" + untar ${AVRDUDE_ARCHIVE} + cd avrdude-${AVRDUDE_VERSION} + mkdir -p build-avr/ + cd build-avr/ || exit 1 + rm -rf * + ../configure --prefix=${PREFIX} || exit 1 + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avrdude.log + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + cd ${BASE}/build/ || exit 1 +fi + +source ${BASE}/script/build-gdb.sh + +source ${BASE}/script/finalize.sh diff --git a/build-ia16.sh b/build-ia16.sh index 100b90e..eb99927 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -25,16 +25,19 @@ if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" ls ia16/ + ls binutils/ exit 1 fi while [ ! -z $1 ]; do - if [ ! -x ia16/$1 ]; then + if [ -e ia16/$1 ]; then + source ia16/$1 + elif [ -e binutils/$1 ]; then + source binutils/$1 + else echo "Unsupported package: $1" exit 1 fi - - [ -e ia16/$1 ] && source ia16/$1 shift done @@ -55,7 +58,7 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then binutils) [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ && [ -z ${BINUTILS_VERSION} ] \ - && source ia16/binutils + && source binutils/binutils ;; gcc) [ -z ${GCC_VERSION} ] \ @@ -95,7 +98,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then echo "Building binutils" if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then untar ${BINUTILS_ARCHIVE} || exit 1 - touch binutils-unpacked + touch binutils-${BINUTILS_VERSION}/binutils-unpacked fi cd binutils-${BINUTILS_VERSION} || exit 1 diff --git a/build-newlib.sh b/build-newlib.sh index a5e5839..e1d2379 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -27,12 +27,16 @@ if [ -z $1 ]; then fi while [ ! -z $1 ]; do - if [ ! -x newlib/$1 ] && [ ! -x common/$1 ]; then + if [ -e newlib/$1 ]; then + source newlib/$1 + elif [ -e binutils/$1 ]; then + source binutils/$1 + elif [ -e common/$1 ]; then + source common/$1 + else echo "Unsupported package: $1" exit 1 fi - - [ -e newlib/$1 ] && source newlib/$1 || source common/$1 shift done @@ -53,7 +57,7 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then binutils) [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ && [ -z ${BINUTILS_VERSION} ] \ - && source newlib/binutils + && source binutils/binutils ;; gcc) [ -z ${GCC_VERSION} ] \ @@ -75,10 +79,10 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then - echo "Building binutils" if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + echo "Unpacking binutils..." untar ${BINUTILS_ARCHIVE} || exit 1 - touch binutils-unpacked + touch binutils-${BINUTILS_VERSION}/binutils-unpacked fi cd binutils-${BINUTILS_VERSION} || exit 1 diff --git a/newlib/binutils b/newlib/binutils deleted file mode 100755 index 6b3e5ff..0000000 --- a/newlib/binutils +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -source newlib/binutils-2.32 diff --git a/newlib/common b/newlib/common deleted file mode 100755 index 3b10e52..0000000 --- a/newlib/common +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -source newlib/newlib -source newlib/binutils -source common/gcc -source common/gdb diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh new file mode 100755 index 0000000..35723de --- /dev/null +++ b/script/build-avr-gcc.sh @@ -0,0 +1,97 @@ +cd ${BASE}/build/ + +if [ ! -z ${AVRLIBC_VERSION} ]; then + if [ ! -e avr-libc-${AVRLIBC_VERSION}/avr-libc-unpacked ]; then + echo "Unpacking avr-libc..." + untar ${AVRLIBC_ARCHIVE} + cd avr-libc-${AVRLIBC_VERSION}/ + untar ${AVRLIBC_DOC_ARCHIVE} + touch avr-libc-unpacked + cd .. + fi + cd avr-libc-${AVRLIBC_VERSION}/ + #${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ + #${SUDO} cp -rv include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/man/ + ${SUDO} cp -rv man/* ${PREFIX}/${TARGET}/share/man/ | exit 1 + cd .. +fi + +if [ ! -z ${GCC_VERSION} ]; then + if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then + echo "Unpacking gcc..." + untar ${GCC_ARCHIVE} + + # download mpc/gmp/mpfr/isl libraries + echo "Downloading gcc dependencies" + cd gcc-${GCC_VERSION}/ + ./contrib/download_prerequisites + touch gcc-unpacked + cd - + fi + + echo "Building gcc" + + mkdir -p gcc-${GCC_VERSION}/build-${TARGET} + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} + --enable-languages=${ENABLE_LANGUAGES} --with-avrlibc --with-headers" + strip_whitespace GCC_CONFIGURE_OPTIONS + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then + rm -rf * + rm -rf ${BASE}/build/avr-libc-${AVRLIBC_VERSION}/build-${TARGET}/* + ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 + + export CFLAGS="$TEMP_CFLAGS" +fi + +cd ${BASE}/build/ + +if [ ! -z ${AVRLIBC_VERSION} ]; then + mkdir -p avr-libc-${AVRLIBC_VERSION}/build-${TARGET} + cd avr-libc-${AVRLIBC_VERSION}/build-${TARGET} || exit 1 + + AVRLIBC_CONFIGURE_OPTIONS+=" --host=${TARGET} --prefix=${PREFIX} ${BUILD_FLAG}" + strip_whitespace AVRLIBC_CONFIGURE_OPTIONS + + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${AVRLIBC_CONFIGURE_OPTIONS}" ]; then + rm -rf * + CC=avr-gcc ../configure ${AVRLIBC_CONFIGURE_OPTIONS} || exit 1 + echo ${AVRLIBC_CONFIGURE_OPTIONS} > configure-prefix + else + echo "Note: avr-libc already configured. To force a rebuild, use: rm -rf $(pwd)" + sleep 5 + fi + + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avr-libc.log + ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 +fi + +cd ${BASE}/build/ + +if [ ! -z ${GCC_VERSION} ]; then + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install + + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed +fi diff --git a/script/download.sh b/script/download.sh index 1cb9a28..39c0620 100755 --- a/script/download.sh +++ b/script/download.sh @@ -4,7 +4,11 @@ echo "You are about to build and install:" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" [ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" [ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" -[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" +[ -z ${AVRLIBC_VERSION} ] || echo " - avr-libc ${AVRLIBC_VERSION}" +[ -z ${AVRDUDE_VERSION} ] || echo " - AVRDUDE ${AVRDUDE_VERSION}" +[ -z ${AVARICE_VERSION} ] || echo " - AVaRICE ${AVARICE_VERSION}" +[ -z ${SIMULAVR_VERSION} ] || echo " - SimulAVR ${SIMULAVR_VERSION}" + echo "" echo "With the following options:" [ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" @@ -38,6 +42,9 @@ fi if [ ! -z ${NEWLIB_VERSION} ]; then echo " NEWLIB_CONFIGURE_OPTIONS=`echo ${NEWLIB_CONFIGURE_OPTIONS}`" fi +if [ ! -z ${AVRLIBC_VERSION} ]; then + echo " AVRLIBC_CONFIGURE_OPTIONS=`echo ${AVRLIBC_CONFIGURE_OPTIONS}`" +fi echo "" mkdir -p ${PREFIX} @@ -95,7 +102,8 @@ rm test-zlib.exe 2>/dev/null # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE - $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $NEWLIB_ARCHIVE" + $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $NEWLIB_ARCHIVE + $AVRLIBC_ARCHIVE $AVRLIBC_DOC_ARCHIVE $AVRDUDE_ARCHIVE $AVARICE_ARCHIVE" echo "Download source files..." mkdir -p download || exit 1 diff --git a/script/finalize.sh b/script/finalize.sh index a4cf740..46439da 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -13,7 +13,7 @@ echo "Copy long name executables to short name." cat << STOP > ${BASE}/build/setenv-${TARGET} export PATH="${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH" export GCC_EXEC_PREFIX="${PREFIX}/lib/gcc/" -export MANPATH="${PREFIX}/share/man:\$MANPATH" +export MANPATH="${PREFIX}/${TARGET}/share/man:${PREFIX}/share/man:\$MANPATH" export INFOPATH="${PREFIX}/${TARGET}/share/info:${PREFIX}/share/info:\$INFOPATH" STOP From a004f58f2cd27e65310781f0df7097fe1fa5345b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Jul 2019 17:50:14 +0200 Subject: [PATCH 221/536] added binutils-ia16 as default for target ia16. --- build-ia16.sh | 15 +++++++++------ ia16/binutils | 3 +-- ia16/binutils-ia16 | 3 +++ 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100755 ia16/binutils-ia16 diff --git a/build-ia16.sh b/build-ia16.sh index eb99927..e09a39d 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -58,7 +58,7 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then binutils) [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ && [ -z ${BINUTILS_VERSION} ] \ - && source binutils/binutils + && source ia16/binutils ;; gcc) [ -z ${GCC_VERSION} ] \ @@ -91,12 +91,15 @@ git reset --hard HEAD git pull || exit 1 cd .. -#[ -d binutils-ia16 ] || git clone https://github.com/crtc-demos/binutils-ia16.git --depth 1 --branch master -#cd binutils-ia16 && git pull && cd .. || exit 1 - if [ ! -z ${BINUTILS_VERSION} ]; then - echo "Building binutils" - if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + if [ "$BINUTILS_VERSION" = "ia16" ]; then + [ -d binutils-ia16 ] || git clone https://github.com/tkchia/binutils-ia16.git --depth 1 --branch master + cd binutils-ia16 + git reset --hard HEAD + git pull || exit 1 + cd .. + elif [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + echo "Unpacking binutils.." untar ${BINUTILS_ARCHIVE} || exit 1 touch binutils-${BINUTILS_VERSION}/binutils-unpacked fi diff --git a/ia16/binutils b/ia16/binutils index 68ed9df..efffa2d 100755 --- a/ia16/binutils +++ b/ia16/binutils @@ -1,4 +1,3 @@ #!/usr/bin/env bash -#BINUTILS_VERSION="ia16" -source newlib/binutils +source ia16/binutils-ia16 diff --git a/ia16/binutils-ia16 b/ia16/binutils-ia16 new file mode 100755 index 0000000..6ec0e0a --- /dev/null +++ b/ia16/binutils-ia16 @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +BINUTILS_VERSION=ia16 From 376e3ebe9ed3fefc576b2c9bbcceac43e622565c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Jul 2019 17:51:12 +0200 Subject: [PATCH 222/536] don't preinstall headers for newlib, make install does this already. --- script/build-newlib-gcc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index d3b4e6b..f46f840 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -2,8 +2,8 @@ cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then untar ${NEWLIB_ARCHIVE} - ${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ - ${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + #${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ + #${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 touch newlib-${NEWLIB_VERSION}/newlib-unpacked fi @@ -31,7 +31,7 @@ if [ ! -z ${GCC_VERSION} ]; then GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES} - --with-newlib" + --with-newlib --with-headers" strip_whitespace GCC_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then From f2e46998de981c13cfcf443710a75e12cc26b58d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Jul 2019 17:51:43 +0200 Subject: [PATCH 223/536] update readme with additional dependencies. --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ee7009..291d78c 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ Before running this script, you need to install these programs first: * g++ * gcc * unzip +* tar +* bzip2 +* gzip +* xz * bison * flex * make (or gmake for FreeBSD) @@ -41,13 +45,13 @@ On Debian/Ubuntu, you can install these programs by : ``` sudo apt-get update -sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev g++ unzip +sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip ``` Fedora : ``` -sudo yum install gcc-c++ bison flex texinfo patch zlib-devel +sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip ``` MinGW : @@ -57,10 +61,10 @@ mingw-get update mingw-get install msys-unzip libz-dev msys-wget msys-bison msys-flex msys-patch ``` -MinGW64 : +MinGW64 (msys2) : ``` -pacman -Syuu base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-curl mingw-w64-x86_64-zlib unzip +pacman -Syuu base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-curl mingw-w64-x86_64-zlib compression ``` ### Configuration From 33f97c308846ace1fb5d7a5d9a6237fd2f83703a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Jul 2019 17:54:12 +0200 Subject: [PATCH 224/536] default to gdb 8.2.1 for djgpp, version 8.3 doesn't work. --- djgpp/all | 2 +- djgpp/gdb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 djgpp/gdb diff --git a/djgpp/all b/djgpp/all index 41810fe..23d6acd 100755 --- a/djgpp/all +++ b/djgpp/all @@ -2,4 +2,4 @@ source djgpp/default source djgpp/dxegen -source common/gdb +source djgpp/gdb diff --git a/djgpp/gdb b/djgpp/gdb new file mode 100755 index 0000000..da2fb5b --- /dev/null +++ b/djgpp/gdb @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +source common/gdb-8.2.1 + From 88cb94856292be2ece2468a0d01896d82514b3c1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Jul 2019 17:59:30 +0200 Subject: [PATCH 225/536] update readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 291d78c..e8f1a4e 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,17 @@ * 2019-06-06: `master` is now the default branch again. -### Current package versions, as of 2019-05-26: +### Current package versions, as of 2019-07-11: * gcc 9.1.0 * binutils 2.32 * gdb 8.3 * djgpp 2.05 * newlib 3.1.0 +* avr-libc 2.0.0 +* avrdude 6.3 +* avarice 2.13 +* simulavr git ### Tested targets: From 5fd9bb86ab2e6579cd7a6ff30ac72d6f5b813282 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Jul 2019 18:10:30 +0200 Subject: [PATCH 226/536] dxegen was accidentally removed from the build list. --- script/download.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/download.sh b/script/download.sh index 39c0620..0d84268 100755 --- a/script/download.sh +++ b/script/download.sh @@ -4,6 +4,7 @@ echo "You are about to build and install:" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" [ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" [ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" +[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" [ -z ${AVRLIBC_VERSION} ] || echo " - avr-libc ${AVRLIBC_VERSION}" [ -z ${AVRDUDE_VERSION} ] || echo " - AVRDUDE ${AVRDUDE_VERSION}" [ -z ${AVARICE_VERSION} ] || echo " - AVaRICE ${AVARICE_VERSION}" From 045be2d7cb6037a56ea83b6a1a3039023ba47c6f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Jul 2019 18:11:00 +0200 Subject: [PATCH 227/536] check for availability of tar, xz, bunzip2, gunzip on startup. --- script/download.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/download.sh b/script/download.sh index 0d84268..0548f5b 100755 --- a/script/download.sh +++ b/script/download.sh @@ -61,7 +61,7 @@ echo "If you wish to change anything, press CTRL-C now. Otherwise, press any oth read -s -n 1 # check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch" +REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" # MinGW doesn't have curl, so we use wget. if ! which curl > /dev/null; then From b66e4e32217461e3c74a2ea2c57c0ba36a5370d0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 12 Jul 2019 17:44:36 +0200 Subject: [PATCH 228/536] fetch correct branch for binutils-ia16 --- build-ia16.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-ia16.sh b/build-ia16.sh index e09a39d..e0f3cd5 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -93,13 +93,14 @@ cd .. if [ ! -z ${BINUTILS_VERSION} ]; then if [ "$BINUTILS_VERSION" = "ia16" ]; then - [ -d binutils-ia16 ] || git clone https://github.com/tkchia/binutils-ia16.git --depth 1 --branch master + echo "Downloading binutils..." + [ -d binutils-ia16 ] || git clone https://github.com/tkchia/binutils-ia16.git --depth 1 --branch binutils-ia16-tkchia cd binutils-ia16 git reset --hard HEAD git pull || exit 1 cd .. elif [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then - echo "Unpacking binutils.." + echo "Unpacking binutils..." untar ${BINUTILS_ARCHIVE} || exit 1 touch binutils-${BINUTILS_VERSION}/binutils-unpacked fi From c0be388de186bda41a84823edf1117e9d8f790b1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 12 Jul 2019 18:32:55 +0200 Subject: [PATCH 229/536] more echo statements to better describe what's going on, and when sudo is needed. --- build-avr.sh | 8 ++++++-- build-djgpp.sh | 10 ++++++---- build-ia16.sh | 2 ++ script/build-avr-gcc.sh | 8 +++++++- script/build-binutils.sh | 11 +++++++++-- script/build-gdb.sh | 5 +++-- script/build-newlib-gcc.sh | 9 ++++++++- script/finalize.sh | 1 + 8 files changed, 42 insertions(+), 12 deletions(-) diff --git a/build-avr.sh b/build-avr.sh index 2b1133b..1489eb1 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -82,6 +82,7 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 if [ ! -z ${SIMULAVR_VERSION} ]; then + echo "Downloading simulavr..." [ -d simulavr ] || git clone https://git.savannah.nongnu.org/git/simulavr.git --depth 1 --branch master cd simulavr git reset --hard HEAD @@ -90,8 +91,8 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then fi if [ ! -z ${BINUTILS_VERSION} ]; then - echo "Building binutils" if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + echo "Unpacking binutils..." untar ${BINUTILS_ARCHIVE} || exit 1 touch binutils-${BINUTILS_VERSION}/binutils-unpacked fi @@ -103,7 +104,7 @@ fi source ${BASE}/script/build-avr-gcc.sh if [ ! -z ${SIMULAVR_VERSION} ]; then - echo "Building SimulAVR" + echo "Building simulavr" cd simulavr/ || exit 1 ./bootstrap || exit 1 #mkdir -p build-avr/ @@ -112,6 +113,7 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then ./configure --prefix=${PREFIX} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/simulavr.log + echo "Installing simulavr" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 cd ${BASE}/build/ || exit 1 fi @@ -126,6 +128,7 @@ if [ ! -z ${AVARICE_VERSION} ]; then ../configure --prefix=${PREFIX} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avarice.log + echo "Installing AVaRICE" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 cd ${BASE}/build/ || exit 1 fi @@ -140,6 +143,7 @@ if [ ! -z ${AVRDUDE_VERSION} ]; then ../configure --prefix=${PREFIX} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avrdude.log + echo "Installing AVRDUDE" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 cd ${BASE}/build/ || exit 1 fi diff --git a/build-djgpp.sh b/build-djgpp.sh index 3e2f275..5cfafd6 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -91,10 +91,10 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then - echo "Building binutils" mkdir -p bnu${BINUTILS_VERSION}s cd bnu${BINUTILS_VERSION}s if [ ! -e binutils-unpacked ]; then + echo "Unpacking binutils..." unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 # patch for binutils 2.27 @@ -116,7 +116,7 @@ fi cd ${BASE}/build/ || exit 1 if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then - echo "Prepare djgpp" + echo "Unpacking djgpp..." rm -rf ${BASE}/build/djgpp-${DJGPP_VERSION} mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} cd ${BASE}/build/djgpp-${DJGPP_VERSION} || exit 1 @@ -134,6 +134,7 @@ if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then cd ../.. + echo "Installing djgpp libc" ${SUDO} mkdir -p $PREFIX/${TARGET}/sys-include || exit 1 ${SUDO} cp -rp include/* $PREFIX/${TARGET}/sys-include/ || exit 1 ${SUDO} cp -rp lib $PREFIX/${TARGET}/ || exit 1 @@ -245,6 +246,7 @@ if [ ! -z ${GCC_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + echo "Installing gcc" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install @@ -264,16 +266,16 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd src PATH=$PREFIX/bin/:$PATH ${MAKE} || exit 1 cd dxe + echo "Installing DXE tools" ${SUDO} cp -p dxegen $PREFIX/bin/${TARGET}-dxegen || exit 1 ${SUDO} cp -p dxe3gen $PREFIX/bin/${TARGET}-dxe3gen || exit 1 ${SUDO} cp -p dxe3res $PREFIX/bin/${TARGET}-dxe3res || exit 1 cd ../.. touch ${PREFIX}/${TARGET}/etc/dxegen-installed - else - echo "Building DXE tools requires gcc, skip." fi cd src/stub ${HOST_CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 + echo "Installing exe2coff" ${SUDO} cp -p exe2coff $PREFIX/bin/${TARGET}-exe2coff || exit 1 # djlsr done diff --git a/build-ia16.sh b/build-ia16.sh index e0f3cd5..ed1c6bf 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -79,12 +79,14 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 +echo "Downloading gcc..." [ -d gcc-ia16 ] || git clone https://github.com/tkchia/gcc-ia16.git --depth 1 --branch gcc-6_3_0-ia16-tkchia cd gcc-ia16 git reset --hard HEAD git pull || exit 1 cd .. +echo "Downloading newlib..." [ -d newlib-ia16 ] || git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia cd newlib-ia16 git reset --hard HEAD diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 35723de..a5933cb 100755 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -12,6 +12,7 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then cd avr-libc-${AVRLIBC_VERSION}/ #${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ #${SUDO} cp -rv include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + echo "Installing avr-libc documentation" ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/man/ ${SUDO} cp -rv man/* ${PREFIX}/${TARGET}/share/man/ | exit 1 cd .. @@ -30,7 +31,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - fi - echo "Building gcc" + echo "Building gcc (stage 1)" mkdir -p gcc-${GCC_VERSION}/build-${TARGET} cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 @@ -53,6 +54,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + echo "Installing gcc (stage 1)" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 export CFLAGS="$TEMP_CFLAGS" @@ -61,6 +63,7 @@ fi cd ${BASE}/build/ if [ ! -z ${AVRLIBC_VERSION} ]; then + echo "Building avr-libc" mkdir -p avr-libc-${AVRLIBC_VERSION}/build-${TARGET} cd avr-libc-${AVRLIBC_VERSION}/build-${TARGET} || exit 1 @@ -78,6 +81,7 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avr-libc.log + echo "Installing avr-libc" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 fi @@ -86,8 +90,10 @@ cd ${BASE}/build/ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + echo "Building gcc (stage 2)" ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + echo "Installing gcc" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install diff --git a/script/build-binutils.sh b/script/build-binutils.sh index 7173f95..c10f97b 100755 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -1,6 +1,8 @@ mkdir -p build-${TARGET} cd build-${TARGET} || exit 1 +echo "Building binutils" + BINUTILS_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" strip_whitespace BINUTILS_CONFIGURE_OPTIONS @@ -13,12 +15,17 @@ else sleep 5 fi -if [ ${TARGET} == "i586-pc-msdosdjgpp" ]; then +case $TARGET in +*-msdosdjgpp) ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 -fi + ;; +*) ;; +esac + ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/binutils.log +echo "Installing binutils" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/binutils-*-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 545cd30..d353171 100755 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -2,14 +2,14 @@ cd ${BASE}/build if [ ! -z ${GDB_VERSION} ]; then if [ ! -e gdb-${GDB_VERSION}/gdb-unpacked ]; then - echo "Unpacking gdb." + echo "Unpacking gdb..." untar ${GDB_ARCHIVE} || exit 1 touch gdb-${GDB_VERSION}/gdb-unpacked fi mkdir -p gdb-${GDB_VERSION}/build-${TARGET} cd gdb-${GDB_VERSION}/build-${TARGET} || exit 1 - echo "Building gdb." + echo "Building gdb" GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" [ -e ${PREFIX}/lib/libmpfr.a ] && GDB_CONFIGURE_OPTIONS+=" --with-mpfr=${PREFIX}" @@ -25,6 +25,7 @@ if [ ! -z ${GDB_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gdb.log + echo "Installing gdb" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gdb-*-installed diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index f46f840..2abf7e2 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -1,6 +1,7 @@ cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then + echo "Unpacking newlib..." untar ${NEWLIB_ARCHIVE} #${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ #${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 @@ -9,6 +10,7 @@ fi if [ ! -z ${GCC_VERSION} ]; then if [ ! -e gcc-${GCC_VERSION}/gcc-unpacked ]; then + echo "Unpacking gcc..." untar ${GCC_ARCHIVE} # download mpc/gmp/mpfr/isl libraries @@ -21,7 +23,7 @@ if [ ! -z ${GCC_VERSION} ]; then echo "gcc already unpacked, skipping." fi - echo "Building gcc" + echo "Building gcc (stage 1)" mkdir -p gcc-${GCC_VERSION}/build-${TARGET} cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 @@ -45,6 +47,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + echo "Installing gcc (stage 1)" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 export CFLAGS="$TEMP_CFLAGS" @@ -53,6 +56,7 @@ fi cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ]; then + echo "Building newlib" mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 @@ -70,6 +74,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/newlib.log + echo "Installing newlib" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || \ ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 fi @@ -77,10 +82,12 @@ fi cd ${BASE}/build/ if [ ! -z ${GCC_VERSION} ]; then + echo "Building gcc (stage 2)" cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + echo "Installing gcc" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install diff --git a/script/finalize.sh b/script/finalize.sh index 46439da..edca6a9 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -30,6 +30,7 @@ case $TARGET in ;; esac +echo "Installing setenv-${TARGET}" ${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null From 2580c3ba1aae8bdb6f31e2629cc74e4d54a0a96a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 12 Jul 2019 18:52:51 +0200 Subject: [PATCH 230/536] added function download_git(). --- build-avr.sh | 7 +------ build-ia16.sh | 23 ++++------------------- script/init.sh | 13 +++++++++++++ 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/build-avr.sh b/build-avr.sh index 1489eb1..f50acbb 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -82,12 +82,7 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 if [ ! -z ${SIMULAVR_VERSION} ]; then - echo "Downloading simulavr..." - [ -d simulavr ] || git clone https://git.savannah.nongnu.org/git/simulavr.git --depth 1 --branch master - cd simulavr - git reset --hard HEAD - git pull || exit 1 - cd .. + download_git https://git.savannah.nongnu.org/git/simulavr.git master fi if [ ! -z ${BINUTILS_VERSION} ]; then diff --git a/build-ia16.sh b/build-ia16.sh index ed1c6bf..34a2f1d 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -79,28 +79,13 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 -echo "Downloading gcc..." -[ -d gcc-ia16 ] || git clone https://github.com/tkchia/gcc-ia16.git --depth 1 --branch gcc-6_3_0-ia16-tkchia -cd gcc-ia16 -git reset --hard HEAD -git pull || exit 1 -cd .. - -echo "Downloading newlib..." -[ -d newlib-ia16 ] || git clone https://github.com/tkchia/newlib-ia16.git --depth 1 --branch newlib-2_4_0-ia16-tkchia -cd newlib-ia16 -git reset --hard HEAD -git pull || exit 1 -cd .. +download_git https://github.com/tkchia/gcc-ia16.git gcc-6_3_0-ia16-tkchia + +download_git https://github.com/tkchia/newlib-ia16.git newlib-2_4_0-ia16-tkchia if [ ! -z ${BINUTILS_VERSION} ]; then if [ "$BINUTILS_VERSION" = "ia16" ]; then - echo "Downloading binutils..." - [ -d binutils-ia16 ] || git clone https://github.com/tkchia/binutils-ia16.git --depth 1 --branch binutils-ia16-tkchia - cd binutils-ia16 - git reset --hard HEAD - git pull || exit 1 - cd .. + download_git https://github.com/tkchia/binutils-ia16.git binutils-ia16-tkchia elif [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then echo "Unpacking binutils..." untar ${BINUTILS_ARCHIVE} || exit 1 diff --git a/script/init.sh b/script/init.sh index 9f78fd9..04f658f 100755 --- a/script/init.sh +++ b/script/init.sh @@ -59,3 +59,16 @@ untar() strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } prepend() { eval "$1=\"$2 ${!1}\""; } + +download_git() +{ + local repo=$(basename $1) + repo=${repo%.*} + echo "Downloading ${repo}..." + [ -d $repo ] || git clone $1 --depth 1 $([ "$2" != "" ] && echo "--branch $2") + cd $repo || exit 1 + git reset --hard HEAD + git checkout $2 + git pull || exit 1 + cd .. +} From 132384cdbb191dede9d9545c37cbd3babf17b60e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 07:46:27 +0200 Subject: [PATCH 231/536] fix binutils script path in newlib/all. --- newlib/all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/all b/newlib/all index 3b10e52..1cdd7b2 100755 --- a/newlib/all +++ b/newlib/all @@ -1,6 +1,6 @@ #!/usr/bin/env bash source newlib/newlib -source newlib/binutils +source binutils/binutils source common/gcc source common/gdb From 220c6e1b389dd193b90fecfb11e539f701159436 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 08:01:03 +0200 Subject: [PATCH 232/536] download newlib via http. --- newlib/newlib-3.0.0 | 2 +- newlib/newlib-3.0.0.20180226 | 2 +- newlib/newlib-3.0.0.20180720 | 2 +- newlib/newlib-3.0.0.20180802 | 2 +- newlib/newlib-3.1.0 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/newlib/newlib-3.0.0 b/newlib/newlib-3.0.0 index 80f7f67..4306960 100755 --- a/newlib/newlib-3.0.0 +++ b/newlib/newlib-3.0.0 @@ -1,4 +1,4 @@ #!/usr/bin/env bash NEWLIB_VERSION=3.0.0 -NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.0.0.20180226 b/newlib/newlib-3.0.0.20180226 index d66ff0d..5322027 100755 --- a/newlib/newlib-3.0.0.20180226 +++ b/newlib/newlib-3.0.0.20180226 @@ -1,4 +1,4 @@ #!/usr/bin/env bash NEWLIB_VERSION=3.0.0.20180226 -NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.0.0.20180720 b/newlib/newlib-3.0.0.20180720 index d5702e7..5ad82ca 100755 --- a/newlib/newlib-3.0.0.20180720 +++ b/newlib/newlib-3.0.0.20180720 @@ -1,4 +1,4 @@ #!/usr/bin/env bash NEWLIB_VERSION=3.0.0.20180720 -NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.0.0.20180802 b/newlib/newlib-3.0.0.20180802 index cfbb8d8..401b0b7 100755 --- a/newlib/newlib-3.0.0.20180802 +++ b/newlib/newlib-3.0.0.20180802 @@ -1,4 +1,4 @@ #!/usr/bin/env bash NEWLIB_VERSION=3.0.0.20180802 -NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.1.0 b/newlib/newlib-3.1.0 index 242d179..729784b 100755 --- a/newlib/newlib-3.1.0 +++ b/newlib/newlib-3.1.0 @@ -1,4 +1,4 @@ #!/usr/bin/env bash NEWLIB_VERSION=3.1.0 -NEWLIB_ARCHIVE="ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" From 8eb7a3b3a8017cae4ce40380a23c08e5845b1d73 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 08:07:31 +0200 Subject: [PATCH 233/536] download gcc prerequisites from http. --- script/build-avr-gcc.sh | 1 + script/build-newlib-gcc.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index a5933cb..22882bf 100755 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -26,6 +26,7 @@ if [ ! -z ${GCC_VERSION} ]; then # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" cd gcc-${GCC_VERSION}/ + sed -i 's/ftp/http/' contrib/download_prerequisites ./contrib/download_prerequisites touch gcc-unpacked cd - diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 2abf7e2..edc9a77 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -16,6 +16,7 @@ if [ ! -z ${GCC_VERSION} ]; then # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" cd gcc-${GCC_VERSION}/ + sed -i 's/ftp/http/' contrib/download_prerequisites ./contrib/download_prerequisites touch gcc-unpacked cd - From 31b6fba0d547d7a7cd85d3910fe6ab7ebc339a84 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Jul 2019 02:30:00 +0200 Subject: [PATCH 234/536] return to build dir before compiling avr utilities. --- build-avr.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-avr.sh b/build-avr.sh index f50acbb..b13a6eb 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -98,6 +98,8 @@ fi source ${BASE}/script/build-avr-gcc.sh +cd ${BASE}/build/ + if [ ! -z ${SIMULAVR_VERSION} ]; then echo "Building simulavr" cd simulavr/ || exit 1 From 71ef4ed333160b823a53e49d9d1b7e57e9258c84 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Jul 2019 02:31:56 +0200 Subject: [PATCH 235/536] patch gcc-ia16 to suppress warning: target system does not support debug output --- build-ia16.sh | 11 +++++++++-- patch/patch-gcc-ia16.txt | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 patch/patch-gcc-ia16.txt diff --git a/build-ia16.sh b/build-ia16.sh index 34a2f1d..935f1d9 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -79,9 +79,16 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 -download_git https://github.com/tkchia/gcc-ia16.git gcc-6_3_0-ia16-tkchia +if [ ! -z ${GCC_VERSION} ]; then + download_git https://github.com/tkchia/gcc-ia16.git gcc-6_3_0-ia16-tkchia + cd gcc-ia16/ + patch -p1 -u < ../../patch/patch-gcc-ia16.txt || exit 1 + cd .. +fi -download_git https://github.com/tkchia/newlib-ia16.git newlib-2_4_0-ia16-tkchia +if [ ! -z ${NEWLIB_VERSION} ]; then + download_git https://github.com/tkchia/newlib-ia16.git newlib-2_4_0-ia16-tkchia +fi if [ ! -z ${BINUTILS_VERSION} ]; then if [ "$BINUTILS_VERSION" = "ia16" ]; then diff --git a/patch/patch-gcc-ia16.txt b/patch/patch-gcc-ia16.txt new file mode 100644 index 0000000..bcdb65f --- /dev/null +++ b/patch/patch-gcc-ia16.txt @@ -0,0 +1,15 @@ +diff --git a/gcc/opts.c b/gcc/opts.c +index 0f9431a0b..91af66f98 100644 +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -2340,8 +2340,8 @@ set_debug_level (enum debug_info_type type, int extended, const char *arg, + #endif + } + +- if (opts->x_write_symbols == NO_DEBUG) +- warning_at (loc, 0, "target system does not support debug output"); ++// if (opts->x_write_symbols == NO_DEBUG) ++// warning_at (loc, 0, "target system does not support debug output"); + } + } + else From e0b057c92d8c4a210afb7f2f31689171109bb6dc Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Jul 2019 02:32:26 +0200 Subject: [PATCH 236/536] make sure -w isn't set in CFLAGS before building sed. --- script/build-tools.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/build-tools.sh b/script/build-tools.sh index ef9253d..099625f 100755 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -9,9 +9,12 @@ if [ ! -z $SED_VERSION ]; then echo "Building sed" untar ${SED_ARCHIVE} || exit 1 cd sed-${SED_VERSION}/ + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="${CFLAGS//-w}" # configure fails if warnings are disabled. ./configure --prefix=${BASE}/build/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 ${MAKE} -j${MAKE_JOBS} install || exit 1 + CFLAGS="$TEMP_CFLAGS" touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed fi fi From da05911584ee48bde88f31e54ddf37e88f2dc15b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Jul 2019 05:50:17 +0200 Subject: [PATCH 237/536] added patch to build avarice with gcc5+ --- build-avr.sh | 1 + patch/patch-avarice-2.13.txt | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 patch/patch-avarice-2.13.txt diff --git a/build-avr.sh b/build-avr.sh index b13a6eb..7024545 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -119,6 +119,7 @@ if [ ! -z ${AVARICE_VERSION} ]; then echo "Building AVaRICE" untar ${AVARICE_ARCHIVE} cd avarice-${AVARICE_VERSION} + [ -e ${BASE}/patch/patch-avarice-${AVARICE_VERSION}.txt ] && patch -p1 -u < ${BASE}/patch/patch-avarice-${AVARICE_VERSION}.txt || exit 1 mkdir -p build-avr/ cd build-avr/ || exit 1 rm -rf * diff --git a/patch/patch-avarice-2.13.txt b/patch/patch-avarice-2.13.txt new file mode 100644 index 0000000..a4e385e --- /dev/null +++ b/patch/patch-avarice-2.13.txt @@ -0,0 +1,23 @@ +Description: Fix FTBFS for GCC 5 +Author: Tobias Frost +Bug: https://sourceforge.net/p/avarice/patches/34/ +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777789 +Last-Update: 2015-05-18 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/src/pragma.h ++++ b/src/pragma.h +@@ -28,9 +28,10 @@ + */ + #if defined(__GNUC__) + # if __GNUC__ > 4 +-# define PRAGMA_DIAG_PUSH _Pragma(GCC diagnostic push) +-# define PRAGMA_DIAG_POP _Pragma(GCC diagnostic pop) +-# define PRAGMA_DIAG_IGNORED(x) _Pragma(GCC diagnostic ignored x) ++# define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push") ++# define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop") ++# define PRAGMA_(x) _Pragma(#x) ++# define PRAGMA_DIAG_IGNORED(x) PRAGMA_(GCC diagnostic ignored x) + # elif __GNUC__ == 4 + # if __GNUC_MINOR__ >= 6 + # define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push") From 90a25a6ffe82b7653beab93dcc1a520719052a3f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 01:39:59 +0200 Subject: [PATCH 238/536] run test builds on travis-ci --- .travis.yml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ script/test.sh | 22 +++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 .travis.yml create mode 100755 script/test.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..722b7d2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,59 @@ +os: + - linux + - osx + +dist: xenial + +language: c++ + +addons: + apt: + packages: + - bison + - flex + - curl + - make + - texinfo + - zlib1g-dev + - tar + - bzip2 + - gzip + - xz-utils + - unzip + - dos2unix + - libtool-bin + homebrew: + update: true + packages: + - bison + - flex + - curl + - make + - texinfo + - zlib + - bzip2 + - gzip + - xz + - unzip + - dos2unix + - libtool + +compiler: + - gcc + - clang + +env: + - TARGET=i586-pc-msdosdjgpp PACKAGES="binutils gcc djgpp-2.05" + - TARGET=i586-pc-msdosdjgpp PACKAGES="gdb" + - TARGET=arm-eabi PACKAGES="binutils gcc newlib" + - TARGET=arm-eabi PACKAGES="gdb" + - TARGET=avr PACKAGES="binutils gcc avr-libc" + - TARGET=avr PACKAGES="gdb avarice simulavr avrdude" + - TARGET=ia16 PACKAGES="binutils gcc newlib" + +before_install: +# - if [ $TRAVIS_OS_NAME = 'linux' ] && [ $CC = 'clang' ] ; then sudo apt-get -y install ; fi +# - if [ $TRAVIS_OS_NAME = 'osx' ] && [ $CC = 'clang' ]; then brew install ; fi + +script: + - ./script/test.sh diff --git a/README.md b/README.md index e8f1a4e..f8dde1c 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ * arm-eabi * avr +See the [build logs](https://travis-ci.org/jwt27/build-gcc) on Travis-CI for a detailed status of individual targets. + ### Requirements Before running this script, you need to install these programs first: diff --git a/script/test.sh b/script/test.sh new file mode 100755 index 0000000..4fea330 --- /dev/null +++ b/script/test.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -e + +PREFIX="`pwd`/install" + +[ $TRAVIS_OS_NAME = 'linux' ] && MAKE_JOBS=`nproc` +[ $TRAVIS_OS_NAME = 'osx' ] && MAKE_JOBS=`sysctl -n hw.ncpu` +MAKE_JOBS+=" --quiet" + +CFLAGS="-w" +CXXFLAGS="-w" + +export PREFIX MAKE_JOBS CFLAGS CXXFLAGS + +case $TARGET in +*-msdosdjgpp) SCRIPT=./build-djgpp.sh ;; +ia16*) SCRIPT=./build-ia16.sh ;; +avr) SCRIPT=./build-avr.sh ;; +*) SCRIPT=./build-newlib.sh ;; +esac + +echo | ${SCRIPT} ${PACKAGES} From f7bace373847730c7eed905026bbcba8b5758e36 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 07:33:38 +0200 Subject: [PATCH 239/536] added djgpp-cvs. build djgpp from source. --- build-djgpp.sh | 98 ++++++++++++----------- djgpp/djgpp-cvs | 3 + patch/patch-djlsr205.txt | 167 +++++++++++++++++++++++++++++++-------- script/finalize.sh | 1 + 4 files changed, 191 insertions(+), 78 deletions(-) create mode 100755 djgpp/djgpp-cvs diff --git a/build-djgpp.sh b/build-djgpp.sh index 5cfafd6..872fae4 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -115,38 +115,44 @@ fi cd ${BASE}/build/ || exit 1 -if [ ! -z ${DJGPP_VERSION} ] || [ ! -z ${BUILD_DXEGEN} ]; then - echo "Unpacking djgpp..." - rm -rf ${BASE}/build/djgpp-${DJGPP_VERSION} - mkdir -p ${BASE}/build/djgpp-${DJGPP_VERSION} - cd ${BASE}/build/djgpp-${DJGPP_VERSION} || exit 1 - unzip -uo ../../download/djdev${DJGPP_VERSION}.zip || exit 1 - unzip -uo ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 - unzip -uo ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 - patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 - patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 - - cd src/stub - ${CC} -O2 ${CFLAGS} stubify.c -o stubify || exit 1 - ${CC} -O2 ${CFLAGS} stubedit.c -o stubedit || exit 1 - ${HOST_CC} -O2 ${CFLAGS} stubify.c -o ${TARGET}-stubify || exit 1 - ${HOST_CC} -O2 ${CFLAGS} stubedit.c -o ${TARGET}-stubedit || exit 1 - - cd ../.. +if [ ! -z ${DJGPP_VERSION} ]; then + if [ "${DJGPP_VERSION}" == "cvs" ]; then + download_git https://github.com/jwt27/djgpp-cvs.git jwt27 + cd djgpp-cvs + else + echo "Unpacking djgpp..." + rm -rf djgpp-${DJGPP_VERSION}/ + mkdir -p djgpp-${DJGPP_VERSION}/ + cd djgpp-${DJGPP_VERSION}/ || exit 1 + unzip -uo ../../download/djdev${DJGPP_VERSION}.zip || exit 1 + unzip -uo ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 + unzip -uo ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 + patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 + patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 + fi - echo "Installing djgpp libc" + cd src + unset COMSPEC + sed -i '50cCROSS_PREFIX = ${TARGET}-' makefile.def + ${MAKE} misc.exe makemake.exe ../hostbin || exit 1 + ${MAKE} config || exit 1 + echo "-Wno-error" >> gcc.opt + ${MAKE} -C djasm native || exit 1 + ${MAKE} -C stub native || exit 1 + cd .. + + case `uname` in + MINGW*) EXE=.exe ;; + MSYS*) EXE=.exe ;; + *) EXE= ;; + esac + + echo "Installing djgpp headers" ${SUDO} mkdir -p $PREFIX/${TARGET}/sys-include || exit 1 ${SUDO} cp -rp include/* $PREFIX/${TARGET}/sys-include/ || exit 1 - ${SUDO} cp -rp lib $PREFIX/${TARGET}/ || exit 1 ${SUDO} mkdir -p $PREFIX/bin || exit 1 - ${SUDO} cp -p src/stub/${TARGET}-stubify $PREFIX/bin/ || exit 1 - ${SUDO} cp -p src/stub/${TARGET}-stubedit $PREFIX/bin/ || exit 1 - - ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/info - ${SUDO} cp -pf info/* ${PREFIX}/${TARGET}/share/info/ - - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/djgpp-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed + ${SUDO} cp -p hostbin/stubify.exe $PREFIX/bin/${TARGET}-stubify${EXE} || exit 1 + ${SUDO} cp -p hostbin/stubedit.exe $PREFIX/bin/${TARGET}-stubedit${EXE} || exit 1 fi cd ${BASE}/build/ @@ -205,7 +211,7 @@ if [ ! -z ${GCC_VERSION} ]; then cd - # copy stubify programs - cp -p ${BASE}/build/djgpp-${DJGPP_VERSION}/src/stub/stubify $BUILDDIR/tmpinst/bin/ + cp $PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify cd $BUILDDIR/ @@ -259,26 +265,28 @@ fi # gcc done if [ ! -z ${DJGPP_VERSION} ]; then - # build djlsr (for dxegen / exe2coff) - cd ${BASE}/build/djgpp-${DJGPP_VERSION} - if [ "$CC" == "gcc" ] && [ ! -z ${BUILD_DXEGEN} ]; then - echo "Building DXE tools." - cd src - PATH=$PREFIX/bin/:$PATH ${MAKE} || exit 1 - cd dxe + echo "Building djgpp libc" + cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src + ${MAKE} -j${MAKE_JOBS}|| exit 1 + cd .. + + echo "Installing djgpp libc" + ${SUDO} mkdir -p ${PREFIX}/${TARGET}/lib + ${SUDO} cp -rp lib/* $PREFIX/${TARGET}/lib || exit 1 + ${SUDO} cp -p hostbin/exe2coff.exe $PREFIX/bin/${TARGET}-exe2coff${EXE} || exit 1 + ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/info + ${SUDO} cp -rp info/* ${PREFIX}/${TARGET}/share/info + + if [ ! -z ${BUILD_DXEGEN} ]; then echo "Installing DXE tools" - ${SUDO} cp -p dxegen $PREFIX/bin/${TARGET}-dxegen || exit 1 - ${SUDO} cp -p dxe3gen $PREFIX/bin/${TARGET}-dxe3gen || exit 1 - ${SUDO} cp -p dxe3res $PREFIX/bin/${TARGET}-dxe3res || exit 1 - cd ../.. + ${SUDO} cp -p hostbin/dxegen.exe $PREFIX/bin/${TARGET}-dxegen${EXE} || exit 1 + ${SUDO} ln -s $PREFIX/bin/${TARGET}-dxegen${EXE} $PREFIX/bin/${TARGET}-dxe3gen${EXE} || exit 1 + ${SUDO} cp -p hostbin/dxe3res.exe $PREFIX/bin/${TARGET}-dxe3res${EXE} || exit 1 touch ${PREFIX}/${TARGET}/etc/dxegen-installed fi - cd src/stub - ${HOST_CC} -O2 ${CFLAGS} -o exe2coff exe2coff.c || exit 1 - echo "Installing exe2coff" - ${SUDO} cp -p exe2coff $PREFIX/bin/${TARGET}-exe2coff || exit 1 - # djlsr done + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/djgpp-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi cd ${BASE}/build diff --git a/djgpp/djgpp-cvs b/djgpp/djgpp-cvs new file mode 100755 index 0000000..0c83b77 --- /dev/null +++ b/djgpp/djgpp-cvs @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +export DJGPP_VERSION=cvs diff --git a/patch/patch-djlsr205.txt b/patch/patch-djlsr205.txt index 6274348..d7e1d58 100644 --- a/patch/patch-djlsr205.txt +++ b/patch/patch-djlsr205.txt @@ -93,39 +93,7 @@ diff -ur djlsr205-orig/src/dxe/dxe3gen.c djlsr205/src/dxe/dxe3gen.c { if (VALID_RELOC(relocs[i])) fwrite(&relocs[i].r_vaddr, 1, sizeof(relocs[0].r_vaddr), outf); -diff -ur djlsr205-orig/src/makefile djlsr205/src/makefile ---- djlsr205-orig/src/makefile 2017-04-29 14:32:47.000000000 +0800 -+++ djlsr205/src/makefile 2017-04-29 14:32:57.000000000 +0800 -@@ -40,17 +40,18 @@ - $(MAKE) -C stub native - $(MAKE) -C utils native - $(MAKE) -C dxe native -- $(MAKE) -C mkdoc -- $(MAKE) -C libc -- $(MAKE) -C debug -- $(MAKE) -C djasm -- $(MAKE) -C stub -- $(MAKE) -C dxe -- $(MAKE) -C libemu -- $(MAKE) -C libm -- $(MAKE) -C utils -- $(MAKE) -C docs -- -$(MAKE) -C ../zoneinfo/src -+ $(MAKE) -C dxe -f makefile.dxe -+ #$(MAKE) -C mkdoc -+ #$(MAKE) -C libc -+ #$(MAKE) -C debug -+ #$(MAKE) -C djasm -+ #$(MAKE) -C stub -+ #$(MAKE) -C dxe -+ #$(MAKE) -C libemu -+ #$(MAKE) -C libm -+ #$(MAKE) -C utils -+ #$(MAKE) -C docs -+ #-$(MAKE) -C ../zoneinfo/src - $(MAKE) -f makempty - - .PHONY : clean + diff -ur djlsr205-orig/src/misc.c djlsr205/src/misc.c --- djlsr205-orig/src/misc.c 2017-04-29 14:32:47.000000000 +0800 +++ djlsr205/src/misc.c 2017-04-29 14:32:57.000000000 +0800 @@ -158,3 +126,136 @@ diff -ur djlsr205-orig/src/stub/exe2coff.c djlsr205/src/stub/exe2coff.c static void exe2aout(char *fname) + +--- a/src/makefile.def ++++ b/src/makefile.def +@@ -47,11 +47,12 @@ + + # For building distributed (djgpp) libraries and programs + +-CROSS_GCC = i586-pc-msdosdjgpp-gcc -pipe +-CROSS_AR = i586-pc-msdosdjgpp-ar +-CROSS_AS = i586-pc-msdosdjgpp-as +-CROSS_LD = i586-pc-msdosdjgpp-ld +-CROSS_STRIP = i586-pc-msdosdjgpp-strip ++CROSS_PREFIX = i586-pc-msdosdjgpp- ++CROSS_GCC = $(CROSS_PREFIX)gcc -pipe ++CROSS_AR = $(CROSS_PREFIX)ar ++CROSS_AS = $(CROSS_PREFIX)as ++CROSS_LD = $(CROSS_PREFIX)ld ++CROSS_STRIP = $(CROSS_PREFIX)strip + CROSS_BISON = bison + + # For building programs that *run* during the build (hostbin/*); +diff --git a/src/debug/common/dbgcom.c b/src/debug/common/dbgcom.c +index 77ca122b..1480f27c 100644 +--- a/src/debug/common/dbgcom.c ++++ b/src/debug/common/dbgcom.c +@@ -1338,13 +1338,13 @@ int invalid_sel_addr(short sel, unsigned a, unsigned len, char for_write) + (" \n\ + movw %2,%%ax \n\ + verr %%ax \n\ +- jnz .Ldoes_not_has_read_right \n\ ++ jnz .Ldoes_not_has_read_right%= \n\ + movb $1,%0 \n\ +-.Ldoes_not_has_read_right: \n\ ++.Ldoes_not_has_read_right%=: \n\ + verw %%ax \n\ +- jnz .Ldoes_not_has_write_right \n\ ++ jnz .Ldoes_not_has_write_right%= \n\ + movb $1,%1 \n\ +-.Ldoes_not_has_write_right: " ++.Ldoes_not_has_write_right%=: " + : "=qm" (read_allowed), "=qm" (write_allowed) + : "g" (sel) + ); +diff --git a/src/dxe/makefile b/src/dxe/makefile +index cf715867..b856b9ed 100644 +--- a/src/dxe/makefile ++++ b/src/dxe/makefile +@@ -13,7 +13,8 @@ all :: native \ + $(BIN)/dxe3res.exe \ + $E + +-native :: $(HOSTBIN)/dxegen.exe ++native :: $(HOSTBIN)/dxegen.exe \ ++ $(HOSTBIN)/dxe3res.exe + $(NOP) + + .o.h: +@@ -36,5 +37,8 @@ CROSS_CC = $(word 1,$(CROSS_GCC)) + $(HOSTBIN)/dxegen.exe : dxe3gen.c init1.h init2.h init3.h init4.h init5.h fini1.h fini2.h fini3.h fini4.h fini5.h + $(GCC) -DDXE_LD=\"$(CROSS_LD)\" -DDXE_CC=\"$(CROSS_CC)\" -DDXE_AR=\"$(CROSS_AR)\" -DDXE_AS=\"$(CROSS_AS)\" dxe3gen.c -o $@ + ++$(HOSTBIN)/dxe3res.exe: dxe3res.c ++ $(GCC) -O2 -Wall dxe3res.c -o $@ ++ + clean :: + @-$(MISC) rm *.o *.h $(HOSTBIN)/dxegen.exe +diff --git a/src/makefile b/src/makefile +index f62b70e4..e6f397fd 100644 +--- a/src/makefile ++++ b/src/makefile +@@ -21,7 +21,7 @@ DIRS = \ + ../info \ + ../lib + +-all : misc.exe config $(DIRS) makemake.exe subs ../lib/libg.a ../lib/libpc.a ++all : misc.exe config $(DIRS) makemake.exe subs + + misc.exe : misc.c + gcc -O2 -Wall misc.c -o misc.exe +diff --git a/src/makefile.inc b/src/makefile.inc +index 664fdf9f..09c6f997 100644 +--- a/src/makefile.inc ++++ b/src/makefile.inc +@@ -165,7 +165,7 @@ ifneq ($(MAKEFILE_LIB),1) + all :: makefile.oh + makefile.oh : makefile + @$(MISC) echo - building new response file +- @$(MISC) echo makefile.oh $(addprefix \&/,$(OBJS)) ++ @echo "$(addprefix &/,$(OBJS))" > makefile.oh + endif + + clean :: +diff --git a/src/makefile.lib b/src/makefile.lib +index 3a72a464..a3b5bd1e 100644 +--- a/src/makefile.lib ++++ b/src/makefile.lib +@@ -23,6 +23,7 @@ $(LIB)/lib$(LIBNAME).a : $(OBJS) makefile.rf $(TOP)/../ident.c + ifeq ($(CROSS_BUILD),0) + $(CROSS_AR) q $(LIB)/lib$(LIBNAME).a @makefile.rf id_$(LIBNAME).o + else ++ dos2unix makefile.rf + $(CROSS_AR) q $(LIB)/lib$(LIBNAME).a `cat makefile.rf` id_$(LIBNAME).o + endif + $(CROSS_AR) s $(LIB)/lib$(LIBNAME).a +diff --git a/src/stub/makefile b/src/stub/makefile +index 83de0f1d..fef8ac8f 100644 +--- a/src/stub/makefile ++++ b/src/stub/makefile +@@ -22,6 +22,7 @@ all :: native \ + native :: \ + $(HOSTBIN)/stubedit.exe \ + $(HOSTBIN)/stubify.exe \ ++ $(HOSTBIN)/exe2coff.exe \ + $(INC)/stubinfo.h \ + $E + $(NOP) +@@ -63,10 +64,13 @@ $(BIN)/stubedit.exe : $(C) stubedit.o $(L) + + + $(HOSTBIN)/stubify.exe : stubify.c stub.h +- $(GCC) stubify.c -o $@ ++ $(GCC) -O2 stubify.c -o $@ + + $(HOSTBIN)/stubedit.exe : stubedit.c $(INC)/stubinfo.h +- $(GCC) stubedit.c -o $@ ++ $(GCC) -O2 stubedit.c -o $@ ++ ++$(HOSTBIN)/exe2coff.exe : exe2coff.c ++ $(GCC) -O2 $< -o $@ + + ./stub2inc.exe : stub2inc.c + $(GCC) stub2inc.c -o $@ + diff --git a/script/finalize.sh b/script/finalize.sh index edca6a9..e4d1259 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -1,6 +1,7 @@ echo "Copy long name executables to short name." ( cd $PREFIX || exit 1 + mkdir -p ${TARGET}/bin SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/${TARGET}-$SHORT_NAME ]; then From 97b2f9e8d2cfbe29bc0fa0200ad8aa7510949231 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 19:07:39 +0200 Subject: [PATCH 240/536] build djgpp host binaries with CC from environment. build libc with DJGPP_CFLAGS. --- build-djgpp.sh | 4 ++++ script/download.sh | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 872fae4..ac69d78 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -134,6 +134,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd src unset COMSPEC sed -i '50cCROSS_PREFIX = ${TARGET}-' makefile.def + sed -i '61cGCC = \$(CC) -g -O2 \$(HOST_CFLAGS)' makefile.def ${MAKE} misc.exe makemake.exe ../hostbin || exit 1 ${MAKE} config || exit 1 echo "-Wno-error" >> gcc.opt @@ -267,7 +268,10 @@ fi if [ ! -z ${DJGPP_VERSION} ]; then echo "Building djgpp libc" cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src + TEMP_CFLAGS="$CFLAGS" + CFLAGS="$DJGPP_CFLAGS" ${MAKE} -j${MAKE_JOBS}|| exit 1 + CFLAGS="$TEMP_CFLAGS" cd .. echo "Installing djgpp libc" diff --git a/script/download.sh b/script/download.sh index 0548f5b..7f9420c 100755 --- a/script/download.sh +++ b/script/download.sh @@ -46,6 +46,9 @@ fi if [ ! -z ${AVRLIBC_VERSION} ]; then echo " AVRLIBC_CONFIGURE_OPTIONS=`echo ${AVRLIBC_CONFIGURE_OPTIONS}`" fi +if [ ! -z ${DJGPP_VERSION} ]; then + echo " DJGPP_CFLAGS=`echo ${DJGPP_CFLAGS}`" +fi echo "" mkdir -p ${PREFIX} @@ -53,10 +56,10 @@ mkdir -p ${PREFIX} if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then echo "WARNING: no write access to ${PREFIX}." echo "You may need to enter your sudo password several times during the build process." + echo "" SUDO=sudo fi -echo "" echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." read -s -n 1 From 64bc1e7bd2a8cec42d2221d2df234c4fd0b0945b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 19:13:04 +0200 Subject: [PATCH 241/536] building djgpp libc now requires binutils and gcc. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index ac69d78..4f255d4 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -45,7 +45,7 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then [ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " [ ! -z ${GDB_VERSION} ] && DEPS+=" " - [ ! -z ${DJGPP_VERSION} ] && DEPS+=" " + [ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" [ ! -z ${BUILD_DXEGEN} ] && DEPS+=" djgpp binutils gcc" for DEP in ${DEPS}; do From 8b986d492064d3cea2e6b861cf9c1e858eedba5d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 19:19:03 +0200 Subject: [PATCH 242/536] default value for DJGPP_CFLAGS = -O2 --- build-djgpp.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 4f255d4..5bc8109 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -21,6 +21,8 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls" +prepend DJGPP_CFLAGS "-O2" + if [ -z $1 ]; then echo "Usage: $0 [packages...]" echo "Supported packages:" @@ -269,7 +271,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Building djgpp libc" cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" - CFLAGS="$DJGPP_CFLAGS" + export CFLAGS="$DJGPP_CFLAGS" ${MAKE} -j${MAKE_JOBS}|| exit 1 CFLAGS="$TEMP_CFLAGS" cd .. From e8f024be5ad753d06802460ed5261b30254ba9b2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 19:26:18 +0200 Subject: [PATCH 243/536] patch djgpp __crt1_startup() to align stack pointer. --- patch/patch-djlsr205.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/patch/patch-djlsr205.txt b/patch/patch-djlsr205.txt index d7e1d58..38a2239 100644 --- a/patch/patch-djlsr205.txt +++ b/patch/patch-djlsr205.txt @@ -258,4 +258,36 @@ index 83de0f1d..fef8ac8f 100644 ./stub2inc.exe : stub2inc.c $(GCC) stub2inc.c -o $@ +diff --git a/src/libc/crt0/crt1.c b/src/libc/crt0/crt1.c +index 1bb6aa55..f0ba9919 100644 +--- a/src/libc/crt0/crt1.c ++++ b/src/libc/crt0/crt1.c +@@ -208,7 +208,7 @@ setup_os_version(void) + _osminor = v & 0xff; + } +- ++__attribute__((force_align_arg_pointer)) + void + __crt1_startup(void) + { +diff --git a/src/makefile.cfg b/src/makefile.cfg +index 11bb06db..1a709f97 100644 +--- a/src/makefile.cfg ++++ b/src/makefile.cfg +@@ -55,6 +55,7 @@ gcc.opt: makefile.cfg + @./misc.exe echo - "-Wsign-compare" >>gcc.opt + @./misc.exe echo - "-nostdinc" >>gcc.opt + @./misc.exe echo - "$(IQUOTE)" >>gcc.opt ++ @./misc.exe echo - "-mpreferred-stack-boundary=4" >>gcc.opt + + + gcc-l.opt: makefile.cfg +@@ -65,6 +66,7 @@ gcc-l.opt: makefile.cfg + @./misc.exe echo - "-Wall" >>gcc-l.opt + @./misc.exe echo - "-nostdinc" >>gcc-l.opt + @./misc.exe echo - "$(IQUOTE)" >>gcc-l.opt ++ @./misc.exe echo - "-mpreferred-stack-boundary=4" >>gcc-l.opt + + gpp.opt: gcc.opt + sed -f gpp.sed $< > $@ From 2851f71a30ae6706d19838fc5d3f7d6b7d4772b6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 19:47:03 +0200 Subject: [PATCH 244/536] apply memalign patch for djlsr205 (github issue #5) --- patch/patch-djlsr205.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/patch/patch-djlsr205.txt b/patch/patch-djlsr205.txt index 38a2239..0e6ecbc 100644 --- a/patch/patch-djlsr205.txt +++ b/patch/patch-djlsr205.txt @@ -291,3 +291,25 @@ index 11bb06db..1a709f97 100644 gpp.opt: gcc.opt sed -f gpp.sed $< > $@ +--- a/src/libc/ansi/stdlib/nmalloc.c ++++ b/src/libc/ansi/stdlib/nmalloc.c +@@ -1145,6 +1145,7 @@ + return nmalloc(szneed); /* EXIT */ + } + else if ((minit = nmalloc(szneed + XTRA))) { ++ m = MEMBLKp(minit); + /* alignment >= 2*ALIGN and power of 2 if here */ + misalign = (ulong)minit % alignment; + DBGPRTM(" misalignment = %d", misalign); +@@ -1154,9 +1155,10 @@ + } + else { + /* two or more chunks to release */ +- /* for now, just return NULL and have a leak */ + DBGPRTM(" Complex case, release multiple chunks"); + DBGEOLN; ++ nfree(PTR(split(&m, alignment - misalign))); ++ return nrealloc(PTR(m), size); + } + } /* alignment > ALIGN */ + } /* valid parameters */ From 1dbba92824b9468f2f07c050de90180c1609753c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 20:12:23 +0200 Subject: [PATCH 245/536] forgot a sudo --- script/finalize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/finalize.sh b/script/finalize.sh index e4d1259..86a584c 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -1,7 +1,7 @@ echo "Copy long name executables to short name." ( cd $PREFIX || exit 1 - mkdir -p ${TARGET}/bin + ${SUDO} mkdir -p ${TARGET}/bin SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/${TARGET}-$SHORT_NAME ]; then From f5abbe3e7955173f90c4fbd01ebe86a184198db4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 20:25:41 +0200 Subject: [PATCH 246/536] document new build variables --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8dde1c..0bc62b9 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ pacman -Syuu base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-curl mingw-w Several environment variables control the build process. Usually you only need to specify `TARGET`. Here is the full list: ``` # Primary build options: -TARGET= # Target duplet or triplet. +TARGET= # Target name. PREFIX= # Install location. ENABLE_LANGUAGES= # Comma-separated list of languages to build compilers for. @@ -88,6 +88,8 @@ GCC_CONFIGURE_OPTIONS= # Extra options to pass to gcc's ./configure BINUTILS_CONFIGURE_OPTIONS= # Same, for binutils GDB_CONFIGURE_OPTIONS= # Same, for gdb NEWLIB_CONFIGURE_OPTIONS= # Same, for newlib +AVRLIBC_CONFIGURE_OPTIONS= # Same, for avr-libc +DJGPP_CFLAGS= # CFLAGS for building djgpp's libc. # Misc. HOST= # The platform you are building for, when building a cross-cross compiler From f19538e3e4b48663c5ae03c0c5a14e3d3a4e2ede Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 21:00:07 +0200 Subject: [PATCH 247/536] fixed makefile.cfg patch for djgpp 2.05 --- patch/patch-djlsr205.txt | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/patch/patch-djlsr205.txt b/patch/patch-djlsr205.txt index 0e6ecbc..4fb28f5 100644 --- a/patch/patch-djlsr205.txt +++ b/patch/patch-djlsr205.txt @@ -271,26 +271,24 @@ index 1bb6aa55..f0ba9919 100644 void __crt1_startup(void) { -diff --git a/src/makefile.cfg b/src/makefile.cfg -index 11bb06db..1a709f97 100644 --- a/src/makefile.cfg +++ b/src/makefile.cfg -@@ -55,6 +55,7 @@ gcc.opt: makefile.cfg - @./misc.exe echo - "-Wsign-compare" >>gcc.opt - @./misc.exe echo - "-nostdinc" >>gcc.opt - @./misc.exe echo - "$(IQUOTE)" >>gcc.opt -+ @./misc.exe echo - "-mpreferred-stack-boundary=4" >>gcc.opt - - +@@ -48,6 +48,7 @@ + @./misc.exe echo - "-Wsign-compare" >>gcc.opt + @./misc.exe echo - "-nostdinc" >>gcc.opt + @./misc.exe echo - "$(IQUOTE)" >>gcc.opt ++ @./misc.exe echo - "-mpreferred-stack-boundary=4" >>gcc.opt + + gcc-l.opt: makefile.cfg -@@ -65,6 +66,7 @@ gcc-l.opt: makefile.cfg - @./misc.exe echo - "-Wall" >>gcc-l.opt - @./misc.exe echo - "-nostdinc" >>gcc-l.opt - @./misc.exe echo - "$(IQUOTE)" >>gcc-l.opt -+ @./misc.exe echo - "-mpreferred-stack-boundary=4" >>gcc-l.opt - +@@ -58,6 +59,7 @@ + @./misc.exe echo - "-Wall" >>gcc-l.opt + @./misc.exe echo - "-nostdinc" >>gcc-l.opt + @./misc.exe echo - "$(IQUOTE)" >>gcc-l.opt ++ @./misc.exe echo - "-mpreferred-stack-boundary=4" >>gcc.opt + gpp.opt: gcc.opt - sed -f gpp.sed $< > $@ + sed -f gpp.sed $< > $@ --- a/src/libc/ansi/stdlib/nmalloc.c +++ b/src/libc/ansi/stdlib/nmalloc.c @@ -1145,6 +1145,7 @@ From cf7b0fd2d9c12c5d5ab23eeb0ec76b876314b544 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 13 Jul 2019 22:49:59 +0200 Subject: [PATCH 248/536] build and install gcc in 2 stages. --- build-djgpp.sh | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 5bc8109..dc43a75 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -232,14 +232,14 @@ if [ ! -z ${GCC_VERSION} ]; then echo "gcc already unpacked, skipping." fi - echo "Building gcc" + echo "Building gcc (stage 1)" mkdir -p djcross cd djcross || exit 1 TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES}" strip_whitespace GCC_CONFIGURE_OPTIONS @@ -253,14 +253,9 @@ if [ ! -z ${GCC_VERSION} ]; then sleep 5 fi - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log - echo "Installing gcc" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install - - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + echo "Installing gcc (stage 1)" + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 export CFLAGS="$TEMP_CFLAGS" fi @@ -295,6 +290,24 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi +if [ ! -z ${GCC_VERSION} ]; then + echo "Building gcc (stage 2)" + cd $BUILDDIR/djcross || exit 1 + + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + echo "Installing gcc (stage 2)" + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install + CFLAGS="$TEMP_CFLAGS" + + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed +fi + cd ${BASE}/build source ${BASE}/script/build-gdb.sh From 9fc2da1ff382149f46d5e52b083adafe6dd6f48b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 01:30:02 +0200 Subject: [PATCH 249/536] minor tweaks and fixes building gcc --- build-djgpp.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index dc43a75..313b036 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -197,12 +197,14 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR if [ ! -e gcc-unpacked ]; then - echo "Patch unpack-gcc.sh" + rm -rf $BUILDDIR/gnu/ 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 + # prevent renaming source directory. + sed -i 's/gcc-\$short_ver/gcc-\$gcc_version/' unpack-gcc.sh || exit 1 echo "Running unpack-gcc.sh" sh unpack-gcc.sh --no-djgpp-source ../../download/$(basename ${GCC_ARCHIVE}) || exit 1 @@ -213,15 +215,12 @@ if [ ! -z ${GCC_VERSION} ]; then sed -i "s/[^^]@\(\(tex\)\|\(end\)\)/\n@\1/g" gcc.texi || exit 1 cd - - # copy stubify programs - cp $PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify - cd $BUILDDIR/ # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" - cd gnu/gcc-${GCC_VERSION_SHORT} - ./contrib/download_prerequisites + cd gnu/gcc-${GCC_VERSION} || exit 1 + ./contrib/download_prerequisites || exit 1 # apply extra patches if necessary [ -e ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt ] && patch -p 1 -u -i ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt @@ -246,13 +245,15 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then rm -rf * - ../gnu/gcc-${GCC_VERSION_SHORT}/configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + ../gnu/gcc-${GCC_VERSION}/configure ${GCC_CONFIGURE_OPTIONS} || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" sleep 5 fi + cp $PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify || exit 1 + ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 echo "Installing gcc (stage 1)" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 From d92dfe2eb6c1811368114216333bb10897de49b0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 06:04:34 +0200 Subject: [PATCH 250/536] unzip quietly --- build-djgpp.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 313b036..efc6e97 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -97,7 +97,7 @@ if [ ! -z ${BINUTILS_VERSION} ]; then cd bnu${BINUTILS_VERSION}s if [ ! -e binutils-unpacked ]; then echo "Unpacking binutils..." - unzip -o ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 + unzip -oq ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 # patch for binutils 2.27 [ ${BINUTILS_VERSION} == 227 ] && (patch gnu/binutils-*/bfd/init.c ${BASE}/patch/patch-bnu27-bfd-init.txt || exit 1 ) @@ -126,9 +126,9 @@ if [ ! -z ${DJGPP_VERSION} ]; then rm -rf djgpp-${DJGPP_VERSION}/ mkdir -p djgpp-${DJGPP_VERSION}/ cd djgpp-${DJGPP_VERSION}/ || exit 1 - unzip -uo ../../download/djdev${DJGPP_VERSION}.zip || exit 1 - unzip -uo ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 - unzip -uo ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 + unzip -uoq ../../download/djdev${DJGPP_VERSION}.zip || exit 1 + unzip -uoq ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 + unzip -uoq ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 fi From 7fbf89a98b358880cb6f6acae4977e2ca83c594d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 06:04:59 +0200 Subject: [PATCH 251/536] fix variable expansion in sed script --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index efc6e97..d4a8051 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -135,7 +135,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd src unset COMSPEC - sed -i '50cCROSS_PREFIX = ${TARGET}-' makefile.def + sed -i "50cCROSS_PREFIX = ${TARGET}-" makefile.def sed -i '61cGCC = \$(CC) -g -O2 \$(HOST_CFLAGS)' makefile.def ${MAKE} misc.exe makemake.exe ../hostbin || exit 1 ${MAKE} config || exit 1 From d4d9832dc8ab666defdba600df94c226e3069384 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 06:05:19 +0200 Subject: [PATCH 252/536] download gcc prerequisites from http. --- build-djgpp.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index d4a8051..f7d6b29 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -220,6 +220,7 @@ if [ ! -z ${GCC_VERSION} ]; then # download mpc/gmp/mpfr/isl libraries echo "Downloading gcc dependencies" cd gnu/gcc-${GCC_VERSION} || exit 1 + sed -i 's/ftp/http/' contrib/download_prerequisites ./contrib/download_prerequisites || exit 1 # apply extra patches if necessary From d9cbce6578f9bba3b2fda503b03397c85875dae0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 06:23:18 +0200 Subject: [PATCH 253/536] only build the parts of djgpp that we need. --- build-djgpp.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index f7d6b29..1fe0eae 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -269,7 +269,15 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" export CFLAGS="$DJGPP_CFLAGS" - ${MAKE} -j${MAKE_JOBS}|| exit 1 + ${MAKE} -j${MAKE_JOBS} -C mkdoc || exit 1 + ${MAKE} -j${MAKE_JOBS} -C libc || exit 1 + #${MAKE} -j${MAKE_JOBS} -C debug || exit 1 + ${MAKE} -j${MAKE_JOBS} -C libemu || exit 1 + ${MAKE} -j${MAKE_JOBS} -C libm || exit 1 + ${MAKE} -j${MAKE_JOBS} -C utils native || exit 1 + ${MAKE} -j${MAKE_JOBS} -C docs || exit 1 + #${MAKE} -j${MAKE_JOBS} -C ../zoneinfo/src + ${MAKE} -j${MAKE_JOBS} -f makempty || exit 1 CFLAGS="$TEMP_CFLAGS" cd .. @@ -281,6 +289,8 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${SUDO} cp -rp info/* ${PREFIX}/${TARGET}/share/info if [ ! -z ${BUILD_DXEGEN} ]; then + echo "Building DXE tools" + ${MAKE} -j${MAKE_JOBS} -C dxe native || exit 1 echo "Installing DXE tools" ${SUDO} cp -p hostbin/dxegen.exe $PREFIX/bin/${TARGET}-dxegen${EXE} || exit 1 ${SUDO} ln -s $PREFIX/bin/${TARGET}-dxegen${EXE} $PREFIX/bin/${TARGET}-dxe3gen${EXE} || exit 1 From bffa7875a3d179c2badd642a60d86e4667f5014b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 06:58:22 +0200 Subject: [PATCH 254/536] run make config only after building gcc. --- build-djgpp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 1fe0eae..7292d0f 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -138,8 +138,6 @@ if [ ! -z ${DJGPP_VERSION} ]; then sed -i "50cCROSS_PREFIX = ${TARGET}-" makefile.def sed -i '61cGCC = \$(CC) -g -O2 \$(HOST_CFLAGS)' makefile.def ${MAKE} misc.exe makemake.exe ../hostbin || exit 1 - ${MAKE} config || exit 1 - echo "-Wno-error" >> gcc.opt ${MAKE} -C djasm native || exit 1 ${MAKE} -C stub native || exit 1 cd .. @@ -269,6 +267,8 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" export CFLAGS="$DJGPP_CFLAGS" + ${MAKE} config || exit 1 + echo "-Wno-error" >> gcc.opt ${MAKE} -j${MAKE_JOBS} -C mkdoc || exit 1 ${MAKE} -j${MAKE_JOBS} -C libc || exit 1 #${MAKE} -j${MAKE_JOBS} -C debug || exit 1 From 3ca3cb5872af91e355c08cadc377c50fafcb3211 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 07:53:56 +0200 Subject: [PATCH 255/536] install libc before building other parts of djgpp. --- build-djgpp.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 7292d0f..10bbb9c 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -271,6 +271,11 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "-Wno-error" >> gcc.opt ${MAKE} -j${MAKE_JOBS} -C mkdoc || exit 1 ${MAKE} -j${MAKE_JOBS} -C libc || exit 1 + + echo "Installing djgpp libc" + ${SUDO} mkdir -p ${PREFIX}/${TARGET}/lib + ${SUDO} cp -rp ../lib/* $PREFIX/${TARGET}/lib || exit 1 + #${MAKE} -j${MAKE_JOBS} -C debug || exit 1 ${MAKE} -j${MAKE_JOBS} -C libemu || exit 1 ${MAKE} -j${MAKE_JOBS} -C libm || exit 1 @@ -281,8 +286,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then CFLAGS="$TEMP_CFLAGS" cd .. - echo "Installing djgpp libc" - ${SUDO} mkdir -p ${PREFIX}/${TARGET}/lib + echo "Installing djgpp libraries and utilities" ${SUDO} cp -rp lib/* $PREFIX/${TARGET}/lib || exit 1 ${SUDO} cp -p hostbin/exe2coff.exe $PREFIX/bin/${TARGET}-exe2coff${EXE} || exit 1 ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/info From a91dfb82ddd976d1a0d84b7b5d9f133caefdd25d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 07:54:35 +0200 Subject: [PATCH 256/536] install djasm too. --- build-djgpp.sh | 1 + script/finalize.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 10bbb9c..111fbe3 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -289,6 +289,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Installing djgpp libraries and utilities" ${SUDO} cp -rp lib/* $PREFIX/${TARGET}/lib || exit 1 ${SUDO} cp -p hostbin/exe2coff.exe $PREFIX/bin/${TARGET}-exe2coff${EXE} || exit 1 + ${SUDO} cp -p hostbin/djasm.exe $PREFIX/bin/${TARGET}-djasm${EXE} || exit 1 ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/info ${SUDO} cp -rp info/* ${PREFIX}/${TARGET}/share/info diff --git a/script/finalize.sh b/script/finalize.sh index 86a584c..f9b2087 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -2,7 +2,7 @@ echo "Copy long name executables to short name." ( cd $PREFIX || exit 1 ${SUDO} mkdir -p ${TARGET}/bin - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb" + SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb djasm" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/${TARGET}-$SHORT_NAME ]; then ${SUDO} cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME From 17b5945cbb0a0ac2e204996f0371552f2477ca29 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 07:54:51 +0200 Subject: [PATCH 257/536] remove -Werror from makefile.cfg --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 111fbe3..585b277 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -267,8 +267,8 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" export CFLAGS="$DJGPP_CFLAGS" + sed -i 's/Werror/Wno-error/' makefile.cfg ${MAKE} config || exit 1 - echo "-Wno-error" >> gcc.opt ${MAKE} -j${MAKE_JOBS} -C mkdoc || exit 1 ${MAKE} -j${MAKE_JOBS} -C libc || exit 1 From 6a7a0aed4dad258f88457f28d5fb744f89bc57ed Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 08:47:48 +0200 Subject: [PATCH 258/536] build misc djgpp libraries only after gcc is fully installed. --- build-djgpp.sh | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 585b277..e33d9ab 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -275,13 +275,39 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Installing djgpp libc" ${SUDO} mkdir -p ${PREFIX}/${TARGET}/lib ${SUDO} cp -rp ../lib/* $PREFIX/${TARGET}/lib || exit 1 + CFLAGS="$TEMP_CFLAGS" +fi + +if [ ! -z ${GCC_VERSION} ]; then + echo "Building gcc (stage 2)" + cd $BUILDDIR/djcross || exit 1 - #${MAKE} -j${MAKE_JOBS} -C debug || exit 1 + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + ${MAKE} -j${MAKE_JOBS} || exit 1 + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + echo "Installing gcc (stage 2)" + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ + ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install + CFLAGS="$TEMP_CFLAGS" + + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed +fi + +if [ ! -z ${DJGPP_VERSION} ]; then + echo "Building djgpp libraries" + cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src + TEMP_CFLAGS="$CFLAGS" + export CFLAGS="$DJGPP_CFLAGS" + ${MAKE} -j${MAKE_JOBS} -C dxe native || exit 1 + ${MAKE} -j${MAKE_JOBS} -C debug || exit 1 ${MAKE} -j${MAKE_JOBS} -C libemu || exit 1 ${MAKE} -j${MAKE_JOBS} -C libm || exit 1 ${MAKE} -j${MAKE_JOBS} -C utils native || exit 1 ${MAKE} -j${MAKE_JOBS} -C docs || exit 1 - #${MAKE} -j${MAKE_JOBS} -C ../zoneinfo/src + ${MAKE} -j${MAKE_JOBS} -C ../zoneinfo/src ${MAKE} -j${MAKE_JOBS} -f makempty || exit 1 CFLAGS="$TEMP_CFLAGS" cd .. @@ -294,8 +320,6 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${SUDO} cp -rp info/* ${PREFIX}/${TARGET}/share/info if [ ! -z ${BUILD_DXEGEN} ]; then - echo "Building DXE tools" - ${MAKE} -j${MAKE_JOBS} -C dxe native || exit 1 echo "Installing DXE tools" ${SUDO} cp -p hostbin/dxegen.exe $PREFIX/bin/${TARGET}-dxegen${EXE} || exit 1 ${SUDO} ln -s $PREFIX/bin/${TARGET}-dxegen${EXE} $PREFIX/bin/${TARGET}-dxe3gen${EXE} || exit 1 @@ -307,24 +331,6 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi -if [ ! -z ${GCC_VERSION} ]; then - echo "Building gcc (stage 2)" - cd $BUILDDIR/djcross || exit 1 - - TEMP_CFLAGS="$CFLAGS" - export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log - echo "Installing gcc (stage 2)" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install - CFLAGS="$TEMP_CFLAGS" - - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed -fi - cd ${BASE}/build source ${BASE}/script/build-gdb.sh From 46dce31536a8536bf4e4316515f242a407b76f8e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 14 Jul 2019 21:01:21 +0200 Subject: [PATCH 259/536] build utils before dxe. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index e33d9ab..19960db 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -301,11 +301,11 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" export CFLAGS="$DJGPP_CFLAGS" + ${MAKE} -j${MAKE_JOBS} -C utils native || exit 1 ${MAKE} -j${MAKE_JOBS} -C dxe native || exit 1 ${MAKE} -j${MAKE_JOBS} -C debug || exit 1 ${MAKE} -j${MAKE_JOBS} -C libemu || exit 1 ${MAKE} -j${MAKE_JOBS} -C libm || exit 1 - ${MAKE} -j${MAKE_JOBS} -C utils native || exit 1 ${MAKE} -j${MAKE_JOBS} -C docs || exit 1 ${MAKE} -j${MAKE_JOBS} -C ../zoneinfo/src ${MAKE} -j${MAKE_JOBS} -f makempty || exit 1 From 58f5b54dacc5c9f6924587d09b54ccc3ec92973e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Jul 2019 02:37:58 +0200 Subject: [PATCH 260/536] add test for djgpp-cvs in .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 722b7d2..f1d59b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,6 +44,7 @@ compiler: env: - TARGET=i586-pc-msdosdjgpp PACKAGES="binutils gcc djgpp-2.05" + - TARGET=i586-pc-msdosdjgpp PACKAGES="binutils gcc djgpp-cvs" - TARGET=i586-pc-msdosdjgpp PACKAGES="gdb" - TARGET=arm-eabi PACKAGES="binutils gcc newlib" - TARGET=arm-eabi PACKAGES="gdb" From d4228ea27ab40ce6bf50a49707522df94856b7a9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Jul 2019 20:29:33 +0200 Subject: [PATCH 261/536] run test builds using gcc-9 and clang-9 --- .travis.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1d59b4..25e83d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,10 @@ language: c++ addons: apt: + sources: + - ubuntu-toolchain-r-test + - sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' packages: - bison - flex @@ -22,6 +26,13 @@ addons: - unzip - dos2unix - libtool-bin + - gcc-9 + - g++-9 + - libstdc++-9-dev + - clang-9 + - llvm-9 + - libc++-9-dev + - libc++abi-9-dev homebrew: update: true packages: @@ -50,11 +61,7 @@ env: - TARGET=arm-eabi PACKAGES="gdb" - TARGET=avr PACKAGES="binutils gcc avr-libc" - TARGET=avr PACKAGES="gdb avarice simulavr avrdude" - - TARGET=ia16 PACKAGES="binutils gcc newlib" - -before_install: -# - if [ $TRAVIS_OS_NAME = 'linux' ] && [ $CC = 'clang' ] ; then sudo apt-get -y install ; fi -# - if [ $TRAVIS_OS_NAME = 'osx' ] && [ $CC = 'clang' ]; then brew install ; fi +# - TARGET=ia16 PACKAGES="binutils gcc newlib" script: - ./script/test.sh From 6ed5f4eb8375f90ba198421a0304767a70ab4da9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Jul 2019 21:05:36 +0200 Subject: [PATCH 262/536] unpack gcc in build-djgpp.sh --- build-djgpp.sh | 10 ++++++--- patch/patch-unpack-gcc.txt | 44 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 patch/patch-unpack-gcc.txt diff --git a/build-djgpp.sh b/build-djgpp.sh index 19960db..e201ece 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -201,11 +201,15 @@ if [ ! -z ${GCC_VERSION} ]; then # The --verbose option is not recognized by BSD patch sed -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1 fi - # prevent renaming source directory. - sed -i 's/gcc-\$short_ver/gcc-\$gcc_version/' unpack-gcc.sh || exit 1 + patch -p1 -u < ${BASE}/patch/patch-unpack-gcc.txt || exit 1 + + mkdir gnu/ + cd gnu/ || exit 1 + untar ${GCC_ARCHIVE} + cd .. echo "Running unpack-gcc.sh" - sh unpack-gcc.sh --no-djgpp-source ../../download/$(basename ${GCC_ARCHIVE}) || exit 1 + sh unpack-gcc.sh --no-djgpp-source || exit 1 # patch gnu/gcc-X.XX/gcc/doc/gcc.texi echo "Patch gcc/doc/gcc.texi" diff --git a/patch/patch-unpack-gcc.txt b/patch/patch-unpack-gcc.txt new file mode 100644 index 0000000..9282a2b --- /dev/null +++ b/patch/patch-unpack-gcc.txt @@ -0,0 +1,44 @@ +--- a/unpack-gcc.sh ++++ b/unpack-gcc.sh +@@ -33,32 +33,6 @@ + esac + done + +-archive=${1-gcc-$gcc_version.tar.bz2} +- +-# +-# Detect required tar command line parameters for unpacking source archice +-# +-tar_param=`case $archive in *.gz|*.tgz) echo '--use=gzip' ;; +- *.bz2) echo '--use=bzip2' ;; +- *.xz) echo '--use=xz' ;; +-esac` +- +-if test "$tar_param" = "" ; then +- echo "Failed to detect how to decompress $archive" +- exit 1 +-fi +- +-rm -rf gnu +-mkdir gnu +- +-rm -f $top/s-sources +-( cd gnu && tar xf $top/$archive $tar_param && echo $archive >$top/s-sources ) +- +-if ! [ -f s-sources ] ; then +- echo "Cannot unpack GCC sources" +- exit 1 +-fi +- + orig_dir_name=`(cd gnu && ls -d gcc* | sed 1q; )` + + base_ver=$(cat gnu/$orig_dir_name/gcc/BASE-VER) +@@ -80,7 +54,7 @@ + short_ver_2=${short_ver_2}-$datestamp + fi + +-dir_name=gcc-$short_ver ++dir_name=gcc-$gcc_version + + if ! test "$dir_name" = "$orig_dir_name" ; then + mv -f gnu/$orig_dir_name gnu/$dir_name || exit 1 From 561a36f52105760b7effaf32cebfbae437a744ab Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Jul 2019 22:54:56 +0200 Subject: [PATCH 263/536] remove failing test, for now --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 25e83d2..2a06c0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,12 @@ compiler: - gcc - clang +matrix: + exclude: + - os: linux + compiler: clang + env: TARGET=avr PACKAGES="gdb avarice simulavr avrdude" + env: - TARGET=i586-pc-msdosdjgpp PACKAGES="binutils gcc djgpp-2.05" - TARGET=i586-pc-msdosdjgpp PACKAGES="binutils gcc djgpp-cvs" @@ -61,7 +67,7 @@ env: - TARGET=arm-eabi PACKAGES="gdb" - TARGET=avr PACKAGES="binutils gcc avr-libc" - TARGET=avr PACKAGES="gdb avarice simulavr avrdude" -# - TARGET=ia16 PACKAGES="binutils gcc newlib" +# - TARGET=ia16-elf PACKAGES="binutils gcc newlib" script: - ./script/test.sh From f4512b9c54702bd52a0609f3337f51112c43071b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 16 Jul 2019 04:20:50 +0200 Subject: [PATCH 264/536] remove test builds that time out on travis-ci (>50 min). --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2a06c0d..8e403e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,10 @@ matrix: - os: linux compiler: clang env: TARGET=avr PACKAGES="gdb avarice simulavr avrdude" + - os: osx + env: TARGET=arm-eabi PACKAGES="binutils gcc newlib" + - os: osx + env: TARGET=avr PACKAGES="binutils gcc avr-libc" env: - TARGET=i586-pc-msdosdjgpp PACKAGES="binutils gcc djgpp-2.05" From c7e3208fde9dd5465f86df663a8884711123a743 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 19 Jul 2019 05:55:51 +0200 Subject: [PATCH 265/536] remove dxegen package, it's already being built as part of libc so we might as well install it by default. --- build-djgpp.sh | 11 +++-------- djgpp/all | 1 - djgpp/dxegen | 3 --- 3 files changed, 3 insertions(+), 12 deletions(-) delete mode 100755 djgpp/dxegen diff --git a/build-djgpp.sh b/build-djgpp.sh index e201ece..8a8a419 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -320,17 +320,12 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${SUDO} cp -rp lib/* $PREFIX/${TARGET}/lib || exit 1 ${SUDO} cp -p hostbin/exe2coff.exe $PREFIX/bin/${TARGET}-exe2coff${EXE} || exit 1 ${SUDO} cp -p hostbin/djasm.exe $PREFIX/bin/${TARGET}-djasm${EXE} || exit 1 + ${SUDO} cp -p hostbin/dxegen.exe $PREFIX/bin/${TARGET}-dxegen${EXE} || exit 1 + ${SUDO} ln -s $PREFIX/bin/${TARGET}-dxegen${EXE} $PREFIX/bin/${TARGET}-dxe3gen${EXE} || exit 1 + ${SUDO} cp -p hostbin/dxe3res.exe $PREFIX/bin/${TARGET}-dxe3res${EXE} || exit 1 ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/info ${SUDO} cp -rp info/* ${PREFIX}/${TARGET}/share/info - if [ ! -z ${BUILD_DXEGEN} ]; then - echo "Installing DXE tools" - ${SUDO} cp -p hostbin/dxegen.exe $PREFIX/bin/${TARGET}-dxegen${EXE} || exit 1 - ${SUDO} ln -s $PREFIX/bin/${TARGET}-dxegen${EXE} $PREFIX/bin/${TARGET}-dxe3gen${EXE} || exit 1 - ${SUDO} cp -p hostbin/dxe3res.exe $PREFIX/bin/${TARGET}-dxe3res${EXE} || exit 1 - touch ${PREFIX}/${TARGET}/etc/dxegen-installed - fi - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/djgpp-*-installed ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi diff --git a/djgpp/all b/djgpp/all index 23d6acd..7774dae 100755 --- a/djgpp/all +++ b/djgpp/all @@ -1,5 +1,4 @@ #!/usr/bin/env bash source djgpp/default -source djgpp/dxegen source djgpp/gdb diff --git a/djgpp/dxegen b/djgpp/dxegen deleted file mode 100755 index 2919cee..0000000 --- a/djgpp/dxegen +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -export BUILD_DXEGEN=yes From 67804e5f1d179e69bd2cac4a10ad20e87e5cf413 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 19 Jul 2019 05:56:46 +0200 Subject: [PATCH 266/536] use CFLAGS_FOR_TARGET to build djgpp. --- build-djgpp.sh | 8 ++++---- script/download.sh | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 8a8a419..e6c4321 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -21,7 +21,7 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls" -prepend DJGPP_CFLAGS "-O2" +prepend CFLAGS_FOR_TARGET "-O2" if [ -z $1 ]; then echo "Usage: $0 [packages...]" @@ -136,7 +136,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd src unset COMSPEC sed -i "50cCROSS_PREFIX = ${TARGET}-" makefile.def - sed -i '61cGCC = \$(CC) -g -O2 \$(HOST_CFLAGS)' makefile.def + sed -i "61cGCC = \$(CC) -g -O2 ${CFLAGS}" makefile.def ${MAKE} misc.exe makemake.exe ../hostbin || exit 1 ${MAKE} -C djasm native || exit 1 ${MAKE} -C stub native || exit 1 @@ -270,7 +270,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Building djgpp libc" cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" - export CFLAGS="$DJGPP_CFLAGS" + export CFLAGS="$CFLAGS_FOR_TARGET" sed -i 's/Werror/Wno-error/' makefile.cfg ${MAKE} config || exit 1 ${MAKE} -j${MAKE_JOBS} -C mkdoc || exit 1 @@ -304,7 +304,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Building djgpp libraries" cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" - export CFLAGS="$DJGPP_CFLAGS" + export CFLAGS="$CFLAGS_FOR_TARGET" ${MAKE} -j${MAKE_JOBS} -C utils native || exit 1 ${MAKE} -j${MAKE_JOBS} -C dxe native || exit 1 ${MAKE} -j${MAKE_JOBS} -C debug || exit 1 diff --git a/script/download.sh b/script/download.sh index 7f9420c..02841fe 100755 --- a/script/download.sh +++ b/script/download.sh @@ -21,6 +21,8 @@ echo " CC=${CC}" echo " CXX=${CXX}" echo " CFLAGS=${CFLAGS}" echo " CXXFLAGS=${CXXFLAGS}" +echo " CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET}" +echo " CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET}" echo " LDFLAGS=${LDFLAGS}" echo " MAKE=${MAKE}" echo " MAKE_JOBS=${MAKE_JOBS}" @@ -46,9 +48,6 @@ fi if [ ! -z ${AVRLIBC_VERSION} ]; then echo " AVRLIBC_CONFIGURE_OPTIONS=`echo ${AVRLIBC_CONFIGURE_OPTIONS}`" fi -if [ ! -z ${DJGPP_VERSION} ]; then - echo " DJGPP_CFLAGS=`echo ${DJGPP_CFLAGS}`" -fi echo "" mkdir -p ${PREFIX} From 6c5668172c7262f6b4483b77066d15c9f7629824 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 19 Jul 2019 06:01:02 +0200 Subject: [PATCH 267/536] run gcc's configure through eval, as GCC_CONFIGURE_OPTIONS may contain quotes. --- build-djgpp.sh | 2 +- script/build-avr-gcc.sh | 2 +- script/build-newlib-gcc.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index e6c4321..ed7a836 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -248,7 +248,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then rm -rf * - ../gnu/gcc-${GCC_VERSION}/configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + eval "../gnu/gcc-${GCC_VERSION}/configure ${GCC_CONFIGURE_OPTIONS}" || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 22882bf..aeafe08 100755 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -47,7 +47,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then rm -rf * rm -rf ${BASE}/build/avr-libc-${AVRLIBC_VERSION}/build-${TARGET}/* - ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + eval "../configure ${GCC_CONFIGURE_OPTIONS}" || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index edc9a77..e702db3 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -40,7 +40,7 @@ if [ ! -z ${GCC_VERSION} ]; then if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then rm -rf * rm -rf ${BASE}/build/newlib-${NEWLIB_VERSION}/build-${TARGET}/* - ../configure ${GCC_CONFIGURE_OPTIONS} || exit 1 + eval "../configure ${GCC_CONFIGURE_OPTIONS}" || exit 1 echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" From 85b7073e730bbf510fa6c4512ae94e1c999daf7a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 19 Jul 2019 06:07:05 +0200 Subject: [PATCH 268/536] update readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0bc62b9..6e360d3 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. +## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. [![Build Status](https://travis-ci.org/jwt27/build-gcc.svg?branch=master)](https://travis-ci.org/jwt27/build-gcc) ### Upgrade notes: * 2019-06-06: `master` is now the default branch again. -### Current package versions, as of 2019-07-11: +### Current package versions, as of 2019-07-19: * gcc 9.1.0 * binutils 2.32 * gdb 8.3 -* djgpp 2.05 +* djgpp 2.05 / cvs * newlib 3.1.0 * avr-libc 2.0.0 * avrdude 6.3 From c4756c5d49b88002738065b4bbfc60bcc22f4c0e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:00:46 +0100 Subject: [PATCH 269/536] improves handling of command line parameters also adds new switches: --prefix= --target= --no-download --- build-avr.sh | 67 +++++------------------------- build-djgpp.sh | 69 +++--------------------------- build-ia16.sh | 62 +++------------------------ build-newlib.sh | 62 +++------------------------ script/download.sh | 99 ++++++++++++++++++++++++++++++++++---------- script/parse-args.sh | 34 +++++++++++++++ 6 files changed, 138 insertions(+), 255 deletions(-) create mode 100755 script/parse-args.sh diff --git a/build-avr.sh b/build-avr.sh index 7024545..00e94e8 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -2,6 +2,9 @@ source script/init.sh +PACKAGE_SOURCES="avr binutils common" +source script/parse-args.sh + TARGET="avr" prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror @@ -16,64 +19,14 @@ prepend GDB_CONFIGURE_OPTIONS "--disable-werror prepend AVRLIBC_CONFIGURE_OPTIONS "--enable-device-lib" -if [ -z $1 ]; then - echo "Usage: $0 [packages...]" - echo "Supported packages:" - ls avr/ - ls binutils/ - ls common/ - exit 1 -fi - -while [ ! -z $1 ]; do - if [ -e avr/$1 ]; then - source avr/$1 - elif [ -e binutils/$1 ]; then - source binutils/$1 - elif [ -e common/$1 ]; then - source common/$1 - else - echo "Unsupported package: $1" - exit 1 - fi - shift -done - DEPS="" - -if [ -z ${IGNORE_DEPENDENCIES} ]; then - [ ! -z ${GCC_VERSION} ] && DEPS+=" avr-libc binutils" - [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " - [ ! -z ${GDB_VERSION} ] && DEPS+=" " - [ ! -z ${AVRLIBC_VERSION} ] && DEPS+=" gcc binutils" - [ ! -z ${AVRDUDE_VERSION} ] && DEPS+=" " - [ ! -z ${AVARICE_VERSION} ] && DEPS+=" " - [ ! -z ${SIMULAVR_VERSION} ] && DEPS+=" " - - for DEP in ${DEPS}; do - case $DEP in - avr-libc) - [ -z ${AVRLIBC_VERSION} ] \ - && source avr/avr-libc - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source binutils/binutils - ;; - gcc) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ - && [ -z ${GCC_VERSION} ] \ - && source common/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - esac - done -fi +[ ! -z ${GCC_VERSION} ] && DEPS+=" avr-libc binutils" +[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " +[ ! -z ${GDB_VERSION} ] && DEPS+=" " +[ ! -z ${AVRLIBC_VERSION} ] && DEPS+=" gcc binutils" +[ ! -z ${AVRDUDE_VERSION} ] && DEPS+=" " +[ ! -z ${AVARICE_VERSION} ] && DEPS+=" " +[ ! -z ${SIMULAVR_VERSION} ] && DEPS+=" " source ${BASE}/script/download.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index ed7a836..32b2761 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -2,13 +2,15 @@ source script/init.sh +DJGPP_DOWNLOAD_BASE="http://www.mirrorservice.org/sites/ftp.delorie.com/pub" +PACKAGE_SOURCES="djgpp common" +source script/parse-args.sh + case $TARGET in *-msdosdjgpp) ;; *) TARGET="i586-pc-msdosdjgpp" ;; esac -export DJGPP_DOWNLOAD_BASE="http://www.mirrorservice.org/sites/ftp.delorie.com/pub" - prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror --disable-nls" @@ -23,68 +25,9 @@ prepend GDB_CONFIGURE_OPTIONS "--disable-werror prepend CFLAGS_FOR_TARGET "-O2" -if [ -z $1 ]; then - echo "Usage: $0 [packages...]" - echo "Supported packages:" - ls djgpp/ - ls common/ - exit 1 -fi - -while [ ! -z $1 ]; do - if [ ! -x djgpp/$1 ] && [ ! -x common/$1 ]; then - echo "Unsupported package: $1" - exit 1 - fi - - [ -e djgpp/$1 ] && source djgpp/$1 || source common/$1 - shift -done - DEPS="" - -if [ -z ${IGNORE_DEPENDENCIES} ]; then - [ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" - [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " - [ ! -z ${GDB_VERSION} ] && DEPS+=" " - [ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" - [ ! -z ${BUILD_DXEGEN} ] && DEPS+=" djgpp binutils gcc" - - for DEP in ${DEPS}; do - case $DEP in - djgpp) - [ -z ${DJGPP_VERSION} ] \ - && source djgpp/djgpp - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source djgpp/binutils - ;; - gcc) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ - && [ -z ${GCC_VERSION} ] \ - && source common/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - dxegen) - [ -z "`ls ${PREFIX}/${TARGET}/etc/dxegen-installed 2> /dev/null`" ] \ - && [ -z ${BUILD_DXEGEN} ] \ - && source djgpp/dxegen - ;; - esac - done -fi - -if [ ! -z ${GCC_VERSION} ] && [ -z ${DJCROSS_GCC_ARCHIVE} ]; then - DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" - # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. - OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} -fi +[ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" +[ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" source ${BASE}/script/download.sh diff --git a/build-ia16.sh b/build-ia16.sh index 935f1d9..3f4a13e 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -2,6 +2,9 @@ source script/init.sh +PACKAGE_SOURCES="ia16 binutils" +source script/parse-args.sh + TARGET="ia16-elf" prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror @@ -16,62 +19,9 @@ prepend GDB_CONFIGURE_OPTIONS "--disable-werror prepend NEWLIB_CONFIGURE_OPTIONS "--enable-newlib-nano-malloc --disable-newlib-multithread" -if [ -z ${TARGET} ]; then - echo "Please specify a target with: export TARGET=..." - exit 1 -fi - -if [ -z $1 ]; then - echo "Usage: $0 [packages...]" - echo "Supported packages:" - ls ia16/ - ls binutils/ - exit 1 -fi - -while [ ! -z $1 ]; do - if [ -e ia16/$1 ]; then - source ia16/$1 - elif [ -e binutils/$1 ]; then - source binutils/$1 - else - echo "Unsupported package: $1" - exit 1 - fi - shift -done - -if [ -z ${IGNORE_DEPENDENCIES} ]; then - DEPS="" - - [ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" - [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " - [ ! -z ${GDB_VERSION} ] && DEPS+=" " - [ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" - - for DEP in ${DEPS}; do - case $DEP in - newlib) - [ -z ${NEWLIB_VERSION} ] \ - && source ia16/newlib - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source ia16/binutils - ;; - gcc) - [ -z ${GCC_VERSION} ] \ - && source ia16/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - esac - done -fi +DEPS="" +[ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" +[ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" source ${BASE}/script/download.sh diff --git a/build-newlib.sh b/build-newlib.sh index e1d2379..5afdd0f 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -2,6 +2,9 @@ source script/init.sh +PACKAGE_SOURCES="newlib binutils common" +source script/parse-args.sh + prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror --disable-nls" @@ -13,64 +16,9 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls" -if [ -z ${TARGET} ]; then - echo "Please specify a target with: export TARGET=..." - exit 1 -fi - -if [ -z $1 ]; then - echo "Usage: $0 [packages...]" - echo "Supported packages:" - ls newlib/ - ls common/ - exit 1 -fi - -while [ ! -z $1 ]; do - if [ -e newlib/$1 ]; then - source newlib/$1 - elif [ -e binutils/$1 ]; then - source binutils/$1 - elif [ -e common/$1 ]; then - source common/$1 - else - echo "Unsupported package: $1" - exit 1 - fi - shift -done - DEPS="" - -if [ -z ${IGNORE_DEPENDENCIES} ]; then - [ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" - [ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " - [ ! -z ${GDB_VERSION} ] && DEPS+=" " - [ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" - - for DEP in ${DEPS}; do - case $DEP in - newlib) - [ -z ${NEWLIB_VERSION} ] \ - && source newlib/newlib - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && source binutils/binutils - ;; - gcc) - [ -z ${GCC_VERSION} ] \ - && source common/gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && source common/gdb - ;; - esac - done -fi +[ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" +[ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" source ${BASE}/script/download.sh diff --git a/script/download.sh b/script/download.sh index 02841fe..91d75bc 100755 --- a/script/download.sh +++ b/script/download.sh @@ -1,5 +1,44 @@ +if [ -z ${TARGET} ]; then + echo "Please specify a target with: export TARGET=..." + exit 1 +fi + +if [ -z ${IGNORE_DEPENDENCIES} ]; then + for DEP in ${DEPS}; do + case $DEP in + djgpp) + [ -z ${DJGPP_VERSION} ] \ + && add_pkg djgpp + ;; + newlib) + [ -z ${NEWLIB_VERSION} ] \ + && add_pkg newlib + ;; + avr-libc) + [ -z ${AVRLIBC_VERSION} ] \ + && add_pkg avr-libc + ;; + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && add_pkg binutils + ;; + gcc) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ + && [ -z ${GCC_VERSION} ] \ + && add_pkg gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && add_pkg gdb + ;; + esac + done +fi + echo "You are about to build and install:" -[ -z ${DJGPP_VERSION} ] || echo " - DJGPP base library ${DJGPP_VERSION}" +[ -z ${DJGPP_VERSION} ] || echo " - DJGPP libraries and utilities ${DJGPP_VERSION}" [ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" [ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" @@ -102,38 +141,54 @@ fi rm test-zlib 2>/dev/null rm test-zlib.exe 2>/dev/null +if [ ! -z ${GCC_VERSION} ] && [ -z ${DJCROSS_GCC_ARCHIVE} ]; then + DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" + # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. + OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} +fi + # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $NEWLIB_ARCHIVE $AVRLIBC_ARCHIVE $AVRLIBC_DOC_ARCHIVE $AVRDUDE_ARCHIVE $AVARICE_ARCHIVE" -echo "Download source files..." -mkdir -p download || exit 1 -cd download - -for ARCHIVE in $ARCHIVE_LIST; do - FILE=`basename $ARCHIVE` - if ! [ -f $FILE ]; then - echo "Download $ARCHIVE ..." - if [ ! -z $USE_WGET ]; then - DL_CMD="wget -U firefox $ARCHIVE" - else - DL_CMD="curl -f $ARCHIVE -L -o $FILE" - fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." +if [ -z ${NO_DOWNLOAD} ]; then + echo "Download source files..." + mkdir -p download || exit 1 + cd download + + for ARCHIVE in $ARCHIVE_LIST; do + FILE=`basename $ARCHIVE` + if ! [ -f $FILE ]; then + echo "Download $ARCHIVE ..." + if [ ! -z $USE_WGET ]; then + DL_CMD="wget -U firefox $ARCHIVE" else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 + DL_CMD="curl -f $ARCHIVE -L -o $FILE" + fi + echo "Command : $DL_CMD" + if ! eval $DL_CMD; then + if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then + echo "$FILE maybe moved to deleted/ directory." + else + rm $FILE + echo "Download $ARCHIVE failed." + exit 1 + fi fi fi + done + cd .. +fi + +for ARCHIVE in $ARCHIVE_LIST; do + FILE=`basename $ARCHIVE` + if ! [ -f download/$FILE ]; then + echo "Missing: $FILE" + exit 1 fi done -cd .. echo "Creating install directory: ${PREFIX}" [ -d ${PREFIX} ] || ${SUDO} mkdir -p ${PREFIX} || exit 1 diff --git a/script/parse-args.sh b/script/parse-args.sh new file mode 100755 index 0000000..8372cca --- /dev/null +++ b/script/parse-args.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env false + +if [ -z $1 ]; then + echo "Usage: $0 [packages...]" + echo "Supported packages:" + for DIR in ${PACKAGE_SOURCES}; do + ls $DIR + done + exit 1 +fi + +add_pkg() +{ + for DIR in ${PACKAGE_SOURCES}; do + if [ -e $DIR/$1 ]; then + source $DIR/$1 + return + fi + done + echo "Unsupported package: $1" + exit 1 +} + +for A in "$@"; do + case $A in + --no-download) + # assumes tar archives are already present in ./download/ + # does not prevent downloading from git sources. + NO_DOWNLOAD=y ;; + --prefix=*) PREFIX=${A#*=} ;; + --target=*) TARGET=${A#*=} ;; + *) add_pkg $A ;; + esac +done From 68ed5998fbf60048929760661be10e257e2dfafd Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:03:54 +0100 Subject: [PATCH 270/536] force creation of dxegen symlink if it already exists [fixes #8] --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 32b2761..963f01b 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -264,7 +264,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${SUDO} cp -p hostbin/exe2coff.exe $PREFIX/bin/${TARGET}-exe2coff${EXE} || exit 1 ${SUDO} cp -p hostbin/djasm.exe $PREFIX/bin/${TARGET}-djasm${EXE} || exit 1 ${SUDO} cp -p hostbin/dxegen.exe $PREFIX/bin/${TARGET}-dxegen${EXE} || exit 1 - ${SUDO} ln -s $PREFIX/bin/${TARGET}-dxegen${EXE} $PREFIX/bin/${TARGET}-dxe3gen${EXE} || exit 1 + ${SUDO} ln -fs $PREFIX/bin/${TARGET}-dxegen${EXE} $PREFIX/bin/${TARGET}-dxe3gen${EXE} || exit 1 ${SUDO} cp -p hostbin/dxe3res.exe $PREFIX/bin/${TARGET}-dxe3res${EXE} || exit 1 ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/info ${SUDO} cp -rp info/* ${PREFIX}/${TARGET}/share/info From a80fe5dac0129a036f332377c900438fc7bcf0fd Mon Sep 17 00:00:00 2001 From: Dave Holloway Date: Sat, 21 Dec 2019 22:26:25 +0100 Subject: [PATCH 271/536] Update binutils-2.32 Fixed 404 for binutils --- djgpp/binutils-2.32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djgpp/binutils-2.32 b/djgpp/binutils-2.32 index ad3bbda..573400b 100755 --- a/djgpp/binutils-2.32 +++ b/djgpp/binutils-2.32 @@ -1,4 +1,4 @@ #!/usr/bin/env bash export BINUTILS_VERSION=232 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" From fd383fecb86b744d0c619a68e1c6075db49501b4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:20:59 +0100 Subject: [PATCH 272/536] adds binutils 2.33.1 for djgpp [fixes #13] --- djgpp/binutils | 2 +- djgpp/binutils-2.33.1 | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 djgpp/binutils-2.33.1 diff --git a/djgpp/binutils b/djgpp/binutils index e27ec74..019df62 100755 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source djgpp/binutils-2.32 +source djgpp/binutils-2.33.1 diff --git a/djgpp/binutils-2.33.1 b/djgpp/binutils-2.33.1 new file mode 100755 index 0000000..8dce433 --- /dev/null +++ b/djgpp/binutils-2.33.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export BINUTILS_VERSION=2331 +export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" From 1d0e1b4ccf9fd9d1dac73099aa26500a7739752a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:21:55 +0100 Subject: [PATCH 273/536] adds binutils 2.33.1 and 2.34 --- binutils/binutils | 2 +- binutils/binutils-2.33.1 | 4 ++++ binutils/binutils-2.34 | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 binutils/binutils-2.33.1 create mode 100755 binutils/binutils-2.34 diff --git a/binutils/binutils b/binutils/binutils index 34418e3..6cdb226 100755 --- a/binutils/binutils +++ b/binutils/binutils @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source binutils/binutils-2.32 +source binutils/binutils-2.34 diff --git a/binutils/binutils-2.33.1 b/binutils/binutils-2.33.1 new file mode 100755 index 0000000..359a6ee --- /dev/null +++ b/binutils/binutils-2.33.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +BINUTILS_VERSION=2.33.1 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.34 b/binutils/binutils-2.34 new file mode 100755 index 0000000..0da32c4 --- /dev/null +++ b/binutils/binutils-2.34 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +BINUTILS_VERSION=2.34 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" From 5b4fe861a7618ff2cece22af578f889ab004c853 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:26:33 +0100 Subject: [PATCH 274/536] adds gcc 9.2.0 --- common/gcc | 2 +- common/gcc-9.2.0 | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 common/gcc-9.2.0 diff --git a/common/gcc b/common/gcc index 5e59c16..e28a7da 100755 --- a/common/gcc +++ b/common/gcc @@ -1,3 +1,3 @@ #!/usr/bin/env bash -source common/gcc-9.1.0 +source common/gcc-9.2.0 diff --git a/common/gcc-9.2.0 b/common/gcc-9.2.0 new file mode 100755 index 0000000..a1c2c7d --- /dev/null +++ b/common/gcc-9.2.0 @@ -0,0 +1,13 @@ +export GCC_VERSION=9.2.0 +export GCC_VERSION_SHORT=9.20 +export AUTOCONF_VERSION=2.69 +export AUTOMAKE_VERSION=1.15.1 + +# tarball location +export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" +export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" +export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" + +export GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" From 872d509c2dc6fa8ac00c6ed83d40de84a9d3b323 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:29:23 +0100 Subject: [PATCH 275/536] adds gdb 8.3.1 --- common/gdb | 4 +--- common/gdb-8.3.1 | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100755 common/gdb-8.3.1 diff --git a/common/gdb b/common/gdb index e810503..1a13f6d 100755 --- a/common/gdb +++ b/common/gdb @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -source common/gdb-8.3 +source common/gdb-8.3.1 diff --git a/common/gdb-8.3.1 b/common/gdb-8.3.1 new file mode 100755 index 0000000..664a40e --- /dev/null +++ b/common/gdb-8.3.1 @@ -0,0 +1,2 @@ +export GDB_VERSION=8.3.1 +export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From c0a9330bed7a1a4762e0a6aa62efbc709a28df98 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:35:17 +0100 Subject: [PATCH 276/536] update readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6e360d3..241012e 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ * 2019-06-06: `master` is now the default branch again. -### Current package versions, as of 2019-07-19: +### Current package versions, as of 2020-02-03: -* gcc 9.1.0 -* binutils 2.32 -* gdb 8.3 +* gcc 9.2.0 +* binutils 2.34 +* gdb 8.3.1 * djgpp 2.05 / cvs * newlib 3.1.0 * avr-libc 2.0.0 @@ -89,7 +89,6 @@ BINUTILS_CONFIGURE_OPTIONS= # Same, for binutils GDB_CONFIGURE_OPTIONS= # Same, for gdb NEWLIB_CONFIGURE_OPTIONS= # Same, for newlib AVRLIBC_CONFIGURE_OPTIONS= # Same, for avr-libc -DJGPP_CFLAGS= # CFLAGS for building djgpp's libc. # Misc. HOST= # The platform you are building for, when building a cross-cross compiler @@ -173,6 +172,7 @@ $PREFIX/setenv-$TARGET.bat * exe2coff * stubedit * stubify +* djasm ### Supported AVR utilities From 31ee6068ee810209f2cd8109e7d93da74c6a8474 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:41:26 +0100 Subject: [PATCH 277/536] add newlib 3.2.0 and 3.3.0 --- README.md | 2 +- newlib/newlib | 4 +--- newlib/newlib-3.2.0 | 2 ++ newlib/newlib-3.3.0 | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100755 newlib/newlib-3.2.0 create mode 100755 newlib/newlib-3.3.0 diff --git a/README.md b/README.md index 241012e..7013e14 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ * binutils 2.34 * gdb 8.3.1 * djgpp 2.05 / cvs -* newlib 3.1.0 +* newlib 3.3.0 * avr-libc 2.0.0 * avrdude 6.3 * avarice 2.13 diff --git a/newlib/newlib b/newlib/newlib index 01ecd10..89dc816 100755 --- a/newlib/newlib +++ b/newlib/newlib @@ -1,3 +1 @@ -#!/usr/bin/env bash - -source newlib/newlib-3.1.0 +source newlib/newlib-3.3.0 diff --git a/newlib/newlib-3.2.0 b/newlib/newlib-3.2.0 new file mode 100755 index 0000000..0980d04 --- /dev/null +++ b/newlib/newlib-3.2.0 @@ -0,0 +1,2 @@ +NEWLIB_VERSION=3.2.0 +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.3.0 b/newlib/newlib-3.3.0 new file mode 100755 index 0000000..5903d7d --- /dev/null +++ b/newlib/newlib-3.3.0 @@ -0,0 +1,2 @@ +NEWLIB_VERSION=3.3.0 +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" From edb5253124e3703113fe98f0170fe7ec64ab3321 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 00:45:26 +0100 Subject: [PATCH 278/536] fix travis build on ubuntu --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e403e0..42c6d05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,10 +29,10 @@ addons: - gcc-9 - g++-9 - libstdc++-9-dev - - clang-9 - - llvm-9 - - libc++-9-dev - - libc++abi-9-dev + - clang-11 + - llvm-11 + - libc++-11-dev + - libc++abi-11-dev homebrew: update: true packages: From b794df0f19d767ac06e6f95d9e29e0acb4db32ca Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 02:15:22 +0100 Subject: [PATCH 279/536] only download djcross-gcc package when building for djgpp. --- script/download.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/download.sh b/script/download.sh index 91d75bc..bb731d4 100755 --- a/script/download.sh +++ b/script/download.sh @@ -147,6 +147,11 @@ if [ ! -z ${GCC_VERSION} ] && [ -z ${DJCROSS_GCC_ARCHIVE} ]; then OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} fi +case $TARGET in +*-msdosdjgpp) ;; +*) unset DJCROSS_GCC_ARCHIVE OLD_DJCROSS_GCC_ARCHIVE ;; +esac + # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE From 95555086c1abc0d35023025fb79cfaa7790504fb Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 02:19:30 +0100 Subject: [PATCH 280/536] display status message when unpacking gcc. --- build-djgpp.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index 963f01b..6cfed55 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -146,6 +146,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi patch -p1 -u < ${BASE}/patch/patch-unpack-gcc.txt || exit 1 + echo "Unpacking gcc..." mkdir gnu/ cd gnu/ || exit 1 untar ${GCC_ARCHIVE} From cf665f9481d8ba186c145eb8fe0c0bccc3f930cc Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 21:55:12 +0100 Subject: [PATCH 281/536] fix patching unpack-gcc.sh for older versions [fixes #14] --- build-djgpp.sh | 11 ++++++++- patch/patch-unpack-gcc-4.7.3.txt | 36 ++++++++++++++++++++++++++++ patch/patch-unpack-gcc-4.8.0.txt | 41 ++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 patch/patch-unpack-gcc-4.7.3.txt create mode 100644 patch/patch-unpack-gcc-4.8.0.txt diff --git a/build-djgpp.sh b/build-djgpp.sh index 6cfed55..ba93289 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -144,7 +144,16 @@ if [ ! -z ${GCC_VERSION} ]; then # The --verbose option is not recognized by BSD patch sed -i 's/patch --verbose/patch/' unpack-gcc.sh || exit 1 fi - patch -p1 -u < ${BASE}/patch/patch-unpack-gcc.txt || exit 1 + + 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 "Unpacking gcc..." mkdir gnu/ diff --git a/patch/patch-unpack-gcc-4.7.3.txt b/patch/patch-unpack-gcc-4.7.3.txt new file mode 100644 index 0000000..99d089e --- /dev/null +++ b/patch/patch-unpack-gcc-4.7.3.txt @@ -0,0 +1,36 @@ +--- a/unpack-gcc.sh 2020-02-03 21:15:48.960456100 +0100 ++++ b/unpack-gcc.sh 2020-02-03 21:16:16.080456100 +0100 +@@ -31,24 +31,6 @@ + esac + done + +-archive=${1-gcc-$gcc_version.tar.bz2} +- +-if test "$tar_param" = "xf" ; then +- echo "Failed to detect how to decompress $archive" +- exit 1 +-fi +- +-rm -rf gnu +-mkdir gnu +- +-rm -f $top/s-sources +-( cd gnu && tar xf $top/$archive --use=`case $archive in *.gz|*.tgz) echo 'gzip';; *.bz2) echo 'bzip2';; *.xz) echo 'xz';; esac` && echo $archive >$top/s-sources ) +- +-if ! [ -f s-sources ] ; then +- echo "Cannot unpack GCC sources" +- exit 1 +-fi +- + orig_dir_name=`(cd gnu && ls -d gcc* | sed 1q; )` + + base_ver=$(cat gnu/$orig_dir_name/gcc/BASE-VER) +@@ -70,7 +52,7 @@ + short_ver_2=${short_ver_2}-$datestamp + fi + +-dir_name=gcc-$short_ver ++dir_name=gcc-$gcc_version + + if ! test "$dir_name" = "$orig_dir_name" ; then + mv -f gnu/$orig_dir_name gnu/$dir_name || exit 1 diff --git a/patch/patch-unpack-gcc-4.8.0.txt b/patch/patch-unpack-gcc-4.8.0.txt new file mode 100644 index 0000000..491f5b9 --- /dev/null +++ b/patch/patch-unpack-gcc-4.8.0.txt @@ -0,0 +1,41 @@ +--- a/unpack-gcc.sh 2020-02-03 21:17:50.083456100 +0100 ++++ b/unpack-gcc.sh 2020-02-03 21:18:18.017456100 +0100 +@@ -31,29 +31,6 @@ + esac + done + +-archive=${1-gcc-$gcc_version.tar.bz2} +- +-# +-# Detect required tar command line parameters for unpacking source archice +-# +-tar_param=xf`case $archive in *.gz|*.tgz) echo 'z';; *.bz2) echo 'j';; *.xz) echo 'J';; esac` +- +-if test "$tar_param" = "xf" ; then +- echo "Failed to detect how to decompress $archive" +- exit 1 +-fi +- +-rm -rf gnu +-mkdir gnu +- +-rm -f $top/s-sources +-( cd gnu && tar $tar_param $top/$archive && echo $archive >$top/s-sources ) +- +-if ! [ -f s-sources ] ; then +- echo "Cannot unpack GCC sources" +- exit 1 +-fi +- + orig_dir_name=`(cd gnu && ls -d gcc* | sed 1q; )` + + base_ver=$(cat gnu/$orig_dir_name/gcc/BASE-VER) +@@ -75,7 +52,7 @@ + short_ver_2=${short_ver_2}-$datestamp + fi + +-dir_name=gcc-$short_ver ++dir_name=gcc-$gcc_version + + if ! test "$dir_name" = "$orig_dir_name" ; then + mv -f gnu/$orig_dir_name gnu/$dir_name || exit 1 From 29b650895dbe43e50fe3ed282179c0d741f33f23 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 3 Feb 2020 22:27:35 +0100 Subject: [PATCH 282/536] fix simulavr build script since they switched to cmake. --- build-avr.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/build-avr.sh b/build-avr.sh index 00e94e8..9181121 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -21,12 +21,7 @@ prepend AVRLIBC_CONFIGURE_OPTIONS "--enable-device-lib" DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" avr-libc binutils" -[ ! -z ${BINUTILS_VERSION} ] && DEPS+=" " -[ ! -z ${GDB_VERSION} ] && DEPS+=" " [ ! -z ${AVRLIBC_VERSION} ] && DEPS+=" gcc binutils" -[ ! -z ${AVRDUDE_VERSION} ] && DEPS+=" " -[ ! -z ${AVARICE_VERSION} ] && DEPS+=" " -[ ! -z ${SIMULAVR_VERSION} ] && DEPS+=" " source ${BASE}/script/download.sh @@ -56,11 +51,12 @@ cd ${BASE}/build/ if [ ! -z ${SIMULAVR_VERSION} ]; then echo "Building simulavr" cd simulavr/ || exit 1 - ./bootstrap || exit 1 - #mkdir -p build-avr/ - #cd build-avr/ || exit 1 - make distclean - ./configure --prefix=${PREFIX} || exit 1 + case `uname` in + MINGW*) ;& + MSYS*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;; + esac + sed -i 's/\/bin\///' cmake/GetGitInfo.cmake + make build ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/simulavr.log echo "Installing simulavr" From 5eb67d52f8fa8102c214eefad29ad75e6463de31 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Feb 2020 02:07:59 +0100 Subject: [PATCH 283/536] patch binutils to remove dependency on byteswap.h [fixes #15] --- build-avr.sh | 11 +---- build-djgpp.sh | 7 +++- build-ia16.sh | 13 ++---- build-newlib.sh | 11 +---- patch/patch-binutils-2.33.1-swap.txt | 46 +++++++++++++++++++++ patch/patch-binutils-2.34-swap.txt | 20 +++++++++ patch/patch-djgpp-binutils-2.33.1-swap.txt | 47 ++++++++++++++++++++++ script/unpack-build-binutils.sh | 16 ++++++++ 8 files changed, 140 insertions(+), 31 deletions(-) create mode 100644 patch/patch-binutils-2.33.1-swap.txt create mode 100644 patch/patch-binutils-2.34-swap.txt create mode 100644 patch/patch-djgpp-binutils-2.33.1-swap.txt create mode 100755 script/unpack-build-binutils.sh diff --git a/build-avr.sh b/build-avr.sh index 9181121..7485076 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -33,16 +33,7 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then download_git https://git.savannah.nongnu.org/git/simulavr.git master fi -if [ ! -z ${BINUTILS_VERSION} ]; then - if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then - echo "Unpacking binutils..." - untar ${BINUTILS_ARCHIVE} || exit 1 - touch binutils-${BINUTILS_VERSION}/binutils-unpacked - fi - - cd binutils-${BINUTILS_VERSION} || exit 1 - source ${BASE}/script/build-binutils.sh -fi +source ${BASE}/script/unpack-build-binutils.sh source ${BASE}/script/build-avr-gcc.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index ba93289..a35051a 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -42,8 +42,11 @@ if [ ! -z ${BINUTILS_VERSION} ]; then echo "Unpacking binutils..." unzip -oq ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - # patch for binutils 2.27 - [ ${BINUTILS_VERSION} == 227 ] && (patch gnu/binutils-*/bfd/init.c ${BASE}/patch/patch-bnu27-bfd-init.txt || exit 1 ) + case ${BINUTILS_VERSION} in + 227) patch gnu/binutils-*/bfd/init.c ${BASE}/patch/patch-bnu27-bfd-init.txt || exit 1 ;; + 2331) patch gnu/binutils-*/libctf/swap.h ${BASE}/patch/patch-djgpp-binutils-2.33.1-swap.txt || exit 1 ;; + 234) ;; #TODO + esac touch binutils-unpacked fi diff --git a/build-ia16.sh b/build-ia16.sh index 3f4a13e..f97b0d2 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -40,17 +40,12 @@ if [ ! -z ${NEWLIB_VERSION} ]; then download_git https://github.com/tkchia/newlib-ia16.git newlib-2_4_0-ia16-tkchia fi -if [ ! -z ${BINUTILS_VERSION} ]; then - if [ "$BINUTILS_VERSION" = "ia16" ]; then - download_git https://github.com/tkchia/binutils-ia16.git binutils-ia16-tkchia - elif [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then - echo "Unpacking binutils..." - untar ${BINUTILS_ARCHIVE} || exit 1 - touch binutils-${BINUTILS_VERSION}/binutils-unpacked - fi - +if [ "$BINUTILS_VERSION" = "ia16" ]; then + download_git https://github.com/tkchia/binutils-ia16.git binutils-ia16-tkchia cd binutils-${BINUTILS_VERSION} || exit 1 source ${BASE}/script/build-binutils.sh +else + source ${BASE}/script/unpack-build-binutils.sh fi source ${BASE}/script/build-newlib-gcc.sh diff --git a/build-newlib.sh b/build-newlib.sh index 5afdd0f..f2b3a24 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -26,16 +26,7 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 -if [ ! -z ${BINUTILS_VERSION} ]; then - if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then - echo "Unpacking binutils..." - untar ${BINUTILS_ARCHIVE} || exit 1 - touch binutils-${BINUTILS_VERSION}/binutils-unpacked - fi - - cd binutils-${BINUTILS_VERSION} || exit 1 - source ${BASE}/script/build-binutils.sh -fi +source ${BASE}/script/unpack-build-binutils.sh source ${BASE}/script/build-newlib-gcc.sh diff --git a/patch/patch-binutils-2.33.1-swap.txt b/patch/patch-binutils-2.33.1-swap.txt new file mode 100644 index 0000000..497d4da --- /dev/null +++ b/patch/patch-binutils-2.33.1-swap.txt @@ -0,0 +1,46 @@ +--- swap.original.h 2020-02-04 01:52:21.137081500 +0100 ++++ swap.h 2020-02-04 01:53:00.090081500 +0100 +@@ -23,18 +23,14 @@ + #include "config.h" + #include + +-#ifdef HAVE_BYTESWAP_H +-#include +-#else +- + /* Provide our own versions of the byteswap functions. */ +-inline uint16_t ++static inline uint16_t + bswap_16 (uint16_t v) + { + return ((v >> 8) & 0xff) | ((v & 0xff) << 8); + } + +-inline uint32_t ++static inline uint32_t + bswap_32 (uint32_t v) + { + return ( ((v & 0xff000000) >> 24) +@@ -43,13 +39,13 @@ + | ((v & 0x000000ff) << 24)); + } + +-inline uint64_t ++static inline uint64_t + bswap_identity_64 (uint64_t v) + { + return v; + } + +-inline uint64_t ++static inline uint64_t + bswap_64 (uint64_t v) + { + return ( ((v & 0xff00000000000000ULL) >> 56) +@@ -61,6 +57,5 @@ + | ((v & 0x000000000000ff00ULL) << 40) + | ((v & 0x00000000000000ffULL) << 56)); + } +-#endif /* !defined(HAVE_BYTESWAP_H) */ + + #endif /* !defined(_CTF_SWAP_H) */ diff --git a/patch/patch-binutils-2.34-swap.txt b/patch/patch-binutils-2.34-swap.txt new file mode 100644 index 0000000..d69d9e8 --- /dev/null +++ b/patch/patch-binutils-2.34-swap.txt @@ -0,0 +1,20 @@ +--- swap.original.h 2020-02-04 01:56:36.717929400 +0100 ++++ swap.h 2020-02-04 01:57:35.702827300 +0100 +@@ -23,10 +23,6 @@ + #include "config.h" + #include + +-#ifdef HAVE_BYTESWAP_H +-#include +-#else +- + /* Provide our own versions of the byteswap functions. */ + static inline uint16_t + bswap_16 (uint16_t v) +@@ -61,6 +57,5 @@ + | ((v & 0x000000000000ff00ULL) << 40) + | ((v & 0x00000000000000ffULL) << 56)); + } +-#endif /* !defined(HAVE_BYTESWAP_H) */ + + #endif /* !defined(_CTF_SWAP_H) */ diff --git a/patch/patch-djgpp-binutils-2.33.1-swap.txt b/patch/patch-djgpp-binutils-2.33.1-swap.txt new file mode 100644 index 0000000..56b4e53 --- /dev/null +++ b/patch/patch-djgpp-binutils-2.33.1-swap.txt @@ -0,0 +1,47 @@ +--- swap.original.h 2020-02-04 02:01:06.703925300 +0100 ++++ swap.h 2020-02-04 02:01:35.474802100 +0100 +@@ -23,19 +23,15 @@ + #include "config.h" + #include + +-#ifdef HAVE_BYTESWAP_H +-#include +-#else +- + #ifndef __DJGPP__ + /* Provide our own versions of the byteswap functions. */ +-inline uint16_t ++static inline uint16_t + bswap_16 (uint16_t v) + { + return ((v >> 8) & 0xff) | ((v & 0xff) << 8); + } + +-inline uint32_t ++static inline uint32_t + bswap_32 (uint32_t v) + { + return ( ((v & 0xff000000) >> 24) +@@ -44,13 +40,13 @@ + | ((v & 0x000000ff) << 24)); + } + +-inline uint64_t ++static inline uint64_t + bswap_identity_64 (uint64_t v) + { + return v; + } + +-inline uint64_t ++static inline uint64_t + bswap_64 (uint64_t v) + { + return ( ((v & 0xff00000000000000ULL) >> 56) +@@ -118,6 +114,4 @@ + ) + #endif /* __DJGPP__ */ + +-#endif /* !defined(HAVE_BYTESWAP_H) */ +- + #endif /* !defined(_CTF_SWAP_H) */ diff --git a/script/unpack-build-binutils.sh b/script/unpack-build-binutils.sh new file mode 100755 index 0000000..52a8c23 --- /dev/null +++ b/script/unpack-build-binutils.sh @@ -0,0 +1,16 @@ +if [ ! -z ${BINUTILS_VERSION} ]; then + if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then + echo "Unpacking binutils..." + untar ${BINUTILS_ARCHIVE} || exit 1 + + case ${BINUTILS_VERSION} in + 2.33.1) patch binutils-${BINUTILS_VERSION}/libctf/swap.h ${BASE}/patch/patch-binutils-2.33.1-swap.txt || exit 1 ;; + 2.34) patch binutils-${BINUTILS_VERSION}/libctf/swap.h ${BASE}/patch/patch-binutils-2.34-swap.txt || exit 1 ;; + esac + + touch binutils-${BINUTILS_VERSION}/binutils-unpacked + fi + + cd binutils-${BINUTILS_VERSION} || exit 1 + source ${BASE}/script/build-binutils.sh +fi From b9cf9f8e090e2b997f2918cf19fa34d269e6819e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Feb 2020 03:03:35 +0100 Subject: [PATCH 284/536] fix installing simulavr --- build-avr.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-avr.sh b/build-avr.sh index 7485076..fdd554a 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -43,15 +43,15 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then echo "Building simulavr" cd simulavr/ || exit 1 case `uname` in - MINGW*) ;& - MSYS*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;; + MINGW*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;; esac + sed -i "s/-DCMAKE_INSTALL_PREFIX=/-DCMAKE_INSTALL_PREFIX=${PREFIX} #/" Makefile ;; sed -i 's/\/bin\///' cmake/GetGitInfo.cmake - make build - ${MAKE} -j${MAKE_JOBS} || exit 1 + ${MAKE} -j${MAKE_JOBS} build || exit 1 + ${MAKE} -j${MAKE_JOBS} doc || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/simulavr.log echo "Installing simulavr" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${SUDO} ${MAKE} -C build install || exit 1 cd ${BASE}/build/ || exit 1 fi From 6b5a0edc8f453bc255e0bf13f2f3c18e723f5a50 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Feb 2020 03:07:24 +0100 Subject: [PATCH 285/536] upgrade bash for OSX target on travis. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 42c6d05..ac2ad45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,7 @@ addons: homebrew: update: true packages: + - bash - bison - flex - curl From d7611680dc6588fc3a0827591fc6cd3d780d5d1c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Feb 2020 03:18:21 +0100 Subject: [PATCH 286/536] fix typo in build-avr.sh --- build-avr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-avr.sh b/build-avr.sh index fdd554a..9868991 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -45,7 +45,7 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then case `uname` in MINGW*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;; esac - sed -i "s/-DCMAKE_INSTALL_PREFIX=/-DCMAKE_INSTALL_PREFIX=${PREFIX} #/" Makefile ;; + sed -i "s/-DCMAKE_INSTALL_PREFIX=/-DCMAKE_INSTALL_PREFIX=${PREFIX} #/" Makefile sed -i 's/\/bin\///' cmake/GetGitInfo.cmake ${MAKE} -j${MAKE_JOBS} build || exit 1 ${MAKE} -j${MAKE_JOBS} doc || exit 1 From 924a724be022fb78faf9cf436937c9b812dea18d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Feb 2020 21:41:02 +0100 Subject: [PATCH 287/536] patch avarice to fix invalid type conversion source: https://sourceforge.net/p/avarice/bugs/24/ --- patch/patch-avarice-2.13.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patch/patch-avarice-2.13.txt b/patch/patch-avarice-2.13.txt index a4e385e..d99911e 100644 --- a/patch/patch-avarice-2.13.txt +++ b/patch/patch-avarice-2.13.txt @@ -21,3 +21,15 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ # elif __GNUC__ == 4 # if __GNUC_MINOR__ >= 6 # define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push") + +--- src/jtagrw.cc.orig 2018-06-27 21:49:14 UTC ++++ src/jtagrw.cc +@@ -131,7 +131,7 @@ uchar *jtag1::jtagRead(unsigned long add + else + numLocations = (numBytes + 1) / 2; + if (numLocations > 256) +- return false; ++ return NULL; + + command[1] = whichSpace; + command[2] = numLocations - 1; From 4d2b8fda80d6dad2916c49be46ead2598e185f75 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Feb 2020 17:38:17 +0100 Subject: [PATCH 288/536] run test builds on Github Actions. --- .github/workflows/main.yml | 57 ++++++++++++++++++++++++++++ .travis.yml | 78 -------------------------------------- README.md | 4 +- script/test.sh | 4 -- 4 files changed, 59 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..dcd5e8e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,57 @@ +name: Test builds + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest ] + env: + - + TARGET: i586-pc-msdosdjgpp + PACKAGES: binutils gcc djgpp-2.05 + - + TARGET: i586-pc-msdosdjgpp + PACKAGES: binutils gcc djgpp-cvs + - + TARGET: i586-pc-msdosdjgpp + PACKAGES: gdb + - + TARGET: arm-eabi + PACKAGES: binutils gcc newlib + - + TARGET: arm-eabi + PACKAGES: gdb + - + TARGET: avr + PACKAGES: binutils gcc avr-libc + - + TARGET: avr + PACKAGES: gdb avarice simulavr avrdude + - + TARGET: ia16-elf + PACKAGES: binutils gcc newlib + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies (ubuntu) + if: contains(matrix.os, 'ubuntu') + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-9 g++-9 + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" + export CC=gcc-9 CXX=g++-9 + - name: Install dependencies (macos) + if: contains(matrix.os, 'macos') + run: | + brew update + brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool + - name: Build + env: + TARGET: ${{ matrix.env.TARGET }} + PACKAGES: ${{ matrix.env.PACKAGES }} + run: ./script/test.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ac2ad45..0000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -os: - - linux - - osx - -dist: xenial - -language: c++ - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - packages: - - bison - - flex - - curl - - make - - texinfo - - zlib1g-dev - - tar - - bzip2 - - gzip - - xz-utils - - unzip - - dos2unix - - libtool-bin - - gcc-9 - - g++-9 - - libstdc++-9-dev - - clang-11 - - llvm-11 - - libc++-11-dev - - libc++abi-11-dev - homebrew: - update: true - packages: - - bash - - bison - - flex - - curl - - make - - texinfo - - zlib - - bzip2 - - gzip - - xz - - unzip - - dos2unix - - libtool - -compiler: - - gcc - - clang - -matrix: - exclude: - - os: linux - compiler: clang - env: TARGET=avr PACKAGES="gdb avarice simulavr avrdude" - - os: osx - env: TARGET=arm-eabi PACKAGES="binutils gcc newlib" - - os: osx - env: TARGET=avr PACKAGES="binutils gcc avr-libc" - -env: - - TARGET=i586-pc-msdosdjgpp PACKAGES="binutils gcc djgpp-2.05" - - TARGET=i586-pc-msdosdjgpp PACKAGES="binutils gcc djgpp-cvs" - - TARGET=i586-pc-msdosdjgpp PACKAGES="gdb" - - TARGET=arm-eabi PACKAGES="binutils gcc newlib" - - TARGET=arm-eabi PACKAGES="gdb" - - TARGET=avr PACKAGES="binutils gcc avr-libc" - - TARGET=avr PACKAGES="gdb avarice simulavr avrdude" -# - TARGET=ia16-elf PACKAGES="binutils gcc newlib" - -script: - - ./script/test.sh diff --git a/README.md b/README.md index 7013e14..b4ccf0b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. [![Build Status](https://travis-ci.org/jwt27/build-gcc.svg?branch=master)](https://travis-ci.org/jwt27/build-gcc) +## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. [![Build Status](https://github.com/jwt27/build-gcc/workflows/Test%20builds/badge.svg?branch=master)](https://github.com/jwt27/build-gcc/actions) ### Upgrade notes: @@ -23,7 +23,7 @@ * arm-eabi * avr -See the [build logs](https://travis-ci.org/jwt27/build-gcc) on Travis-CI for a detailed status of individual targets. +See the [Actions tab](https://github.com/jwt27/build-gcc/actions) on Github for a detailed status of individual targets. ### Requirements diff --git a/script/test.sh b/script/test.sh index 4fea330..e4e311a 100755 --- a/script/test.sh +++ b/script/test.sh @@ -3,10 +3,6 @@ set -e PREFIX="`pwd`/install" -[ $TRAVIS_OS_NAME = 'linux' ] && MAKE_JOBS=`nproc` -[ $TRAVIS_OS_NAME = 'osx' ] && MAKE_JOBS=`sysctl -n hw.ncpu` -MAKE_JOBS+=" --quiet" - CFLAGS="-w" CXXFLAGS="-w" From cd7b2a36854c5fe2a1ac2f8fd5625ab120e3e39c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Feb 2020 22:52:10 +0100 Subject: [PATCH 289/536] fix avarice patch --- patch/patch-avarice-2.13.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patch/patch-avarice-2.13.txt b/patch/patch-avarice-2.13.txt index d99911e..53573b1 100644 --- a/patch/patch-avarice-2.13.txt +++ b/patch/patch-avarice-2.13.txt @@ -22,8 +22,8 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ # if __GNUC_MINOR__ >= 6 # define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push") ---- src/jtagrw.cc.orig 2018-06-27 21:49:14 UTC -+++ src/jtagrw.cc +--- a/src/jtagrw.cc 2018-06-27 21:49:14 UTC ++++ b/src/jtagrw.cc @@ -131,7 +131,7 @@ uchar *jtag1::jtagRead(unsigned long add else numLocations = (numBytes + 1) / 2; From ff188c73354547c81634399f00d48cd58b9646f5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 02:37:49 +0100 Subject: [PATCH 290/536] change links to build status in readme. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b4ccf0b..abb0c24 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. [![Build Status](https://github.com/jwt27/build-gcc/workflows/Test%20builds/badge.svg?branch=master)](https://github.com/jwt27/build-gcc/actions) +## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. [![Build Status](https://github.com/jwt27/build-gcc/workflows/Test%20builds/badge.svg?branch=master)](https://github.com/jwt27/build-gcc/actions?query=workflow%3A"Test+builds"+branch%3Amaster) ### Upgrade notes: @@ -23,7 +23,7 @@ * arm-eabi * avr -See the [Actions tab](https://github.com/jwt27/build-gcc/actions) on Github for a detailed status of individual targets. +See the [Actions tab](https://github.com/jwt27/build-gcc/actions?query=workflow%3A"Test+builds"+branch%3Amaster) on Github for a detailed status of individual targets. ### Requirements From 4470c70eeafc9df04c6d03b202ecaf1b979de958 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Fri, 4 Oct 2019 14:16:01 +0300 Subject: [PATCH 291/536] add djgpp patches from comcom32 project --- build-djgpp.sh | 2 +- ...01-fix-handling-of-empty-environment.patch | 118 ++++++++++++++++++ ...criptor-leak-work-around-conditional.patch | 63 ++++++++++ patch/{ => djlsr205}/patch-djlsr205.txt | 0 4 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 patch/djlsr205/0001-fix-handling-of-empty-environment.patch create mode 100644 patch/djlsr205/0001-process-make-descriptor-leak-work-around-conditional.patch rename patch/{ => djlsr205}/patch-djlsr205.txt (100%) diff --git a/build-djgpp.sh b/build-djgpp.sh index a35051a..6628a60 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -75,8 +75,8 @@ if [ ! -z ${DJGPP_VERSION} ]; then unzip -uoq ../../download/djdev${DJGPP_VERSION}.zip || exit 1 unzip -uoq ../../download/djlsr${DJGPP_VERSION}.zip || exit 1 unzip -uoq ../../download/djcrx${DJGPP_VERSION}.zip || exit 1 - patch -p1 -u < ../../patch/patch-djlsr${DJGPP_VERSION}.txt || exit 1 patch -p1 -u < ../../patch/patch-djcrx${DJGPP_VERSION}.txt || exit 1 + cat ../../patch/djlsr${DJGPP_VERSION}/* | patch -p1 -u || exit 1 fi cd src diff --git a/patch/djlsr205/0001-fix-handling-of-empty-environment.patch b/patch/djlsr205/0001-fix-handling-of-empty-environment.patch new file mode 100644 index 0000000..437e203 --- /dev/null +++ b/patch/djlsr205/0001-fix-handling-of-empty-environment.patch @@ -0,0 +1,118 @@ +From 65d7caeb32f21597938f49364737789727516fdb Mon Sep 17 00:00:00 2001 +From: Stas Sergeev +Date: Sun, 4 Aug 2019 01:25:38 +0300 +Subject: [PATCH] fix handling of empty environment + +Currently if the DOS environment is empty (can happen +when starting command.com), djgpp startup produces the +corrupted environment. This patch fixes it by checking +the loop end condition before loop action. + +Another problematic case is the missing environment segment. +In this case there is no work-around, so the error msg +is printed and the program terminates. +--- + src/libc/crt0/crt1.c | 12 +++++++----- + src/stub/stub.asm | 16 +++++++++++++--- + 2 files changed, 20 insertions(+), 8 deletions(-) + +diff --git a/src/libc/crt0/crt1.c b/src/libc/crt0/crt1.c +index f0ba9919..37c7dedb 100644 +--- a/src/libc/crt0/crt1.c ++++ b/src/libc/crt0/crt1.c +@@ -128,31 +128,33 @@ char *__dos_argv0; + static void + setup_environment(void) + { +- char *dos_environ = alloca(_stubinfo->env_size), *cp; ++ char *dos_environ, *cp; + short env_selector; + int env_count=0; ++ ++ dos_environ = alloca(_stubinfo->env_size); + movedata(_stubinfo->psp_selector, 0x2c, ds, (int)&env_selector, 2); + movedata(env_selector, 0, ds, (int)dos_environ, _stubinfo->env_size); + cp = dos_environ; +- do { ++ while (*cp) { /* repeat until two NULs */ + env_count++; + while (*cp) cp++; /* skip to NUL */ + cp++; /* skip to next character */ +- } while (*cp); /* repeat until two NULs */ ++ } + _environ = (char **)malloc((env_count+1) * sizeof(char *)); + if (_environ == 0) + return; + + cp = dos_environ; + env_count = 0; +- do { ++ while (*cp) { /* repeat until two NULs */ + /* putenv assumes each string is malloc'd */ + _environ[env_count] = (char *)malloc(strlen(cp)+1); + strcpy(_environ[env_count], cp); + env_count++; + while (*cp) cp++; /* skip to NUL */ + cp++; /* skip to next character */ +- } while (*cp); /* repeat until two NULs */ ++ } + _environ[env_count] = 0; + + /* +diff --git a/src/stub/stub.asm b/src/stub/stub.asm +index 62dee9e9..76b2edd6 100644 +--- a/src/stub/stub.asm ++++ b/src/stub/stub.asm +@@ -160,13 +160,21 @@ resize_again: + ; Scan environment for "PATH=" and the stub's full name after environment + + mov es, es:[0x2c] ; get environment segment ++ mov di, es ++ or di, di ; check if no env ++ jnz @f1 ++ mov al, 111 ++ mov dx, msg_no_env ++ jmpl error ++@f1: + xor di, di ; begin search for NUL/NUL (di = 0) + ; mov cx, 0xff04 ; effectively `infinite' loop + xor al, al +- .db 0xa9 ; "test ax,...." -- skip 2 bytes ++ jmp @f1 + scan_environment: + repne + scasb ; search for NUL ++@f1: + cmpw es:[di], 0x4150 ; "PA" + jne not_path + scasw +@@ -182,6 +190,8 @@ not_path: + scasb + jne scan_environment ; no, still environment + scasw ; adjust pointer to point to prog name ++ push es ++ push di + + ;; When we are spawned from a program which has more than 20 handles in use, + ;; all the handles passed to us by DOS are taken (since only the first 20 +@@ -199,8 +209,6 @@ not_path: + ;----------------------------------------------------------------------------- + ; Get DPMI information before doing anything 386-specific + +- push es +- push di + xor cx, cx ; flag for load attempt set cx = 0 + jz @f2 ; We always jump, shorter than jmp + @b1: +@@ -828,6 +836,8 @@ msg_not_exe: + .db ": not EXE$" + msg_not_coff: + .db ": not COFF (Check for viruses)$" ++msg_no_env: ++ .db "no environment segment$" + msg_no_dpmi: + .db "no DPMI - Get csdpmi*b.zip$" + msg_no_dos_memory: +-- +2.20.1 + diff --git a/patch/djlsr205/0001-process-make-descriptor-leak-work-around-conditional.patch b/patch/djlsr205/0001-process-make-descriptor-leak-work-around-conditional.patch new file mode 100644 index 0000000..02f5343 --- /dev/null +++ b/patch/djlsr205/0001-process-make-descriptor-leak-work-around-conditional.patch @@ -0,0 +1,63 @@ +From 12d00dab0e179b4ec1c5a6a7d6e93eb907ef606d Mon Sep 17 00:00:00 2001 +From: Stas Sergeev +Date: Sat, 17 Aug 2019 19:00:10 +0300 +Subject: [PATCH] process: make descriptor leak work-around conditional + +This patch adds the __spawn_flags variable and __spawn_leak_workaround +flag to allow the software to control the leak work-around. +Previous behaviour was to always enable the work-around unless +the DPMI host is cwsdpmi. + +Without this patch it is not possible to spawn a prot-mode TSR +program like 32rtm. djgpp treats it as a leak and wipes out of +memory. With this patch things work properly if the DPMI server +is smart enough to direct the control to prev client after 32rtm +TSRed. The problem is that 32rtm just jumps to the realmode exit +addr, so the DPMI server doesn't see the exit and may get confused +unless the special logic is implemented for that case (i.e. not all +DPMI servers treat that correctly even after that patch). +--- + include/process.h | 4 ++++ + src/libc/dos/process/dosexec.c | 4 +++- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/include/process.h b/include/process.h +index 2816ce25..e57467d4 100644 +--- a/include/process.h ++++ b/include/process.h +@@ -52,6 +52,10 @@ int __djgpp_spawn(int _mode, const char *_path, char *const _argv[], char *const + #define SPAWN_EXTENSION_SRCH 1 + #define SPAWN_NO_EXTENSION_SRCH 2 + ++#define __spawn_leak_workaround 0x0001 /* free descriptor leaks */ ++ ++extern int __spawn_flags; ++ + #endif /* !_POSIX_SOURCE */ + #endif /* !__STRICT_ANSI__ */ + #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ +diff --git a/src/libc/dos/process/dosexec.c b/src/libc/dos/process/dosexec.c +index 87d7fbd9..d547a31f 100644 +--- a/src/libc/dos/process/dosexec.c ++++ b/src/libc/dos/process/dosexec.c +@@ -45,6 +45,7 @@ + extern char **_environ; + + int __dosexec_in_system = 0; ++int __spawn_flags = __spawn_leak_workaround; + + typedef struct { + unsigned short eseg; +@@ -492,7 +493,8 @@ static int direct_exec_tail (const char *program, const char *args, + /* r5 as corresponding DPMI call is supported beginning with v5. */ + + ret = __dpmi_get_capabilities(&flags, dpmi_vendor); +- if (ret == 0 && strcmp(dpmi_vendor + 2, "CWSDPMI") == 0) ++ if ((ret == 0 && strcmp(dpmi_vendor + 2, "CWSDPMI") == 0) ++ || (__spawn_flags & __spawn_leak_workaround) == 0) + workaround_descriptor_leaks = 0; + else + { +-- +2.20.1 + diff --git a/patch/patch-djlsr205.txt b/patch/djlsr205/patch-djlsr205.txt similarity index 100% rename from patch/patch-djlsr205.txt rename to patch/djlsr205/patch-djlsr205.txt From 63533b4377664d82d446a040e67cf4d65422c3cf Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Fri, 4 Oct 2019 20:15:39 +0300 Subject: [PATCH 292/536] update djgpp patch Shorten the error msg to stay in the 2K boundaries. --- patch/djlsr205/0001-fix-handling-of-empty-environment.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch/djlsr205/0001-fix-handling-of-empty-environment.patch b/patch/djlsr205/0001-fix-handling-of-empty-environment.patch index 437e203..ad8c1fc 100644 --- a/patch/djlsr205/0001-fix-handling-of-empty-environment.patch +++ b/patch/djlsr205/0001-fix-handling-of-empty-environment.patch @@ -109,7 +109,7 @@ index 62dee9e9..76b2edd6 100644 msg_not_coff: .db ": not COFF (Check for viruses)$" +msg_no_env: -+ .db "no environment segment$" ++ .db "no envseg$" msg_no_dpmi: .db "no DPMI - Get csdpmi*b.zip$" msg_no_dos_memory: From 8de879076d6391a35da1acf0350e89cb119cae13 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 00:39:13 +0100 Subject: [PATCH 293/536] add command line option: --only-download --- build-avr.sh | 10 +- build-djgpp.sh | 11 ++- build-ia16.sh | 13 ++- build-newlib.sh | 4 + script/check-deps-and-confirm.sh | 144 +++++++++++++++++++++++++++++ script/download.sh | 153 ------------------------------- script/mkdirs.sh | 9 ++ script/parse-args.sh | 6 +- 8 files changed, 187 insertions(+), 163 deletions(-) create mode 100755 script/check-deps-and-confirm.sh create mode 100755 script/mkdirs.sh diff --git a/build-avr.sh b/build-avr.sh index 9868991..42e7b51 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -23,16 +23,20 @@ DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" avr-libc binutils" [ ! -z ${AVRLIBC_VERSION} ] && DEPS+=" gcc binutils" +source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh -source ${BASE}/script/build-tools.sh - +mkdir -p ${BASE}/build cd ${BASE}/build/ || exit 1 - if [ ! -z ${SIMULAVR_VERSION} ]; then download_git https://git.savannah.nongnu.org/git/simulavr.git master fi +[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 + +source ${BASE}/script/mkdirs.sh +source ${BASE}/script/build-tools.sh + source ${BASE}/script/unpack-build-binutils.sh source ${BASE}/script/build-avr-gcc.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index 6628a60..e71b80f 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -29,8 +29,18 @@ DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" [ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" +source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh +if [ "${DJGPP_VERSION}" == "cvs" ]; then + mkdir ${BASE}/build + cd ${BASE}/build/ || exit 1 + download_git https://github.com/jwt27/djgpp-cvs.git jwt27 +fi + +[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 + +source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 @@ -65,7 +75,6 @@ cd ${BASE}/build/ || exit 1 if [ ! -z ${DJGPP_VERSION} ]; then if [ "${DJGPP_VERSION}" == "cvs" ]; then - download_git https://github.com/jwt27/djgpp-cvs.git jwt27 cd djgpp-cvs else echo "Unpacking djgpp..." diff --git a/build-ia16.sh b/build-ia16.sh index f97b0d2..38515d8 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -23,10 +23,10 @@ DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" [ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" +source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh -source ${BASE}/script/build-tools.sh - +mkdir -p ${BASE}/build cd ${BASE}/build/ || exit 1 if [ ! -z ${GCC_VERSION} ]; then @@ -42,6 +42,15 @@ fi if [ "$BINUTILS_VERSION" = "ia16" ]; then download_git https://github.com/tkchia/binutils-ia16.git binutils-ia16-tkchia +fi + +[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 + +source ${BASE}/script/mkdirs.sh +source ${BASE}/script/build-tools.sh + +cd ${BASE}/build/ || exit 1 +if [ "$BINUTILS_VERSION" = "ia16" ]; then cd binutils-${BINUTILS_VERSION} || exit 1 source ${BASE}/script/build-binutils.sh else diff --git a/build-newlib.sh b/build-newlib.sh index f2b3a24..ae90d60 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -20,8 +20,12 @@ DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" [ ! -z ${NEWLIB_VERSION} ] && DEPS+=" gcc binutils" +source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh +[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 + +source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh new file mode 100755 index 0000000..1e93f06 --- /dev/null +++ b/script/check-deps-and-confirm.sh @@ -0,0 +1,144 @@ +[ ! -z ${ONLY_DOWNLOAD} ] && return + +if [ -z ${TARGET} ]; then + echo "Please specify a target with: export TARGET=..." + exit 1 +fi + +if [ -z ${IGNORE_DEPENDENCIES} ]; then + for DEP in ${DEPS}; do + case $DEP in + djgpp) + [ -z ${DJGPP_VERSION} ] \ + && add_pkg djgpp + ;; + newlib) + [ -z ${NEWLIB_VERSION} ] \ + && add_pkg newlib + ;; + avr-libc) + [ -z ${AVRLIBC_VERSION} ] \ + && add_pkg avr-libc + ;; + binutils) + [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ + && [ -z ${BINUTILS_VERSION} ] \ + && add_pkg binutils + ;; + gcc) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ + && [ -z ${GCC_VERSION} ] \ + && add_pkg gcc + ;; + gdb) + [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ + && [ -z ${GDB_VERSION} ] \ + && add_pkg gdb + ;; + esac + done +fi + +# check required programs +REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" + +# MinGW doesn't have curl, so we use wget. +if ! which curl > /dev/null; then + USE_WGET=1 +fi + +# use curl or wget? +if [ ! -z $USE_WGET ]; then + REQ_PROG_LIST+=" wget" +else + REQ_PROG_LIST+=" curl" +fi + +for REQ_PROG in $REQ_PROG_LIST; do + if ! which $REQ_PROG > /dev/null; then + echo "$REQ_PROG not installed" + exit 1 + fi +done + +# check GNU sed is installed or not. +# It is for OSX, which doesn't ship with GNU sed. +if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then + echo GNU sed is not installed, need to download. + SED_VERSION=4.4 + SED_ARCHIVE="http://ftpmirror.gnu.org/sed/sed-${SED_VERSION}.tar.xz" +else + SED_ARCHIVE="" +fi + +# check zlib is installed +if ! ${CC} test-zlib.c -o test-zlib -lz; then + echo "zlib not installed" + exit 1 +fi +rm test-zlib 2>/dev/null +rm test-zlib.exe 2>/dev/null + +echo "You are about to build and install:" +[ -z ${DJGPP_VERSION} ] || echo " - DJGPP libraries and utilities ${DJGPP_VERSION}" +[ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" +[ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" +[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" +[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" +[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" +[ -z ${AVRLIBC_VERSION} ] || echo " - avr-libc ${AVRLIBC_VERSION}" +[ -z ${AVRDUDE_VERSION} ] || echo " - AVRDUDE ${AVRDUDE_VERSION}" +[ -z ${AVARICE_VERSION} ] || echo " - AVaRICE ${AVARICE_VERSION}" +[ -z ${SIMULAVR_VERSION} ] || echo " - SimulAVR ${SIMULAVR_VERSION}" + +echo "" +echo "With the following options:" +[ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" +echo " TARGET=${TARGET}" +echo " HOST=${HOST}" +echo " BUILD=${BUILD}" +echo " PREFIX=${PREFIX}" +echo " CC=${CC}" +echo " CXX=${CXX}" +echo " CFLAGS=${CFLAGS}" +echo " CXXFLAGS=${CXXFLAGS}" +echo " CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET}" +echo " CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET}" +echo " LDFLAGS=${LDFLAGS}" +echo " MAKE=${MAKE}" +echo " MAKE_JOBS=${MAKE_JOBS}" +echo " MAKE_CHECK=${MAKE_CHECK}" +echo " MAKE_CHECK_GCC=${MAKE_CHECK_GCC}" +if [ ! -z ${HOST} ]; then + echo " HOST_CC=`echo ${HOST_CC}`" + echo " HOST_CXX=`echo ${HOST_CXX}`" +fi +if [ ! -z ${GCC_VERSION} ]; then + echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" + echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${BINUTILS_VERSION} ]; then + echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${GDB_VERSION} ]; then + echo " GDB_CONFIGURE_OPTIONS=`echo ${GDB_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${NEWLIB_VERSION} ]; then + echo " NEWLIB_CONFIGURE_OPTIONS=`echo ${NEWLIB_CONFIGURE_OPTIONS}`" +fi +if [ ! -z ${AVRLIBC_VERSION} ]; then + echo " AVRLIBC_CONFIGURE_OPTIONS=`echo ${AVRLIBC_CONFIGURE_OPTIONS}`" +fi +echo "" + +mkdir -p ${PREFIX} + +if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then + echo "WARNING: no write access to ${PREFIX}." + echo "You may need to enter your sudo password several times during the build process." + echo "" + SUDO=sudo +fi + +echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." +read -s -n 1 diff --git a/script/download.sh b/script/download.sh index bb731d4..3cfaab4 100755 --- a/script/download.sh +++ b/script/download.sh @@ -1,146 +1,3 @@ -if [ -z ${TARGET} ]; then - echo "Please specify a target with: export TARGET=..." - exit 1 -fi - -if [ -z ${IGNORE_DEPENDENCIES} ]; then - for DEP in ${DEPS}; do - case $DEP in - djgpp) - [ -z ${DJGPP_VERSION} ] \ - && add_pkg djgpp - ;; - newlib) - [ -z ${NEWLIB_VERSION} ] \ - && add_pkg newlib - ;; - avr-libc) - [ -z ${AVRLIBC_VERSION} ] \ - && add_pkg avr-libc - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && add_pkg binutils - ;; - gcc) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ - && [ -z ${GCC_VERSION} ] \ - && add_pkg gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && add_pkg gdb - ;; - esac - done -fi - -echo "You are about to build and install:" -[ -z ${DJGPP_VERSION} ] || echo " - DJGPP libraries and utilities ${DJGPP_VERSION}" -[ -z ${NEWLIB_VERSION} ] || echo " - newlib ${NEWLIB_VERSION}" -[ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" -[ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" -[ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" -[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" -[ -z ${AVRLIBC_VERSION} ] || echo " - avr-libc ${AVRLIBC_VERSION}" -[ -z ${AVRDUDE_VERSION} ] || echo " - AVRDUDE ${AVRDUDE_VERSION}" -[ -z ${AVARICE_VERSION} ] || echo " - AVaRICE ${AVARICE_VERSION}" -[ -z ${SIMULAVR_VERSION} ] || echo " - SimulAVR ${SIMULAVR_VERSION}" - -echo "" -echo "With the following options:" -[ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" -echo " TARGET=${TARGET}" -echo " HOST=${HOST}" -echo " BUILD=${BUILD}" -echo " PREFIX=${PREFIX}" -echo " CC=${CC}" -echo " CXX=${CXX}" -echo " CFLAGS=${CFLAGS}" -echo " CXXFLAGS=${CXXFLAGS}" -echo " CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET}" -echo " CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET}" -echo " LDFLAGS=${LDFLAGS}" -echo " MAKE=${MAKE}" -echo " MAKE_JOBS=${MAKE_JOBS}" -echo " MAKE_CHECK=${MAKE_CHECK}" -echo " MAKE_CHECK_GCC=${MAKE_CHECK_GCC}" -if [ ! -z ${HOST} ]; then - echo " HOST_CC=`echo ${HOST_CC}`" - echo " HOST_CXX=`echo ${HOST_CXX}`" -fi -if [ ! -z ${GCC_VERSION} ]; then - echo " ENABLE_LANGUAGES=${ENABLE_LANGUAGES}" - echo " GCC_CONFIGURE_OPTIONS=`echo ${GCC_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${BINUTILS_VERSION} ]; then - echo " BINUTILS_CONFIGURE_OPTIONS=`echo ${BINUTILS_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${GDB_VERSION} ]; then - echo " GDB_CONFIGURE_OPTIONS=`echo ${GDB_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${NEWLIB_VERSION} ]; then - echo " NEWLIB_CONFIGURE_OPTIONS=`echo ${NEWLIB_CONFIGURE_OPTIONS}`" -fi -if [ ! -z ${AVRLIBC_VERSION} ]; then - echo " AVRLIBC_CONFIGURE_OPTIONS=`echo ${AVRLIBC_CONFIGURE_OPTIONS}`" -fi -echo "" - -mkdir -p ${PREFIX} - -if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then - echo "WARNING: no write access to ${PREFIX}." - echo "You may need to enter your sudo password several times during the build process." - echo "" - SUDO=sudo -fi - -echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." -read -s -n 1 - -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" - -# MinGW doesn't have curl, so we use wget. -if ! which curl > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 - fi -done - -# check GNU sed is installed or not. -# It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then - echo GNU sed is not installed, need to download. - SED_VERSION=4.4 - SED_ARCHIVE="http://ftpmirror.gnu.org/sed/sed-${SED_VERSION}.tar.xz" -else - SED_ARCHIVE="" -fi - -# check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then - echo "zlib not installed" - exit 1 -fi -rm test-zlib 2>/dev/null -rm test-zlib.exe 2>/dev/null - if [ ! -z ${GCC_VERSION} ] && [ -z ${DJCROSS_GCC_ARCHIVE} ]; then DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. @@ -194,13 +51,3 @@ for ARCHIVE in $ARCHIVE_LIST; do exit 1 fi done - -echo "Creating install directory: ${PREFIX}" -[ -d ${PREFIX} ] || ${SUDO} mkdir -p ${PREFIX} || exit 1 -[ -d ${PREFIX}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 - -export PATH="${PREFIX}/bin:$PATH" - -rm -rf ${BASE}/tests -mkdir -p ${BASE}/tests -mkdir -p ${BASE}/build diff --git a/script/mkdirs.sh b/script/mkdirs.sh new file mode 100755 index 0000000..7e209f3 --- /dev/null +++ b/script/mkdirs.sh @@ -0,0 +1,9 @@ +echo "Creating install directory: ${PREFIX}" +[ -d ${PREFIX} ] || ${SUDO} mkdir -p ${PREFIX} || exit 1 +[ -d ${PREFIX}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 + +export PATH="${PREFIX}/bin:$PATH" + +rm -rf ${BASE}/tests +mkdir -p ${BASE}/tests +mkdir -p ${BASE}/build diff --git a/script/parse-args.sh b/script/parse-args.sh index 8372cca..f08326d 100755 --- a/script/parse-args.sh +++ b/script/parse-args.sh @@ -23,10 +23,8 @@ add_pkg() for A in "$@"; do case $A in - --no-download) - # assumes tar archives are already present in ./download/ - # does not prevent downloading from git sources. - NO_DOWNLOAD=y ;; + --no-download) NO_DOWNLOAD=y ;; + --only-download) ONLY_DOWNLOAD=y ;; --prefix=*) PREFIX=${A#*=} ;; --target=*) TARGET=${A#*=} ;; *) add_pkg $A ;; From 62e5c872262b644e658ea7d66a4effdbcc910a12 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 02:41:36 +0100 Subject: [PATCH 294/536] make --no-download also apply to git clones. --- script/init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/init.sh b/script/init.sh index 04f658f..840fc21 100755 --- a/script/init.sh +++ b/script/init.sh @@ -62,6 +62,7 @@ prepend() { eval "$1=\"$2 ${!1}\""; } download_git() { + [ ! -z ${NO_DOWNLOAD} ] && return local repo=$(basename $1) repo=${repo%.*} echo "Downloading ${repo}..." From d4afd7741b9ffb7c71c9deb911bc159c7127f9c8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 04:13:39 +0100 Subject: [PATCH 295/536] move misc files from root directory to script/ --- script/check-deps-and-confirm.sh | 2 +- script/finalize.sh | 6 ++---- hello-cpp.cpp => script/hello-cpp.cpp | 0 hello.c => script/hello.c | 0 test-zlib.c => script/test-zlib.c | 0 5 files changed, 3 insertions(+), 5 deletions(-) rename hello-cpp.cpp => script/hello-cpp.cpp (100%) rename hello.c => script/hello.c (100%) rename test-zlib.c => script/test-zlib.c (100%) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 1e93f06..e7aa8c8 100755 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -72,7 +72,7 @@ else fi # check zlib is installed -if ! ${CC} test-zlib.c -o test-zlib -lz; then +if ! ${CC} ${BASE}/script/test-zlib.c -o test-zlib -lz; then echo "zlib not installed" exit 1 fi diff --git a/script/finalize.sh b/script/finalize.sh index f9b2087..99ed762 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -35,18 +35,16 @@ echo "Installing setenv-${TARGET}" ${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null -cd ${BASE}/build - for x in $(echo $ENABLE_LANGUAGES | tr "," " ") do case $x in c++) echo "Testing C++ compiler: " - ($PREFIX/bin/${TARGET}-c++ ../hello-cpp.cpp -o hello-cpp && echo "PASS") || echo "FAIL" + ($PREFIX/bin/${TARGET}-c++ ${BASE}/script/hello-cpp.cpp -o hello-cpp && echo "PASS") || echo "FAIL" ;; c) echo "Testing C compiler: " - ($PREFIX/bin/${TARGET}-gcc ../hello.c -o hello && echo "PASS") || echo "FAIL" + ($PREFIX/bin/${TARGET}-gcc ${BASE}/script/hello.c -o hello && echo "PASS") || echo "FAIL" ;; esac done diff --git a/hello-cpp.cpp b/script/hello-cpp.cpp similarity index 100% rename from hello-cpp.cpp rename to script/hello-cpp.cpp diff --git a/hello.c b/script/hello.c similarity index 100% rename from hello.c rename to script/hello.c diff --git a/test-zlib.c b/script/test-zlib.c similarity index 100% rename from test-zlib.c rename to script/test-zlib.c From 938427cc2268c3053639d97a07537877587b8109 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 14:08:09 +0100 Subject: [PATCH 296/536] check if curl/wget is installed when --only-download is given. skip this for --no-download. --- script/check-deps-and-confirm.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index e7aa8c8..1e9450d 100755 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -1,3 +1,14 @@ +if [ -z ${NO_DOWNLOAD} ]; then + # MinGW32 doesn't have curl, so we use wget. + if ! which curl > /dev/null; then + USE_WGET=1 + if ! which wget > /dev/null; then + echo "curl or wget not installed" + exit 1 + fi + fi +fi + [ ! -z ${ONLY_DOWNLOAD} ] && return if [ -z ${TARGET} ]; then @@ -42,18 +53,6 @@ fi # check required programs REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" -# MinGW doesn't have curl, so we use wget. -if ! which curl > /dev/null; then - USE_WGET=1 -fi - -# use curl or wget? -if [ ! -z $USE_WGET ]; then - REQ_PROG_LIST+=" wget" -else - REQ_PROG_LIST+=" curl" -fi - for REQ_PROG in $REQ_PROG_LIST; do if ! which $REQ_PROG > /dev/null; then echo "$REQ_PROG not installed" @@ -63,7 +62,7 @@ done # check GNU sed is installed or not. # It is for OSX, which doesn't ship with GNU sed. -if ! sed --version 2>/dev/null |grep "GNU sed" > /dev/null ;then +if ! sed --version 2>/dev/null | grep "GNU sed" > /dev/null ;then echo GNU sed is not installed, need to download. SED_VERSION=4.4 SED_ARCHIVE="http://ftpmirror.gnu.org/sed/sed-${SED_VERSION}.tar.xz" From 16ee10da71c4cf7f4076922fcf28993bccf3e006 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 14:32:35 +0100 Subject: [PATCH 297/536] only test compilers if gcc is successfully installed. --- script/finalize.sh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 99ed762..b365d88 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -35,19 +35,21 @@ echo "Installing setenv-${TARGET}" ${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null -for x in $(echo $ENABLE_LANGUAGES | tr "," " ") -do - case $x in - c++) - echo "Testing C++ compiler: " - ($PREFIX/bin/${TARGET}-c++ ${BASE}/script/hello-cpp.cpp -o hello-cpp && echo "PASS") || echo "FAIL" - ;; - c) - echo "Testing C compiler: " - ($PREFIX/bin/${TARGET}-gcc ${BASE}/script/hello.c -o hello && echo "PASS") || echo "FAIL" - ;; - esac -done +if [ ! -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ]; then + for x in $(echo $ENABLE_LANGUAGES | tr "," " ") + do + case $x in + c++) + echo "Testing C++ compiler: " + ($PREFIX/bin/${TARGET}-c++ ${BASE}/script/hello-cpp.cpp -o hello-cpp && echo "PASS") || echo "FAIL" + ;; + c) + echo "Testing C compiler: " + ($PREFIX/bin/${TARGET}-gcc ${BASE}/script/hello.c -o hello && echo "PASS") || echo "FAIL" + ;; + esac + done +fi echo "Done." echo "To remove temporary build files, use: rm -rf build/" From 819df8a22e85677cc991428a32324b70d324569d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 14:30:27 +0100 Subject: [PATCH 298/536] move setenv script to $PREFIX/bin/setenv-$TARGET --- script/finalize.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index b365d88..7dd2baf 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -11,14 +11,14 @@ echo "Copy long name executables to short name." ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} ) -cat << STOP > ${BASE}/build/setenv-${TARGET} +cat << STOP > ${BASE}/build/${TARGET}-setenv export PATH="${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH" export GCC_EXEC_PREFIX="${PREFIX}/lib/gcc/" export MANPATH="${PREFIX}/${TARGET}/share/man:${PREFIX}/share/man:\$MANPATH" export INFOPATH="${PREFIX}/${TARGET}/share/info:${PREFIX}/share/info:\$INFOPATH" STOP -cat << STOP > ${BASE}/build/setenv-${TARGET}.bat +cat << STOP > ${BASE}/build/${TARGET}-setenv.bat @echo off PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH% set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\ @@ -26,14 +26,18 @@ STOP case $TARGET in *-msdosdjgpp) - echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${BASE}/build/setenv-${TARGET} - echo "set DJDIR=%~dp0${TARGET}" >> ${BASE}/build/setenv-${TARGET}.bat + echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${BASE}/build/${TARGET}-setenv + echo "set DJDIR=%~dp0${TARGET}" >> ${BASE}/build/${TARGET}-setenv.bat ;; esac -echo "Installing setenv-${TARGET}" -${SUDO} cp ${BASE}/build/setenv-${TARGET} ${PREFIX}/ -cp ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/ 2> /dev/null +echo "Installing ${TARGET}-setenv" +chmod +x ${BASE}/build/${TARGET}-setenv +${SUDO} cp -p ${BASE}/build/${TARGET}-setenv ${PREFIX}/bin/ +case `uname` in +MINGW*) ;& +MSYS*) cp -p ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/bin/ 2> /dev/null ;; +esac if [ ! -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ]; then for x in $(echo $ENABLE_LANGUAGES | tr "," " ") From 1f605ff9a9f8292c542e2ca66327cb23e09ef9f2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 18:44:22 +0100 Subject: [PATCH 299/536] add options: --ignore-dependencies and --batch --- script/build-avr-gcc.sh | 4 ++-- script/build-binutils.sh | 2 +- script/build-gdb.sh | 2 +- script/build-newlib-gcc.sh | 4 ++-- script/check-deps-and-confirm.sh | 7 +++++-- script/parse-args.sh | 2 ++ 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index aeafe08..92080ea 100755 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -51,7 +51,7 @@ if [ ! -z ${GCC_VERSION} ]; then echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 + [ -z ${BUILD_BATCH} ] && sleep 5 fi ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 @@ -77,7 +77,7 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then echo ${AVRLIBC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: avr-libc already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 + [ -z ${BUILD_BATCH} ] && sleep 5 fi ${MAKE} -j${MAKE_JOBS} || exit 1 diff --git a/script/build-binutils.sh b/script/build-binutils.sh index c10f97b..d624df5 100755 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -12,7 +12,7 @@ if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${BINUTILS_CONFI echo ${BINUTILS_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: binutils already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 + [ -z ${BUILD_BATCH} ] && sleep 5 fi case $TARGET in diff --git a/script/build-gdb.sh b/script/build-gdb.sh index d353171..421f4f9 100755 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -21,7 +21,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo ${GDB_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 + [ -z ${BUILD_BATCH} ] && sleep 5 fi ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gdb.log diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index e702db3..66308d7 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -44,7 +44,7 @@ if [ ! -z ${GCC_VERSION} ]; then echo ${GCC_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: gcc already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 + [ -z ${BUILD_BATCH} ] && sleep 5 fi ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 @@ -70,7 +70,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix else echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" - sleep 5 + [ -z ${BUILD_BATCH} ] && sleep 5 fi ${MAKE} -j${MAKE_JOBS} || exit 1 diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 1e9450d..9c3406b 100755 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -134,10 +134,13 @@ mkdir -p ${PREFIX} if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then echo "WARNING: no write access to ${PREFIX}." + [ ! -z ${BUILD_BATCH} ] && exit 1 echo "You may need to enter your sudo password several times during the build process." echo "" SUDO=sudo fi -echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." -read -s -n 1 +if [ -z ${BUILD_BATCH} ]; then + echo "If you wish to change anything, press CTRL-C now. Otherwise, press any other key to continue." + read -s -n 1 +fi diff --git a/script/parse-args.sh b/script/parse-args.sh index f08326d..bc4c224 100755 --- a/script/parse-args.sh +++ b/script/parse-args.sh @@ -25,6 +25,8 @@ for A in "$@"; do case $A in --no-download) NO_DOWNLOAD=y ;; --only-download) ONLY_DOWNLOAD=y ;; + --ignore-dependencies) IGNORE_DEPENDENCIES=y ;; + --batch) BUILD_BATCH=y ;; --prefix=*) PREFIX=${A#*=} ;; --target=*) TARGET=${A#*=} ;; *) add_pkg $A ;; From b3124a6fe81927c0eda975719e13b6d6af3f61f4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 18:55:52 +0100 Subject: [PATCH 300/536] document command line options --prefix and --target --- README.md | 4 ++-- script/check-deps-and-confirm.sh | 2 +- script/parse-args.sh | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index abb0c24..ebffd76 100644 --- a/README.md +++ b/README.md @@ -78,8 +78,8 @@ pacman -Syuu base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-curl mingw-w Several environment variables control the build process. Usually you only need to specify `TARGET`. Here is the full list: ``` # Primary build options: -TARGET= # Target name. -PREFIX= # Install location. +TARGET= # Target name. (deprecated, use option --target=[...]) +PREFIX= # Install location. (deprecated, use option --prefix=[...]) ENABLE_LANGUAGES= # Comma-separated list of languages to build compilers for. # Advanced build options: diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 9c3406b..8b42552 100755 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -12,7 +12,7 @@ fi [ ! -z ${ONLY_DOWNLOAD} ] && return if [ -z ${TARGET} ]; then - echo "Please specify a target with: export TARGET=..." + echo "Please specify a target with: --target=..." exit 1 fi diff --git a/script/parse-args.sh b/script/parse-args.sh index bc4c224..dec88ed 100755 --- a/script/parse-args.sh +++ b/script/parse-args.sh @@ -1,7 +1,10 @@ #!/usr/bin/env false if [ -z $1 ]; then - echo "Usage: $0 [packages...]" + echo "Usage: $0 [options...] [packages...]" + echo "Supported options:" + echo " --prefix=[...]" + echo " --target=[...]" echo "Supported packages:" for DIR in ${PACKAGE_SOURCES}; do ls $DIR From 0c4e8b52f45257c5d23dcc8f5420221b329d534e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 22:09:13 +0100 Subject: [PATCH 301/536] test c++ compiler with c file so it doesn't rely on --- script/finalize.sh | 2 +- script/hello-cpp.cpp | 8 -------- script/hello.c | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 script/hello-cpp.cpp diff --git a/script/finalize.sh b/script/finalize.sh index 7dd2baf..4941a45 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -45,7 +45,7 @@ if [ ! -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ]; then case $x in c++) echo "Testing C++ compiler: " - ($PREFIX/bin/${TARGET}-c++ ${BASE}/script/hello-cpp.cpp -o hello-cpp && echo "PASS") || echo "FAIL" + ($PREFIX/bin/${TARGET}-c++ ${BASE}/script/hello.c -o hello && echo "PASS") || echo "FAIL" ;; c) echo "Testing C compiler: " diff --git a/script/hello-cpp.cpp b/script/hello-cpp.cpp deleted file mode 100644 index cce843c..0000000 --- a/script/hello-cpp.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include -using namespace std; -int main() -{ - printf("Hello world from C.\n"); - cout << "Hello world from C++." << endl; -} diff --git a/script/hello.c b/script/hello.c index e4344f8..6ae766e 100644 --- a/script/hello.c +++ b/script/hello.c @@ -1,5 +1,5 @@ #include int main() { - printf("Hello world from C.\n"); + printf("Hello world.\n"); } From 223a389ae4ae409d6fbe0f7d57ee429213a918b9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 5 Feb 2020 22:11:35 +0100 Subject: [PATCH 302/536] fail if c compiler does not work. --- script/finalize.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/finalize.sh b/script/finalize.sh index 4941a45..391b16b 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -49,7 +49,12 @@ if [ ! -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ]; then ;; c) echo "Testing C compiler: " - ($PREFIX/bin/${TARGET}-gcc ${BASE}/script/hello.c -o hello && echo "PASS") || echo "FAIL" + if $PREFIX/bin/${TARGET}-gcc ${BASE}/script/hello.c -o hello; then + echo "PASS" + else + echo "FAIL" + exit 1 + fi ;; esac done From b3df3dc5f611a5260f28fd2f4e6b4702e44b30e4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Feb 2020 20:38:59 +0100 Subject: [PATCH 303/536] reset and checkout git repos even if --no-download is given. --- script/init.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/init.sh b/script/init.sh index 840fc21..6dca9c1 100755 --- a/script/init.sh +++ b/script/init.sh @@ -62,14 +62,15 @@ prepend() { eval "$1=\"$2 ${!1}\""; } download_git() { - [ ! -z ${NO_DOWNLOAD} ] && return local repo=$(basename $1) repo=${repo%.*} - echo "Downloading ${repo}..." - [ -d $repo ] || git clone $1 --depth 1 $([ "$2" != "" ] && echo "--branch $2") + if [ -z ${NO_DOWNLOAD} ]; then + echo "Downloading ${repo}..." + [ -d $repo ] || git clone $1 --depth 1 $([ "$2" != "" ] && echo "--branch $2") + fi cd $repo || exit 1 git reset --hard HEAD git checkout $2 - git pull || exit 1 + [ -z ${NO_DOWNLOAD} ] && (git pull || exit 1) cd .. } From 8ebaf3b1f5a101f86a39ae2a52e6b19e3e712791 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Feb 2020 20:35:54 +0100 Subject: [PATCH 304/536] rebuild djgpp if configuration parameters change. --- build-djgpp.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index e71b80f..53ce7c5 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -92,6 +92,9 @@ if [ ! -z ${DJGPP_VERSION} ]; then unset COMSPEC sed -i "50cCROSS_PREFIX = ${TARGET}-" makefile.def sed -i "61cGCC = \$(CC) -g -O2 ${CFLAGS}" makefile.def + if [ -e configure-options ] && [ ! "`cat configure-options 2> /dev/null`" == "${TARGET}:${PREFIX}:${CFLAGS_FOR_TARGET}" ]; then + ${MAKE} -j${MAKE_JOBS} clean + fi ${MAKE} misc.exe makemake.exe ../hostbin || exit 1 ${MAKE} -C djasm native || exit 1 ${MAKE} -C stub native || exit 1 @@ -238,6 +241,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then export CFLAGS="$CFLAGS_FOR_TARGET" sed -i 's/Werror/Wno-error/' makefile.cfg ${MAKE} config || exit 1 + echo "${TARGET}:${PREFIX}:${CFLAGS_FOR_TARGET}" > configure-options ${MAKE} -j${MAKE_JOBS} -C mkdoc || exit 1 ${MAKE} -j${MAKE_JOBS} -C libc || exit 1 From 542cb8bb2ed19f9ecb334d7546b882a969c41564 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Feb 2020 03:17:54 +0100 Subject: [PATCH 305/536] download and unpack gcc dependencies separately --- build-djgpp.sh | 22 +++++++++++++--------- common/gcc-9.2.0 | 20 ++++++++++---------- ia16/gcc | 11 ++++++----- script/build-avr-gcc.sh | 19 ++++++++++++------- script/build-newlib-gcc.sh | 19 ++++++++++++------- script/download.sh | 15 ++++++++++++++- 6 files changed, 67 insertions(+), 39 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 53ce7c5..4f34dc6 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -187,15 +187,19 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR/ - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gnu/gcc-${GCC_VERSION} || exit 1 - sed -i 's/ftp/http/' contrib/download_prerequisites - ./contrib/download_prerequisites || exit 1 - - # apply extra patches if necessary - [ -e ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt ] && patch -p 1 -u -i ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt - cd - + echo "Unpacking gcc dependencies" + ( + cd gnu/gcc-${GCC_VERSION} || exit 1 + + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + FILE=`basename $URL` + untar ${FILE} + mv ${FILE%.*.*} ${FILE%%-*} + done + + # apply extra patches if necessary + [ -e ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt ] && patch -p 1 -u -i ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt + ) touch gcc-unpacked else diff --git a/common/gcc-9.2.0 b/common/gcc-9.2.0 index a1c2c7d..c6cae26 100755 --- a/common/gcc-9.2.0 +++ b/common/gcc-9.2.0 @@ -1,13 +1,13 @@ -export GCC_VERSION=9.2.0 -export GCC_VERSION_SHORT=9.20 -export AUTOCONF_VERSION=2.69 -export AUTOMAKE_VERSION=1.15.1 +GCC_VERSION=9.2.0 +GCC_VERSION_SHORT=9.20 +AUTOCONF_VERSION=2.69 +AUTOMAKE_VERSION=1.15.1 # tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +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" -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/ia16/gcc b/ia16/gcc index 205f249..10b32f4 100755 --- a/ia16/gcc +++ b/ia16/gcc @@ -1,8 +1,9 @@ #!/usr/bin/env bash -export GCC_VERSION="ia16" +GCC_VERSION="ia16" +ISL_VERSION=0.15 -export GCC_CONFIGURE_OPTIONS="--disable-plugin - --enable-lto - --disable-libstdcxx-dual-abi - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin + --enable-lto + --disable-libstdcxx-dual-abi + ${GCC_CONFIGURE_OPTIONS}" diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 92080ea..5c7a3c6 100755 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -23,13 +23,18 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Unpacking gcc..." untar ${GCC_ARCHIVE} - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gcc-${GCC_VERSION}/ - sed -i 's/ftp/http/' contrib/download_prerequisites - ./contrib/download_prerequisites - touch gcc-unpacked - cd - + echo "Unpacking gcc dependencies" + ( + cd gcc-${GCC_VERSION} || exit 1 + + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + FILE=`basename $URL` + untar ${FILE} + mv ${FILE%.*.*} ${FILE%%-*} + done + + touch gcc-unpacked + ) fi echo "Building gcc (stage 1)" diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 66308d7..9c7379b 100755 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -13,13 +13,18 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Unpacking gcc..." untar ${GCC_ARCHIVE} - # download mpc/gmp/mpfr/isl libraries - echo "Downloading gcc dependencies" - cd gcc-${GCC_VERSION}/ - sed -i 's/ftp/http/' contrib/download_prerequisites - ./contrib/download_prerequisites - touch gcc-unpacked - cd - + echo "Unpacking gcc dependencies" + ( + cd gcc-${GCC_VERSION} || exit 1 + + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + FILE=`basename $URL` + untar ${FILE} + mv ${FILE%.*.*} ${FILE%%-*} + done + + touch gcc-unpacked + ) else echo "gcc already unpacked, skipping." fi diff --git a/script/download.sh b/script/download.sh index 3cfaab4..5d0069f 100755 --- a/script/download.sh +++ b/script/download.sh @@ -9,11 +9,24 @@ case $TARGET in *) unset DJCROSS_GCC_ARCHIVE OLD_DJCROSS_GCC_ARCHIVE ;; esac +if [ ! -z ${GCC_VERSION} ]; then + GMP_VERSION=${GMP_VERSION:-6.2.0} + MPFR_VERSION=${MPFR_VERSION:-4.0.2} + MPC_VERSION=${MPC_VERSION:-1.1.0} + ISL_VERSION=${ISL_VERSION:-0.21} + + GMP_ARCHIVE="http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" + MPFR_ARCHIVE="http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz" + MPC_ARCHIVE="http://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz" + ISL_ARCHIVE="http://isl.gforge.inria.fr/isl-${ISL_VERSION}.tar.xz" +fi + # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE $AUTOCONF_ARCHIVE $AUTOMAKE_ARCHIVE $GDB_ARCHIVE $NEWLIB_ARCHIVE - $AVRLIBC_ARCHIVE $AVRLIBC_DOC_ARCHIVE $AVRDUDE_ARCHIVE $AVARICE_ARCHIVE" + $AVRLIBC_ARCHIVE $AVRLIBC_DOC_ARCHIVE $AVRDUDE_ARCHIVE $AVARICE_ARCHIVE + $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE" if [ -z ${NO_DOWNLOAD} ]; then echo "Download source files..." From 9c04f208ebe8a9238538f34da72808e523504c70 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 7 Feb 2020 03:57:44 +0100 Subject: [PATCH 306/536] add option --enable-languages=... --- script/parse-args.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/parse-args.sh b/script/parse-args.sh index dec88ed..bc98727 100755 --- a/script/parse-args.sh +++ b/script/parse-args.sh @@ -5,6 +5,7 @@ if [ -z $1 ]; then echo "Supported options:" echo " --prefix=[...]" echo " --target=[...]" + echo " --enable-languages=[...]" echo "Supported packages:" for DIR in ${PACKAGE_SOURCES}; do ls $DIR @@ -20,7 +21,7 @@ add_pkg() return fi done - echo "Unsupported package: $1" + echo "Unrecognized option or invalid package: $1" exit 1 } @@ -32,6 +33,7 @@ for A in "$@"; do --batch) BUILD_BATCH=y ;; --prefix=*) PREFIX=${A#*=} ;; --target=*) TARGET=${A#*=} ;; + --enable-languages=*) ENABLE_LANGUAGES=${A#*=} ;; *) add_pkg $A ;; esac done From adc6288343d28e748fea75236527f1958dcf08b3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 7 Feb 2020 04:35:18 +0100 Subject: [PATCH 307/536] fix setenv script for windows cmd, as it is now moved to $PREFIX/bin/. rename to setenv.cmd. --- script/finalize.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 391b16b..0794dbc 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -18,16 +18,16 @@ export MANPATH="${PREFIX}/${TARGET}/share/man:${PREFIX}/share/man:\$MANPATH" export INFOPATH="${PREFIX}/${TARGET}/share/info:${PREFIX}/share/info:\$INFOPATH" STOP -cat << STOP > ${BASE}/build/${TARGET}-setenv.bat +cat << STOP > ${BASE}/build/${TARGET}-setenv.cmd @echo off -PATH=%~dp0${TARGET}\\bin;%~dp0bin;%PATH% -set GCC_EXEC_PREFIX=%~dp0lib\\gcc\\ +PATH=%~dp0..\\${TARGET}\\bin;%~dp0..\\bin;%PATH% +set GCC_EXEC_PREFIX=%~dp0..\\lib\\gcc\\ STOP case $TARGET in *-msdosdjgpp) echo "export DJDIR=\"${PREFIX}/${TARGET}\"" >> ${BASE}/build/${TARGET}-setenv - echo "set DJDIR=%~dp0${TARGET}" >> ${BASE}/build/${TARGET}-setenv.bat + echo "set DJDIR=%~dp0..\\${TARGET}" >> ${BASE}/build/${TARGET}-setenv.cmd ;; esac @@ -36,7 +36,7 @@ chmod +x ${BASE}/build/${TARGET}-setenv ${SUDO} cp -p ${BASE}/build/${TARGET}-setenv ${PREFIX}/bin/ case `uname` in MINGW*) ;& -MSYS*) cp -p ${BASE}/build/setenv-${TARGET}.bat ${PREFIX}/bin/ 2> /dev/null ;; +MSYS*) cp -p ${BASE}/build/setenv-${TARGET}.cmd ${PREFIX}/bin/ 2> /dev/null ;; esac if [ ! -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ]; then From b7f18332b60c4820f4a4ad0079c8a0b43ffc82f0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 7 Feb 2020 04:36:20 +0100 Subject: [PATCH 308/536] warn user if setenv script is not called with source. --- script/finalize.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/finalize.sh b/script/finalize.sh index 0794dbc..db3b828 100755 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -12,6 +12,11 @@ echo "Copy long name executables to short name." ) cat << STOP > ${BASE}/build/${TARGET}-setenv +if ! (return 2> /dev/null); then + echo "This script must be executed with 'source' to set environment variables:" + echo "source \$0" + exit 1 +fi export PATH="${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH" export GCC_EXEC_PREFIX="${PREFIX}/lib/gcc/" export MANPATH="${PREFIX}/${TARGET}/share/man:${PREFIX}/share/man:\$MANPATH" From e79cb7603df299490911b6de519787b979663e0b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 7 Feb 2020 04:36:42 +0100 Subject: [PATCH 309/536] update readme --- README.md | 100 +++++++++++++++++++++++++----------------------------- 1 file changed, 46 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index ebffd76..58f1c62 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ### Upgrade notes: +* 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 2020-02-03: @@ -18,7 +19,7 @@ ### Tested targets: -* *-pc-msdosdjgpp +* i586-pc-msdosdjgpp * ia16 * arm-eabi * avr @@ -49,48 +50,52 @@ Depending on your system, installation procedure maybe different. On Debian/Ubuntu, you can install these programs by : -``` +```sh sudo apt-get update sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip ``` Fedora : -``` +```sh sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip ``` MinGW : -``` +```sh mingw-get update mingw-get install msys-unzip libz-dev msys-wget msys-bison msys-flex msys-patch ``` MinGW64 (msys2) : -``` +```sh pacman -Syuu base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-curl mingw-w64-x86_64-zlib compression ``` ### Configuration -Several environment variables control the build process. Usually you only need to specify `TARGET`. Here is the full list: +The following command line options are recognized: +```sh + --prefix=... # Install location (default: /usr/local/cross) + --target=... # Target name + --enable-languages=... # Comma-separated list of languages to build compilers for (default: c,c++) + --no-download # Do not download any files + --only-download # Download source files, then exit + --ignore-dependencies # Do not check package dependencies + --batch # Run in batch mode (will not prompt or delay to confirm settings) ``` -# Primary build options: -TARGET= # Target name. (deprecated, use option --target=[...]) -PREFIX= # Install location. (deprecated, use option --prefix=[...]) -ENABLE_LANGUAGES= # Comma-separated list of languages to build compilers for. -# Advanced build options: +Several environment variables also control the build process: +```sh MAKE_JOBS= # Number of parallel build threads (auto-detected) GCC_CONFIGURE_OPTIONS= # Extra options to pass to gcc's ./configure BINUTILS_CONFIGURE_OPTIONS= # Same, for binutils GDB_CONFIGURE_OPTIONS= # Same, for gdb NEWLIB_CONFIGURE_OPTIONS= # Same, for newlib AVRLIBC_CONFIGURE_OPTIONS= # Same, for avr-libc - -# Misc. +CFLAGS_FOR_TARGET= # CFLAGS used to build target libraries HOST= # The platform you are building for, when building a cross-cross compiler BUILD= # The platform you are building on (auto-detected) MAKE_CHECK= # Run test suites on built programs. @@ -100,71 +105,58 @@ MAKE_CHECK_GCC= # Run gcc test suites. ### Building Pick the script you want to use: -``` -build-glibc.sh # builds a toolchain with glibc (gcc's default standard library) -build-djgpp.sh # builds a toolchain with the djgpp standard library (fixed TARGET: i586-pc-msdosdjgpp) -build-newlib.sh # builds a toolchain with the newlib standard library -build-ia16.sh # builds a toolchain with the newlib standard library (fixed TARGET: ia16-elf) +```sh +build-djgpp.sh # builds a toolchain targeting djgpp (default TARGET: i586-pc-msdosdjgpp) +build-newlib.sh # builds a toolchain with the newlib C library +build-ia16.sh # builds a toolchain targeting 8086 processors, with the newlib C library (fixed TARGET: ia16-elf) +build-avr.sh # builds a toolchain targeting AVR microcontrollers (fixed TARGET: avr) ``` To build DJGPP, just run: -``` -./build-djgpp.sh [packages...] +```sh +./build-djgpp.sh [options...] [packages...] ``` Run with no arguments to see a list of supported packages and versions. -For example, to build gcc 7.2.0 with the djgpp base library and latest binutils: -``` -./build-djgpp.sh base binutils gcc-7.2.0 +For example, to build gcc 9.2.0 with the latest djgpp C library from CVS and latest binutils: +```sh +./build-djgpp.sh --prefix=/usr/local djgpp-cvs binutils gcc-9.2.0 ``` To install or upgrade all packages: -``` -./build-djgpp.sh all +```sh +./build-djgpp.sh --prefix=/usr/local all ``` -It will download all necessary files, build DJGPP compiler and binutils, and install it. +It will download all necessary files, build DJGPP compiler, binutils, and gdb, and install it. ### Using -There are 2 methods to run the compiler (`$PREFIX` and `$TARGET` here are the variables you used to build). - -* Use compiler full name: +In order to use your new compiler, you must add its `bin/` directory to your `PATH`. +You can then access the compiler through its target-prefixed name: (`$PREFIX` and `$TARGET` in these examples are the variables you used to build) -``` -export PATH=$PREFIX/bin/:$PATH -$TARGET-g++ hello.cpp +```sh +$ PATH=$PREFIX/bin/:$PATH +$ $TARGET-g++ hello.cpp ``` -* Or, use compiler short name, you have to change environment variables. +To use the short name variant, and access documentation with `man` and `info`, use the installed setenv script: -If you are using Linux: -``` -export PATH=$PREFIX/$TARGET/bin/:$PATH -export GCC_EXEC_PREFIX=$PREFIX/lib/gcc/ -g++ hello.cpp -``` -Or, run : - -``` -source $PREFIX/setenv-$TARGET +```sh +$ source $TARGET-setenv +$ g++ hello.cpp ``` If you are using Windows command prompt : -``` -PATH=$PREFIX/$TARGET/bin;%PATH% -set GCC_EXEC_PREFIX=$PREFIX/lib/gcc/ -g++ hello.cpp -``` - -Or, run : - -``` -$PREFIX/setenv-$TARGET.bat +```bat +> PATH=$PREFIX/bin;%PATH% +> $TARGET-g++ hello.cpp +> $TARGET-setenv +> g++ hello.cpp ``` -### Supported DJGPP Utilities +### Supported DJGPP utilities * dxe3gen * dxe3res From 9b439c04aeffc92c4d949377c59a7747f1b675d0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 7 Feb 2020 15:48:42 +0100 Subject: [PATCH 310/536] default to isl version 0.21 when using clang. --- script/download.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/download.sh b/script/download.sh index 5d0069f..3b93a18 100755 --- a/script/download.sh +++ b/script/download.sh @@ -13,7 +13,11 @@ if [ ! -z ${GCC_VERSION} ]; then GMP_VERSION=${GMP_VERSION:-6.2.0} MPFR_VERSION=${MPFR_VERSION:-4.0.2} MPC_VERSION=${MPC_VERSION:-1.1.0} - ISL_VERSION=${ISL_VERSION:-0.21} + if ${CC} -v 2>&1 | grep "clang version" > /dev/null ;then + ISL_VERSION=${ISL_VERSION:-0.21} + else + ISL_VERSION=${ISL_VERSION:-0.22.1} + fi GMP_ARCHIVE="http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" MPFR_ARCHIVE="http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz" From cda01e550f099959e8b0d2d71cb978e76d900805 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 7 Feb 2020 17:57:31 +0100 Subject: [PATCH 311/536] clean up test script --- script/test.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/script/test.sh b/script/test.sh index e4e311a..e6f6804 100755 --- a/script/test.sh +++ b/script/test.sh @@ -1,13 +1,6 @@ #!/usr/bin/env bash set -e -PREFIX="`pwd`/install" - -CFLAGS="-w" -CXXFLAGS="-w" - -export PREFIX MAKE_JOBS CFLAGS CXXFLAGS - case $TARGET in *-msdosdjgpp) SCRIPT=./build-djgpp.sh ;; ia16*) SCRIPT=./build-ia16.sh ;; @@ -15,4 +8,4 @@ avr) SCRIPT=./build-avr.sh ;; *) SCRIPT=./build-newlib.sh ;; esac -echo | ${SCRIPT} ${PACKAGES} +${SCRIPT} --batch --prefix=`pwd`/install --target=${TARGET} ${PACKAGES} From 67d305a25380764afad3067031be5743e99a06a6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 7 Feb 2020 18:11:14 +0100 Subject: [PATCH 312/536] do not download clang/llvm to test ubuntu build. --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dcd5e8e..25263db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,6 @@ jobs: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-9 g++-9 - sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" export CC=gcc-9 CXX=g++-9 - name: Install dependencies (macos) if: contains(matrix.os, 'macos') From eed33ab0e5c32946f13e1ad86d3634e9f55b72a9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 02:58:06 +0100 Subject: [PATCH 313/536] move dependency checks to check-deps-and-confirm.sh --- script/check-deps-and-confirm.sh | 77 +++++++++++++++++++++----------- script/download.sh | 27 ----------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 8b42552..88ee88b 100755 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -1,21 +1,3 @@ -if [ -z ${NO_DOWNLOAD} ]; then - # MinGW32 doesn't have curl, so we use wget. - if ! which curl > /dev/null; then - USE_WGET=1 - if ! which wget > /dev/null; then - echo "curl or wget not installed" - exit 1 - fi - fi -fi - -[ ! -z ${ONLY_DOWNLOAD} ] && return - -if [ -z ${TARGET} ]; then - echo "Please specify a target with: --target=..." - exit 1 -fi - if [ -z ${IGNORE_DEPENDENCIES} ]; then for DEP in ${DEPS}; do case $DEP in @@ -50,15 +32,32 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then done fi -# check required programs -REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" +if [ ! -z ${GCC_VERSION} ] && [ -z ${DJCROSS_GCC_ARCHIVE} ]; then + DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" + # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. + OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} +fi -for REQ_PROG in $REQ_PROG_LIST; do - if ! which $REQ_PROG > /dev/null; then - echo "$REQ_PROG not installed" - exit 1 +case $TARGET in +*-msdosdjgpp) ;; +*) unset DJCROSS_GCC_ARCHIVE OLD_DJCROSS_GCC_ARCHIVE ;; +esac + +if [ ! -z ${GCC_VERSION} ]; then + GMP_VERSION=${GMP_VERSION:-6.2.0} + MPFR_VERSION=${MPFR_VERSION:-4.0.2} + MPC_VERSION=${MPC_VERSION:-1.1.0} + if ${CC} -v 2>&1 | grep "clang version" > /dev/null ;then + ISL_VERSION=${ISL_VERSION:-0.21} + else + ISL_VERSION=${ISL_VERSION:-0.22.1} fi -done + + GMP_ARCHIVE="http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" + MPFR_ARCHIVE="http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz" + MPC_ARCHIVE="http://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz" + ISL_ARCHIVE="http://isl.gforge.inria.fr/isl-${ISL_VERSION}.tar.xz" +fi # check GNU sed is installed or not. # It is for OSX, which doesn't ship with GNU sed. @@ -70,6 +69,34 @@ else SED_ARCHIVE="" fi +if [ -z ${NO_DOWNLOAD} ]; then + # MinGW32 doesn't have curl, so we use wget. + if ! which curl > /dev/null; then + USE_WGET=1 + if ! which wget > /dev/null; then + echo "curl or wget not installed" + exit 1 + fi + fi +fi + +[ ! -z ${ONLY_DOWNLOAD} ] && return + +if [ -z ${TARGET} ]; then + echo "Please specify a target with: --target=..." + exit 1 +fi + +# check required programs +REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" + +for REQ_PROG in $REQ_PROG_LIST; do + if ! which $REQ_PROG > /dev/null; then + echo "$REQ_PROG not installed" + exit 1 + fi +done + # check zlib is installed if ! ${CC} ${BASE}/script/test-zlib.c -o test-zlib -lz; then echo "zlib not installed" diff --git a/script/download.sh b/script/download.sh index 3b93a18..6d8d89f 100755 --- a/script/download.sh +++ b/script/download.sh @@ -1,30 +1,3 @@ -if [ ! -z ${GCC_VERSION} ] && [ -z ${DJCROSS_GCC_ARCHIVE} ]; then - DJCROSS_GCC_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/rpms/djcross-gcc-${GCC_VERSION}/djcross-gcc-${GCC_VERSION}.tar.bz2" - # djcross-gcc-X.XX-tar.* maybe moved from /djgpp/rpms/ to /djgpp/deleted/rpms/ directory. - OLD_DJCROSS_GCC_ARCHIVE=${DJCROSS_GCC_ARCHIVE/rpms\//deleted\/rpms\/} -fi - -case $TARGET in -*-msdosdjgpp) ;; -*) unset DJCROSS_GCC_ARCHIVE OLD_DJCROSS_GCC_ARCHIVE ;; -esac - -if [ ! -z ${GCC_VERSION} ]; then - GMP_VERSION=${GMP_VERSION:-6.2.0} - MPFR_VERSION=${MPFR_VERSION:-4.0.2} - MPC_VERSION=${MPC_VERSION:-1.1.0} - if ${CC} -v 2>&1 | grep "clang version" > /dev/null ;then - ISL_VERSION=${ISL_VERSION:-0.21} - else - ISL_VERSION=${ISL_VERSION:-0.22.1} - fi - - GMP_ARCHIVE="http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" - MPFR_ARCHIVE="http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz" - MPC_ARCHIVE="http://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz" - ISL_ARCHIVE="http://isl.gforge.inria.fr/isl-${ISL_VERSION}.tar.xz" -fi - # download source files ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $SED_ARCHIVE $DJCROSS_GCC_ARCHIVE $OLD_DJCROSS_GCC_ARCHIVE $GCC_ARCHIVE From 1d360d49ebdc99971fd4c6b84e869dfbd2603d29 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 03:00:08 +0100 Subject: [PATCH 314/536] proceed in batch mode if sudo is needed, but does not require a password. --- script/check-deps-and-confirm.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 88ee88b..dae05b2 100755 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -157,13 +157,19 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then fi echo "" -mkdir -p ${PREFIX} +mkdir -p ${PREFIX} 2> /dev/null if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then - echo "WARNING: no write access to ${PREFIX}." - [ ! -z ${BUILD_BATCH} ] && exit 1 - echo "You may need to enter your sudo password several times during the build process." - echo "" + if [ ! -z ${BUILD_BATCH} ]; then + if ! sudo -n : 2> /dev/null; then + echo "ERROR: no write access to ${PREFIX} (requires sudo)" + exit 1 + fi + else + echo "WARNING: no write access to ${PREFIX}" + echo "You may need to enter your sudo password several times during the build process." + echo "" + fi SUDO=sudo fi From 87c7fa064d17d7805bc11b29ebb09093a524384b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 03:36:15 +0100 Subject: [PATCH 315/536] download git sources in download.sh --- avr/simulavr-git | 3 +-- build-avr.sh | 12 ----------- build-djgpp.sh | 10 --------- build-ia16.sh | 29 ++++++-------------------- build-newlib.sh | 9 -------- djgpp/djgpp-cvs | 5 ++--- ia16/binutils-ia16 | 3 +-- ia16/gcc | 4 ++-- ia16/newlib | 3 +-- script/download.sh | 37 +++++++++++++++++++++++++++++++-- script/init.sh | 15 ------------- script/unpack-build-binutils.sh | 2 ++ 12 files changed, 50 insertions(+), 82 deletions(-) diff --git a/avr/simulavr-git b/avr/simulavr-git index 8b56e8f..d665ec3 100755 --- a/avr/simulavr-git +++ b/avr/simulavr-git @@ -1,3 +1,2 @@ -#!/usr/bin/env bash - SIMULAVR_VERSION=git +SIMULAVR_GIT="https://git.savannah.nongnu.org/git/simulavr.git::master" diff --git a/build-avr.sh b/build-avr.sh index 42e7b51..f3c5f9e 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -25,20 +25,9 @@ DEPS="" source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh - -mkdir -p ${BASE}/build -cd ${BASE}/build/ || exit 1 -if [ ! -z ${SIMULAVR_VERSION} ]; then - download_git https://git.savannah.nongnu.org/git/simulavr.git master -fi - -[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 - source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh - source ${BASE}/script/unpack-build-binutils.sh - source ${BASE}/script/build-avr-gcc.sh cd ${BASE}/build/ @@ -91,5 +80,4 @@ if [ ! -z ${AVRDUDE_VERSION} ]; then fi source ${BASE}/script/build-gdb.sh - source ${BASE}/script/finalize.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index 4f34dc6..80c1ba6 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -31,15 +31,6 @@ DEPS="" source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh - -if [ "${DJGPP_VERSION}" == "cvs" ]; then - mkdir ${BASE}/build - cd ${BASE}/build/ || exit 1 - download_git https://github.com/jwt27/djgpp-cvs.git jwt27 -fi - -[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 - source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh @@ -306,5 +297,4 @@ fi cd ${BASE}/build source ${BASE}/script/build-gdb.sh - source ${BASE}/script/finalize.sh diff --git a/build-ia16.sh b/build-ia16.sh index 38515d8..9da31d0 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -25,27 +25,6 @@ DEPS="" source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh - -mkdir -p ${BASE}/build -cd ${BASE}/build/ || exit 1 - -if [ ! -z ${GCC_VERSION} ]; then - download_git https://github.com/tkchia/gcc-ia16.git gcc-6_3_0-ia16-tkchia - cd gcc-ia16/ - patch -p1 -u < ../../patch/patch-gcc-ia16.txt || exit 1 - cd .. -fi - -if [ ! -z ${NEWLIB_VERSION} ]; then - download_git https://github.com/tkchia/newlib-ia16.git newlib-2_4_0-ia16-tkchia -fi - -if [ "$BINUTILS_VERSION" = "ia16" ]; then - download_git https://github.com/tkchia/binutils-ia16.git binutils-ia16-tkchia -fi - -[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 - source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh @@ -57,8 +36,12 @@ else source ${BASE}/script/unpack-build-binutils.sh fi -source ${BASE}/script/build-newlib-gcc.sh +if [ ! -z ${GCC_VERSION} ]; then + cd ${BASE}/build/gcc-ia16/ + patch -p1 -u < ../../patch/patch-gcc-ia16.txt || exit 1 + cd - +fi +source ${BASE}/script/build-newlib-gcc.sh source ${BASE}/script/build-gdb.sh - source ${BASE}/script/finalize.sh diff --git a/build-newlib.sh b/build-newlib.sh index ae90d60..1770f44 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -22,18 +22,9 @@ DEPS="" source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh - -[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 - source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh - -cd ${BASE}/build/ || exit 1 - source ${BASE}/script/unpack-build-binutils.sh - source ${BASE}/script/build-newlib-gcc.sh - source ${BASE}/script/build-gdb.sh - source ${BASE}/script/finalize.sh diff --git a/djgpp/djgpp-cvs b/djgpp/djgpp-cvs index 0c83b77..02ad5be 100755 --- a/djgpp/djgpp-cvs +++ b/djgpp/djgpp-cvs @@ -1,3 +1,2 @@ -#!/usr/bin/env bash - -export DJGPP_VERSION=cvs +DJGPP_VERSION=cvs +DJGPP_GIT="https://github.com/jwt27/djgpp-cvs.git::jwt27" diff --git a/ia16/binutils-ia16 b/ia16/binutils-ia16 index 6ec0e0a..f2426a7 100755 --- a/ia16/binutils-ia16 +++ b/ia16/binutils-ia16 @@ -1,3 +1,2 @@ -#!/usr/bin/env bash - BINUTILS_VERSION=ia16 +BINUTILS_GIT="https://github.com/tkchia/binutils-ia16.git::binutils-ia16-tkchia" diff --git a/ia16/gcc b/ia16/gcc index 10b32f4..cdd6de6 100755 --- a/ia16/gcc +++ b/ia16/gcc @@ -1,8 +1,8 @@ -#!/usr/bin/env bash - GCC_VERSION="ia16" ISL_VERSION=0.15 +GCC_GIT="https://github.com/tkchia/gcc-ia16.git::gcc-6_3_0-ia16-tkchia" + GCC_CONFIGURE_OPTIONS="--disable-plugin --enable-lto --disable-libstdcxx-dual-abi diff --git a/ia16/newlib b/ia16/newlib index 4632a86..429aafb 100755 --- a/ia16/newlib +++ b/ia16/newlib @@ -1,3 +1,2 @@ -#!/usr/bin/env bash - NEWLIB_VERSION="ia16" +NEWLIB_GIT="https://github.com/tkchia/newlib-ia16.git::newlib-2_4_0-ia16-tkchia" diff --git a/script/download.sh b/script/download.sh index 6d8d89f..d196b97 100755 --- a/script/download.sh +++ b/script/download.sh @@ -7,8 +7,8 @@ ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE if [ -z ${NO_DOWNLOAD} ]; then echo "Download source files..." - mkdir -p download || exit 1 - cd download + mkdir -p download + cd download || exit 1 for ARCHIVE in $ARCHIVE_LIST; do FILE=`basename $ARCHIVE` @@ -34,6 +34,37 @@ if [ -z ${NO_DOWNLOAD} ]; then cd .. fi +download_git() +{ + local repo=$(basename $1) + repo=${repo%.*} + if [ ! -d $repo ]; then + if [ -z ${NO_DOWNLOAD} ]; then + echo "Downloading ${repo}..." + git clone $1 --depth 1 $([ "$2" != "" ] && echo "--branch $2") + else + echo "Missing: ${repo}" + exit 1 + fi + fi + cd $repo || exit 1 + git reset --hard HEAD + git checkout $2 + [ -z ${NO_DOWNLOAD} ] && (git pull || exit 1) + cd .. +} + +# these variables are of the form "git://url/repo.git::branch" +# if 'branch' is empty then the default branch is checked out. +GIT_LIST="$DJGPP_GIT $GCC_GIT $BINUTILS_GIT $NEWLIB_GIT $SIMULAVR_GIT" +( + mkdir -p build + cd build || exit 1 + for REPO in $GIT_LIST; do + download_git ${REPO%::*} ${REPO##*::} + done +) + for ARCHIVE in $ARCHIVE_LIST; do FILE=`basename $ARCHIVE` if ! [ -f download/$FILE ]; then @@ -41,3 +72,5 @@ for ARCHIVE in $ARCHIVE_LIST; do exit 1 fi done + +[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 diff --git a/script/init.sh b/script/init.sh index 6dca9c1..9f78fd9 100755 --- a/script/init.sh +++ b/script/init.sh @@ -59,18 +59,3 @@ untar() strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } prepend() { eval "$1=\"$2 ${!1}\""; } - -download_git() -{ - local repo=$(basename $1) - repo=${repo%.*} - if [ -z ${NO_DOWNLOAD} ]; then - echo "Downloading ${repo}..." - [ -d $repo ] || git clone $1 --depth 1 $([ "$2" != "" ] && echo "--branch $2") - fi - cd $repo || exit 1 - git reset --hard HEAD - git checkout $2 - [ -z ${NO_DOWNLOAD} ] && (git pull || exit 1) - cd .. -} diff --git a/script/unpack-build-binutils.sh b/script/unpack-build-binutils.sh index 52a8c23..216b6ee 100755 --- a/script/unpack-build-binutils.sh +++ b/script/unpack-build-binutils.sh @@ -1,3 +1,5 @@ +cd ${BASE}/build/ || exit 1 + if [ ! -z ${BINUTILS_VERSION} ]; then if [ ! -e binutils-${BINUTILS_VERSION}/binutils-unpacked ]; then echo "Unpacking binutils..." From af592f83d64f4580be6a053ae677de748dd66459 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 04:09:29 +0100 Subject: [PATCH 316/536] clean up package version files and clear unnecessary executable bits. --- avr/all | 2 -- avr/avarice | 2 -- avr/avarice-2.13 | 2 -- avr/avr-libc | 2 -- avr/avr-libc-2.0.0 | 2 -- avr/avrdude | 2 -- avr/avrdude-6.3 | 2 -- avr/simulavr | 2 -- avr/simulavr-git | 0 binutils/binutils | 2 -- binutils/binutils-2.29.1 | 2 -- binutils/binutils-2.30 | 2 -- binutils/binutils-2.31 | 2 -- binutils/binutils-2.31.1 | 2 -- binutils/binutils-2.32 | 2 -- binutils/binutils-2.33.1 | 2 -- binutils/binutils-2.34 | 2 -- common/gcc | 2 -- common/gcc-4.7.3 | 21 +++++++++------------ common/gcc-4.8.4 | 23 ++++++++++------------- common/gcc-4.8.5 | 23 ++++++++++------------- common/gcc-4.9.2 | 23 ++++++++++------------- common/gcc-4.9.3 | 23 ++++++++++------------- common/gcc-4.9.4 | 23 ++++++++++------------- common/gcc-5.1.0 | 23 ++++++++++------------- common/gcc-5.2.0 | 23 ++++++++++------------- common/gcc-5.3.0 | 23 ++++++++++------------- common/gcc-5.4.0 | 23 ++++++++++------------- common/gcc-5.5.0 | 23 ++++++++++------------- common/gcc-6.1.0 | 23 ++++++++++------------- common/gcc-6.2.0 | 23 ++++++++++------------- common/gcc-6.3.0 | 23 ++++++++++------------- common/gcc-6.4.0 | 25 +++++++++++-------------- common/gcc-7.1.0 | 25 +++++++++++-------------- common/gcc-7.2.0 | 25 +++++++++++-------------- common/gcc-7.3.0 | 25 +++++++++++-------------- common/gcc-8.1.0 | 25 +++++++++++-------------- common/gcc-8.2.0 | 27 ++++++++++++--------------- common/gcc-8.3.0 | 25 +++++++++++-------------- common/gcc-9.1.0 | 23 ++++++++++------------- common/gcc-9.2.0 | 1 - common/gdb | 0 common/gdb-7.12.1 | 6 ++---- common/gdb-8.0 | 6 ++---- common/gdb-8.0.1 | 6 ++---- common/gdb-8.1 | 6 ++---- common/gdb-8.1.1 | 6 ++---- common/gdb-8.2 | 6 ++---- common/gdb-8.2.1 | 6 ++---- common/gdb-8.3 | 6 ++---- common/gdb-8.3.1 | 4 ++-- djgpp/all | 2 -- djgpp/binutils | 2 -- djgpp/binutils-2.29.1 | 6 ++---- djgpp/binutils-2.30 | 6 ++---- djgpp/binutils-2.31.1 | 6 ++---- djgpp/binutils-2.32 | 6 ++---- djgpp/binutils-2.33.1 | 6 ++---- djgpp/default | 2 -- djgpp/djgpp | 2 -- djgpp/djgpp-2.05 | 12 ++++-------- djgpp/djgpp-cvs | 0 djgpp/gdb | 2 -- ia16/binutils | 2 -- ia16/binutils-ia16 | 0 ia16/gcc | 0 ia16/newlib | 0 newlib/all | 2 -- newlib/newlib | 0 newlib/newlib-3.0.0 | 2 -- newlib/newlib-3.0.0.20180226 | 2 -- newlib/newlib-3.0.0.20180720 | 2 -- newlib/newlib-3.0.0.20180802 | 2 -- newlib/newlib-3.1.0 | 2 -- newlib/newlib-3.2.0 | 0 newlib/newlib-3.3.0 | 0 script/build-avr-gcc.sh | 0 script/build-binutils.sh | 0 script/build-gdb.sh | 0 script/build-newlib-gcc.sh | 0 script/build-tools.sh | 0 script/check-deps-and-confirm.sh | 0 script/download.sh | 0 script/finalize.sh | 0 script/init.sh | 0 script/mkdirs.sh | 0 script/parse-args.sh | 0 script/unpack-build-binutils.sh | 0 88 files changed, 259 insertions(+), 414 deletions(-) mode change 100755 => 100644 avr/all mode change 100755 => 100644 avr/avarice mode change 100755 => 100644 avr/avarice-2.13 mode change 100755 => 100644 avr/avr-libc mode change 100755 => 100644 avr/avr-libc-2.0.0 mode change 100755 => 100644 avr/avrdude mode change 100755 => 100644 avr/avrdude-6.3 mode change 100755 => 100644 avr/simulavr mode change 100755 => 100644 avr/simulavr-git mode change 100755 => 100644 binutils/binutils mode change 100755 => 100644 binutils/binutils-2.29.1 mode change 100755 => 100644 binutils/binutils-2.30 mode change 100755 => 100644 binutils/binutils-2.31 mode change 100755 => 100644 binutils/binutils-2.31.1 mode change 100755 => 100644 binutils/binutils-2.32 mode change 100755 => 100644 binutils/binutils-2.33.1 mode change 100755 => 100644 binutils/binutils-2.34 mode change 100755 => 100644 common/gcc mode change 100755 => 100644 common/gcc-4.7.3 mode change 100755 => 100644 common/gcc-4.8.4 mode change 100755 => 100644 common/gcc-4.8.5 mode change 100755 => 100644 common/gcc-4.9.2 mode change 100755 => 100644 common/gcc-4.9.3 mode change 100755 => 100644 common/gcc-4.9.4 mode change 100755 => 100644 common/gcc-5.1.0 mode change 100755 => 100644 common/gcc-5.2.0 mode change 100755 => 100644 common/gcc-5.3.0 mode change 100755 => 100644 common/gcc-5.4.0 mode change 100755 => 100644 common/gcc-5.5.0 mode change 100755 => 100644 common/gcc-6.1.0 mode change 100755 => 100644 common/gcc-6.2.0 mode change 100755 => 100644 common/gcc-6.3.0 mode change 100755 => 100644 common/gcc-6.4.0 mode change 100755 => 100644 common/gcc-7.1.0 mode change 100755 => 100644 common/gcc-7.2.0 mode change 100755 => 100644 common/gcc-7.3.0 mode change 100755 => 100644 common/gcc-8.1.0 mode change 100755 => 100644 common/gcc-8.2.0 mode change 100755 => 100644 common/gcc-8.3.0 mode change 100755 => 100644 common/gcc-9.1.0 mode change 100755 => 100644 common/gcc-9.2.0 mode change 100755 => 100644 common/gdb mode change 100755 => 100644 common/gdb-7.12.1 mode change 100755 => 100644 common/gdb-8.0 mode change 100755 => 100644 common/gdb-8.0.1 mode change 100755 => 100644 common/gdb-8.1 mode change 100755 => 100644 common/gdb-8.1.1 mode change 100755 => 100644 common/gdb-8.2 mode change 100755 => 100644 common/gdb-8.2.1 mode change 100755 => 100644 common/gdb-8.3 mode change 100755 => 100644 common/gdb-8.3.1 mode change 100755 => 100644 djgpp/all mode change 100755 => 100644 djgpp/binutils mode change 100755 => 100644 djgpp/binutils-2.29.1 mode change 100755 => 100644 djgpp/binutils-2.30 mode change 100755 => 100644 djgpp/binutils-2.31.1 mode change 100755 => 100644 djgpp/binutils-2.32 mode change 100755 => 100644 djgpp/binutils-2.33.1 mode change 100755 => 100644 djgpp/default mode change 100755 => 100644 djgpp/djgpp mode change 100755 => 100644 djgpp/djgpp-2.05 mode change 100755 => 100644 djgpp/djgpp-cvs mode change 100755 => 100644 djgpp/gdb mode change 100755 => 100644 ia16/binutils mode change 100755 => 100644 ia16/binutils-ia16 mode change 100755 => 100644 ia16/gcc mode change 100755 => 100644 ia16/newlib mode change 100755 => 100644 newlib/all mode change 100755 => 100644 newlib/newlib mode change 100755 => 100644 newlib/newlib-3.0.0 mode change 100755 => 100644 newlib/newlib-3.0.0.20180226 mode change 100755 => 100644 newlib/newlib-3.0.0.20180720 mode change 100755 => 100644 newlib/newlib-3.0.0.20180802 mode change 100755 => 100644 newlib/newlib-3.1.0 mode change 100755 => 100644 newlib/newlib-3.2.0 mode change 100755 => 100644 newlib/newlib-3.3.0 mode change 100755 => 100644 script/build-avr-gcc.sh mode change 100755 => 100644 script/build-binutils.sh mode change 100755 => 100644 script/build-gdb.sh mode change 100755 => 100644 script/build-newlib-gcc.sh mode change 100755 => 100644 script/build-tools.sh mode change 100755 => 100644 script/check-deps-and-confirm.sh mode change 100755 => 100644 script/download.sh mode change 100755 => 100644 script/finalize.sh mode change 100755 => 100644 script/init.sh mode change 100755 => 100644 script/mkdirs.sh mode change 100755 => 100644 script/parse-args.sh mode change 100755 => 100644 script/unpack-build-binutils.sh diff --git a/avr/all b/avr/all old mode 100755 new mode 100644 index 8a183f8..8ead2f9 --- a/avr/all +++ b/avr/all @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - source avr/avr-libc source avr/binutils source common/gcc diff --git a/avr/avarice b/avr/avarice old mode 100755 new mode 100644 index d140d6e..4a57d87 --- a/avr/avarice +++ b/avr/avarice @@ -1,3 +1 @@ -#!/usr/bin/env bash - source avr/avarice-2.13 diff --git a/avr/avarice-2.13 b/avr/avarice-2.13 old mode 100755 new mode 100644 index e868091..f4b9841 --- a/avr/avarice-2.13 +++ b/avr/avarice-2.13 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - AVARICE_VERSION=2.13 AVARICE_ARCHIVE=https://downloads.sourceforge.net/project/avarice/avarice/avarice-2.13/avarice-2.13.tar.bz2 diff --git a/avr/avr-libc b/avr/avr-libc old mode 100755 new mode 100644 index 0058efc..c0d1809 --- a/avr/avr-libc +++ b/avr/avr-libc @@ -1,3 +1 @@ -#!/usr/bin/env bash - source avr/avr-libc-2.0.0 diff --git a/avr/avr-libc-2.0.0 b/avr/avr-libc-2.0.0 old mode 100755 new mode 100644 index e268a38..62a90c4 --- a/avr/avr-libc-2.0.0 +++ b/avr/avr-libc-2.0.0 @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - AVRLIBC_VERSION=2.0.0 AVRLIBC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 AVRLIBC_DOC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-manpages-2.0.0.tar.bz2 diff --git a/avr/avrdude b/avr/avrdude old mode 100755 new mode 100644 index 8993932..361fe36 --- a/avr/avrdude +++ b/avr/avrdude @@ -1,3 +1 @@ -#!/usr/bin/env bash - source avr/avrdude-6.3 diff --git a/avr/avrdude-6.3 b/avr/avrdude-6.3 old mode 100755 new mode 100644 index a2c9678..5aeeda4 --- a/avr/avrdude-6.3 +++ b/avr/avrdude-6.3 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - AVRDUDE_VERSION=6.3 AVRDUDE_ARCHIVE=http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3.tar.gz diff --git a/avr/simulavr b/avr/simulavr old mode 100755 new mode 100644 index 0addf39..7ee9b9f --- a/avr/simulavr +++ b/avr/simulavr @@ -1,3 +1 @@ -#!/usr/bin/env bash - source avr/simulavr-git diff --git a/avr/simulavr-git b/avr/simulavr-git old mode 100755 new mode 100644 diff --git a/binutils/binutils b/binutils/binutils old mode 100755 new mode 100644 index 6cdb226..6ac7732 --- a/binutils/binutils +++ b/binutils/binutils @@ -1,3 +1 @@ -#!/usr/bin/env bash - source binutils/binutils-2.34 diff --git a/binutils/binutils-2.29.1 b/binutils/binutils-2.29.1 old mode 100755 new mode 100644 index 5625d2f..2b36981 --- a/binutils/binutils-2.29.1 +++ b/binutils/binutils-2.29.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - BINUTILS_VERSION=2.29.1 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.30 b/binutils/binutils-2.30 old mode 100755 new mode 100644 index 78221f5..4e2678c --- a/binutils/binutils-2.30 +++ b/binutils/binutils-2.30 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - BINUTILS_VERSION=2.30 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.31 b/binutils/binutils-2.31 old mode 100755 new mode 100644 index 3366281..cd4a4b2 --- a/binutils/binutils-2.31 +++ b/binutils/binutils-2.31 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - BINUTILS_VERSION=2.31 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.31.1 b/binutils/binutils-2.31.1 old mode 100755 new mode 100644 index 8165efe..ec5fb7c --- a/binutils/binutils-2.31.1 +++ b/binutils/binutils-2.31.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - BINUTILS_VERSION=2.31.1 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.32 b/binutils/binutils-2.32 old mode 100755 new mode 100644 index 1b727d8..cf49825 --- a/binutils/binutils-2.32 +++ b/binutils/binutils-2.32 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - BINUTILS_VERSION=2.32 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.33.1 b/binutils/binutils-2.33.1 old mode 100755 new mode 100644 index 359a6ee..a054e54 --- a/binutils/binutils-2.33.1 +++ b/binutils/binutils-2.33.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - BINUTILS_VERSION=2.33.1 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.34 b/binutils/binutils-2.34 old mode 100755 new mode 100644 index 0da32c4..52172cf --- a/binutils/binutils-2.34 +++ b/binutils/binutils-2.34 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - BINUTILS_VERSION=2.34 BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/common/gcc b/common/gcc old mode 100755 new mode 100644 index e28a7da..770f870 --- a/common/gcc +++ b/common/gcc @@ -1,3 +1 @@ -#!/usr/bin/env bash - source common/gcc-9.2.0 diff --git a/common/gcc-4.7.3 b/common/gcc-4.7.3 old mode 100755 new mode 100644 index f256300..d62a732 --- a/common/gcc-4.7.3 +++ b/common/gcc-4.7.3 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=4.7.3 +GCC_VERSION_SHORT=4.73 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=4.7.3 -export GCC_VERSION_SHORT=4.73 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" +GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS}" -export GCC_CONFIGURE_OPTIONS="${GCC_CONFIGURE_OPTIONS}" - -export GCC_EXTRA_CFLAGS="-std=gnu90" +GCC_EXTRA_CFLAGS="-std=gnu90" diff --git a/common/gcc-4.8.4 b/common/gcc-4.8.4 old mode 100755 new mode 100644 index 6c55945..c3c3f47 --- a/common/gcc-4.8.4 +++ b/common/gcc-4.8.4 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=4.8.4 +GCC_VERSION_SHORT=4.84 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=4.8.4 -export GCC_VERSION_SHORT=4.84 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" +GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -export GCC_CONFIGURE_OPTIONS="--enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" - -export GCC_EXTRA_CFLAGS="-std=gnu90" +GCC_EXTRA_CFLAGS="-std=gnu90" diff --git a/common/gcc-4.8.5 b/common/gcc-4.8.5 old mode 100755 new mode 100644 index ecb8df6..f8fb77d --- a/common/gcc-4.8.5 +++ b/common/gcc-4.8.5 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=4.8.5 +GCC_VERSION_SHORT=4.85 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=4.8.5 -export GCC_VERSION_SHORT=4.85 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" +GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -export GCC_CONFIGURE_OPTIONS="--enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" - -export GCC_EXTRA_CFLAGS="-std=gnu90" +GCC_EXTRA_CFLAGS="-std=gnu90" diff --git a/common/gcc-4.9.2 b/common/gcc-4.9.2 old mode 100755 new mode 100644 index d760432..9469ada --- a/common/gcc-4.9.2 +++ b/common/gcc-4.9.2 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=4.9.2 +GCC_VERSION_SHORT=4.92 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=4.9.2 -export GCC_VERSION_SHORT=4.92 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" +GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -export GCC_CONFIGURE_OPTIONS="--enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" - -export GCC_EXTRA_CFLAGS="-std=gnu90" +GCC_EXTRA_CFLAGS="-std=gnu90" diff --git a/common/gcc-4.9.3 b/common/gcc-4.9.3 old mode 100755 new mode 100644 index 3310b9c..469da59 --- a/common/gcc-4.9.3 +++ b/common/gcc-4.9.3 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=4.9.3 +GCC_VERSION_SHORT=4.93 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=4.9.3 -export GCC_VERSION_SHORT=4.93 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" +GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -export GCC_CONFIGURE_OPTIONS="--enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" - -export GCC_EXTRA_CFLAGS="-std=gnu90" +GCC_EXTRA_CFLAGS="-std=gnu90" diff --git a/common/gcc-4.9.4 b/common/gcc-4.9.4 old mode 100755 new mode 100644 index a5e02f5..ee7fc3f --- a/common/gcc-4.9.4 +++ b/common/gcc-4.9.4 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=4.9.4 +GCC_VERSION_SHORT=4.94 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=4.9.4 -export GCC_VERSION_SHORT=4.94 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" +GCC_CONFIGURE_OPTIONS="--enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" -export GCC_CONFIGURE_OPTIONS="--enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" - -export GCC_EXTRA_CFLAGS="-std=gnu90" +GCC_EXTRA_CFLAGS="-std=gnu90" diff --git a/common/gcc-5.1.0 b/common/gcc-5.1.0 old mode 100755 new mode 100644 index cb1f06a..5bd7dfb --- a/common/gcc-5.1.0 +++ b/common/gcc-5.1.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=5.1.0 +GCC_VERSION_SHORT=5.10 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=5.1.0 -export GCC_VERSION_SHORT=5.10 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-5.2.0 b/common/gcc-5.2.0 old mode 100755 new mode 100644 index 9e7dd6b..06faec1 --- a/common/gcc-5.2.0 +++ b/common/gcc-5.2.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=5.2.0 +GCC_VERSION_SHORT=5.20 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=5.2.0 -export GCC_VERSION_SHORT=5.20 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-5.3.0 b/common/gcc-5.3.0 old mode 100755 new mode 100644 index 8de1cec..be570a3 --- a/common/gcc-5.3.0 +++ b/common/gcc-5.3.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=5.3.0 +GCC_VERSION_SHORT=5.30 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=5.3.0 -export GCC_VERSION_SHORT=5.30 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-5.4.0 b/common/gcc-5.4.0 old mode 100755 new mode 100644 index 23ed87b..3316b20 --- a/common/gcc-5.4.0 +++ b/common/gcc-5.4.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=5.4.0 +GCC_VERSION_SHORT=5.40 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=5.4.0 -export GCC_VERSION_SHORT=5.40 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-5.5.0 b/common/gcc-5.5.0 old mode 100755 new mode 100644 index dad661b..d60b0c9 --- a/common/gcc-5.5.0 +++ b/common/gcc-5.5.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=5.5.0 +GCC_VERSION_SHORT=5.50 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.1 -export GCC_VERSION=5.5.0 -export GCC_VERSION_SHORT=5.50 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.1 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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.bz2" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.bz2" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-6.1.0 b/common/gcc-6.1.0 old mode 100755 new mode 100644 index 34a8778..9b4ea93 --- a/common/gcc-6.1.0 +++ b/common/gcc-6.1.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=6.1.0 +GCC_VERSION_SHORT=6.10 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=6.1.0 -export GCC_VERSION_SHORT=6.10 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-6.2.0 b/common/gcc-6.2.0 old mode 100755 new mode 100644 index de274e8..9ef8419 --- a/common/gcc-6.2.0 +++ b/common/gcc-6.2.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=6.2.0 +GCC_VERSION_SHORT=6.20 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=6.2.0 -export GCC_VERSION_SHORT=6.20 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-6.3.0 b/common/gcc-6.3.0 old mode 100755 new mode 100644 index b49ebd1..ee648cc --- a/common/gcc-6.3.0 +++ b/common/gcc-6.3.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=6.3.0 +GCC_VERSION_SHORT=6.30 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=6.3.0 -export GCC_VERSION_SHORT=6.30 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-6.4.0 b/common/gcc-6.4.0 old mode 100755 new mode 100644 index 7af2f1d..cbd4b64 --- a/common/gcc-6.4.0 +++ b/common/gcc-6.4.0 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=6.4.0 +GCC_VERSION_SHORT=6.40 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=6.4.0 -export GCC_VERSION_SHORT=6.40 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-7.1.0 b/common/gcc-7.1.0 old mode 100755 new mode 100644 index a1c898f..d19a21e --- a/common/gcc-7.1.0 +++ b/common/gcc-7.1.0 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=7.1.0 +GCC_VERSION_SHORT=7.10 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=7.1.0 -export GCC_VERSION_SHORT=7.10 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-7.2.0 b/common/gcc-7.2.0 old mode 100755 new mode 100644 index 728bb7e..06114f2 --- a/common/gcc-7.2.0 +++ b/common/gcc-7.2.0 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=7.2.0 +GCC_VERSION_SHORT=7.20 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=7.2.0 -export GCC_VERSION_SHORT=7.20 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-7.3.0 b/common/gcc-7.3.0 old mode 100755 new mode 100644 index 75d3a2a..b4679c0 --- a/common/gcc-7.3.0 +++ b/common/gcc-7.3.0 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=7.3.0 +GCC_VERSION_SHORT=7.30 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=7.3.0 -export GCC_VERSION_SHORT=7.30 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-8.1.0 b/common/gcc-8.1.0 old mode 100755 new mode 100644 index d9ef61c..72c1409 --- a/common/gcc-8.1.0 +++ b/common/gcc-8.1.0 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=8.1.0 +GCC_VERSION_SHORT=8.10 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=8.1.0 -export GCC_VERSION_SHORT=8.10 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-8.2.0 b/common/gcc-8.2.0 old mode 100755 new mode 100644 index d558fe0..72aa7c6 --- a/common/gcc-8.2.0 +++ b/common/gcc-8.2.0 @@ -1,18 +1,15 @@ -#!/usr/bin/env bash +GCC_VERSION=8.2.0 +GCC_VERSION_SHORT=8.20 +AUTOCONF_VERSION=2.64 +AUTOMAKE_VERSION=1.11.6 -export GCC_VERSION=8.2.0 -export GCC_VERSION_SHORT=8.20 -export AUTOCONF_VERSION=2.64 -export AUTOMAKE_VERSION=1.11.6 +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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" +DJCROSS_GCC_ARCHIVE="http://ap1.pp.fi/djgpp/gcc/${GCC_VERSION}/rpm/djcross-gcc-${GCC_VERSION}.tar.bz2" -export DJCROSS_GCC_ARCHIVE="http://ap1.pp.fi/djgpp/gcc/${GCC_VERSION}/rpm/djcross-gcc-${GCC_VERSION}.tar.bz2" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-8.3.0 b/common/gcc-8.3.0 old mode 100755 new mode 100644 index 21078f2..e9902b1 --- a/common/gcc-8.3.0 +++ b/common/gcc-8.3.0 @@ -1,16 +1,13 @@ -#!/usr/bin/env bash +GCC_VERSION=8.3.0 +GCC_VERSION_SHORT=8.30 +AUTOCONF_VERSION=2.69 +AUTOMAKE_VERSION=1.15.1 -export GCC_VERSION=8.3.0 -export GCC_VERSION_SHORT=8.30 -export AUTOCONF_VERSION=2.69 -export 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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - --enable-libstdcxx-filesystem-ts \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + --enable-libstdcxx-filesystem-ts \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-9.1.0 b/common/gcc-9.1.0 old mode 100755 new mode 100644 index ef66f3a..b277f19 --- a/common/gcc-9.1.0 +++ b/common/gcc-9.1.0 @@ -1,15 +1,12 @@ -#!/usr/bin/env bash +GCC_VERSION=9.1.0 +GCC_VERSION_SHORT=9.10 +AUTOCONF_VERSION=2.69 +AUTOMAKE_VERSION=1.15.1 -export GCC_VERSION=9.1.0 -export GCC_VERSION_SHORT=9.10 -export AUTOCONF_VERSION=2.69 -export 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" -# tarball location -export GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz" -export AUTOCONF_ARCHIVE="http://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.xz" -export AUTOMAKE_ARCHIVE="http://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.xz" - -export GCC_CONFIGURE_OPTIONS="--disable-plugin \ - --enable-lto \ - ${GCC_CONFIGURE_OPTIONS}" +GCC_CONFIGURE_OPTIONS="--disable-plugin \ + --enable-lto \ + ${GCC_CONFIGURE_OPTIONS}" diff --git a/common/gcc-9.2.0 b/common/gcc-9.2.0 old mode 100755 new mode 100644 index c6cae26..429971c --- a/common/gcc-9.2.0 +++ b/common/gcc-9.2.0 @@ -3,7 +3,6 @@ GCC_VERSION_SHORT=9.20 AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.15.1 -# tarball location 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" diff --git a/common/gdb b/common/gdb old mode 100755 new mode 100644 diff --git a/common/gdb-7.12.1 b/common/gdb-7.12.1 old mode 100755 new mode 100644 index ec01823..06ce0e1 --- a/common/gdb-7.12.1 +++ b/common/gdb-7.12.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export GDB_VERSION=7.12.1 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=7.12.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.0 b/common/gdb-8.0 old mode 100755 new mode 100644 index 2303dfe..0d51a64 --- a/common/gdb-8.0 +++ b/common/gdb-8.0 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export GDB_VERSION=8.0 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=8.0 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.0.1 b/common/gdb-8.0.1 old mode 100755 new mode 100644 index 7f6c200..9358015 --- a/common/gdb-8.0.1 +++ b/common/gdb-8.0.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export GDB_VERSION=8.0.1 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=8.0.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.1 b/common/gdb-8.1 old mode 100755 new mode 100644 index 1e8ab24..fd87a76 --- a/common/gdb-8.1 +++ b/common/gdb-8.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export GDB_VERSION=8.1 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=8.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.1.1 b/common/gdb-8.1.1 old mode 100755 new mode 100644 index 9746af3..9d305b4 --- a/common/gdb-8.1.1 +++ b/common/gdb-8.1.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export GDB_VERSION=8.1.1 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=8.1.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.2 b/common/gdb-8.2 old mode 100755 new mode 100644 index 4d6abab..7355d25 --- a/common/gdb-8.2 +++ b/common/gdb-8.2 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export GDB_VERSION=8.2 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=8.2 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.2.1 b/common/gdb-8.2.1 old mode 100755 new mode 100644 index 54a9c56..26e0cac --- a/common/gdb-8.2.1 +++ b/common/gdb-8.2.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export GDB_VERSION=8.2.1 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=8.2.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.3 b/common/gdb-8.3 old mode 100755 new mode 100644 index 5db2b42..789a86b --- a/common/gdb-8.3 +++ b/common/gdb-8.3 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export GDB_VERSION=8.3 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=8.3 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-8.3.1 b/common/gdb-8.3.1 old mode 100755 new mode 100644 index 664a40e..2970fae --- a/common/gdb-8.3.1 +++ b/common/gdb-8.3.1 @@ -1,2 +1,2 @@ -export GDB_VERSION=8.3.1 -export GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +GDB_VERSION=8.3.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/djgpp/all b/djgpp/all old mode 100755 new mode 100644 index 7774dae..0929192 --- a/djgpp/all +++ b/djgpp/all @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - source djgpp/default source djgpp/gdb diff --git a/djgpp/binutils b/djgpp/binutils old mode 100755 new mode 100644 index 019df62..76654a5 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1,3 +1 @@ -#!/usr/bin/env bash - source djgpp/binutils-2.33.1 diff --git a/djgpp/binutils-2.29.1 b/djgpp/binutils-2.29.1 old mode 100755 new mode 100644 index 279db25..142fecd --- a/djgpp/binutils-2.29.1 +++ b/djgpp/binutils-2.29.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export BINUTILS_VERSION=2291 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" +BINUTILS_VERSION=2291 +BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/binutils-2.30 b/djgpp/binutils-2.30 old mode 100755 new mode 100644 index 9f3d65f..ccf2150 --- a/djgpp/binutils-2.30 +++ b/djgpp/binutils-2.30 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export BINUTILS_VERSION=230 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" +BINUTILS_VERSION=230 +BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/binutils-2.31.1 b/djgpp/binutils-2.31.1 old mode 100755 new mode 100644 index d124c0b..71e5b3a --- a/djgpp/binutils-2.31.1 +++ b/djgpp/binutils-2.31.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export BINUTILS_VERSION=2311 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" +BINUTILS_VERSION=2311 +BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/binutils-2.32 b/djgpp/binutils-2.32 old mode 100755 new mode 100644 index 573400b..e81abd7 --- a/djgpp/binutils-2.32 +++ b/djgpp/binutils-2.32 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export BINUTILS_VERSION=232 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" +BINUTILS_VERSION=232 +BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/binutils-2.33.1 b/djgpp/binutils-2.33.1 old mode 100755 new mode 100644 index 8dce433..05ef4b0 --- a/djgpp/binutils-2.33.1 +++ b/djgpp/binutils-2.33.1 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - -export BINUTILS_VERSION=2331 -export BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" +BINUTILS_VERSION=2331 +BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/default b/djgpp/default old mode 100755 new mode 100644 index 9d5336f..d997f2e --- a/djgpp/default +++ b/djgpp/default @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - source djgpp/djgpp source djgpp/binutils source common/gcc diff --git a/djgpp/djgpp b/djgpp/djgpp old mode 100755 new mode 100644 index 1fe9a64..5e947ba --- a/djgpp/djgpp +++ b/djgpp/djgpp @@ -1,3 +1 @@ -#!/usr/bin/env bash - source djgpp/djgpp-2.05 diff --git a/djgpp/djgpp-2.05 b/djgpp/djgpp-2.05 old mode 100755 new mode 100644 index a279d74..e55a0e9 --- a/djgpp/djgpp-2.05 +++ b/djgpp/djgpp-2.05 @@ -1,9 +1,5 @@ -#!/usr/bin/env bash +DJGPP_VERSION=205 -# source tarball versions -export DJGPP_VERSION=205 - -# source tarball locations -export DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJGPP_VERSION}.zip" -export DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJGPP_VERSION}.zip" -export DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJGPP_VERSION}.zip" +DJCRX_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djcrx${DJGPP_VERSION}.zip" +DJLSR_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djlsr${DJGPP_VERSION}.zip" +DJDEV_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2/djdev${DJGPP_VERSION}.zip" diff --git a/djgpp/djgpp-cvs b/djgpp/djgpp-cvs old mode 100755 new mode 100644 diff --git a/djgpp/gdb b/djgpp/gdb old mode 100755 new mode 100644 index da2fb5b..fb4697b --- a/djgpp/gdb +++ b/djgpp/gdb @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - source common/gdb-8.2.1 diff --git a/ia16/binutils b/ia16/binutils old mode 100755 new mode 100644 index efffa2d..a87142f --- a/ia16/binutils +++ b/ia16/binutils @@ -1,3 +1 @@ -#!/usr/bin/env bash - source ia16/binutils-ia16 diff --git a/ia16/binutils-ia16 b/ia16/binutils-ia16 old mode 100755 new mode 100644 diff --git a/ia16/gcc b/ia16/gcc old mode 100755 new mode 100644 diff --git a/ia16/newlib b/ia16/newlib old mode 100755 new mode 100644 diff --git a/newlib/all b/newlib/all old mode 100755 new mode 100644 index 1cdd7b2..fd71014 --- a/newlib/all +++ b/newlib/all @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - source newlib/newlib source binutils/binutils source common/gcc diff --git a/newlib/newlib b/newlib/newlib old mode 100755 new mode 100644 diff --git a/newlib/newlib-3.0.0 b/newlib/newlib-3.0.0 old mode 100755 new mode 100644 index 4306960..b854c38 --- a/newlib/newlib-3.0.0 +++ b/newlib/newlib-3.0.0 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - NEWLIB_VERSION=3.0.0 NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.0.0.20180226 b/newlib/newlib-3.0.0.20180226 old mode 100755 new mode 100644 index 5322027..d842c12 --- a/newlib/newlib-3.0.0.20180226 +++ b/newlib/newlib-3.0.0.20180226 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - NEWLIB_VERSION=3.0.0.20180226 NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.0.0.20180720 b/newlib/newlib-3.0.0.20180720 old mode 100755 new mode 100644 index 5ad82ca..45d2b6d --- a/newlib/newlib-3.0.0.20180720 +++ b/newlib/newlib-3.0.0.20180720 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - NEWLIB_VERSION=3.0.0.20180720 NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.0.0.20180802 b/newlib/newlib-3.0.0.20180802 old mode 100755 new mode 100644 index 401b0b7..d9ee829 --- a/newlib/newlib-3.0.0.20180802 +++ b/newlib/newlib-3.0.0.20180802 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - NEWLIB_VERSION=3.0.0.20180802 NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.1.0 b/newlib/newlib-3.1.0 old mode 100755 new mode 100644 index 729784b..dbf34e1 --- a/newlib/newlib-3.1.0 +++ b/newlib/newlib-3.1.0 @@ -1,4 +1,2 @@ -#!/usr/bin/env bash - NEWLIB_VERSION=3.1.0 NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-3.2.0 b/newlib/newlib-3.2.0 old mode 100755 new mode 100644 diff --git a/newlib/newlib-3.3.0 b/newlib/newlib-3.3.0 old mode 100755 new mode 100644 diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh old mode 100755 new mode 100644 diff --git a/script/build-binutils.sh b/script/build-binutils.sh old mode 100755 new mode 100644 diff --git a/script/build-gdb.sh b/script/build-gdb.sh old mode 100755 new mode 100644 diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh old mode 100755 new mode 100644 diff --git a/script/build-tools.sh b/script/build-tools.sh old mode 100755 new mode 100644 diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh old mode 100755 new mode 100644 diff --git a/script/download.sh b/script/download.sh old mode 100755 new mode 100644 diff --git a/script/finalize.sh b/script/finalize.sh old mode 100755 new mode 100644 diff --git a/script/init.sh b/script/init.sh old mode 100755 new mode 100644 diff --git a/script/mkdirs.sh b/script/mkdirs.sh old mode 100755 new mode 100644 diff --git a/script/parse-args.sh b/script/parse-args.sh old mode 100755 new mode 100644 diff --git a/script/unpack-build-binutils.sh b/script/unpack-build-binutils.sh old mode 100755 new mode 100644 From 2aa6db880532c976f2a769197faa4cc3df7131c1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Feb 2020 20:35:00 +0100 Subject: [PATCH 317/536] implement DESTDIR support --- build-avr.sh | 2 +- build-djgpp.sh | 57 ++++++++++++++++---------------- script/build-avr-gcc.sh | 30 +++++++++-------- script/build-binutils.sh | 4 +-- script/build-gdb.sh | 6 ++-- script/build-newlib-gcc.sh | 23 +++++++------ script/build-tools.sh | 2 +- script/check-deps-and-confirm.sh | 12 ++++--- script/destdir-hack.sh | 7 ++++ script/finalize.sh | 12 +++---- script/mkdirs.sh | 8 ++--- script/parse-args.sh | 1 + 12 files changed, 89 insertions(+), 75 deletions(-) create mode 100755 script/destdir-hack.sh diff --git a/build-avr.sh b/build-avr.sh index f3c5f9e..11d57a5 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -38,7 +38,7 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then case `uname` in MINGW*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;; esac - sed -i "s/-DCMAKE_INSTALL_PREFIX=/-DCMAKE_INSTALL_PREFIX=${PREFIX} #/" Makefile + sed -i "s/-DCMAKE_INSTALL_PREFIX=/-DCMAKE_INSTALL_PREFIX=${DST} #/" Makefile sed -i 's/\/bin\///' cmake/GetGitInfo.cmake ${MAKE} -j${MAKE_JOBS} build || exit 1 ${MAKE} -j${MAKE_JOBS} doc || exit 1 diff --git a/build-djgpp.sh b/build-djgpp.sh index 80c1ba6..45ad97d 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -66,7 +66,7 @@ cd ${BASE}/build/ || exit 1 if [ ! -z ${DJGPP_VERSION} ]; then if [ "${DJGPP_VERSION}" == "cvs" ]; then - cd djgpp-cvs + cd djgpp-cvs || exit 1 else echo "Unpacking djgpp..." rm -rf djgpp-${DJGPP_VERSION}/ @@ -83,7 +83,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then unset COMSPEC sed -i "50cCROSS_PREFIX = ${TARGET}-" makefile.def sed -i "61cGCC = \$(CC) -g -O2 ${CFLAGS}" makefile.def - if [ -e configure-options ] && [ ! "`cat configure-options 2> /dev/null`" == "${TARGET}:${PREFIX}:${CFLAGS_FOR_TARGET}" ]; then + if [ -e configure-options ] && [ ! "`cat configure-options 2> /dev/null`" == "${TARGET}:${DST}:${CFLAGS_FOR_TARGET}" ]; then ${MAKE} -j${MAKE_JOBS} clean fi ${MAKE} misc.exe makemake.exe ../hostbin || exit 1 @@ -97,12 +97,12 @@ if [ ! -z ${DJGPP_VERSION} ]; then *) EXE= ;; esac - echo "Installing djgpp headers" - ${SUDO} mkdir -p $PREFIX/${TARGET}/sys-include || exit 1 - ${SUDO} cp -rp include/* $PREFIX/${TARGET}/sys-include/ || exit 1 - ${SUDO} mkdir -p $PREFIX/bin || exit 1 - ${SUDO} cp -p hostbin/stubify.exe $PREFIX/bin/${TARGET}-stubify${EXE} || exit 1 - ${SUDO} cp -p hostbin/stubedit.exe $PREFIX/bin/${TARGET}-stubedit${EXE} || exit 1 + echo "Installing djgpp headers and utilities" + ${SUDO} mkdir -p ${DST}/${TARGET}/sys-include || exit 1 + ${SUDO} cp -rp include/* ${DST}/${TARGET}/sys-include/ || exit 1 + ${SUDO} mkdir -p ${DST}/bin || exit 1 + ${SUDO} cp -p hostbin/stubify.exe ${DST}/bin/${TARGET}-stubify${EXE} || exit 1 + ${SUDO} cp -p hostbin/stubedit.exe ${DST}/bin/${TARGET}-stubedit${EXE} || exit 1 fi cd ${BASE}/build/ @@ -121,7 +121,7 @@ if [ ! -z ${GCC_VERSION} ]; then untar ${AUTOCONF_ARCHIVE} || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} all install || exit 1 + ${MAKE} -j${MAKE_JOBS} DESTDIR=/ all install || exit 1 rm ${BUILDDIR}/tmpinst/autoconf-*-built touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built else @@ -134,7 +134,7 @@ if [ ! -z ${GCC_VERSION} ]; then untar ${AUTOMAKE_ARCHIVE} || exit 1 cd automake-${AUTOMAKE_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} all install || exit 1 + ${MAKE} DESTDIR=/ all install || exit 1 rm ${BUILDDIR}/tmpinst/automake-*-built touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built else @@ -218,7 +218,7 @@ if [ ! -z ${GCC_VERSION} ]; then sleep 5 fi - cp $PREFIX/bin/${TARGET}-stubify $BUILDDIR/tmpinst/bin/stubify || exit 1 + cp ${DST}/bin/${TARGET}-stubify ${BUILDDIR}/tmpinst/bin/stubify || exit 1 ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 echo "Installing gcc (stage 1)" @@ -227,8 +227,6 @@ if [ ! -z ${GCC_VERSION} ]; then export CFLAGS="$TEMP_CFLAGS" fi -# gcc done - if [ ! -z ${DJGPP_VERSION} ]; then echo "Building djgpp libc" cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src @@ -236,13 +234,13 @@ if [ ! -z ${DJGPP_VERSION} ]; then export CFLAGS="$CFLAGS_FOR_TARGET" sed -i 's/Werror/Wno-error/' makefile.cfg ${MAKE} config || exit 1 - echo "${TARGET}:${PREFIX}:${CFLAGS_FOR_TARGET}" > configure-options + echo "${TARGET}:${DST}:${CFLAGS_FOR_TARGET}" > configure-options ${MAKE} -j${MAKE_JOBS} -C mkdoc || exit 1 ${MAKE} -j${MAKE_JOBS} -C libc || exit 1 echo "Installing djgpp libc" - ${SUDO} mkdir -p ${PREFIX}/${TARGET}/lib - ${SUDO} cp -rp ../lib/* $PREFIX/${TARGET}/lib || exit 1 + ${SUDO} mkdir -p ${DST}/${TARGET}/lib + ${SUDO} cp -rp ../lib/* ${DST}/${TARGET}/lib || exit 1 CFLAGS="$TEMP_CFLAGS" fi @@ -252,6 +250,7 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log echo "Installing gcc (stage 2)" @@ -260,8 +259,8 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install CFLAGS="$TEMP_CFLAGS" - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed fi if [ ! -z ${DJGPP_VERSION} ]; then @@ -281,17 +280,17 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd .. echo "Installing djgpp libraries and utilities" - ${SUDO} cp -rp lib/* $PREFIX/${TARGET}/lib || exit 1 - ${SUDO} cp -p hostbin/exe2coff.exe $PREFIX/bin/${TARGET}-exe2coff${EXE} || exit 1 - ${SUDO} cp -p hostbin/djasm.exe $PREFIX/bin/${TARGET}-djasm${EXE} || exit 1 - ${SUDO} cp -p hostbin/dxegen.exe $PREFIX/bin/${TARGET}-dxegen${EXE} || exit 1 - ${SUDO} ln -fs $PREFIX/bin/${TARGET}-dxegen${EXE} $PREFIX/bin/${TARGET}-dxe3gen${EXE} || exit 1 - ${SUDO} cp -p hostbin/dxe3res.exe $PREFIX/bin/${TARGET}-dxe3res${EXE} || exit 1 - ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/info - ${SUDO} cp -rp info/* ${PREFIX}/${TARGET}/share/info - - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/djgpp-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed + ${SUDO} cp -rp lib/* ${DST}/${TARGET}/lib || exit 1 + ${SUDO} mkdir -p ${DST}/${TARGET}/share/info + ${SUDO} cp -rp info/* ${DST}/${TARGET}/share/info + ${SUDO} cp -p hostbin/exe2coff.exe ${DST}/bin/${TARGET}-exe2coff${EXE} || exit 1 + ${SUDO} cp -p hostbin/djasm.exe ${DST}/bin/${TARGET}-djasm${EXE} || exit 1 + ${SUDO} cp -p hostbin/dxegen.exe ${DST}/bin/${TARGET}-dxegen${EXE} || exit 1 + ${SUDO} cp -p hostbin/dxegen.exe ${DST}/bin/${TARGET}-dxe3gen${EXE} || exit 1 + ${SUDO} cp -p hostbin/dxe3res.exe ${DST}/bin/${TARGET}-dxe3res${EXE} || exit 1 + + ${SUDO} rm -f ${DST}/${TARGET}/etc/djgpp-*-installed + ${SUDO} touch ${DST}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed fi cd ${BASE}/build diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 5c7a3c6..c9a2e5d 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -10,11 +10,11 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then cd .. fi cd avr-libc-${AVRLIBC_VERSION}/ - #${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ - #${SUDO} cp -rv include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + ${SUDO} mkdir -p ${DST}/${TARGET}/include/ + ${SUDO} cp -rv include/* ${DST}/${TARGET}/include/ | exit 1 echo "Installing avr-libc documentation" - ${SUDO} mkdir -p ${PREFIX}/${TARGET}/share/man/ - ${SUDO} cp -rv man/* ${PREFIX}/${TARGET}/share/man/ | exit 1 + ${SUDO} mkdir -p ${DST}/${TARGET}/share/man/ + ${SUDO} cp -rv man/* ${DST}/${TARGET}/share/man/ | exit 1 cd .. fi @@ -44,9 +44,10 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} - --enable-languages=${ENABLE_LANGUAGES} --with-avrlibc --with-headers" + --enable-languages=${ENABLE_LANGUAGES} + --with-avrlibc" strip_whitespace GCC_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then @@ -72,10 +73,10 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then echo "Building avr-libc" mkdir -p avr-libc-${AVRLIBC_VERSION}/build-${TARGET} cd avr-libc-${AVRLIBC_VERSION}/build-${TARGET} || exit 1 - + AVRLIBC_CONFIGURE_OPTIONS+=" --host=${TARGET} --prefix=${PREFIX} ${BUILD_FLAG}" strip_whitespace AVRLIBC_CONFIGURE_OPTIONS - + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${AVRLIBC_CONFIGURE_OPTIONS}" ]; then rm -rf * CC=avr-gcc ../configure ${AVRLIBC_CONFIGURE_OPTIONS} || exit 1 @@ -84,7 +85,7 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then echo "Note: avr-libc already configured. To force a rebuild, use: rm -rf $(pwd)" [ -z ${BUILD_BATCH} ] && sleep 5 fi - + ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avr-libc.log echo "Installing avr-libc" @@ -94,16 +95,17 @@ fi cd ${BASE}/build/ if [ ! -z ${GCC_VERSION} ]; then - cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - echo "Building gcc (stage 2)" + cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + + export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log echo "Installing gcc" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install - - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + + ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed fi diff --git a/script/build-binutils.sh b/script/build-binutils.sh index d624df5..7e4cd79 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -28,5 +28,5 @@ ${MAKE} -j${MAKE_JOBS} || exit 1 echo "Installing binutils" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 -${SUDO} rm -f ${PREFIX}/${TARGET}/etc/binutils-*-installed -${SUDO} touch ${PREFIX}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed +${SUDO} rm -f ${DST}/${TARGET}/etc/binutils-*-installed +${SUDO} touch ${DST}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 421f4f9..4a30001 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -12,7 +12,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Building gdb" GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" - [ -e ${PREFIX}/lib/libmpfr.a ] && GDB_CONFIGURE_OPTIONS+=" --with-mpfr=${PREFIX}" + [ -e ${DST}/lib/libmpfr.a ] && GDB_CONFIGURE_OPTIONS+=" --with-mpfr=${PREFIX}" strip_whitespace GDB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then @@ -28,6 +28,6 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Installing gdb" ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gdb-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/gdb-${GDB_VERSION}-installed + ${SUDO} rm -f ${DST}/${TARGET}/etc/gdb-*-installed + ${SUDO} touch ${DST}/${TARGET}/etc/gdb-${GDB_VERSION}-installed fi diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 9c7379b..1d2fddc 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -3,8 +3,8 @@ cd ${BASE}/build/ if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked ]; then echo "Unpacking newlib..." untar ${NEWLIB_ARCHIVE} - #${SUDO} mkdir -p ${PREFIX}/${TARGET}/sys-include/ - #${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${PREFIX}/${TARGET}/sys-include/ | exit 1 + ${SUDO} mkdir -p ${DST}/${TARGET}/include/ + ${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${DST}/${TARGET}/include/ | exit 1 touch newlib-${NEWLIB_VERSION}/newlib-unpacked fi @@ -36,10 +36,10 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" - + GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES} - --with-newlib --with-headers" + --with-newlib" strip_whitespace GCC_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${GCC_CONFIGURE_OPTIONS}" ]; then @@ -65,10 +65,10 @@ if [ ! -z ${NEWLIB_VERSION} ]; then echo "Building newlib" mkdir -p newlib-${NEWLIB_VERSION}/build-${TARGET} cd newlib-${NEWLIB_VERSION}/build-${TARGET} || exit 1 - + NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" strip_whitespace NEWLIB_CONFIGURE_OPTIONS - + if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then rm -rf * ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 @@ -77,7 +77,7 @@ if [ ! -z ${NEWLIB_VERSION} ]; then echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" [ -z ${BUILD_BATCH} ] && sleep 5 fi - + ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/newlib.log echo "Installing newlib" @@ -90,14 +90,15 @@ cd ${BASE}/build/ if [ ! -z ${GCC_VERSION} ]; then echo "Building gcc (stage 2)" cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 - + + export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" ${MAKE} -j${MAKE_JOBS} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log echo "Installing gcc" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install - - ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${PREFIX}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + + ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed + ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed fi diff --git a/script/build-tools.sh b/script/build-tools.sh index 099625f..b358e6a 100644 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -13,7 +13,7 @@ if [ ! -z $SED_VERSION ]; then export CFLAGS="${CFLAGS//-w}" # configure fails if warnings are disabled. ./configure --prefix=${BASE}/build/tmpinst || exit 1 ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${MAKE} -j${MAKE_JOBS} DESTDIR=/ install || exit 1 CFLAGS="$TEMP_CFLAGS" touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed fi diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index dae05b2..2e7166a 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -87,6 +87,9 @@ if [ -z ${TARGET} ]; then exit 1 fi +DST="${DESTDIR}${PREFIX}" +export DESTDIR + # check required programs REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" @@ -120,6 +123,7 @@ echo "You are about to build and install:" echo "" echo "With the following options:" [ ! -z ${IGNORE_DEPENDENCIES} ] && echo " IGNORE_DEPENDENCIES=${IGNORE_DEPENDENCIES}" +[ ! -z ${DESTDIR} ] && echo " DESTDIR=${DESTDIR}" echo " TARGET=${TARGET}" echo " HOST=${HOST}" echo " BUILD=${BUILD}" @@ -157,16 +161,16 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then fi echo "" -mkdir -p ${PREFIX} 2> /dev/null +mkdir -p ${DST} 2> /dev/null -if [ ! -d ${PREFIX} ] || [ ! -w ${PREFIX} ]; then +if [ ! -d ${DST} ] || [ ! -w ${DST} ]; then if [ ! -z ${BUILD_BATCH} ]; then if ! sudo -n : 2> /dev/null; then - echo "ERROR: no write access to ${PREFIX} (requires sudo)" + echo "ERROR: no write access to ${DST} (requires sudo)" exit 1 fi else - echo "WARNING: no write access to ${PREFIX}" + echo "WARNING: no write access to ${DST}" echo "You may need to enter your sudo password several times during the build process." echo "" fi diff --git a/script/destdir-hack.sh b/script/destdir-hack.sh new file mode 100755 index 0000000..133cb3b --- /dev/null +++ b/script/destdir-hack.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +DIR=$1 +shift +GCC=$1 +shift +${GCC} -B${DIR}/lib/ -isystem ${DIR}/include/ -isystem ${DIR}/sys-include/ "$@" +exit $? diff --git a/script/finalize.sh b/script/finalize.sh index db3b828..a1c10f2 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -1,6 +1,6 @@ echo "Copy long name executables to short name." ( - cd $PREFIX || exit 1 + cd ${DST} || exit 1 ${SUDO} mkdir -p ${TARGET}/bin SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb djasm" for SHORT_NAME in $SHORT_NAME_LIST; do @@ -38,23 +38,23 @@ esac echo "Installing ${TARGET}-setenv" chmod +x ${BASE}/build/${TARGET}-setenv -${SUDO} cp -p ${BASE}/build/${TARGET}-setenv ${PREFIX}/bin/ +${SUDO} cp -p ${BASE}/build/${TARGET}-setenv ${DST}/bin/ case `uname` in MINGW*) ;& -MSYS*) cp -p ${BASE}/build/setenv-${TARGET}.cmd ${PREFIX}/bin/ 2> /dev/null ;; +MSYS*) cp -p ${BASE}/build/setenv-${TARGET}.cmd ${DST}/bin/ 2> /dev/null ;; esac -if [ ! -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ]; then +if [ ! -z "`ls ${DST}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ]; then for x in $(echo $ENABLE_LANGUAGES | tr "," " ") do case $x in c++) echo "Testing C++ compiler: " - ($PREFIX/bin/${TARGET}-c++ ${BASE}/script/hello.c -o hello && echo "PASS") || echo "FAIL" + (${DST}/bin/${TARGET}-c++ ${BASE}/script/hello.c -o hello && echo "PASS") || echo "FAIL" ;; c) echo "Testing C compiler: " - if $PREFIX/bin/${TARGET}-gcc ${BASE}/script/hello.c -o hello; then + if ${DST}/bin/${TARGET}-gcc ${BASE}/script/hello.c -o hello; then echo "PASS" else echo "FAIL" diff --git a/script/mkdirs.sh b/script/mkdirs.sh index 7e209f3..846dce1 100644 --- a/script/mkdirs.sh +++ b/script/mkdirs.sh @@ -1,8 +1,8 @@ -echo "Creating install directory: ${PREFIX}" -[ -d ${PREFIX} ] || ${SUDO} mkdir -p ${PREFIX} || exit 1 -[ -d ${PREFIX}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${PREFIX}/${TARGET}/etc/ || exit 1 +echo "Creating install directory: ${DST}" +[ -d ${DST} ] || ${SUDO} mkdir -p ${DST} || exit 1 +[ -d ${DST}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${DST}/${TARGET}/etc/ || exit 1 -export PATH="${PREFIX}/bin:$PATH" +export PATH="${DST}/bin:${PREFIX}/bin:$PATH" rm -rf ${BASE}/tests mkdir -p ${BASE}/tests diff --git a/script/parse-args.sh b/script/parse-args.sh index bc98727..dabd84b 100644 --- a/script/parse-args.sh +++ b/script/parse-args.sh @@ -31,6 +31,7 @@ for A in "$@"; do --only-download) ONLY_DOWNLOAD=y ;; --ignore-dependencies) IGNORE_DEPENDENCIES=y ;; --batch) BUILD_BATCH=y ;; + --destdir=*) DESTDIR=${A#*=} ;; --prefix=*) PREFIX=${A#*=} ;; --target=*) TARGET=${A#*=} ;; --enable-languages=*) ENABLE_LANGUAGES=${A#*=} ;; From 067c7071d7806a8c1ee75fe731fea39d395f9a48 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 16:04:51 +0100 Subject: [PATCH 318/536] add gdb 9.1 --- common/gdb | 2 +- common/gdb-9.1 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 common/gdb-9.1 diff --git a/common/gdb b/common/gdb index 1a13f6d..7c37f86 100644 --- a/common/gdb +++ b/common/gdb @@ -1,2 +1,2 @@ -source common/gdb-8.3.1 +source common/gdb-9.1 diff --git a/common/gdb-9.1 b/common/gdb-9.1 new file mode 100644 index 0000000..964392a --- /dev/null +++ b/common/gdb-9.1 @@ -0,0 +1,2 @@ +GDB_VERSION=9.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From c9d0532aa73be35ee0b05da8b36b19e3a2641892 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 16:27:57 +0100 Subject: [PATCH 319/536] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 58f1c62..9d349c7 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ * 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 2020-02-03: +### Current package versions, as of 2020-02-08: * gcc 9.2.0 * binutils 2.34 -* gdb 8.3.1 +* gdb 9.1 * djgpp 2.05 / cvs * newlib 3.3.0 * avr-libc 2.0.0 From 9e8cab0ba7807c023ca154b8cbd9f81530a3f43b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 16:38:24 +0100 Subject: [PATCH 320/536] merge mkdirs.sh into download.sh --- build-avr.sh | 1 - build-djgpp.sh | 1 - build-ia16.sh | 1 - build-newlib.sh | 1 - script/download.sh | 9 +++++++++ script/mkdirs.sh | 9 --------- 6 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 script/mkdirs.sh diff --git a/build-avr.sh b/build-avr.sh index 11d57a5..646e2e0 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -25,7 +25,6 @@ DEPS="" source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh -source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh source ${BASE}/script/unpack-build-binutils.sh source ${BASE}/script/build-avr-gcc.sh diff --git a/build-djgpp.sh b/build-djgpp.sh index 45ad97d..5b3b361 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -31,7 +31,6 @@ DEPS="" source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh -source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 diff --git a/build-ia16.sh b/build-ia16.sh index 9da31d0..9feaa07 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -25,7 +25,6 @@ DEPS="" source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh -source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 diff --git a/build-newlib.sh b/build-newlib.sh index 1770f44..a9cba2f 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -22,7 +22,6 @@ DEPS="" source ${BASE}/script/check-deps-and-confirm.sh source ${BASE}/script/download.sh -source ${BASE}/script/mkdirs.sh source ${BASE}/script/build-tools.sh source ${BASE}/script/unpack-build-binutils.sh source ${BASE}/script/build-newlib-gcc.sh diff --git a/script/download.sh b/script/download.sh index d196b97..d250bde 100644 --- a/script/download.sh +++ b/script/download.sh @@ -74,3 +74,12 @@ for ARCHIVE in $ARCHIVE_LIST; do done [ ! -z ${ONLY_DOWNLOAD} ] && exit 0 + +echo "Creating install directory: ${DST}" +[ -d ${DST} ] || ${SUDO} mkdir -p ${DST} || exit 1 +[ -d ${DST}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${DST}/${TARGET}/etc/ || exit 1 + +export PATH="${DST}/bin:${PREFIX}/bin:$PATH" + +rm -rf ${BASE}/tests +mkdir -p ${BASE}/tests diff --git a/script/mkdirs.sh b/script/mkdirs.sh deleted file mode 100644 index 846dce1..0000000 --- a/script/mkdirs.sh +++ /dev/null @@ -1,9 +0,0 @@ -echo "Creating install directory: ${DST}" -[ -d ${DST} ] || ${SUDO} mkdir -p ${DST} || exit 1 -[ -d ${DST}/${TARGET}/etc/ ] || ${SUDO} mkdir -p ${DST}/${TARGET}/etc/ || exit 1 - -export PATH="${DST}/bin:${PREFIX}/bin:$PATH" - -rm -rf ${BASE}/tests -mkdir -p ${BASE}/tests -mkdir -p ${BASE}/build From 4196c76a2bcb1e08c6b47a97b3e2a782cc1d4a32 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 16:45:27 +0100 Subject: [PATCH 321/536] merge parse-args.sh into init.sh --- build-avr.sh | 4 +--- build-djgpp.sh | 4 +--- build-ia16.sh | 4 +--- build-newlib.sh | 4 +--- script/init.sh | 56 +++++++++++++++++++++++++++++++++++++------- script/parse-args.sh | 40 ------------------------------- 6 files changed, 51 insertions(+), 61 deletions(-) delete mode 100644 script/parse-args.sh diff --git a/build-avr.sh b/build-avr.sh index 646e2e0..d45e990 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -1,9 +1,7 @@ #!/usr/bin/env bash -source script/init.sh - PACKAGE_SOURCES="avr binutils common" -source script/parse-args.sh +source script/init.sh TARGET="avr" diff --git a/build-djgpp.sh b/build-djgpp.sh index 5b3b361..3796ba4 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -1,10 +1,8 @@ #!/usr/bin/env bash -source script/init.sh - DJGPP_DOWNLOAD_BASE="http://www.mirrorservice.org/sites/ftp.delorie.com/pub" PACKAGE_SOURCES="djgpp common" -source script/parse-args.sh +source script/init.sh case $TARGET in *-msdosdjgpp) ;; diff --git a/build-ia16.sh b/build-ia16.sh index 9feaa07..dee048e 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -1,9 +1,7 @@ #!/usr/bin/env bash -source script/init.sh - PACKAGE_SOURCES="ia16 binutils" -source script/parse-args.sh +source script/init.sh TARGET="ia16-elf" diff --git a/build-newlib.sh b/build-newlib.sh index a9cba2f..3d8119d 100755 --- a/build-newlib.sh +++ b/build-newlib.sh @@ -1,9 +1,7 @@ #!/usr/bin/env bash -source script/init.sh - PACKAGE_SOURCES="newlib binutils common" -source script/parse-args.sh +source script/init.sh prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror --disable-nls" diff --git a/script/init.sh b/script/init.sh index 9f78fd9..16243b5 100644 --- a/script/init.sh +++ b/script/init.sh @@ -1,14 +1,8 @@ unset CDPATH +unset SUDO BASE=`pwd` -# target directory -PREFIX=${PREFIX-/usr/local/cross} - -# enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} - # number of parallel build threads if nproc > /dev/null 2>&1 ; then MAKE_JOBS=${MAKE_JOBS-`nproc --all`} @@ -16,8 +10,6 @@ else MAKE_JOBS=${MAKE_JOBS-`sysctl -n hw.physicalcpu`} fi -SUDO= - # use gmake/clang under FreeBSD if [ `uname` = "FreeBSD" ]; then MAKE=${MAKE-gmake} @@ -59,3 +51,49 @@ untar() strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } prepend() { eval "$1=\"$2 ${!1}\""; } + +add_pkg() +{ + for DIR in ${PACKAGE_SOURCES}; do + if [ -e $DIR/$1 ]; then + source $DIR/$1 + return + fi + done + echo "Unrecognized option or invalid package: $1" + exit 1 +} + +if [ -z $1 ]; then + echo "Usage: $0 [options...] [packages...]" + echo "Supported options:" + echo " --prefix=[...]" + echo " --target=[...]" + echo " --enable-languages=[...]" + echo "Supported packages:" + for DIR in ${PACKAGE_SOURCES}; do + ls $DIR + done + exit 1 +fi + +for A in "$@"; do + case $A in + --no-download) NO_DOWNLOAD=y ;; + --only-download) ONLY_DOWNLOAD=y ;; + --ignore-dependencies) IGNORE_DEPENDENCIES=y ;; + --batch) BUILD_BATCH=y ;; + --destdir=*) DESTDIR=${A#*=} ;; + --prefix=*) PREFIX=${A#*=} ;; + --target=*) TARGET=${A#*=} ;; + --enable-languages=*) ENABLE_LANGUAGES=${A#*=} ;; + *) add_pkg $A ;; + esac +done + +# install directory +PREFIX=${PREFIX-/usr/local/cross} + +# enabled languages +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} +ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} diff --git a/script/parse-args.sh b/script/parse-args.sh deleted file mode 100644 index dabd84b..0000000 --- a/script/parse-args.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env false - -if [ -z $1 ]; then - echo "Usage: $0 [options...] [packages...]" - echo "Supported options:" - echo " --prefix=[...]" - echo " --target=[...]" - echo " --enable-languages=[...]" - echo "Supported packages:" - for DIR in ${PACKAGE_SOURCES}; do - ls $DIR - done - exit 1 -fi - -add_pkg() -{ - for DIR in ${PACKAGE_SOURCES}; do - if [ -e $DIR/$1 ]; then - source $DIR/$1 - return - fi - done - echo "Unrecognized option or invalid package: $1" - exit 1 -} - -for A in "$@"; do - case $A in - --no-download) NO_DOWNLOAD=y ;; - --only-download) ONLY_DOWNLOAD=y ;; - --ignore-dependencies) IGNORE_DEPENDENCIES=y ;; - --batch) BUILD_BATCH=y ;; - --destdir=*) DESTDIR=${A#*=} ;; - --prefix=*) PREFIX=${A#*=} ;; - --target=*) TARGET=${A#*=} ;; - --enable-languages=*) ENABLE_LANGUAGES=${A#*=} ;; - *) add_pkg $A ;; - esac -done From 39cfccd8f3612292e38983f1c4842602667d79c7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 18:58:43 +0100 Subject: [PATCH 322/536] split tests into separate download and build steps. --- .github/workflows/main.yml | 9 +++++++-- script/test.sh | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25263db..4ddc1ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,8 +49,13 @@ jobs: run: | brew update brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool + - name: Download sources + env: + TARGET: ${{ matrix.env.TARGET }} + PACKAGES: ${{ matrix.env.PACKAGES }} + run: ./script/test.sh --only-download - name: Build - env: + env: TARGET: ${{ matrix.env.TARGET }} PACKAGES: ${{ matrix.env.PACKAGES }} - run: ./script/test.sh + run: ./script/test.sh --no-download diff --git a/script/test.sh b/script/test.sh index e6f6804..21cd271 100755 --- a/script/test.sh +++ b/script/test.sh @@ -8,4 +8,4 @@ avr) SCRIPT=./build-avr.sh ;; *) SCRIPT=./build-newlib.sh ;; esac -${SCRIPT} --batch --prefix=`pwd`/install --target=${TARGET} ${PACKAGES} +${SCRIPT} --batch --prefix=`pwd`/install --target=${TARGET} ${PACKAGES} "$@" From a4e0a14834e9245867b57e7c692855a3b153c3f6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 20:20:40 +0100 Subject: [PATCH 323/536] re-clone git sources if remote url does not match --- script/download.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/script/download.sh b/script/download.sh index d250bde..2805fec 100644 --- a/script/download.sh +++ b/script/download.sh @@ -36,34 +36,36 @@ fi download_git() { + mkdir -p ${BASE}/build + pushd ${BASE}/build || exit 1 local repo=$(basename $1) repo=${repo%.*} - if [ ! -d $repo ]; then + if [ ! -d $repo/ ] || [ "`cd $repo/ && git remote get-url origin`" != "$1" ]; then if [ -z ${NO_DOWNLOAD} ]; then echo "Downloading ${repo}..." + rm -rf $repo/ git clone $1 --depth 1 $([ "$2" != "" ] && echo "--branch $2") else echo "Missing: ${repo}" exit 1 fi fi - cd $repo || exit 1 + cd $repo/ || exit 1 git reset --hard HEAD git checkout $2 - [ -z ${NO_DOWNLOAD} ] && (git pull || exit 1) - cd .. + if [ -z ${NO_DOWNLOAD} ]; then + git pull || exit 1 + fi + popd } # these variables are of the form "git://url/repo.git::branch" # if 'branch' is empty then the default branch is checked out. GIT_LIST="$DJGPP_GIT $GCC_GIT $BINUTILS_GIT $NEWLIB_GIT $SIMULAVR_GIT" -( - mkdir -p build - cd build || exit 1 - for REPO in $GIT_LIST; do - download_git ${REPO%::*} ${REPO##*::} - done -) + +for REPO in $GIT_LIST; do + download_git ${REPO%::*} ${REPO##*::} +done for ARCHIVE in $ARCHIVE_LIST; do FILE=`basename $ARCHIVE` From e844d300412a90a0204725d30bbacacddc9e64fe Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 19:13:23 +0100 Subject: [PATCH 324/536] cache sources and dependencies in test builds. --- .github/workflows/main.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ddc1ed..4e9e645 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,6 +37,21 @@ jobs: steps: - uses: actions/checkout@v2 + + - name: Cache dependencies (ubuntu) + uses: actions/cache@v1.1.2 + if: contains(matrix.os, 'ubuntu') + with: + path: /var/cache/apt + key: testbuilds-deps-ubuntu + + - name: Cache dependencies (macos) + uses: actions/cache@v1.1.2 + if: contains(matrix.os, 'macos') + with: + path: ~/Library/Caches/Homebrew + key: testbuilds-deps-macos + - name: Install dependencies (ubuntu) if: contains(matrix.os, 'ubuntu') run: | @@ -44,16 +59,25 @@ jobs: sudo apt-get update sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-9 g++-9 export CC=gcc-9 CXX=g++-9 + - name: Install dependencies (macos) if: contains(matrix.os, 'macos') run: | brew update brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool + + - name: Cache sources + uses: actions/cache@v1.1.2 + with: + path: download + key: 'testbuilds-sources-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}' + - name: Download sources env: TARGET: ${{ matrix.env.TARGET }} PACKAGES: ${{ matrix.env.PACKAGES }} run: ./script/test.sh --only-download + - name: Build env: TARGET: ${{ matrix.env.TARGET }} From ab9d4919466ee4ff988b9cfb5540078dc81b143b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 20:41:30 +0100 Subject: [PATCH 325/536] make sources cache in test builds os-dependent. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e9e645..29918e0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,7 +70,7 @@ jobs: uses: actions/cache@v1.1.2 with: path: download - key: 'testbuilds-sources-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}' + key: 'testbuilds-sources-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}' - name: Download sources env: From 5642098259a06c4d6469cda6dfc6377af58c85a8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 23:03:40 +0100 Subject: [PATCH 326/536] retry if download fails. --- script/download.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/script/download.sh b/script/download.sh index 2805fec..6ca1e3c 100644 --- a/script/download.sh +++ b/script/download.sh @@ -19,16 +19,20 @@ if [ -z ${NO_DOWNLOAD} ]; then else DL_CMD="curl -f $ARCHIVE -L -o $FILE" fi - echo "Command : $DL_CMD" - if ! eval $DL_CMD; then - if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then - echo "$FILE maybe moved to deleted/ directory." + while true; do + if eval $DL_CMD; then + break else - rm $FILE - echo "Download $ARCHIVE failed." - exit 1 + if [ "$ARCHIVE" == "$DJCROSS_GCC_ARCHIVE" ]; then + echo "$FILE maybe moved to deleted/ directory." + break + else + rm $FILE + echo "Download $FILE failed, retrying in 5 seconds... (press CTRL-C to abort)" + sleep 5 + fi fi - fi + done fi done cd .. From 96840fa3b21a34b0fb1ce1d4685b60a509cfaac5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Feb 2020 23:04:13 +0100 Subject: [PATCH 327/536] use custom cache action in test builds. --- .github/workflows/main.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 29918e0..75ea834 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,19 +38,29 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Cache dependencies (ubuntu) - uses: actions/cache@v1.1.2 + - name: Cache apt package lists + uses: jwt27/cache@dist if: contains(matrix.os, 'ubuntu') + id: cache-apt-lists + with: + path: /var/lib/apt/lists + key: testbuild-apt-lists + + - name: Cache apt package cache + uses: jwt27/cache@dist + if: contains(matrix.os, 'ubuntu') + id: cache-apt-cache with: path: /var/cache/apt - key: testbuilds-deps-ubuntu + key: testbuild-apt-cache - - name: Cache dependencies (macos) - uses: actions/cache@v1.1.2 + - name: Cache brew package cache + uses: jwt27/cache@dist if: contains(matrix.os, 'macos') + id: cache-brew-cache with: path: ~/Library/Caches/Homebrew - key: testbuilds-deps-macos + key: testbuild-brew-cache - name: Install dependencies (ubuntu) if: contains(matrix.os, 'ubuntu') @@ -67,10 +77,11 @@ jobs: brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool - name: Cache sources - uses: actions/cache@v1.1.2 + uses: jwt27/cache@dist + id: cache-sources with: path: download - key: 'testbuilds-sources-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}' + key: 'testbuild-sources-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}' - name: Download sources env: From 3b1d2ad84a15a1d8fd2d1e13a7b4103bcccf0b9d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Feb 2020 03:53:09 +0100 Subject: [PATCH 328/536] use ::set-env to export variables in workflow script. --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75ea834..28af874 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,8 @@ jobs: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-9 g++-9 - export CC=gcc-9 CXX=g++-9 + echo "::set-env name=CC::gcc-9" + echo "::set-env name=CXX::g++-9" - name: Install dependencies (macos) if: contains(matrix.os, 'macos') From 50b78bcda59f5cb73bfa43681df9cc34260de9d6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Feb 2020 16:31:54 +0100 Subject: [PATCH 329/536] clear package caches in test builds and always save a new action cache --- .github/workflows/main.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28af874..5e4f605 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,29 +38,42 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Clear apt package cache + if: contains(matrix.os, 'ubuntu') + run: | + sudo apt-get clean + + - name: Clear brew package cache + if: contains(matrix.os, 'macos') + run: | + rm -rf $(brew --cache) + - name: Cache apt package lists uses: jwt27/cache@dist if: contains(matrix.os, 'ubuntu') - id: cache-apt-lists with: path: /var/lib/apt/lists - key: testbuild-apt-lists + key: testbuild-apt-lists-${{ github.sha }} + restore-keys: | + testbuild-apt-lists- - name: Cache apt package cache uses: jwt27/cache@dist if: contains(matrix.os, 'ubuntu') - id: cache-apt-cache with: path: /var/cache/apt - key: testbuild-apt-cache + key: testbuild-apt-cache-${{ github.sha }} + restore-keys: | + testbuild-apt-cache- - name: Cache brew package cache uses: jwt27/cache@dist if: contains(matrix.os, 'macos') - id: cache-brew-cache with: path: ~/Library/Caches/Homebrew - key: testbuild-brew-cache + key: testbuild-brew-cache-${{ github.sha }} + restore-keys: | + testbuild-brew-cache- - name: Install dependencies (ubuntu) if: contains(matrix.os, 'ubuntu') @@ -79,10 +92,11 @@ jobs: - name: Cache sources uses: jwt27/cache@dist - id: cache-sources with: path: download - key: 'testbuild-sources-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}' + key: testbuild-sources-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}-${{ github.sha }} + restore-keys: | + testbuild-sources-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}- - name: Download sources env: From a15e0556ad89c7f3915bbebff29978c46cc53f56 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Feb 2020 17:50:49 +0100 Subject: [PATCH 330/536] fix instances where exit is called from a subshell. --- build-djgpp.sh | 23 +++++++++++------------ script/build-avr-gcc.sh | 17 ++++++++--------- script/build-newlib-gcc.sh | 17 ++++++++--------- script/finalize.sh | 21 ++++++++++----------- 4 files changed, 37 insertions(+), 41 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 3796ba4..e12ee59 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -176,18 +176,17 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR/ echo "Unpacking gcc dependencies" - ( - cd gnu/gcc-${GCC_VERSION} || exit 1 - - for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do - FILE=`basename $URL` - untar ${FILE} - mv ${FILE%.*.*} ${FILE%%-*} - done - - # apply extra patches if necessary - [ -e ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt ] && patch -p 1 -u -i ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt - ) + pushd gnu/gcc-${GCC_VERSION} || exit 1 + + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + FILE=`basename $URL` + untar ${FILE} + mv ${FILE%.*.*} ${FILE%%-*} || exit 1 + done + + # apply extra patches if necessary + [ -e ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt ] && patch -p 1 -u -i ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt + popd touch gcc-unpacked else diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index c9a2e5d..74c57dd 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -24,17 +24,16 @@ if [ ! -z ${GCC_VERSION} ]; then untar ${GCC_ARCHIVE} echo "Unpacking gcc dependencies" - ( - cd gcc-${GCC_VERSION} || exit 1 + pushd gcc-${GCC_VERSION} || exit 1 - for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do - FILE=`basename $URL` - untar ${FILE} - mv ${FILE%.*.*} ${FILE%%-*} - done + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + FILE=`basename $URL` + untar ${FILE} + mv ${FILE%.*.*} ${FILE%%-*} || exit 1 + done - touch gcc-unpacked - ) + touch gcc-unpacked + popd fi echo "Building gcc (stage 1)" diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 1d2fddc..9e2bcab 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -14,17 +14,16 @@ if [ ! -z ${GCC_VERSION} ]; then untar ${GCC_ARCHIVE} echo "Unpacking gcc dependencies" - ( - cd gcc-${GCC_VERSION} || exit 1 + pushd gcc-${GCC_VERSION} || exit 1 - for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do - FILE=`basename $URL` - untar ${FILE} - mv ${FILE%.*.*} ${FILE%%-*} - done + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + FILE=`basename $URL` + untar ${FILE} + mv ${FILE%.*.*} ${FILE%%-*} || exit 1 + done - touch gcc-unpacked - ) + touch gcc-unpacked + popd else echo "gcc already unpacked, skipping." fi diff --git a/script/finalize.sh b/script/finalize.sh index a1c10f2..6a139cf 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -1,15 +1,14 @@ echo "Copy long name executables to short name." -( - cd ${DST} || exit 1 - ${SUDO} mkdir -p ${TARGET}/bin - SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb djasm" - for SHORT_NAME in $SHORT_NAME_LIST; do - if [ -f bin/${TARGET}-$SHORT_NAME ]; then - ${SUDO} cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME - fi - done - ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} -) +pushd ${DST} || exit 1 +${SUDO} mkdir -p ${TARGET}/bin +SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb djasm" +for SHORT_NAME in $SHORT_NAME_LIST; do + if [ -f bin/${TARGET}-$SHORT_NAME ]; then + ${SUDO} cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME + fi +done +${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} +popd cat << STOP > ${BASE}/build/${TARGET}-setenv if ! (return 2> /dev/null); then From 9b001984eba21cfb62d881836738a516985caf18 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Feb 2020 17:51:16 +0100 Subject: [PATCH 331/536] exit if tar fails --- script/init.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/init.sh b/script/init.sh index 16243b5..bfe11fe 100644 --- a/script/init.sh +++ b/script/init.sh @@ -37,6 +37,7 @@ fi untar() { + [ -z $1 ] && return local file=$(basename $1) local ext=${file##*.} local param="-a" @@ -45,7 +46,7 @@ untar() bz2) param="-j" ;; gz) param="-z" ;; esac - tar -x ${param} -f ${BASE}/download/${file} + tar -x ${param} -f ${BASE}/download/${file} || exit 1 } strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } From 931ac50112d0382f1a1b45d0b6a31e8b447ca0a6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Feb 2020 18:57:00 +0100 Subject: [PATCH 332/536] test both clean builds and rebuilds. --- .github/workflows/main.yml | 24 ++++++++++++++++++++---- script/{test.sh => select-script.sh} | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) rename script/{test.sh => select-script.sh} (73%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e4f605..59bc855 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest ] + build-type: [ clean, rebuild ] env: - TARGET: i586-pc-msdosdjgpp @@ -102,10 +103,25 @@ jobs: env: TARGET: ${{ matrix.env.TARGET }} PACKAGES: ${{ matrix.env.PACKAGES }} - run: ./script/test.sh --only-download + run: ./script/select-script.sh --only-download - - name: Build + - name: Cache build output + uses: jwt27/cache@dist + if: matrix.build-type == 'rebuild' + with: + path: build + key: testbuild-build-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}-${{ github.sha }} + restore-keys: | + testbuild-build-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}- + + - name: Clean build + if: matrix.build-type == 'clean' env: TARGET: ${{ matrix.env.TARGET }} - PACKAGES: ${{ matrix.env.PACKAGES }} - run: ./script/test.sh --no-download + run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }} ${{ matrix.env.PACKAGES }} + + - name: Rebuild + if: matrix.build-type == 'rebuild' + env: + TARGET: ${{ matrix.env.TARGET }} + run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }}-${{ github.sha }} ${{ matrix.env.PACKAGES }} diff --git a/script/test.sh b/script/select-script.sh similarity index 73% rename from script/test.sh rename to script/select-script.sh index 21cd271..1fece6d 100755 --- a/script/test.sh +++ b/script/select-script.sh @@ -8,4 +8,4 @@ avr) SCRIPT=./build-avr.sh ;; *) SCRIPT=./build-newlib.sh ;; esac -${SCRIPT} --batch --prefix=`pwd`/install --target=${TARGET} ${PACKAGES} "$@" +${SCRIPT} --batch --target=${TARGET} ${PACKAGES} "$@" From 9329955bd0e6dc8e798b39020b0e4e698c48217d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Feb 2020 19:07:57 +0100 Subject: [PATCH 333/536] run test builds every 6 days. --- .github/workflows/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59bc855..26e85e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,10 @@ name: Test builds -on: [push, pull_request] +on: + push: + pull_request: + schedule: + - cron: '0 0 */6 * *' jobs: build: From 9fc346a4de613a92cf3f60f3ad3dc87f61c64172 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Feb 2020 20:39:50 +0100 Subject: [PATCH 334/536] add 'rebuild if uncached' step in workflow. --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26e85e5..ac20874 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -112,6 +112,7 @@ jobs: - name: Cache build output uses: jwt27/cache@dist if: matrix.build-type == 'rebuild' + id: cache-build with: path: build key: testbuild-build-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}-${{ github.sha }} @@ -129,3 +130,9 @@ jobs: env: TARGET: ${{ matrix.env.TARGET }} run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }}-${{ github.sha }} ${{ matrix.env.PACKAGES }} + + - name: Rebuild if uncached + if: matrix.build-type == 'rebuild' && steps.cache-build.outputs.cache-hit != 'true' + env: + TARGET: ${{ matrix.env.TARGET }} + run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }}-${{ github.sha }} ${{ matrix.env.PACKAGES }} From c81eff6afd523f2355385ecc072444fa1d53de82 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Feb 2020 22:48:14 +0100 Subject: [PATCH 335/536] don't change prefix for rebuild tests. --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac20874..58692c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -123,16 +123,16 @@ jobs: if: matrix.build-type == 'clean' env: TARGET: ${{ matrix.env.TARGET }} - run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }} ${{ matrix.env.PACKAGES }} + run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }}-${{ github.sha }} ${{ matrix.env.PACKAGES }} - name: Rebuild if: matrix.build-type == 'rebuild' env: TARGET: ${{ matrix.env.TARGET }} - run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }}-${{ github.sha }} ${{ matrix.env.PACKAGES }} + run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }} ${{ matrix.env.PACKAGES }} - name: Rebuild if uncached if: matrix.build-type == 'rebuild' && steps.cache-build.outputs.cache-hit != 'true' env: TARGET: ${{ matrix.env.TARGET }} - run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }}-${{ github.sha }} ${{ matrix.env.PACKAGES }} + run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }} ${{ matrix.env.PACKAGES }} From 2044d20c62aaad2aa74291300e65658a06c776cf Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 10 Feb 2020 19:53:26 +0100 Subject: [PATCH 336/536] add patch to prevent overriding CFLAGS in djgpp libc. --- ...-in-libc-posix-regex-makefile-instea.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patch/djlsr205/0001-append-to-CFLAGS-in-libc-posix-regex-makefile-instea.patch diff --git a/patch/djlsr205/0001-append-to-CFLAGS-in-libc-posix-regex-makefile-instea.patch b/patch/djlsr205/0001-append-to-CFLAGS-in-libc-posix-regex-makefile-instea.patch new file mode 100644 index 0000000..1676e0e --- /dev/null +++ b/patch/djlsr205/0001-append-to-CFLAGS-in-libc-posix-regex-makefile-instea.patch @@ -0,0 +1,26 @@ +From 9e29f38d2ce073bc209cafbb9341dd5756b743da Mon Sep 17 00:00:00 2001 +From: "J.W. Jagersma" +Date: Mon, 10 Feb 2020 18:31:38 +0100 +Subject: [PATCH] append to CFLAGS in libc/posix/regex/makefile, instead of + overriding it. + +--- + src/libc/posix/regex/makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libc/posix/regex/makefile b/src/libc/posix/regex/makefile +index ef3ca5c1..b8fc260f 100644 +--- a/src/libc/posix/regex/makefile ++++ b/src/libc/posix/regex/makefile +@@ -4,7 +4,7 @@ + TOP=../.. + + # supress all warnings here +-CFLAGS = -w ++CFLAGS += -w + + SRC += regcomp.c + SRC += regerror.c +-- +2.25.0 + From 4f90e018e77de59ebb1a5ee9e6e20b1b4163f3b1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 10 Feb 2020 20:26:01 +0100 Subject: [PATCH 337/536] copy all executables installed by gcc and binutils from long-name to short-name form. --- script/finalize.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 6a139cf..ac49013 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -1,13 +1,20 @@ echo "Copy long name executables to short name." pushd ${DST} || exit 1 ${SUDO} mkdir -p ${TARGET}/bin -SHORT_NAME_LIST="gcc g++ c++ addr2line c++filt cpp size strings dxegen dxe3gen dxe3res exe2coff stubify stubedit gdb djasm" +SHORT_NAME_LIST="dxegen dxe3gen dxe3res exe2coff stubify stubedit djasm gdb + g++ c++ cpp gcc gprof gcc-nm gcov-tool gcc-ranlib gcc-ar gcov-dump gcov + strings ld readelf ld.bfd size addr2line setenv strip objcopy c++filt ar gprof ranlib as nm elfedit objdump" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/${TARGET}-$SHORT_NAME ]; then ${SUDO} cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME fi done -${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} +if [ ! -z ${GCC_VERSION} ]; then + ${SUDO} cp -p bin/${TARGET}-gcc bin/${TARGET}-gcc-${GCC_VERSION} 2> /dev/null + ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} 2> /dev/null + ${SUDO} cp -p ${TARGET}/bin/gcc ${TARGET}/bin/gcc-${GCC_VERSION} 2> /dev/null + ${SUDO} cp -p ${TARGET}/bin/g++ ${TARGET}/bin/g++-${GCC_VERSION} 2> /dev/null +fi popd cat << STOP > ${BASE}/build/${TARGET}-setenv From c53d8e0f7e8b4728fd4ade4dc09f38586715433b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 10 Feb 2020 20:29:04 +0100 Subject: [PATCH 338/536] install mpfr to temporary directory --- build-djgpp.sh | 2 +- script/build-avr-gcc.sh | 2 +- script/build-gdb.sh | 2 +- script/build-newlib-gcc.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index e12ee59..f596575 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -252,7 +252,7 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Installing gcc (stage 2)" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install DESTDIR=${BASE}/build/tmpinst CFLAGS="$TEMP_CFLAGS" ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 74c57dd..90ae6fa 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -103,7 +103,7 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Installing gcc" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install DESTDIR=${BASE}/build/tmpinst ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 4a30001..2597269 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -12,7 +12,7 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Building gdb" GDB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" - [ -e ${DST}/lib/libmpfr.a ] && GDB_CONFIGURE_OPTIONS+=" --with-mpfr=${PREFIX}" + [ -e ${BASE}/build/tmpinst${PREFIX}/lib/libmpfr.a ] && GDB_CONFIGURE_OPTIONS+=" --with-mpfr=${BASE}/build/tmpinst${PREFIX}" strip_whitespace GDB_CONFIGURE_OPTIONS if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" = "${GDB_CONFIGURE_OPTIONS}" ]; then diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 9e2bcab..319c8b8 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -96,7 +96,7 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Installing gcc" ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install + ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install DESTDIR=${BASE}/build/tmpinst ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed From 66aaabb67667e39bdb0ce157e17c078ff27f7996 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 10 Feb 2020 21:58:54 +0100 Subject: [PATCH 339/536] suppress errors from make zoneinfo. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index f596575..4a38796 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -270,7 +270,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${MAKE} -j${MAKE_JOBS} -C libemu || exit 1 ${MAKE} -j${MAKE_JOBS} -C libm || exit 1 ${MAKE} -j${MAKE_JOBS} -C docs || exit 1 - ${MAKE} -j${MAKE_JOBS} -C ../zoneinfo/src + ${MAKE} -j${MAKE_JOBS} -C ../zoneinfo/src 2> /dev/null ${MAKE} -j${MAKE_JOBS} -f makempty || exit 1 CFLAGS="$TEMP_CFLAGS" cd .. From 648ba9d482f9453470d51b18ebc03321ecef7613 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 10 Feb 2020 21:59:36 +0100 Subject: [PATCH 340/536] install info/man files in target directory too. --- script/finalize.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/script/finalize.sh b/script/finalize.sh index ac49013..be29020 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -1,5 +1,5 @@ -echo "Copy long name executables to short name." pushd ${DST} || exit 1 +echo "Copy long name executables to short name." ${SUDO} mkdir -p ${TARGET}/bin SHORT_NAME_LIST="dxegen dxe3gen dxe3res exe2coff stubify stubedit djasm gdb g++ c++ cpp gcc gprof gcc-nm gcov-tool gcc-ranlib gcc-ar gcov-dump gcov @@ -15,6 +15,26 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} cp -p ${TARGET}/bin/gcc ${TARGET}/bin/gcc-${GCC_VERSION} 2> /dev/null ${SUDO} cp -p ${TARGET}/bin/g++ ${TARGET}/bin/g++-${GCC_VERSION} 2> /dev/null fi + +echo "Installing info files" +${SUDO} mkdir -p ${TARGET}/share/info +INFO_LIST="libquadmath.info gccint.info gcc.info cpp.info cppinternals.info gccinstall.info + gprof.info binutils.info as.info ld.info bfd.info annotate.info gdb.info stabs.info" +for INFO_FILE in $INFO_LIST; do + if [ -f share/info/$INFO_FILE ]; then + ${SUDO} cp -p share/info/$INFO_FILE ${TARGET}/share/info/$INFO_FILE + ${SUDO} install-info ${TARGET}/share/info/$INFO_FILE ${TARGET}/share/info/dir + fi +done + +echo "Installing man pages" +${SUDO} mkdir -p ${TARGET}/man/man7 +MAN_LIST="fsf-funding.7 gpl.7 gfdl.7" +for MAN_FILE in $MAN_LIST; do + if [ -f share/man/man7/$MAN_FILE ]; then + ${SUDO} cp -p share/man/man7/$MAN_FILE ${TARGET}/share/man/man7/$MAN_FILE + fi +done popd cat << STOP > ${BASE}/build/${TARGET}-setenv From 1ed6ef3c6564ac9780df14c9851096347394ebf3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 10 Feb 2020 23:02:58 +0100 Subject: [PATCH 341/536] don't test rebuilds for now --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58692c3..ad0f95a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest ] - build-type: [ clean, rebuild ] + build-type: [ clean ] env: - TARGET: i586-pc-msdosdjgpp From c67c1096dad7d11c7a6e96a05151f80e7ea164ab Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 10 Feb 2020 23:28:34 +0100 Subject: [PATCH 342/536] clone git sources in download/ and link to them from build/ --- script/download.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/script/download.sh b/script/download.sh index 6ca1e3c..26108ef 100644 --- a/script/download.sh +++ b/script/download.sh @@ -40,8 +40,8 @@ fi download_git() { - mkdir -p ${BASE}/build - pushd ${BASE}/build || exit 1 + mkdir -p ${BASE}/download + pushd ${BASE}/download || exit 1 local repo=$(basename $1) repo=${repo%.*} if [ ! -d $repo/ ] || [ "`cd $repo/ && git remote get-url origin`" != "$1" ]; then @@ -60,6 +60,9 @@ download_git() if [ -z ${NO_DOWNLOAD} ]; then git pull || exit 1 fi + mkdir -p ${BASE}/build + rm -rf ${BASE}/build/$repo + ln -fs ../download/$repo ${BASE}/build/$repo popd } From 8e573d514e0c42998549818faac990e0aa9c9244 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 11 Feb 2020 03:08:48 +0100 Subject: [PATCH 343/536] use MAKE_J as alias for 'make -jN -Otarget' --- build-avr.sh | 18 ++++++++--------- build-djgpp.sh | 41 +++++++++++++++++++------------------- script/build-avr-gcc.sh | 20 +++++++++---------- script/build-binutils.sh | 10 +++++----- script/build-gdb.sh | 6 +++--- script/build-newlib-gcc.sh | 22 ++++++++++---------- script/build-tools.sh | 4 ++-- script/init.sh | 3 +++ 8 files changed, 64 insertions(+), 60 deletions(-) diff --git a/build-avr.sh b/build-avr.sh index d45e990..400e104 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -37,9 +37,9 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then esac sed -i "s/-DCMAKE_INSTALL_PREFIX=/-DCMAKE_INSTALL_PREFIX=${DST} #/" Makefile sed -i 's/\/bin\///' cmake/GetGitInfo.cmake - ${MAKE} -j${MAKE_JOBS} build || exit 1 - ${MAKE} -j${MAKE_JOBS} doc || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/simulavr.log + ${MAKE_J} build || exit 1 + ${MAKE_J} doc || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/simulavr.log echo "Installing simulavr" ${SUDO} ${MAKE} -C build install || exit 1 cd ${BASE}/build/ || exit 1 @@ -54,10 +54,10 @@ if [ ! -z ${AVARICE_VERSION} ]; then cd build-avr/ || exit 1 rm -rf * ../configure --prefix=${PREFIX} || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avarice.log + ${MAKE_J} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/avarice.log echo "Installing AVaRICE" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${SUDO} ${MAKE_J} install || exit 1 cd ${BASE}/build/ || exit 1 fi @@ -69,10 +69,10 @@ if [ ! -z ${AVRDUDE_VERSION} ]; then cd build-avr/ || exit 1 rm -rf * ../configure --prefix=${PREFIX} || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avrdude.log + ${MAKE_J} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/avrdude.log echo "Installing AVRDUDE" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${SUDO} ${MAKE_J} install || exit 1 cd ${BASE}/build/ || exit 1 fi diff --git a/build-djgpp.sh b/build-djgpp.sh index 4a38796..9beee60 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -81,9 +81,10 @@ if [ ! -z ${DJGPP_VERSION} ]; then sed -i "50cCROSS_PREFIX = ${TARGET}-" makefile.def sed -i "61cGCC = \$(CC) -g -O2 ${CFLAGS}" makefile.def if [ -e configure-options ] && [ ! "`cat configure-options 2> /dev/null`" == "${TARGET}:${DST}:${CFLAGS_FOR_TARGET}" ]; then - ${MAKE} -j${MAKE_JOBS} clean + ${MAKE_J} clean fi - ${MAKE} misc.exe makemake.exe ../hostbin || exit 1 + ${MAKE} misc.exe makemake.exe || exit 1 + mkdir -p ../hostbin ${MAKE} -C djasm native || exit 1 ${MAKE} -C stub native || exit 1 cd .. @@ -118,7 +119,7 @@ if [ ! -z ${GCC_VERSION} ]; then untar ${AUTOCONF_ARCHIVE} || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} DESTDIR=/ all install || exit 1 + ${MAKE_J} DESTDIR=/ all install || exit 1 rm ${BUILDDIR}/tmpinst/autoconf-*-built touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built else @@ -216,9 +217,9 @@ if [ ! -z ${GCC_VERSION} ]; then cp ${DST}/bin/${TARGET}-stubify ${BUILDDIR}/tmpinst/bin/stubify || exit 1 - ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + ${MAKE_J} all-gcc || exit 1 echo "Installing gcc (stage 1)" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 + ${SUDO} ${MAKE_J} install-gcc || exit 1 export CFLAGS="$TEMP_CFLAGS" fi @@ -231,8 +232,8 @@ if [ ! -z ${DJGPP_VERSION} ]; then sed -i 's/Werror/Wno-error/' makefile.cfg ${MAKE} config || exit 1 echo "${TARGET}:${DST}:${CFLAGS_FOR_TARGET}" > configure-options - ${MAKE} -j${MAKE_JOBS} -C mkdoc || exit 1 - ${MAKE} -j${MAKE_JOBS} -C libc || exit 1 + ${MAKE_J} -C mkdoc || exit 1 + ${MAKE_J} -C libc || exit 1 echo "Installing djgpp libc" ${SUDO} mkdir -p ${DST}/${TARGET}/lib @@ -247,12 +248,12 @@ if [ ! -z ${GCC_VERSION} ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + ${MAKE_J} || exit 1 + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE_J} -s check-gcc | tee ${BASE}/tests/gcc.log echo "Installing gcc (stage 2)" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install DESTDIR=${BASE}/build/tmpinst + ${SUDO} ${MAKE_J} install-strip || \ + ${SUDO} ${MAKE_J} install-strip || exit 1 + ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst CFLAGS="$TEMP_CFLAGS" ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed @@ -264,14 +265,14 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" export CFLAGS="$CFLAGS_FOR_TARGET" - ${MAKE} -j${MAKE_JOBS} -C utils native || exit 1 - ${MAKE} -j${MAKE_JOBS} -C dxe native || exit 1 - ${MAKE} -j${MAKE_JOBS} -C debug || exit 1 - ${MAKE} -j${MAKE_JOBS} -C libemu || exit 1 - ${MAKE} -j${MAKE_JOBS} -C libm || exit 1 - ${MAKE} -j${MAKE_JOBS} -C docs || exit 1 - ${MAKE} -j${MAKE_JOBS} -C ../zoneinfo/src 2> /dev/null - ${MAKE} -j${MAKE_JOBS} -f makempty || exit 1 + ${MAKE_J} -C utils native || exit 1 + ${MAKE_J} -C dxe native || exit 1 + ${MAKE_J} -C debug || exit 1 + ${MAKE_J} -C libemu || exit 1 + ${MAKE_J} -C libm || exit 1 + ${MAKE_J} -C docs || exit 1 + ${MAKE_J} -C ../zoneinfo/src 2> /dev/null + ${MAKE_J} -f makempty || exit 1 CFLAGS="$TEMP_CFLAGS" cd .. diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 90ae6fa..166b55e 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -59,9 +59,9 @@ if [ ! -z ${GCC_VERSION} ]; then [ -z ${BUILD_BATCH} ] && sleep 5 fi - ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + ${MAKE_J} all-gcc || exit 1 echo "Installing gcc (stage 1)" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 + ${SUDO} ${MAKE_J} install-gcc || exit 1 export CFLAGS="$TEMP_CFLAGS" fi @@ -85,10 +85,10 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then [ -z ${BUILD_BATCH} ] && sleep 5 fi - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/avr-libc.log + ${MAKE_J} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/avr-libc.log echo "Installing avr-libc" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${SUDO} ${MAKE_J} install || exit 1 fi cd ${BASE}/build/ @@ -98,12 +98,12 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + ${MAKE_J} || exit 1 + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE_J} -s check-gcc | tee ${BASE}/tests/gcc.log echo "Installing gcc" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install DESTDIR=${BASE}/build/tmpinst + ${SUDO} ${MAKE_J} install-strip || \ + ${SUDO} ${MAKE_J} install-strip || exit 1 + ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed diff --git a/script/build-binutils.sh b/script/build-binutils.sh index 7e4cd79..aa3df1e 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -17,16 +17,16 @@ fi case $TARGET in *-msdosdjgpp) - ${MAKE} -j${MAKE_JOBS} configure-bfd || exit 1 - ${MAKE} -j${MAKE_JOBS} -C bfd stmp-lcoff-h || exit 1 + ${MAKE_J} configure-bfd || exit 1 + ${MAKE_J} -C bfd stmp-lcoff-h || exit 1 ;; *) ;; esac -${MAKE} -j${MAKE_JOBS} || exit 1 -[ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/binutils.log +${MAKE_J} || exit 1 +[ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/binutils.log echo "Installing binutils" -${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 +${SUDO} ${MAKE_J} install || exit 1 ${SUDO} rm -f ${DST}/${TARGET}/etc/binutils-*-installed ${SUDO} touch ${DST}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 2597269..245f95c 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -23,10 +23,10 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Note: gdb already configured. To force a rebuild, use: rm -rf $(pwd)" [ -z ${BUILD_BATCH} ] && sleep 5 fi - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/gdb.log + ${MAKE_J} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/gdb.log echo "Installing gdb" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${SUDO} ${MAKE_J} install || exit 1 ${SUDO} rm -f ${DST}/${TARGET}/etc/gdb-*-installed ${SUDO} touch ${DST}/${TARGET}/etc/gdb-${GDB_VERSION}-installed diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 319c8b8..b3f16bb 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -51,9 +51,9 @@ if [ ! -z ${GCC_VERSION} ]; then [ -z ${BUILD_BATCH} ] && sleep 5 fi - ${MAKE} -j${MAKE_JOBS} all-gcc || exit 1 + ${MAKE_J} all-gcc || exit 1 echo "Installing gcc (stage 1)" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-gcc || exit 1 + ${SUDO} ${MAKE_J} install-gcc || exit 1 export CFLAGS="$TEMP_CFLAGS" fi @@ -77,11 +77,11 @@ if [ ! -z ${NEWLIB_VERSION} ]; then [ -z ${BUILD_BATCH} ] && sleep 5 fi - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK ] && ${MAKE} -j${MAKE_JOBS} -s check | tee ${BASE}/tests/newlib.log + ${MAKE_J} || exit 1 + [ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/newlib.log echo "Installing newlib" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || \ - ${SUDO} ${MAKE} -j${MAKE_JOBS} install || exit 1 + ${SUDO} ${MAKE_J} install || \ + ${SUDO} ${MAKE_J} install || exit 1 fi cd ${BASE}/build/ @@ -91,12 +91,12 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" - ${MAKE} -j${MAKE_JOBS} || exit 1 - [ ! -z $MAKE_CHECK_GCC ] && ${MAKE} -j${MAKE_JOBS} -s check-gcc | tee ${BASE}/tests/gcc.log + ${MAKE_J} || exit 1 + [ ! -z $MAKE_CHECK_GCC ] && ${MAKE_J} -s check-gcc | tee ${BASE}/tests/gcc.log echo "Installing gcc" - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || \ - ${SUDO} ${MAKE} -j${MAKE_JOBS} install-strip || exit 1 - ${SUDO} ${MAKE} -j${MAKE_JOBS} -C mpfr install DESTDIR=${BASE}/build/tmpinst + ${SUDO} ${MAKE_J} install-strip || \ + ${SUDO} ${MAKE_J} install-strip || exit 1 + ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed diff --git a/script/build-tools.sh b/script/build-tools.sh index b358e6a..312987c 100644 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -12,8 +12,8 @@ if [ ! -z $SED_VERSION ]; then TEMP_CFLAGS="$CFLAGS" export CFLAGS="${CFLAGS//-w}" # configure fails if warnings are disabled. ./configure --prefix=${BASE}/build/tmpinst || exit 1 - ${MAKE} -j${MAKE_JOBS} || exit 1 - ${MAKE} -j${MAKE_JOBS} DESTDIR=/ install || exit 1 + ${MAKE_J} || exit 1 + ${MAKE_J} DESTDIR=/ install || exit 1 CFLAGS="$TEMP_CFLAGS" touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed fi diff --git a/script/init.sh b/script/init.sh index bfe11fe..e0a57e2 100644 --- a/script/init.sh +++ b/script/init.sh @@ -1,5 +1,6 @@ unset CDPATH unset SUDO +unset MAKEFLAGS BASE=`pwd` @@ -21,6 +22,8 @@ else CXX=${CXX-g++} fi +MAKE_J="${MAKE} -j${MAKE_JOBS} -Otarget" + export CC CXX MAKE [ ! -z ${BUILD} ] && BUILD_FLAG="--build=${BUILD}" From 25934409599ff4c3be550583055b351719b1405d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 11 Feb 2020 04:20:19 +0100 Subject: [PATCH 344/536] only use 'make -Otarget' if not running on macos. --- script/init.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/init.sh b/script/init.sh index e0a57e2..64c2be5 100644 --- a/script/init.sh +++ b/script/init.sh @@ -22,7 +22,12 @@ else CXX=${CXX-g++} fi -MAKE_J="${MAKE} -j${MAKE_JOBS} -Otarget" +MAKE_J="${MAKE} -j${MAKE_JOBS}" + +case `uname -s` in +Darwin*) ;; +*) MAKE_J+=" -Otarget" ;; +esac export CC CXX MAKE From f670ba08c64075d76171b260e757db9e02d04be9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 11 Feb 2020 18:07:32 +0100 Subject: [PATCH 345/536] set CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET in init.sh --- build-djgpp.sh | 2 -- script/init.sh | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 9beee60..61bb0fa 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -21,8 +21,6 @@ prepend GCC_CONFIGURE_OPTIONS "--disable-nls prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls" -prepend CFLAGS_FOR_TARGET "-O2" - DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" [ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" diff --git a/script/init.sh b/script/init.sh index 64c2be5..06c0a2e 100644 --- a/script/init.sh +++ b/script/init.sh @@ -43,6 +43,9 @@ else HOST_CXX=${CXX} fi +CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET:-"-O2 -g"} +CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET:-"-O2 -g"} + untar() { [ -z $1 ] && return From c69cc942f2dfdcc4982391027e7e120f0c715dbf Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 11 Feb 2020 18:46:39 +0100 Subject: [PATCH 346/536] set LDFLAGS for building djgpp --- build-djgpp.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index 61bb0fa..5f50265 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -226,7 +226,9 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Building djgpp libc" cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" + TEMP_LDFLAGS="$LDFLAGS" export CFLAGS="$CFLAGS_FOR_TARGET" + export LDFLAGS="$LDFLAGS_FOR_TARGET" sed -i 's/Werror/Wno-error/' makefile.cfg ${MAKE} config || exit 1 echo "${TARGET}:${DST}:${CFLAGS_FOR_TARGET}" > configure-options @@ -236,6 +238,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Installing djgpp libc" ${SUDO} mkdir -p ${DST}/${TARGET}/lib ${SUDO} cp -rp ../lib/* ${DST}/${TARGET}/lib || exit 1 + LDFLAGS="$TEMP_LDFLAGS" CFLAGS="$TEMP_CFLAGS" fi @@ -262,7 +265,9 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Building djgpp libraries" cd ${BASE}/build/djgpp-${DJGPP_VERSION}/src TEMP_CFLAGS="$CFLAGS" + TEMP_LDFLAGS="$LDFLAGS" export CFLAGS="$CFLAGS_FOR_TARGET" + export LDFLAGS="$LDFLAGS_FOR_TARGET" ${MAKE_J} -C utils native || exit 1 ${MAKE_J} -C dxe native || exit 1 ${MAKE_J} -C debug || exit 1 @@ -271,6 +276,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${MAKE_J} -C docs || exit 1 ${MAKE_J} -C ../zoneinfo/src 2> /dev/null ${MAKE_J} -f makempty || exit 1 + LDFLAGS="$TEMP_LDFLAGS" CFLAGS="$TEMP_CFLAGS" cd .. From 93bfe4e07f1c5e4ce65d085895966fcf3d1c555e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 11 Feb 2020 19:28:32 +0100 Subject: [PATCH 347/536] fix creating manpages directory. --- script/finalize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/finalize.sh b/script/finalize.sh index be29020..5753dc4 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -28,7 +28,7 @@ for INFO_FILE in $INFO_LIST; do done echo "Installing man pages" -${SUDO} mkdir -p ${TARGET}/man/man7 +${SUDO} mkdir -p ${TARGET}/share/man/man7 MAN_LIST="fsf-funding.7 gpl.7 gfdl.7" for MAN_FILE in $MAN_LIST; do if [ -f share/man/man7/$MAN_FILE ]; then From a2a6d0e1c2462c94a1e39b97b7342b29d349386e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 11 Feb 2020 19:39:07 +0100 Subject: [PATCH 348/536] test builds: clear git sources before caching --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad0f95a..2748394 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -136,3 +136,7 @@ jobs: env: TARGET: ${{ matrix.env.TARGET }} run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }} ${{ matrix.env.PACKAGES }} + + - name: Clear git sources before caching + if: matrix.build-type == 'clean' + run: find download/*/* ! -wholename '*/.git/*' -delete || true From 4d4296f0a66926b2e119a4b2d2a2f47f2023cac3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 11 Feb 2020 23:26:06 +0100 Subject: [PATCH 349/536] Revert "fix creating manpages directory." This reverts commit 93bfe4e07f1c5e4ce65d085895966fcf3d1c555e. Revert "install info/man files in target directory too." This reverts commit 648ba9d482f9453470d51b18ebc03321ecef7613. --- script/finalize.sh | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 5753dc4..ac49013 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -1,5 +1,5 @@ -pushd ${DST} || exit 1 echo "Copy long name executables to short name." +pushd ${DST} || exit 1 ${SUDO} mkdir -p ${TARGET}/bin SHORT_NAME_LIST="dxegen dxe3gen dxe3res exe2coff stubify stubedit djasm gdb g++ c++ cpp gcc gprof gcc-nm gcov-tool gcc-ranlib gcc-ar gcov-dump gcov @@ -15,26 +15,6 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} cp -p ${TARGET}/bin/gcc ${TARGET}/bin/gcc-${GCC_VERSION} 2> /dev/null ${SUDO} cp -p ${TARGET}/bin/g++ ${TARGET}/bin/g++-${GCC_VERSION} 2> /dev/null fi - -echo "Installing info files" -${SUDO} mkdir -p ${TARGET}/share/info -INFO_LIST="libquadmath.info gccint.info gcc.info cpp.info cppinternals.info gccinstall.info - gprof.info binutils.info as.info ld.info bfd.info annotate.info gdb.info stabs.info" -for INFO_FILE in $INFO_LIST; do - if [ -f share/info/$INFO_FILE ]; then - ${SUDO} cp -p share/info/$INFO_FILE ${TARGET}/share/info/$INFO_FILE - ${SUDO} install-info ${TARGET}/share/info/$INFO_FILE ${TARGET}/share/info/dir - fi -done - -echo "Installing man pages" -${SUDO} mkdir -p ${TARGET}/share/man/man7 -MAN_LIST="fsf-funding.7 gpl.7 gfdl.7" -for MAN_FILE in $MAN_LIST; do - if [ -f share/man/man7/$MAN_FILE ]; then - ${SUDO} cp -p share/man/man7/$MAN_FILE ${TARGET}/share/man/man7/$MAN_FILE - fi -done popd cat << STOP > ${BASE}/build/${TARGET}-setenv From 0e6d93905fc121737d3081955ce177e0919b1400 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 12 Feb 2020 02:02:18 +0100 Subject: [PATCH 350/536] add shebang line in setenv script --- script/finalize.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/finalize.sh b/script/finalize.sh index ac49013..4b90125 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -18,6 +18,7 @@ fi popd cat << STOP > ${BASE}/build/${TARGET}-setenv +#!/usr/bin/env bash if ! (return 2> /dev/null); then echo "This script must be executed with 'source' to set environment variables:" echo "source \$0" From 4c0a4f24d46a20d3b82a36692e5f07c8d5a6036d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 16 Aug 2018 22:10:42 +0200 Subject: [PATCH 351/536] set default djgpp TARGET to i386-pc-msdosdjgpp. --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 5f50265..fd6ded5 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -6,7 +6,7 @@ source script/init.sh case $TARGET in *-msdosdjgpp) ;; -*) TARGET="i586-pc-msdosdjgpp" ;; +*) TARGET="i386-pc-msdosdjgpp" ;; esac prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror From e55fc3cb9ede763ba13e53ea9b2bfd2d8a48ea83 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 12 Feb 2020 16:21:24 +0100 Subject: [PATCH 352/536] change tests builds to i386-pc-msdosdjgpp --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2748394..7ed35de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,13 +16,13 @@ jobs: build-type: [ clean ] env: - - TARGET: i586-pc-msdosdjgpp + TARGET: i386-pc-msdosdjgpp PACKAGES: binutils gcc djgpp-2.05 - - TARGET: i586-pc-msdosdjgpp + TARGET: i386-pc-msdosdjgpp PACKAGES: binutils gcc djgpp-cvs - - TARGET: i586-pc-msdosdjgpp + TARGET: i386-pc-msdosdjgpp PACKAGES: gdb - TARGET: arm-eabi From a2334768715019f6b5bc735e8a936a1c5ff2cc2e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 12 Feb 2020 17:20:35 +0100 Subject: [PATCH 353/536] add link-i586 script for *-pc-msdosdjgpp targets for compatibility with other distributions which are compiled with target=i586-pc-msdosdjgpp. --- script/finalize.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/script/finalize.sh b/script/finalize.sh index 4b90125..d2f1215 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -43,6 +43,22 @@ case $TARGET in ;; esac +case $TARGET in +i586-pc-msdosdjgpp) ;; +*-pc-msdosdjgpp) cat << STOP > ${BASE}/build/${TARGET}-link-i586 +#!/usr/bin/env bash +echo "Linking ${TARGET}-* to i586-pc-msdosdjgpp-*" +for PROG in ${PREFIX}/bin/${TARGET}-*; do + ln -fs `basename \$PROG` \${PROG/$TARGET/i586-pc-msdosdjgpp} +done +STOP + echo "Installing ${TARGET}-link-i586" + chmod +x ${BASE}/build/${TARGET}-link-i586 + ${SUDO} cp -p ${BASE}/build/${TARGET}-link-i586 ${DST}/bin/ + ;; +*) ;; +esac + echo "Installing ${TARGET}-setenv" chmod +x ${BASE}/build/${TARGET}-setenv ${SUDO} cp -p ${BASE}/build/${TARGET}-setenv ${DST}/bin/ From 1912cf296a28ecf7eed57774e51934fdd29b25e6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 12 Feb 2020 20:29:47 +0100 Subject: [PATCH 354/536] fix link-i586 script --- script/finalize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index d2f1215..e343ef4 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -47,9 +47,9 @@ case $TARGET in i586-pc-msdosdjgpp) ;; *-pc-msdosdjgpp) cat << STOP > ${BASE}/build/${TARGET}-link-i586 #!/usr/bin/env bash -echo "Linking ${TARGET}-* to i586-pc-msdosdjgpp-*" +echo "Linking i586-pc-msdosdjgpp-* to ${TARGET}-*" for PROG in ${PREFIX}/bin/${TARGET}-*; do - ln -fs `basename \$PROG` \${PROG/$TARGET/i586-pc-msdosdjgpp} + ln -fs \`basename \$PROG\` \${PROG/$TARGET/i586-pc-msdosdjgpp} done STOP echo "Installing ${TARGET}-link-i586" From 4e1288ed19df50269d8a3cf959bc6ad68bed578d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 00:58:38 +0100 Subject: [PATCH 355/536] update readme --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d349c7..ef98657 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ ### Upgrade notes: +* 2020-02-13: default target for djgpp has changed to `i386-pc-msdosdjgpp`. +If you require compatibility with distributions that use `i586`, you can either: + - run `sudo i386-pc-msdosdjgpp-link-i586` after installing, or + - build with `./build-djgpp.sh --prefix=i586-pc-msdosdjgpp`. * 2020-02-07: setenv script is now installed to `$PREFIX/bin/$TARGET-setenv`. * 2019-06-06: `master` is now the default branch again. @@ -19,7 +23,7 @@ ### Tested targets: -* i586-pc-msdosdjgpp +* i386-pc-msdosdjgpp * ia16 * arm-eabi * avr @@ -106,7 +110,7 @@ MAKE_CHECK_GCC= # Run gcc test suites. Pick the script you want to use: ```sh -build-djgpp.sh # builds a toolchain targeting djgpp (default TARGET: i586-pc-msdosdjgpp) +build-djgpp.sh # builds a toolchain targeting djgpp (default TARGET: i386-pc-msdosdjgpp) build-newlib.sh # builds a toolchain with the newlib C library build-ia16.sh # builds a toolchain targeting 8086 processors, with the newlib C library (fixed TARGET: ia16-elf) build-avr.sh # builds a toolchain targeting AVR microcontrollers (fixed TARGET: avr) From 275fc5f9cb49a0ec3401a35575cbb6de7b13b5e2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 04:02:32 +0100 Subject: [PATCH 356/536] support loading git sources from tar file. --- .github/workflows/main.yml | 11 +++++++++-- script/download.sh | 19 ++++++++++++------- script/init.sh | 1 + 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ed35de..3efed82 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,6 +137,13 @@ jobs: TARGET: ${{ matrix.env.TARGET }} run: ./script/select-script.sh --no-download --prefix=${{ github.workspace }} ${{ matrix.env.PACKAGES }} - - name: Clear git sources before caching + - name: Clear and pack git sources before caching if: matrix.build-type == 'clean' - run: find download/*/* ! -wholename '*/.git/*' -delete || true + run: | + find download/*/* ! -wholename '*/.git/*' -delete || true + cd download + for DIR in */; do + DIR=${DIR%/} + tar -c -f $DIR-git.tar $DIR + done + rm -rf */ diff --git a/script/download.sh b/script/download.sh index 26108ef..11e6a67 100644 --- a/script/download.sh +++ b/script/download.sh @@ -45,13 +45,18 @@ download_git() local repo=$(basename $1) repo=${repo%.*} if [ ! -d $repo/ ] || [ "`cd $repo/ && git remote get-url origin`" != "$1" ]; then - if [ -z ${NO_DOWNLOAD} ]; then - echo "Downloading ${repo}..." - rm -rf $repo/ - git clone $1 --depth 1 $([ "$2" != "" ] && echo "--branch $2") - else - echo "Missing: ${repo}" - exit 1 + if [ -f $repo-git.tar ]; then + untar $repo-git.tar + fi + if [ ! -d $repo/ ] || [ "`cd $repo/ && git remote get-url origin`" != "$1" ]; then + if [ -z ${NO_DOWNLOAD} ]; then + echo "Downloading $repo..." + rm -rf $repo/ + git clone $1 --depth 1 $([ "$2" != "" ] && echo "--branch $2") + else + echo "Missing: $repo" + exit 1 + fi fi fi cd $repo/ || exit 1 diff --git a/script/init.sh b/script/init.sh index 06c0a2e..006bf42 100644 --- a/script/init.sh +++ b/script/init.sh @@ -56,6 +56,7 @@ untar() xz) param="-J" ;; bz2) param="-j" ;; gz) param="-z" ;; + tar) param="" ;; esac tar -x ${param} -f ${BASE}/download/${file} || exit 1 } From 4a92c0da944b9df8588d38989f9332788f3e883c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 01:18:39 +0100 Subject: [PATCH 357/536] debian package system --- .gitignore | 2 + debian/Makefile | 26 + debian/binutils-djgpp-doc.info | 5 + debian/binutils-djgpp.install | 34 + debian/binutils-djgpp.manpages | 18 + debian/changelog | 5 + debian/compat | 1 + debian/control | 96 ++ debian/djgpp-doc.info | 3 + debian/djgpp.copyright | 893 ++++++++++++++++++ debian/djgpp.install | 28 + debian/gcc-djgpp-doc.info | 6 + debian/gcc-djgpp-doc.manpages | 3 + debian/gcc-djgpp-extra.install | 4 + debian/gcc-djgpp.copyright | 1623 ++++++++++++++++++++++++++++++++ debian/gcc-djgpp.install | 27 + debian/gcc-djgpp.manpages | 6 + debian/gdb-djgpp-doc.info | 4 + debian/gdb-djgpp-extra.install | 18 + debian/gdb-djgpp.install | 4 + debian/gdb-djgpp.manpages | 4 + debian/rules | 7 + debian/source/format | 1 + script/init.sh | 1 + 24 files changed, 2819 insertions(+) create mode 100644 debian/Makefile create mode 100644 debian/binutils-djgpp-doc.info create mode 100644 debian/binutils-djgpp.install create mode 100644 debian/binutils-djgpp.manpages create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/djgpp-doc.info create mode 100644 debian/djgpp.copyright create mode 100644 debian/djgpp.install create mode 100644 debian/gcc-djgpp-doc.info create mode 100644 debian/gcc-djgpp-doc.manpages create mode 100644 debian/gcc-djgpp-extra.install create mode 100644 debian/gcc-djgpp.copyright create mode 100644 debian/gcc-djgpp.install create mode 100644 debian/gcc-djgpp.manpages create mode 100644 debian/gdb-djgpp-doc.info create mode 100644 debian/gdb-djgpp-extra.install create mode 100644 debian/gdb-djgpp.install create mode 100644 debian/gdb-djgpp.manpages create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/.gitignore b/.gitignore index c5e8204..01f9cf1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ build/ download/ +install/ +/Makefile diff --git a/debian/Makefile b/debian/Makefile new file mode 100644 index 0000000..12a43bd --- /dev/null +++ b/debian/Makefile @@ -0,0 +1,26 @@ +PACKAGES=djgpp-cvs binutils gcc gdb + +all: build + +build: + ./build-djgpp.sh --batch --no-download --prefix=/usr --destdir=`pwd`/install $(PACKAGES) + +install: + sed -i 's/\/usr\/bin\/i386/usr\/bin\/i386/' install/usr/bin/i386-pc-msdosdjgpp-link-i586 + cd install && ./usr/bin/i386-pc-msdosdjgpp-link-i586 + cp -rp install/* $(DESTDIR)/ + +clean: + cp LICENSE debian/copyright + cp LICENSE debian/binutils-djgpp.copyright + cp LICENSE debian/gdb-djgpp.copyright + cp debian/djgpp.copyright debian/djgpp-doc.copyright + cp debian/gcc-djgpp.copyright debian/gcc-djgpp-doc.copyright + cp debian/gcc-djgpp.copyright debian/gcc-djgpp-extra.copyright + cp debian/binutils-djgpp.copyright debian/binutils-djgpp-doc.copyright + cp debian/gdb-djgpp.copyright debian/gdb-djgpp-doc.copyright + cp debian/gdb-djgpp.copyright debian/gdb-djgpp-extra.copyright + -rm -rf build/ install/ + -find download/*/* ! -wholename '*/.git/*' -delete + +.PHONY: all build install clean diff --git a/debian/binutils-djgpp-doc.info b/debian/binutils-djgpp-doc.info new file mode 100644 index 0000000..5bc7c10 --- /dev/null +++ b/debian/binutils-djgpp-doc.info @@ -0,0 +1,5 @@ +usr/share/info/gprof.info +usr/share/info/binutils.info +usr/share/info/as.info +usr/share/info/ld.info +usr/share/info/bfd.info diff --git a/debian/binutils-djgpp.install b/debian/binutils-djgpp.install new file mode 100644 index 0000000..77c420a --- /dev/null +++ b/debian/binutils-djgpp.install @@ -0,0 +1,34 @@ +usr/i*86-pc-msdosdjgpp/lib/ldscripts/* +usr/i*86-pc-msdosdjgpp/bin/strings +usr/i*86-pc-msdosdjgpp/bin/ld +usr/i*86-pc-msdosdjgpp/bin/readelf +usr/i*86-pc-msdosdjgpp/bin/ld.bfd +usr/i*86-pc-msdosdjgpp/bin/size +usr/i*86-pc-msdosdjgpp/bin/addr2line +usr/i*86-pc-msdosdjgpp/bin/strip +usr/i*86-pc-msdosdjgpp/bin/objcopy +usr/i*86-pc-msdosdjgpp/bin/c++filt +usr/i*86-pc-msdosdjgpp/bin/ar +usr/i*86-pc-msdosdjgpp/bin/gprof +usr/i*86-pc-msdosdjgpp/bin/ranlib +usr/i*86-pc-msdosdjgpp/bin/as +usr/i*86-pc-msdosdjgpp/bin/nm +usr/i*86-pc-msdosdjgpp/bin/elfedit +usr/i*86-pc-msdosdjgpp/bin/objdump +usr/bin/i*86-pc-msdosdjgpp-strings +usr/bin/i*86-pc-msdosdjgpp-ld +usr/bin/i*86-pc-msdosdjgpp-readelf +usr/bin/i*86-pc-msdosdjgpp-ld.bfd +usr/bin/i*86-pc-msdosdjgpp-size +usr/bin/i*86-pc-msdosdjgpp-addr2line +usr/bin/i*86-pc-msdosdjgpp-strip +usr/bin/i*86-pc-msdosdjgpp-objcopy +usr/bin/i*86-pc-msdosdjgpp-c++filt +usr/bin/i*86-pc-msdosdjgpp-ar +usr/bin/i*86-pc-msdosdjgpp-gprof +usr/bin/i*86-pc-msdosdjgpp-ranlib +usr/bin/i*86-pc-msdosdjgpp-as +usr/bin/i*86-pc-msdosdjgpp-nm +usr/bin/i*86-pc-msdosdjgpp-elfedit +usr/bin/i*86-pc-msdosdjgpp-objdump +usr/i*86-pc-msdosdjgpp/etc/binutils-*-installed diff --git a/debian/binutils-djgpp.manpages b/debian/binutils-djgpp.manpages new file mode 100644 index 0000000..002157f --- /dev/null +++ b/debian/binutils-djgpp.manpages @@ -0,0 +1,18 @@ +usr/share/man/man1/i*86-pc-msdosdjgpp-gprof.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-ar.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-ranlib.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-windmc.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-objdump.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-c++filt.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-strings.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-readelf.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-ld.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-size.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-objcopy.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-as.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-strip.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-dlltool.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-addr2line.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-nm.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-elfedit.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-windres.1 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..39f3f4b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +djgpp-toolchain (0.20200213.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) bionic; urgency=medium + + * Initial Release. + + -- jwt27 Thu, 13 Feb 2020 02:40:22 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..9200737 --- /dev/null +++ b/debian/control @@ -0,0 +1,96 @@ +Source: djgpp-toolchain +Section: devel +Priority: optional +Maintainer: jwt27 +Build-Depends: + git, + bash, + make, + unzip, + wget, + bison, + flex, + texinfo, + patch, + tar, + xz-utils, + bzip2, + gzip, + dos2unix, + zlib1g-dev, + debhelper (>= 11) +Standards-Version: 4.1.2 +Homepage: https://github.com/jwt27/build-gcc + +Package: djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: djgpp-binutils, djgpp-gcc +Suggests: djgpp-doc +Description: DJGPP C library and utilities + Required for djgpp-gcc. + +Package: djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: djgpp +Description: Documentation for djgpp + +Package: gcc-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp +Suggests: gcc-djgpp-doc, gcc-djgpp-extra +Description: GNU Compiler Collection + Cross-compiler targeting djgpp. Supports C and C++. + +Package: gcc-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: gcc-djgpp +Conflicts: gcc-doc +Description: Documentation for djgpp-gcc + +Package: gcc-djgpp-extra +Architecture: all +Depends: ${misc:Depends} +Recommends: gcc-djgpp +Suggests: gdb-djgpp +Description: Extra files for gcc + Python pretty-printer script files for use with gdb. + May conflict with host gcc. + +Package: binutils-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: djgpp +Suggests: binutils-djgpp-doc +Description: GNU Binutils + Linker, assembler and other binary utilities targeting djgpp. + +Package: binutils-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: binutils-djgpp +Conflicts: binutils-doc +Description: Documentation for djgpp-binutils. + +Package: gdb-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: gdb-djgpp-doc, gcc-djgpp-extra +Description: GNU Debugger + Used to debug djgpp programs over a serial connection. + +Package: gdb-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: gdb-djgpp +Conflicts: gdb-doc +Description: Documentation for djgpp-gdb + +Package: gdb-djgpp-extra +Architecture: all +Depends: ${misc:Depends} +Recommends: gdb-djgpp +Description: Extra files for djgpp-gdb + May conflict with host gdb. diff --git a/debian/djgpp-doc.info b/debian/djgpp-doc.info new file mode 100644 index 0000000..4df371b --- /dev/null +++ b/debian/djgpp-doc.info @@ -0,0 +1,3 @@ +usr/i*86-pc-msdosdjgpp/share/info/libm.info +usr/i*86-pc-msdosdjgpp/share/info/libc.info +usr/i*86-pc-msdosdjgpp/share/info/kb.info diff --git a/debian/djgpp.copyright b/debian/djgpp.copyright new file mode 100644 index 0000000..ffbbf51 --- /dev/null +++ b/debian/djgpp.copyright @@ -0,0 +1,893 @@ +This is the file "copying.dj". It does NOT apply to any sources or +binaries copyrighted by UCB Berkeley, the Free Software Foundation, or +any other agency besides DJ Delorie and others who have agreed to +allow their sources to be distributed under these terms. + + Copyright Information for sources and executables that are marked + Copyright (C) DJ Delorie + 334 North Rd + Deerfield NH 03037-1110 + +This document is Copyright (C) DJ Delorie and may be distributed +verbatim, but changing it is not allowed. + +Source code copyright DJ Delorie is distributed under the terms of the +GNU General Public Licence, with the following exceptions: + +* Sources used to build crt0.o, gcrt0.o, libc.a, libdbg.a, and + libemu.a are distributed under the terms of the GNU Library General + Public License, rather than the GNU GPL. + +* Any existing copyright or authorship information in any given source + file must remain intact. If you modify a source file, a notice to that + effect must be added to the authorship information in the source file. + +* Runtime binaries, as provided by DJ in DJGPP, may be distributed + without sources ONLY if the recipient is given sufficient information + to obtain a copy of djgpp themselves. This primarily applies to + go32-v2.exe, emu387.dxe, and stubedit.exe. + +* Runtime objects and libraries, as provided by DJ in DJGPP, when + linked into an application, may be distributed without sources ONLY + if the recipient is given sufficient information to obtain a copy of + djgpp themselves. This primarily applies to crt0.o and libc.a. + +----- + +Changes to source code copyright BSD, FSF, or others, by DJ Delorie +fall under the terms of the original copyright. Such files usually +have multiple copyright notices in them. + +A copy of the files "COPYING" and "COPYING.LIB" are included with this +document. If you did not receive a copy of these files, you may +obtain one from whence this document was obtained, or by writing: + + Free Software Foundation + 51 Franklin Street, Fifth Floor + Boston, MA 02110-1301 + USA + +----------------------------------------------------------------------------- + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + +----------------------------------------------------------------------------- + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/debian/djgpp.install b/debian/djgpp.install new file mode 100644 index 0000000..28d3efb --- /dev/null +++ b/debian/djgpp.install @@ -0,0 +1,28 @@ +usr/i*86-pc-msdosdjgpp/lib/libg.a +usr/i*86-pc-msdosdjgpp/lib/dxe.ld +usr/i*86-pc-msdosdjgpp/lib/libm.a +usr/i*86-pc-msdosdjgpp/lib/libemu.a +usr/i*86-pc-msdosdjgpp/lib/libpc.a +usr/i*86-pc-msdosdjgpp/lib/crt0.o +usr/i*86-pc-msdosdjgpp/lib/djgpp.djl +usr/i*86-pc-msdosdjgpp/lib/gcrt0.o +usr/i*86-pc-msdosdjgpp/lib/libc.a +usr/i*86-pc-msdosdjgpp/lib/libdbg.a +usr/i*86-pc-msdosdjgpp/lib/libtz.a +usr/i*86-pc-msdosdjgpp/sys-include/* +usr/i*86-pc-msdosdjgpp/bin/stubedit +usr/i*86-pc-msdosdjgpp/bin/dxe3gen +usr/i*86-pc-msdosdjgpp/bin/dxe3res +usr/i*86-pc-msdosdjgpp/bin/djasm +usr/i*86-pc-msdosdjgpp/bin/stubify +usr/i*86-pc-msdosdjgpp/bin/dxegen +usr/i*86-pc-msdosdjgpp/bin/exe2coff +usr/bin/i*86-pc-msdosdjgpp-djasm +usr/bin/i*86-pc-msdosdjgpp-dxe3gen +usr/bin/i*86-pc-msdosdjgpp-exe2coff +usr/bin/i*86-pc-msdosdjgpp-stubify +usr/bin/i*86-pc-msdosdjgpp-dxegen +usr/bin/i*86-pc-msdosdjgpp-stubedit +usr/bin/i*86-pc-msdosdjgpp-dxe3res +usr/bin/i*86-pc-msdosdjgpp-setenv +usr/i*86-pc-msdosdjgpp/etc/djgpp-*-installed diff --git a/debian/gcc-djgpp-doc.info b/debian/gcc-djgpp-doc.info new file mode 100644 index 0000000..05d04ca --- /dev/null +++ b/debian/gcc-djgpp-doc.info @@ -0,0 +1,6 @@ +usr/share/info/libquadmath.info +usr/share/info/gccint.info +usr/share/info/gcc.info +usr/share/info/cpp.info +usr/share/info/cppinternals.info +usr/share/info/gccinstall.info diff --git a/debian/gcc-djgpp-doc.manpages b/debian/gcc-djgpp-doc.manpages new file mode 100644 index 0000000..5627044 --- /dev/null +++ b/debian/gcc-djgpp-doc.manpages @@ -0,0 +1,3 @@ +usr/share/man/man7/fsf-funding.7 +usr/share/man/man7/gpl.7 +usr/share/man/man7/gfdl.7 diff --git a/debian/gcc-djgpp-extra.install b/debian/gcc-djgpp-extra.install new file mode 100644 index 0000000..f4dee1f --- /dev/null +++ b/debian/gcc-djgpp-extra.install @@ -0,0 +1,4 @@ +usr/share/gcc-*.*.*/python/libstdcxx/v6/printers.py +usr/share/gcc-*.*.*/python/libstdcxx/v6/__init__.py +usr/share/gcc-*.*.*/python/libstdcxx/v6/xmethods.py +usr/share/gcc-*.*.*/python/libstdcxx/__init__.py diff --git a/debian/gcc-djgpp.copyright b/debian/gcc-djgpp.copyright new file mode 100644 index 0000000..b2baa64 --- /dev/null +++ b/debian/gcc-djgpp.copyright @@ -0,0 +1,1623 @@ +COPYRIGHT STATEMENTS AND LICENSING TERMS + + +GCC is Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, +1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 +Free Software Foundation, Inc. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +Files that have exception clauses are licensed under the terms of the +GNU General Public License; either version 3, or (at your option) any +later version. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License is in `/usr/share/common-licenses/GPL', version 3 of this +license in `/usr/share/common-licenses/GPL-3'. + +The following runtime libraries are licensed under the terms of the +GNU General Public License (v3 or later) with version 3.1 of the GCC +Runtime Library Exception (included in this file): + + - libgcc (libgcc/, gcc/libgcc2.[ch], gcc/unwind*, gcc/gthr*, + gcc/coretypes.h, gcc/crtstuff.c, gcc/defaults.h, gcc/dwarf2.h, + gcc/emults.c, gcc/gbl-ctors.h, gcc/gcov-io.h, gcc/libgcov.c, + gcc/tsystem.h, gcc/typeclass.h). + - libatomic + - libdecnumber + - libgomp + - libitm + - libssp + - libstdc++-v3 + - libobjc + - libgfortran + - The libgnat-9 Ada support library and libgnatvsn library. + - Various config files in gcc/config/ used in runtime libraries. + - libvtv + +The libbacktrace library is licensed under the following terms: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + (1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + (2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + (3) The name of the author may not be used to + endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +The libsanitizer libraries (libasan, liblsan, libtsan, libubsan) are +licensed under the following terms: + +Copyright (c) 2009-2014 by the LLVM contributors. + +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +The libffi library is licensed under the following terms: + + libffi - Copyright (c) 1996-2003 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + +The documentation is licensed under the GNU Free Documentation License (v1.2). +On Debian GNU/Linux systems, the complete text of this license is in +`/usr/share/common-licenses/GFDL-1.2'. + + +GCC RUNTIME LIBRARY EXCEPTION + +Version 3.1, 31 March 2009 + +Copyright (C) 2009 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This GCC Runtime Library Exception ("Exception") is an additional +permission under section 7 of the GNU General Public License, version +3 ("GPLv3"). It applies to a given file (the "Runtime Library") that +bears a notice placed by the copyright holder of the file stating that +the file is governed by GPLv3 along with this Exception. + +When you use GCC to compile a program, GCC may combine portions of +certain GCC header files and runtime libraries with the compiled +program. The purpose of this Exception is to allow compilation of +non-GPL (including proprietary) programs to use, in this way, the +header files and runtime libraries covered by this Exception. + +0. Definitions. + +A file is an "Independent Module" if it either requires the Runtime +Library for execution after a Compilation Process, or makes use of an +interface provided by the Runtime Library, but is not otherwise based +on the Runtime Library. + +"GCC" means a version of the GNU Compiler Collection, with or without +modifications, governed by version 3 (or a specified later version) of +the GNU General Public License (GPL) with the option of using any +subsequent versions published by the FSF. + +"GPL-compatible Software" is software whose conditions of propagation, +modification and use would permit combination with GCC in accord with +the license of GCC. + +"Target Code" refers to output from any compiler for a real or virtual +target processor architecture, in executable form or suitable for +input to an assembler, loader, linker and/or execution +phase. Notwithstanding that, Target Code does not include data in any +format that is used as a compiler intermediate representation, or used +for producing a compiler intermediate representation. + +The "Compilation Process" transforms code entirely represented in +non-intermediate languages designed for human-written code, and/or in +Java Virtual Machine byte code, into Target Code. Thus, for example, +use of source code generators and preprocessors need not be considered +part of the Compilation Process, since the Compilation Process can be +understood as starting with the output of the generators or +preprocessors. + +A Compilation Process is "Eligible" if it is done using GCC, alone or +with other GPL-compatible software, or if it is done without using any +work based on GCC. For example, using non-GPL-compatible Software to +optimize any GCC intermediate representations would not qualify as an +Eligible Compilation Process. + +1. Grant of Additional Permission. + +You have permission to propagate a work of Target Code formed by +combining the Runtime Library with Independent Modules, even if such +propagation would otherwise violate the terms of GPLv3, provided that +all Target Code was generated by Eligible Compilation Processes. You +may then convey such a combination under terms of your choice, +consistent with the licensing of the Independent Modules. + +2. No Weakening of GCC Copyleft. + +The availability of this Exception does not imply any general +presumption that third-party software is unaffected by the copyleft +requirements of the license of GCC. + + +libquadmath/*.[hc]: + + Copyright (C) 2010 Free Software Foundation, Inc. + Written by Francois-Xavier Coudert + Written by Tobias Burnus + +This file is part of the libiberty library. +Libiberty is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +Libiberty is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +libquadmath/math: + +atanq.c, expm1q.c, j0q.c, j1q.c, log1pq.c, logq.c: + Copyright 2001 by Stephen L. Moshier + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + +coshq.c, erfq.c, jnq.c, lgammaq.c, powq.c, roundq.c: + Changes for 128-bit __float128 are + Copyright (C) 2001 Stephen L. Moshier + and are incorporated herein by permission of the author. The author + reserves the right to distribute this material elsewhere under different + copying permissions. These modifications are distributed here under + the following terms: + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + +ldexpq.c: + * Conversion to long double by Ulrich Drepper, + * Cygnus Support, drepper@cygnus.com. + +cosq_kernel.c, expq.c, sincos_table.c, sincosq.c, sincosq_kernel.c, +sinq_kernel.c, truncq.c: + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + +isinfq.c: + * Written by J.T. Conklin . + * Change for long double by Jakub Jelinek + * Public domain. + +llroundq.c, lroundq.c, tgammaq.c: + Copyright (C) 1997, 1999, 2002, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997 and + Jakub Jelinek , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + +log10q.c: + Cephes Math Library Release 2.2: January, 1991 + Copyright 1984, 1991 by Stephen L. Moshier + Adapted for glibc November, 2001 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + +remaining files: + + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + + +gcc/go/gofrontend, libgo: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +D: +gdc-9 GNU D Compiler +libphobos-9-dev D standard runtime library + +The D source package is made up of the following components. + +The D front-end for GCC: + - d/* + +Copyright (C) 2004-2007 David Friedman +Modified by Vincenzo Ampolo, Michael Parrot, Iain Buclaw, (C) 2009, 2010 + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License is in `/usr/share/common-licenses/GPL', version 2 of this +license in `/usr/share/common-licenses/GPL-2'. + + +The DMD Compiler implementation of the D programming language: + - d/dmd/* + +Copyright (c) 1999-2010 by Digital Mars +All Rights Reserved +written by Walter Bright +http://www.digitalmars.com +License for redistribution is by either the Artistic License or +the GNU General Public License (v1). + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License is in `/usr/share/common-licenses/GPL', the Artistic +license in `/usr/share/common-licenses/Artistic'. + + +The Zlib data compression library: + - d/phobos/etc/c/zlib/* + + (C) 1995-2004 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +The Phobos standard runtime library: + - d/phobos/* + +Unless otherwise marked within the file, each file in the source +is under the following licenses: + +Copyright (C) 2004-2005 by Digital Mars, www.digitalmars.com +Written by Walter Bright + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, in both source and binary form, subject to the following +restrictions: + + o The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + o Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + o This notice may not be removed or altered from any source + distribution. + +By plainly marking modifications, something along the lines of adding to each +file that has been changed a "Modified by Foo Bar" line +underneath the "Written by" line would be adequate. + +The libhsail-rt library is licensed under the following terms: + + Copyright (C) 2015-2017 Free Software Foundation, Inc. + Contributed by Pekka Jaaskelainen + for General Processor Tech. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. + +libhsail-rt/rt/fp16.c is licensed under the following terms: + + Copyright (C) 2008-2017 Free Software Foundation, Inc. + Contributed by CodeSourcery. + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . + +gcc/gm2: +Copyright (C) 2007-2019 Free Software Foundation, Inc. +Contributed by Gaius Mulley . + +This file is part of GNU Modula-2. + +GNU Modula-2 is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GNU Modula-2 is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +gcc/gm2/**/*.texi: +Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2012, 2013 Free Software Foundation, Inc. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + +gcc/gm2/gm2-coroutines: +Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +gcc/gm2/ulm-lib-gm2: +Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. + +GNU Modula-2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +This file was originally part of the University of Ulm library + +Ulm's Modula-2 Library +Copyright (C) 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, +1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +by University of Ulm, SAI, D-89069 Ulm, Germany + +gcc/gm2/ulm-lib-gm2/std/M2RTS.mod: +gcc/gm2/ulm-lib-gm2/std/Storage.mod: +gcc/gm2/ulm-lib-gm2/std/RTExceptions.mod: + +Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +gcc/gm2/gm2-libs: +Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +Free Software Foundation, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +./gm2-libs/cbuiltin.def: +./gm2-libs/MathLib0.def: +./gm2-libs/SYSTEM.def: +./gm2-libs/sckt.def: +./gm2-libs/Indexing.def: +./gm2-libs/Builtins.mod: +./gm2-libs/SFIO.mod: +./gm2-libs/MathLib0.mod: +./gm2-libs/gdbif.mod: +./gm2-libs/M2EXCEPTION.mod: +./gm2-libs/SFIO.def: +./gm2-libs/StringConvert.mod: +./gm2-libs/StringConvert.def: +./gm2-libs/config-host.in: +./gm2-libs/Indexing.mod: +./gm2-libs/errno.def: + +Copyright (C) 2001-2019 Free Software Foundation, Inc. +Contributed by Gaius Mulley . + +GNU Modula-2 is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GNU Modula-2 is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +./gm2-libs/M2EXCEPTION.def: +Library module defined by the International Standard +Information technology - programming languages +BS ISO/IEC 10514-1:1996E Part 1: Modula-2, Base Language. + +Copyright ISO/IEC (International Organization for Standardization +and International Electrotechnical Commission) 1996, 1997, 1998, +1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + +gcc/gm2/gm2-libiberty/: +Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. + +GNU Modula-2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +gcc/gm2/gm2-libs-iso/: +This has a mix of licenses, both LGPL-2.1 and GPL-3.0, plus the apparently +unmodified definition modules from ISO/IEC. + +gcc/gm2/gm2-libs-iso/*.def: + +Library module defined by the International Standard +Information technology - programming languages +BS ISO/IEC 10514-1:1996E Part 1: Modula-2, Base Language. + +Copyright ISO/IEC (International Organization for Standardization +and International Electrotechnical Commission) 1996, 1997, 1998, +1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + +gcc/gm2/gm2-libs-iso/*.def: + +Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + +gcc/gm2/gm2-libs-iso/*.def: +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +gcc/gm2/gm2-libs-iso/*.mod: + +Copyright (C) 2012 Free Software Foundation, Inc. + +GNU Modula-2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +gcc/gm2/gm2-libs-iso/*.mod: + +Copyright (C) 2009, 2010 Free Software Foundation, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +gcc/gm2/gm2-libs-min/*: +Copyright (C) 2001-2019 Free Software Foundation, Inc. +mix of GPL-3.0 and LGPL-3.0 + +gcc/gm2/gm2-libs-pim/*: +Copyright (C) 2001-2019 Free Software Foundation, Inc. +mix of GPL-3.0 and LGPL-2.1/3 + +gcc/gm2/gm2-libs-ch/*: +Copyright (C) 2001-2019 Free Software Foundation, Inc. +mix of GPL-3.0 and LGPL-2.1/3 + +gcc/gm2/examples: +Copyright (C) 2005-2015 Free Software Foundation, Inc. +Mix of LGPL-2.1 and GPL-3.0. + +gcc/gm2/images: +GPL-3+ + +gcc/gm2/el/gm2-mode.el: +;; Everyone is granted permission to copy, modify and redistribute +;; GNU Emacs, but only under the conditions described in the +;; GNU Emacs General Public License. A copy of this license is +;; supposed to have been given to you along with GNU Emacs so you +;; can know your rights and responsibilities. It should be in a +;; file named COPYING. Among other things, the copyright notice +;; and this notice must be preserved on all copies. + +gcc/gm2/mc-boot/: +Copyright (C) 2001-2018 Free Software Foundation, Inc. +Contributed by Gaius Mulley . +Mix of GPL-3 and LGPL-2.1. + +gcc/testsuite/gm2/: +Copyright (C) 2001-2019 Free Software Foundation, Inc. +Mix of GPL-2+ and GPL-3+ + +libgm2: + +libgm2/libiso/: +Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +libgm2/libpim/: +Copyright (C) 2005-2014 Free Software Foundation, Inc. +Mix of LGPL-2.1, LGPL-3 and GPL-3. + +libgm2/liblog/: +Copyright (C) 2005-2018 Free Software Foundation, Inc. +Mix of LGPL-2.1 and LGPL-3. + +libgm2/libpth/: +Copyright: (C) 1999-2006 Ralf S. Engelschall +License: LGPL-2.1+ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + +libgm2/libulm/: +Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. + +GNU Modula-2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +libgm2/libcor/: +Copyright (C) 2005-2019 Free Software Foundation, Inc. +Contributed by Gaius Mulley . + +GNU Modula-2 is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GNU Modula-2 is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +libgm2/libmin/: +Copyright (C) 2010, 2011, 2012, 2013 Free Software Foundation, Inc. + +GNU Modula-2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +libgm2/p2c/: +Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. + +GNU Modula-2 is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GNU Modula-2 is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +newlib-X.Y.Z/: + +Upstream Authors: +newlib@sources.redhat.com +Jeff Johnston +Tom Fitzsimmons + +The newlib subdirectory is a collection of software from several sources. +Each file may have its own copyright/license that is embedded in the source +file. + +This list documents those licenses which are more restrictive than +a BSD-like license or require the copyright notice +to be duplicated in documentation and/or other materials associated with +the distribution. Certain licenses documented here only apply to +specific targets. Certain clauses only apply if you are building the +code as part of your binary. + +Note that this list may omit certain licenses that +only pertain to the copying/modifying of the individual source code. +If you are distributing the source code, then you do not need to +worry about these omitted licenses, so long as you do not modify the +copyright information already in place. + +Parts of this work are licensed under the terms of the GNU General +Public License. On Debian systems, the complete text of this license +can be found in /usr/share/common-licenses/GPL. + +Parts of this work are licensed under the terms of the GNU Library +General Public License. On Debian systems, the complete text of this +license be found in /usr/share/common-licenses/LGPL. + +(1) University of California, Berkeley + +[1a] + +Copyright (c) 1990 The Regents of the University of California. +All rights reserved. + +Redistribution and use in source and binary forms are permitted +provided that the above copyright notice and this paragraph are +duplicated in all such forms and that any documentation, +and other materials related to such distribution and use +acknowledge that the software was developed +by the University of California, Berkeley. The name of the +University may not be used to endorse or promote products derived +from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +[1b] + +Copyright (c) 1990 The Regents of the University of California. +All rights reserved. + +Redistribution and use in source and binary forms are permitted +provided that the above copyright notice and this paragraph are +duplicated in all such forms and that any documentation, +advertising materials, and other materials related to such +distribution and use acknowledge that the software was developed +by the University of California, Berkeley. The name of the +University may not be used to endorse or promote products derived +from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +[1c] + +Copyright (c) 1981, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 +The Regents of the University of California. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the University of + California, Berkeley and its contributors. +4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +[1d] + +Copyright (c) 1988, 1990, 1993 Regents of the University of California. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +[1e] + +Copyright (c) 1982, 1986, 1989, 1991, 1993, 1994 +The Regents of the University of California. All rights reserved. +(c) UNIX System Laboratories, Inc. +All or some portions of this file are derived from material licensed +to the University of California by American Telephone and Telegraph +Co. or Unix System Laboratories, Inc. and are reproduced herein with +the permission of UNIX System Laboratories, Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the University of + California, Berkeley and its contributors. +4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +[1f] + +Copyright (c) 1987, 1988, 2000 Regents of the University of California. +All rights reserved. + +Redistribution and use in source and binary forms are permitted +provided that: (1) source distributions retain this entire copyright +notice and comment, and (2) distributions including binaries display +the following acknowledgement: ``This product includes software +developed by the University of California, Berkeley and its contributors'' +in the documentation or other materials provided with the distribution +and in all advertising materials mentioning features or use of this +software. Neither the name of the University nor the names of its +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +------------------------------------------------------------- + Please note that in some of the above alternate licenses, there is a + statement regarding that acknowledgement must be made in any + advertising materials for products using the code. This restriction + no longer applies due to the following license change: + + ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change + + In some cases the defunct clause has been removed in modified newlib code and + in some cases, the clause has been left as-is. +------------------------------------------------------------- + +(2) Cygwin (cygwin targets only) + +Copyright 2001 Red Hat, Inc. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. + +(3) David M. Gay at AT&T + +The author of this software is David M. Gay. + +Copyright (c) 1991 by AT&T. + +Permission to use, copy, modify, and distribute this software for any +purpose without fee is hereby granted, provided that this entire notice +is included in all copies of any software which is or includes a copy +or modification of this software and in all copies of the supporting +documentation for such software. + +THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED +WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY +REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY +OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + +(4) Advanced Micro Devices + +Copyright 1989, 1990 Advanced Micro Devices, Inc. + +This software is the property of Advanced Micro Devices, Inc (AMD) which +specifically grants the user the right to modify, use and distribute this +software provided this notice is not removed or altered. All other rights +are reserved by AMD. + +AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +USE OF THIS SOFTWARE. + +So that all may benefit from your experience, please report any problems +or suggestions about this software to the 29K Technical Support Center at +800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. + +Advanced Micro Devices, Inc. +29K Support Products +Mail Stop 573 +5900 E. Ben White Blvd. +Austin, TX 78741 +800-292-9263 + +(5) C.W. Sandmann + +Copyright (C) 1993 C.W. Sandmann + +This file may be freely distributed as long as the author's name remains. + +(6) Eric Backus + +(C) Copyright 1992 Eric Backus + +This software may be used freely so long as this copyright notice is +left intact. There is no warrantee on this software. + +(7) Sun Microsystems + +Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunPro, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. + +(8) Hewlett Packard + +(c) Copyright 1986 HEWLETT-PACKARD COMPANY + +To anyone who acknowledges that this file is provided "AS IS" +without any express or implied warranty: + permission to use, copy, modify, and distribute this file +for any purpose is hereby granted without fee, provided that +the above copyright notice and this notice appears in all +copies, and that the name of Hewlett-Packard Company not be +used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. +Hewlett-Packard Company makes no representations about the +suitability of this software for any purpose. + +(9) Hans-Peter Nilsson + +Copyright (C) 2001 Hans-Peter Nilsson + +Permission to use, copy, modify, and distribute this software is +freely granted, provided that the above copyright notice, this notice +and the following disclaimer are preserved with no changes. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. + +(10) Stephane Carrez (m68hc11-elf/m68hc12-elf targets only) + +Copyright (C) 1999, 2000, 2001, 2002 Stephane Carrez (stcarrez@nerim.fr) + +The authors hereby grant permission to use, copy, modify, distribute, +and license this software and its documentation for any purpose, provided +that existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written agreement, +license, or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their authors +and need not follow the licensing terms described here, provided that +the new terms are clearly indicated on the first page of each file where +they apply. + +(11) Christopher G. Demetriou + +Copyright (c) 2001 Christopher G. Demetriou +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(12) SuperH, Inc. + +Copyright 2002 SuperH, Inc. All rights reserved + +This software is the property of SuperH, Inc (SuperH) which specifically +grants the user the right to modify, use and distribute this software +provided this notice is not removed or altered. All other rights are +reserved by SuperH. + +SUPERH MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO +THIS SOFTWARE. IN NO EVENT SHALL SUPERH BE LIABLE FOR INDIRECT, SPECIAL, +INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING FROM +THE FURNISHING, PERFORMANCE, OR USE OF THIS SOFTWARE. + +So that all may benefit from your experience, please report any problems +or suggestions about this software to the SuperH Support Center via +e-mail at softwaresupport@superh.com . + +SuperH, Inc. +405 River Oaks Parkway +San Jose +CA 95134 +USA + +(13) Royal Institute of Technology + +Copyright (c) 1999 Kungliga Tekniska Hgskolan +(Royal Institute of Technology, Stockholm, Sweden). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of KTH nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY KTH AND ITS CONTRIBUTORS ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KTH OR ITS CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(14) Alexey Zelkin + +Copyright (c) 2000, 2001 Alexey Zelkin +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +(15) Andrey A. Chernov + +Copyright (C) 1997 by Andrey A. Chernov, Moscow, Russia. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +(16) FreeBSD + +Copyright (c) 1997-2002 FreeBSD Project. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +(17) S. L. Moshier + +Author: S. L. Moshier. + +Copyright (c) 1984,2000 S.L. Moshier + +Permission to use, copy, modify, and distribute this software for any +purpose without fee is hereby granted, provided that this entire notice +is included in all copies of any software which is or includes a copy +or modification of this software and in all copies of the supporting +documentation for such software. + +THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED +WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION +OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS +SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + +(18) Citrus Project + +Copyright (c)1999 Citrus Project, +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +(19) Todd C. Miller + +Copyright (c) 1998 Todd C. Miller +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(20) DJ Delorie (i386) + +Copyright (C) 1991 DJ Delorie +All rights reserved. + +Redistribution and use in source and binary forms is permitted +provided that the above copyright notice and following paragraph are +duplicated in all such forms. + +This file is distributed WITHOUT ANY WARRANTY; without even the implied +warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +(21) Free Software Foundation LGPL License (*-linux* targets only) + + Copyright (C) 1990-1999, 2000, 2001 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Mark Kettenis , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA + +(22) Xavier Leroy LGPL License (i[3456]86-*-linux* targets only) + +Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Library General Public License for more details. + +(23) Intel (i960) + +Copyright (c) 1993 Intel Corporation + +Intel hereby grants you permission to copy, modify, and distribute this +software and its documentation. Intel grants this permission provided +that the above copyright notice appears in all copies and that both the +copyright notice and this permission notice appear in supporting +documentation. In addition, Intel grants this permission provided that +you prominently mark as "not part of the original" any modifications +made to this software or documentation, and that the name of Intel +Corporation not be used in advertising or publicity pertaining to +distribution of the software or the documentation without specific, +written prior permission. + +Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR +IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY +OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or +representations regarding the use of, or the results of the use of, +the software and documentation in terms of correctness, accuracy, +reliability, currentness, or otherwise; and you rely on the software, +documentation and results solely at your own risk. + +IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, +LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES +OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM +PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + +(24) Hewlett-Packard (hppa targets only) + +(c) Copyright 1986 HEWLETT-PACKARD COMPANY + +To anyone who acknowledges that this file is provided "AS IS" +without any express or implied warranty: + permission to use, copy, modify, and distribute this file +for any purpose is hereby granted without fee, provided that +the above copyright notice and this notice appears in all +copies, and that the name of Hewlett-Packard Company not be +used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. +Hewlett-Packard Company makes no representations about the +suitability of this software for any purpose. + +(25) Henry Spencer (only *-linux targets) + +Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +This software is not subject to any license of the American Telephone +and Telegraph Company or of the Regents of the University of California. + +Permission is granted to anyone to use this software for any purpose on +any computer system, and to alter it and redistribute it, subject +to the following restrictions: + +1. The author is not responsible for the consequences of use of this + software, no matter how awful, even if they arise from flaws in it. + +2. The origin of this software must not be misrepresented, either by + explicit claim or by omission. Since few users ever read sources, + credits must appear in the documentation. + +3. Altered versions must be plainly marked as such, and must not be + misrepresented as being the original software. Since few users + ever read sources, credits must appear in the documentation. + +4. This notice may not be removed or altered. + +(26) Mike Barcroft + +Copyright (c) 2001 Mike Barcroft +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +(27) Konstantin Chuguev (--enable-newlib-iconv) + +Copyright (c) 1999, 2000 + Konstantin Chuguev. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + iconv (Charset Conversion Library) v2.0 + +(27) Artem Bityuckiy (--enable-newlib-iconv) + +Copyright (c) 2003, Artem B. Bityuckiy, SoftMine Corporation. +Rights transferred to Franklin Electronic Publishers. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +(28) Red Hat Incorporated + +Unless otherwise stated in each remaining newlib file, the remaining +files in the newlib subdirectory default to the following copyright. +It should be noted that Red Hat Incorporated now owns copyrights +belonging to Cygnus Solutions and Cygnus Support. + +Copyright (c) 1994, 1997, 2001, 2002, 2003, 2004 Red Hat Incorporated. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + The name of Red Hat Incorporated may not be used to endorse + or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/debian/gcc-djgpp.install b/debian/gcc-djgpp.install new file mode 100644 index 0000000..abbeb59 --- /dev/null +++ b/debian/gcc-djgpp.install @@ -0,0 +1,27 @@ +usr/libexec/gcc/i*86-pc-msdosdjgpp/* +usr/lib/gcc/i*86-pc-msdosdjgpp/* +usr/i*86-pc-msdosdjgpp/bin/g++ +usr/i*86-pc-msdosdjgpp/bin/gcc-nm +usr/i*86-pc-msdosdjgpp/bin/c++ +usr/i*86-pc-msdosdjgpp/bin/cpp +usr/i*86-pc-msdosdjgpp/bin/gcc +usr/i*86-pc-msdosdjgpp/bin/gcc-*.*.* +usr/i*86-pc-msdosdjgpp/bin/gcov-tool +usr/i*86-pc-msdosdjgpp/bin/gcc-ranlib +usr/i*86-pc-msdosdjgpp/bin/gcc-ar +usr/i*86-pc-msdosdjgpp/bin/g++-*.*.* +usr/i*86-pc-msdosdjgpp/bin/gcov-dump +usr/i*86-pc-msdosdjgpp/bin/gcov +usr/bin/i*86-pc-msdosdjgpp-g++ +usr/bin/i*86-pc-msdosdjgpp-gcc-nm +usr/bin/i*86-pc-msdosdjgpp-c++ +usr/bin/i*86-pc-msdosdjgpp-cpp +usr/bin/i*86-pc-msdosdjgpp-gcc +usr/bin/i*86-pc-msdosdjgpp-gcc-*.*.* +usr/bin/i*86-pc-msdosdjgpp-gcov-tool +usr/bin/i*86-pc-msdosdjgpp-gcc-ranlib +usr/bin/i*86-pc-msdosdjgpp-gcc-ar +usr/bin/i*86-pc-msdosdjgpp-g++-*.*.* +usr/bin/i*86-pc-msdosdjgpp-gcov-dump +usr/bin/i*86-pc-msdosdjgpp-gcov +usr/i*86-pc-msdosdjgpp/etc/gcc-*-installed diff --git a/debian/gcc-djgpp.manpages b/debian/gcc-djgpp.manpages new file mode 100644 index 0000000..dece22e --- /dev/null +++ b/debian/gcc-djgpp.manpages @@ -0,0 +1,6 @@ +usr/share/man/man1/i*86-pc-msdosdjgpp-gcov-dump.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-cpp.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-gcov.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-g++.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-gcov-tool.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-gcc.1 diff --git a/debian/gdb-djgpp-doc.info b/debian/gdb-djgpp-doc.info new file mode 100644 index 0000000..26107be --- /dev/null +++ b/debian/gdb-djgpp-doc.info @@ -0,0 +1,4 @@ +usr/share/info/annotate.info +usr/share/info/gdb.info +usr/share/info/bfd.info +usr/share/info/stabs.info diff --git a/debian/gdb-djgpp-extra.install b/debian/gdb-djgpp-extra.install new file mode 100644 index 0000000..2c4a474 --- /dev/null +++ b/debian/gdb-djgpp-extra.install @@ -0,0 +1,18 @@ +usr/share/gdb/system-gdbinit/elinos.py +usr/share/gdb/system-gdbinit/wrs-linux.py +usr/share/gdb/syscalls/aarch64-linux.xml +usr/share/gdb/syscalls/s390-linux.xml +usr/share/gdb/syscalls/mips-n32-linux.xml +usr/share/gdb/syscalls/sparc64-linux.xml +usr/share/gdb/syscalls/s390x-linux.xml +usr/share/gdb/syscalls/ppc64-linux.xml +usr/share/gdb/syscalls/arm-linux.xml +usr/share/gdb/syscalls/amd64-linux.xml +usr/share/gdb/syscalls/mips-n64-linux.xml +usr/share/gdb/syscalls/freebsd.xml +usr/share/gdb/syscalls/i386-linux.xml +usr/share/gdb/syscalls/ppc-linux.xml +usr/share/gdb/syscalls/sparc-linux.xml +usr/share/gdb/syscalls/mips-o32-linux.xml +usr/share/gdb/syscalls/gdb-syscalls.dtd +usr/include/gdb/jit-reader.h diff --git a/debian/gdb-djgpp.install b/debian/gdb-djgpp.install new file mode 100644 index 0000000..a8c5b10 --- /dev/null +++ b/debian/gdb-djgpp.install @@ -0,0 +1,4 @@ +usr/i*86-pc-msdosdjgpp/bin/gdb +usr/bin/i*86-pc-msdosdjgpp-gdb +usr/bin/i*86-pc-msdosdjgpp-gdb-add-index +usr/i*86-pc-msdosdjgpp/etc/gdb-*-installed diff --git a/debian/gdb-djgpp.manpages b/debian/gdb-djgpp.manpages new file mode 100644 index 0000000..dab0bac --- /dev/null +++ b/debian/gdb-djgpp.manpages @@ -0,0 +1,4 @@ +usr/share/man/man5/i*86-pc-msdosdjgpp-gdbinit.5 +usr/share/man/man1/i*86-pc-msdosdjgpp-gdbserver.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-gdb.1 +usr/share/man/man1/i*86-pc-msdosdjgpp-gdb-add-index.1 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..46ee596 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_build: + CFLAGS=-O2 CXXFLAGS=-O2 CPPFLAGS= CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" dh_auto_build $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/script/init.sh b/script/init.sh index 006bf42..2d5b49e 100644 --- a/script/init.sh +++ b/script/init.sh @@ -1,6 +1,7 @@ unset CDPATH unset SUDO unset MAKEFLAGS +unset INSTALL BASE=`pwd` From c04e151eb5045cc0f60e703a378100ea442d2adf Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 01:28:49 +0100 Subject: [PATCH 358/536] deploy ubuntu ppa. --- .github/workflows/deploy.yml | 50 ++++++++++++++++++ .github/workflows/main.yml | 1 + debian/pgp-secret.asc | 98 ++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 debian/pgp-secret.asc diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..18c7469 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,50 @@ +name: Deploy PPA + +on: + push: + branches: djgpp-ppa + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install curl git debhelper devscripts dput gpg + + - name: Download sources + run: | + ./build-djgpp.sh --batch --only-download --ignore-dependencies djgpp-cvs binutils gcc gdb + + - name: Setup makefile + run: | + mv debian/Makefile . + mv debian/pgp-secret.asc .. + + - name: Make source package + run: | + debuild -S -us -uc -d + + - name: Import signing key + env: + DECRYPT_KEY: ${{ secrets.DECRYPT_KEY }} + run: | + gpg --batch --quiet --passphrase "$DECRYPT_KEY" -d ../pgp-secret.asc | gpg --batch --import + rm -f ../pgp-secret.asc + + - name: Sign package + run: | + debsign -k197C3D6E652B6B1C2B7F9EDF84089D0351487AB8 ../*.changes + + - name: Delete key + if: always() + run: | + sudo shred -fu $(gpgconf --list-dirs | grep homedir | sed 's/homedir://')/priv*/* + + - name: Upload package + run: | + dput ppa:jwt27/djgpp-toolchain ../*.changes diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3efed82..f0e8adf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,7 @@ name: Test builds on: push: + branches-ignore: djgpp-ppa pull_request: schedule: - cron: '0 0 */6 * *' diff --git a/debian/pgp-secret.asc b/debian/pgp-secret.asc new file mode 100644 index 0000000..b892129 --- /dev/null +++ b/debian/pgp-secret.asc @@ -0,0 +1,98 @@ +-----BEGIN PGP MESSAGE----- + +jA0ECQMC9U4w6T6btxDH0uwBAz22e3Wdz5Cuqnkzqd+bfRRqgIv9Y10BAJBszWAy +nLNiUkxHiPz4K7r1Fd3IyIwT+fABqOfjbf06351ftHRr4SE4rxdM87sNVwGnkWyT +uUx3/FMnYTmeMmvDtP0BpvdxmTW7a2Rvu/HBgauFHqD16lnwerA8jgWLHdlgORyr +oUItL3iex2mr+epg+xugrLFw8QaQNQQNOsKt+40V4+eDOw95yVfl7WS8hAQ+nUqx +kgoqhCW8/CsIepZJMKa1y3FrRVqcFmZLJvbmiWmzFb9onBteHXAmXd8RXqh6N6f2 +chHkuyL2uEnlmAkl85ojfiQfj+zorbXGmsVaVTJseKQElNNeretpLeJx/44uZCME +hgWujojfz0BHJAHj/hSoeRL9hSUFUf/DPZfKNKjVNgQCo+/6VjvOQ5qAievmpTGV +K9ageAgzeJvSxOM/6RChLI8x2NASrDhTPnT+m7cczv7shoLKpem1xRwZZy/m3Ii+ +eGC6+jyg3jfKsjPupVsu2kSx06uSLUqk9GFo+UqR4W91ySP5tvV4L5m7dgkVoeUC +ANS8+ostbAdgrGEXKTWx0UMjO5gkB8GINibloAxm7JZKiVW8b2HDXNO73OiQAzcc +Jg/VHYajkNWWSxQy1biRlhI21+T/Tnls6tp+3i5r+8SnXiU7wOnG/K9Ilw8HiR/I +VNmQ3VJTvUijK2ui979YeXLQgDofhtP6byYDgZ92QnC68V4Tghx8ru42pEmiOB9a +mwNGTQ1RpS4XPwgHTTjzaYqZWt6rklvVhBlIJS6tG6HsACnKSWJjSa2PmRQkQgt3 +qrPkaVCau/nrzlA9BxaJycTHoyR4zu9dwtoKN6ykl8aOZAg43BxuEqCf3xvxrNdt +N0jHN0DsrRn5UOPqFXOSJiZEDZ/48KlPLJFoXkgqRgI385SZaYgZRVt5cQ6JOaeo +CUy2+qXPWS4lI7CheLhbjWUIdQo0bGaSzyAqHH0h5WwQ5Iu4KxmjZxA+DR702v3J +HMjEIqCUD/CPh5Tf35KFFlHqo5pTpa8x3Tmbt2UMB7wD5xDzL4QN5K4J0R6Kk0Oi +mkEMfal9WehYFdP7vBlVhyUCG1RwN4apjbni+K9xeEZz0sywAmlRGYnmSgSVO5oG +gzWh8gY3KOE50+BhosWbL2/dbPgWxEgrPDuIVRwWwLt1KdqMH++FP/a6C0g+EjCN +/TSvpStOy1y3eR5rAR2rREup0Aqes9UbAWeohXZxxghyH72kNPX63U1+7rvlseUU +hPOXBcP7l4FdDuRMRwj0xYFDcNiX1lU71TGxPjW7cplADm1L17dPkPiPinvgCMgb +K/QL7vaU6FxmXu/E7Eo7lK7yjcU+bJLkJiAFxWyARKHE1a4fC5FjXcMgmJFXT47m +hvEs47UlDwhSdszdrrCts9AfezGmKrWNcHfHhLVYs/moMMlmduZmYKMWLT6qqoHM +ta79vbTubULM0wVYcGJPCss9471RIes9n/wShA5ufQWQyWUaCjM04VuyPVsORCMi +oqcRmIz8ULVpYN0RXJ0qh30m7CrhUmziHKoGEzu2BeUWFSN3qkkAwHuDyUn5EXR6 +8le5EB/RAP4A3Sw1OF2jClsrW1a4L7r1Dy/s2cOFw339GhyP4WCkUzwc+7M1tL5L +be3zBRSpBtqBSwzMnu9HHVcT+QT1SWQmRhjbiw7/yqX7m3ZCsWMyVp39G+4o0hAa +KUdRUSSsEe+n0Hkx60tHfh7Y2W5MTgV6BAoDiyl6iPsZD7ooc8K5wlK76dl+lWdD +uGYp3imHAI/PsmLPtw6T0Ex59xNiTuuhzmjAodsMAGbR4np5vEbhueg8/O8h7AS2 +KTVcX1WQwAI2YSavJj0dFMzEtLksOAVXz4wiushbqRXdp7f5ojeEXjEhsZb3fTMk +m4EBndpAxVJ6tB0/SczknpGCicxHfnVMOj9UrOfYToXJ1eD0/QaerIeFoFq1geIY +Z0DRI2vvTXBA8DlpmNxqSYn6U2N9s8U6PPTglnRi/gZJQTT8ZVEhKE8CSXk4MxJs +tt65ey70A7y6WEvO5RUFCdFbE2tWgITg8cfD3v9YVzjUI6G2t89tK9dLhskhYVzR +LxnCyi+bh2vkdnQCyvLf67LZnzhTRuuYAeE6bkLKBYkBXK5kQFkOud3ts9oLrQnP +i3mzEUFK7LkaiLgt4/I1sl6xAkwkh/2AYRogKYqMV4gwcV2CV8MEcYjT8Qq8bIKm +s1E3kAuqM13bMPZq2VayXoFDgPHu94YV3H2CXDYukf8Sy90n+mDcZTkNy1GpEoxi +y4ley0BzKJBgV6sDDca7y6Tb/keJiDFLLt0cBLOSh2R0+w7Hk1hVLmM0KtD6LLMx +wp9XscbjkkUylorYILBag0R6vYaFdtCMaw2Ra8yq1HDzLTx1h1Xwa4sbrYvh5Uxe +Ti5tO4xWGFltJ8PzIdHGXV3GiynuvIw/1pfqZibPB5y5XQwBznQLCJtVYRgvv5Sq +4xMY3BeisEB7FFAb2ryK1orb4QdEC4S4uhvcgEVxcZZpAyyuUkjchTtZKU6wzgho +uZJ4fdHxPcGgg4ygV1NOOFrfv7yLroIxq6JhQ6Ahno71VBgRxvXXpeJ6jcqKbWO/ +UikgWapMG+ZEW/cr2p2ejZ2088KecKmc7uO+B4ZrM5SijK/6BJ7cHgz5rXveZZ1o +2unKFVK+/0JbXRU/QcIf0gV75S46LB6kEubkQ1iT2NoSM9VWrTnxCutcw3wiQlvc +k8cjx4CSTaoO/Yq4hi1DsQLAoXtbAZYTRMOKLjnLqlv+Xst56oQvdSXNR5KC2xth +P0Hxx3pok+aite8RF5aiaGf16lqrAqYjmRdod3UrjlE/i+WyvM73/96hohMpBHVI +N6uCd6id3b29DTtHQLeBWJ2dfCSCRXMAubhPkOaCXysW2576wqaGMShxKIcJs68j +/mAizU6IhDwtHnHr6oP4G9xuKhXYeWb16Y0LI+Ob0EzyDipXKpeYiUAWqrUrlN7t +O1cWi+F9X/K5iS+2F8ZFIFF3+PgW+KUPniim8XwFPuAJz7jB1GdrUSkqftpYUbah +sFzI71d4wQsQXdd5nWfPXNGziuXjKafjtTzkThTjgDxK3EAFyvNR4Ad/5RFE+jMR +JDIA9AMVa28mmoa9OJnXpDO/5IeUNz2d4jTeGbLnaXT7PZT2mb7ZGIzVUZs+xkmP +oq3cujscdzAQk7ep5qqVlueDoa2/dwTwPDDnclJaOFf8tB+5QBLUPINfF+wbQamD +tAOgs6DDiucV5jGRS+ZQ1l3N/bd4RcQ8IJ3XoOZXdPfYW1I7tyYhUpM7YWpGp7SU +qEEWLRNyj1Cy+4sGNoyVFWx0qQ27rs1Jb9ab/4zVfuc+SdizlvbdoA4dYZuD/TwY +k8viTtq5gTMDOUBFvVnNfmbBJEIGXIVGwfJu0eXACaTbRCbzqSYFqxlPNoqyihif +xH89Tgc7BxLQwbwfYl3VBSD7bY2tQV6rDAloh9ubFADgeIC5Mvb9gCV8SeF/1kap +fIRBE57kyyRMsIqOQueSx10FU97rEDurj72oHwMyZLrqGhoutL5AOZEmNvTnYeR3 +3tyQrzH9eZjXkIJ61OYBJ729+XBhvZoCQCnPKLuBXa81WBjTzjJzStnj9TFm6Jo3 +mTp8mCriKwnOYagmi0H6pYjlFhvJJsom0KewyznoveeQN56JOOySeCJTPZ4yy4I6 +NuXsF2TSpVJ3cLwvguuiJShmIE3m3GmipWPFKgYi4uGbB8ArZKCm6uXY9/6PFcMm +ElZQ3o8YAUAHuwj0ZmQBHC83QyB/aKo9pZbPqqXbkZcmAL5SDOQU0b1XrvLuhlGO +cdZmWM6GeSnLBp2bEJ7tOSnoVggp0fq5l8EZ3QrZ5aLOs2zaKxy7tDHzrbtDAgmz +U67WMWXeZY2YZfVLyqPfEEavIrLlenit0uz9ajSllSPGjEL0fVbGqZBCbXZAa9rr +DSAZ5NO+QeIVLaFivcyVhbb9ydSYMfRXIdmzjRCjzTTIXZRlEGEAkd2rjL+bnLDk +fF+vq3rWVgcZ9QDhZjWMTeIJBKNOAf8WJx2AbxCRTDQEysNeH4343SkclvmE6/X9 +ndmgjkx2dpll7fryIggUCQMvOm7RVYEGW0q3hudo0afVMkOXR58Q08q1N44iHW/v +/pNsyJyYqBfpPOhGQewehXS0FFtoAp0ryO01FiFtPfvRlGvm8hQEOb4zZ/pNCXoO +eLRv6vdcMvMT9OD7YQCocKcMUaDDCD9Ay1uHDmtYb+TpdRm08M6kQZyqMVa8PPPq +MOp2oSQ5m9/CC1T9Je+yftRwtpi3cI8BLnIBi1djy989WPiL5JDVUR7Re6YPI7cf +eYGYgl7ESIUuXggsyugZhk0Cj7VFWMtu8aJBiJdZwY9FzYN3oEVc37NOPAx+MJIM +zjlzznq7uBOu0Tag7YDjjkCmLbvX+RpFDUyT64c9BRzSqgAuEgPjYL2/7mk8RVgp +paMI15zt6nH8TSei2JRKj2ZgF+ABpGvDuI/ssLJ3TP+oYvIxp9QzofJRWY2KQndN +hyITDc0cd/kyA5IGzXc9azkeVg1ISOTBV78k45JzvWKdHJrkD2cjFq1Kbmt+dBam +5MKlTNaG5ckz15PRI2VBhJvTEsiqCvk2mXW4kCuxJOcmub3dcnnHnvJO2xJlMOOt +x1/sMQElsYHUvrlgpyjn7h42QnY6ZFfZh2FxO/d+Lzbk0h4GfMmPvx6DnmktJHzY +LSL6vH4JX0vhnMIG/oEkA7oQtoSUvK6Tl94asqjUB9h4fcpwZRw5Cbcqm9EtmR8a +knOGEa5bJsSMQkkmRSPzsdqhkRgs+i1YT+T8zViR/TV0arAWdtjIBI2nKV+t0peR +i/HfBTFkynX1O0twH28l+5Xcr7GwxkpqTG0EPKmBVuwD/oN2nKGC2D0owJADovTS +U/1/54SiIKo7OYX1LqQtwx2K7HGdsMvbicnwo++SQO0qpMb1CCGCB1flUgz31qgX +5+KlhW3fVUv430XlbQo58hzdYlXPR9YZGrugg+ogimpBgV16130iPlEI1OzDbCvE +tccDJ6UYQCTlvWyiCrDv+912WufJGvfzhYPdRLclg158I3mRyQT++lPQTj+ORCsV +YzbBTC1H6wYBcpo/H/gcTNVdeVbBLwN4nv3WT2lHGyBLJ4mmz+rK2Vpx5xBUDdG/ +ASzHztv2H9TL5EgddRCbN612JgNq+dI9cvwtIP7BoXoGbKLzwj/zF4FT+Hax/LFR +iV2fQxUa5NmOqv0QPYpqu+76WSdflRza94EJ03Sxvks/qwn+xJlKUmEn9wzuD2MH +WtaXXcHEyurTkc8GxnCGkTu7jUI1ahNskkmzWfMS3tGhnt0tDaT18BUKV53/wPW2 +cnIvc+XDMk8I9FEGiWiktH8LDKHG2c+5Hz3F3qZnzTcNyb34tl0AN1aexHKIPzju +H901BNW4MInOi3e04dFzefR1ntfW3qZ2tdpvH4iRQseQwLx1Hc/HaZ20KH2a3IiY +GVbghBT6wGGMbEzIq4gr/vvz5HJvzo3RTrHJe1lDajBCxVensdRtOMDD0aB18p0C ++7Y+Sy3WdLBpJd5lRDvh3LsErP2P2S04Ev0msXUukJ8xzxigNptzKRIZ+xvdU3Z2 +rfAklyyT8rbLG/oVb8g8oNo6Arc4mzQnX2jCAYwwBMSzkHoUwDmAm6mMccHrbudQ +Sz3gDun9EiFYP4pJs7srIAO9onDIN/r+J7s4I+mEER8gFcovui4VxzjSAZ4VBcpH +PfMBfUsUiy3KGgPpNSOKphxsJB4jmyyxEgLnWSwqfaqICMkToQEyDGND/N+sxfrf +qt6IrQOH+fDOmDqKUdbhe9l2dUegHcWmH7Pa4NkY58TFa+EWpy29MRKr4dVSVhY0 +21pBGX0VoXrf/KOHPwRrvPLp/Qckabduyzzf91uHNTBal8pAeYTW96Wf/O6rVWRG +a9X0KYsFkEMyoygezAo2nSK3jORQpbfh4zQufB06BQ== +=3fzz +-----END PGP MESSAGE----- From d01c6f127e73f0db99defdfb139234cbbe561060 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 04:11:25 +0100 Subject: [PATCH 359/536] pack git sources into tar files. --- .github/workflows/deploy.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 18c7469..b2cfb06 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,6 +20,16 @@ jobs: run: | ./build-djgpp.sh --batch --only-download --ignore-dependencies djgpp-cvs binutils gcc gdb + - name: Pack git sources + run: | + find download/*/* ! -wholename '*/.git/*' -delete || true + cd download/ + for DIR in */; do + DIR=${DIR%/} + tar -c -f $DIR-git.tar $DIR + done + rm -rf */ + - name: Setup makefile run: | mv debian/Makefile . From 30a47be1fbcbd31927b1aec04e6d3ef137c4a255 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 16:29:44 +0100 Subject: [PATCH 360/536] fix package names in debian/control file --- debian/changelog | 6 ++++++ debian/control | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 39f3f4b..d534669 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20200213.1+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) bionic; urgency=low + + * fix package names in control file. + + -- jwt27 Thu, 13 Feb 2020 16:27:55 +0100 + djgpp-toolchain (0.20200213.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) bionic; urgency=medium * Initial Release. diff --git a/debian/control b/debian/control index 9200737..cf62f51 100644 --- a/debian/control +++ b/debian/control @@ -25,10 +25,10 @@ Homepage: https://github.com/jwt27/build-gcc Package: djgpp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: djgpp-binutils, djgpp-gcc +Recommends: binutils-djgpp, gcc-djgpp Suggests: djgpp-doc Description: DJGPP C library and utilities - Required for djgpp-gcc. + Required for gcc-djgpp. Package: djgpp-doc Architecture: all @@ -48,7 +48,7 @@ Architecture: all Depends: ${misc:Depends} Suggests: gcc-djgpp Conflicts: gcc-doc -Description: Documentation for djgpp-gcc +Description: Documentation for gcc-djgpp Package: gcc-djgpp-extra Architecture: all @@ -72,7 +72,7 @@ Architecture: all Depends: ${misc:Depends} Suggests: binutils-djgpp Conflicts: binutils-doc -Description: Documentation for djgpp-binutils. +Description: Documentation for binutils-djgpp. Package: gdb-djgpp Architecture: any @@ -86,11 +86,11 @@ Architecture: all Depends: ${misc:Depends} Suggests: gdb-djgpp Conflicts: gdb-doc -Description: Documentation for djgpp-gdb +Description: Documentation for gdb-djgpp Package: gdb-djgpp-extra Architecture: all Depends: ${misc:Depends} Recommends: gdb-djgpp -Description: Extra files for djgpp-gdb +Description: Extra files for gdb-djgpp May conflict with host gdb. From 04e3347e3c79033409c5484a06c49ceacf1589a8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 17:34:07 +0100 Subject: [PATCH 361/536] release ppa for multiple ubuntu versions --- .github/workflows/deploy.yml | 8 +++++++- debian/changelog | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b2cfb06..b70da73 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,6 +7,9 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + ubuntu-version: [ xenial, bionic, disco, eoan, focal ] steps: - uses: actions/checkout@v2 @@ -30,10 +33,13 @@ jobs: done rm -rf */ - - name: Setup makefile + - name: Setup package files + env: + UBUNTU_VERSION: ${{ matrix.ubuntu-version }} run: | mv debian/Makefile . mv debian/pgp-secret.asc .. + sed -i "s/UBUNTU_VERSION/$UBUNTU_VERSION/g" debian/changelog - name: Make source package run: | diff --git a/debian/changelog b/debian/changelog index d534669..7a2c509 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -djgpp-toolchain (0.20200213.1+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) bionic; urgency=low +djgpp-toolchain (0.20200213.1+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * fix package names in control file. -- jwt27 Thu, 13 Feb 2020 16:27:55 +0100 -djgpp-toolchain (0.20200213.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) bionic; urgency=medium +djgpp-toolchain (0.20200213.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=medium * Initial Release. From 7a91f7ed73057b6f34c8ebb85d313a11c5ef08ef Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 18:30:25 +0100 Subject: [PATCH 362/536] drop ppa support for xenial --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b70da73..8436a39 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ xenial, bionic, disco, eoan, focal ] + ubuntu-version: [ bionic, disco, eoan, focal ] steps: - uses: actions/checkout@v2 From 8ea9b931ee4cc94fd7cddaf541c3298dbea0dbc8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 13 Feb 2020 21:53:21 +0100 Subject: [PATCH 363/536] remove binutils-djgpp package for focal --- .github/workflows/deploy.yml | 1 + debian/changelog | 6 +++ debian/focal/control | 81 ++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 debian/focal/control diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8436a39..4055013 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,6 +40,7 @@ jobs: mv debian/Makefile . mv debian/pgp-secret.asc .. sed -i "s/UBUNTU_VERSION/$UBUNTU_VERSION/g" debian/changelog + [ -d debian/$UBUNTU_VERSION ] && cp debian/$UBUNTU_VERSION/* debian/ - name: Make source package run: | diff --git a/debian/changelog b/debian/changelog index 7a2c509..7099aad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20200213.2+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * remove binutils-djgpp and binutils-djgpp-doc for focal and require upstream binutils-djgpp. + + -- jwt27 Thu, 13 Feb 2020 21:51:35 +0100 + djgpp-toolchain (0.20200213.1+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * fix package names in control file. diff --git a/debian/focal/control b/debian/focal/control new file mode 100644 index 0000000..9ff9abf --- /dev/null +++ b/debian/focal/control @@ -0,0 +1,81 @@ +Source: djgpp-toolchain +Section: devel +Priority: optional +Maintainer: jwt27 +Build-Depends: + git, + bash, + make, + unzip, + wget, + bison, + flex, + texinfo, + patch, + tar, + xz-utils, + bzip2, + gzip, + dos2unix, + zlib1g-dev, + debhelper (>= 11) +Standards-Version: 4.1.2 +Homepage: https://github.com/jwt27/build-gcc + +Package: djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: binutils-djgpp, gcc-djgpp +Suggests: djgpp-doc +Description: DJGPP C library and utilities + Required for gcc-djgpp. + +Package: djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: djgpp +Description: Documentation for djgpp + +Package: gcc-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp (>= 2.34-1ubuntu1+1.3) +Suggests: gcc-djgpp-doc, gcc-djgpp-extra +Description: GNU Compiler Collection + Cross-compiler targeting djgpp. Supports C and C++. + +Package: gcc-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: gcc-djgpp +Conflicts: gcc-doc +Description: Documentation for gcc-djgpp + +Package: gcc-djgpp-extra +Architecture: all +Depends: ${misc:Depends} +Recommends: gcc-djgpp +Suggests: gdb-djgpp +Description: Extra files for gcc + Python pretty-printer script files for use with gdb. + May conflict with host gcc. + +Package: gdb-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: gdb-djgpp-doc, gcc-djgpp-extra +Description: GNU Debugger + Used to debug djgpp programs over a serial connection. + +Package: gdb-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: gdb-djgpp +Conflicts: gdb-doc +Description: Documentation for gdb-djgpp + +Package: gdb-djgpp-extra +Architecture: all +Depends: ${misc:Depends} +Recommends: gdb-djgpp +Description: Extra files for gdb-djgpp + May conflict with host gdb. From c648e6e76b8646430c817b52162a112e92bda5d3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 29 Feb 2020 16:35:26 +0100 Subject: [PATCH 364/536] make gcc-djgpp in focal depend on 2.34-3ubuntu1+1.4. --- debian/changelog | 6 ++++++ debian/focal/control | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7099aad..4068d86 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20200229.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * make gcc-djgpp in focal depend on 2.34-3ubuntu1+1.4 + + -- jwt27 Sat, 29 Feb 2020 16:37:17 +0100 + djgpp-toolchain (0.20200213.2+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * remove binutils-djgpp and binutils-djgpp-doc for focal and require upstream binutils-djgpp. diff --git a/debian/focal/control b/debian/focal/control index 9ff9abf..fe08cb4 100644 --- a/debian/focal/control +++ b/debian/focal/control @@ -38,7 +38,7 @@ Description: Documentation for djgpp Package: gcc-djgpp Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp (>= 2.34-1ubuntu1+1.3) +Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp (>= 2.34-3ubuntu1+1.4) Suggests: gcc-djgpp-doc, gcc-djgpp-extra Description: GNU Compiler Collection Cross-compiler targeting djgpp. Supports C and C++. From 8c29c75433c0b8c3cd0316ddd0c9a6751304cd56 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 29 Feb 2020 16:40:24 +0100 Subject: [PATCH 365/536] use empty DESTDIR for temporarily installed tools. --- build-djgpp.sh | 4 ++-- script/build-tools.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index fd6ded5..c8971b8 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -117,7 +117,7 @@ if [ ! -z ${GCC_VERSION} ]; then untar ${AUTOCONF_ARCHIVE} || exit 1 cd autoconf-${AUTOCONF_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE_J} DESTDIR=/ all install || exit 1 + ${MAKE_J} DESTDIR= all install || exit 1 rm ${BUILDDIR}/tmpinst/autoconf-*-built touch ${BUILDDIR}/tmpinst/autoconf-${AUTOCONF_VERSION}-built else @@ -130,7 +130,7 @@ if [ ! -z ${GCC_VERSION} ]; then untar ${AUTOMAKE_ARCHIVE} || exit 1 cd automake-${AUTOMAKE_VERSION}/ ./configure --prefix=$BUILDDIR/tmpinst || exit 1 - ${MAKE} DESTDIR=/ all install || exit 1 + ${MAKE} DESTDIR= all install || exit 1 rm ${BUILDDIR}/tmpinst/automake-*-built touch ${BUILDDIR}/tmpinst/automake-${AUTOMAKE_VERSION}-built else diff --git a/script/build-tools.sh b/script/build-tools.sh index 312987c..5dda755 100644 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -13,7 +13,7 @@ if [ ! -z $SED_VERSION ]; then export CFLAGS="${CFLAGS//-w}" # configure fails if warnings are disabled. ./configure --prefix=${BASE}/build/tmpinst || exit 1 ${MAKE_J} || exit 1 - ${MAKE_J} DESTDIR=/ install || exit 1 + ${MAKE_J} DESTDIR= install || exit 1 CFLAGS="$TEMP_CFLAGS" touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed fi From 2b3f2f9d38dfe9f45bba837bfc9b66a7deb5f07d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 29 Feb 2020 16:42:16 +0100 Subject: [PATCH 366/536] simplify msys2 pacman command in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef98657..890295c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ mingw-get install msys-unzip libz-dev msys-wget msys-bison msys-flex msys-patch MinGW64 (msys2) : ```sh -pacman -Syuu base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-curl mingw-w64-x86_64-zlib compression +pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib} compression ``` ### Configuration From c4f0a27fd5b2e3f5869fd2706f54c10b0a865934 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 29 Feb 2020 17:04:39 +0100 Subject: [PATCH 367/536] run test builds every 14 days. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0e8adf..920ffe0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: branches-ignore: djgpp-ppa pull_request: schedule: - - cron: '0 0 */6 * *' + - cron: '0 0 */14 * *' jobs: build: From d522c91d78a2956dbb29aac078be7e72992c9a35 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 29 Feb 2020 17:14:15 +0100 Subject: [PATCH 368/536] download gcc dependencies separately only if --build-deb is given. use download_prerequisites script otherwise. --- .github/workflows/deploy.yml | 2 +- build-djgpp.sh | 12 +++++++++--- debian/Makefile | 2 +- script/build-avr-gcc.sh | 12 +++++++++--- script/build-newlib-gcc.sh | 12 +++++++++--- script/check-deps-and-confirm.sh | 4 ++-- script/init.sh | 1 + 7 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4055013..09706f5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,7 +21,7 @@ jobs: - name: Download sources run: | - ./build-djgpp.sh --batch --only-download --ignore-dependencies djgpp-cvs binutils gcc gdb + ./build-djgpp.sh --batch --build-deb --only-download --ignore-dependencies djgpp-cvs binutils gcc gdb - name: Pack git sources run: | diff --git a/build-djgpp.sh b/build-djgpp.sh index c8971b8..7b45985 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -174,14 +174,20 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR/ - echo "Unpacking gcc dependencies" pushd gnu/gcc-${GCC_VERSION} || exit 1 - for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + if [ ! -z ${BUILD_DEB} ]; then + echo "Unpacking gcc dependencies" + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do FILE=`basename $URL` untar ${FILE} mv ${FILE%.*.*} ${FILE%%-*} || exit 1 - done + done + else + echo "Downloading gcc dependencies" + sed -i 's/ftp/http/g' contrib/download_prerequisites + ./contrib/download_prerequisites || exit 1 + fi # apply extra patches if necessary [ -e ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt ] && patch -p 1 -u -i ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt diff --git a/debian/Makefile b/debian/Makefile index 12a43bd..f224c99 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -3,7 +3,7 @@ PACKAGES=djgpp-cvs binutils gcc gdb all: build build: - ./build-djgpp.sh --batch --no-download --prefix=/usr --destdir=`pwd`/install $(PACKAGES) + ./build-djgpp.sh --batch --build-deb --no-download --prefix=/usr --destdir=`pwd`/install $(PACKAGES) install: sed -i 's/\/usr\/bin\/i386/usr\/bin\/i386/' install/usr/bin/i386-pc-msdosdjgpp-link-i586 diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 166b55e..407ab39 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -23,14 +23,20 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Unpacking gcc..." untar ${GCC_ARCHIVE} - echo "Unpacking gcc dependencies" pushd gcc-${GCC_VERSION} || exit 1 - for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + if [ ! -z ${BUILD_DEB} ]; then + echo "Unpacking gcc dependencies" + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do FILE=`basename $URL` untar ${FILE} mv ${FILE%.*.*} ${FILE%%-*} || exit 1 - done + done + else + echo "Downloading gcc dependencies" + sed -i 's/ftp/http/g' contrib/download_prerequisites + ./contrib/download_prerequisites || exit 1 + fi touch gcc-unpacked popd diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index b3f16bb..db54d31 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -13,14 +13,20 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Unpacking gcc..." untar ${GCC_ARCHIVE} - echo "Unpacking gcc dependencies" pushd gcc-${GCC_VERSION} || exit 1 - for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do + if [ ! -z ${BUILD_DEB} ]; then + echo "Unpacking gcc dependencies" + for URL in $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE; do FILE=`basename $URL` untar ${FILE} mv ${FILE%.*.*} ${FILE%%-*} || exit 1 - done + done + else + echo "Downloading gcc dependencies" + sed -i 's/ftp/http/g' contrib/download_prerequisites + ./contrib/download_prerequisites || exit 1 + fi touch gcc-unpacked popd diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 2e7166a..4e92f69 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -43,11 +43,11 @@ case $TARGET in *) unset DJCROSS_GCC_ARCHIVE OLD_DJCROSS_GCC_ARCHIVE ;; esac -if [ ! -z ${GCC_VERSION} ]; then +if [ ! -z ${BUILD_DEB} ] && [ ! -z ${GCC_VERSION} ]; then GMP_VERSION=${GMP_VERSION:-6.2.0} MPFR_VERSION=${MPFR_VERSION:-4.0.2} MPC_VERSION=${MPC_VERSION:-1.1.0} - if ${CC} -v 2>&1 | grep "clang version" > /dev/null ;then + if ${CC} -v 2>&1 | grep "clang version" > /dev/null; then ISL_VERSION=${ISL_VERSION:-0.21} else ISL_VERSION=${ISL_VERSION:-0.22.1} diff --git a/script/init.sh b/script/init.sh index 2d5b49e..23b5499 100644 --- a/script/init.sh +++ b/script/init.sh @@ -97,6 +97,7 @@ for A in "$@"; do --only-download) ONLY_DOWNLOAD=y ;; --ignore-dependencies) IGNORE_DEPENDENCIES=y ;; --batch) BUILD_BATCH=y ;; + --build-deb) BUILD_DEB=y ;; --destdir=*) DESTDIR=${A#*=} ;; --prefix=*) PREFIX=${A#*=} ;; --target=*) TARGET=${A#*=} ;; From ad681841ccb7146427ab6bde033ccd4bc744033a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 29 Feb 2020 18:13:27 +0100 Subject: [PATCH 369/536] add lto to default enable-languages option. --- script/init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/init.sh b/script/init.sh index 23b5499..6714d77 100644 --- a/script/init.sh +++ b/script/init.sh @@ -110,5 +110,5 @@ done PREFIX=${PREFIX-/usr/local/cross} # enabled languages -#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,f95,objc,obj-c++} -ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++} +#ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,lto,f95,objc,obj-c++} +ENABLE_LANGUAGES=${ENABLE_LANGUAGES-c,c++,lto} From a37faf972f51bd1a93545f44a582e22d6687ce22 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 10 Mar 2020 21:34:06 +0100 Subject: [PATCH 370/536] add binutils 2.34 for djgpp --- debian/changelog | 6 ++++++ djgpp/binutils | 2 +- djgpp/binutils-2.33.1 | 2 +- djgpp/binutils-2.34 | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 djgpp/binutils-2.34 diff --git a/debian/changelog b/debian/changelog index 4068d86..4c6401e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20200310.0+gcc9.2.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * binutils version 2.34. + + -- jwt27 Tue, 10 Mar 2020 21:31:14 +0100 + djgpp-toolchain (0.20200229.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * make gcc-djgpp in focal depend on 2.34-3ubuntu1+1.4 diff --git a/djgpp/binutils b/djgpp/binutils index 76654a5..479fd4a 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.33.1 +source djgpp/binutils-2.34 diff --git a/djgpp/binutils-2.33.1 b/djgpp/binutils-2.33.1 index 05ef4b0..d2d87ff 100644 --- a/djgpp/binutils-2.33.1 +++ b/djgpp/binutils-2.33.1 @@ -1,2 +1,2 @@ BINUTILS_VERSION=2331 -BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" +BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/deleted/v2gnu/bnu${BINUTILS_VERSION}s.zip" diff --git a/djgpp/binutils-2.34 b/djgpp/binutils-2.34 new file mode 100644 index 0000000..1f7cc8c --- /dev/null +++ b/djgpp/binutils-2.34 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=234 +BINUTILS_ARCHIVE="${DJGPP_DOWNLOAD_BASE}/djgpp/current/v2gnu/bnu${BINUTILS_VERSION}s.zip" From da41f1462f75bf9d33d871a80ef946c887ee422f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 10 Mar 2020 21:56:02 +0100 Subject: [PATCH 371/536] mv ppa signing key to /tmp --- .github/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 09706f5..cbd2664 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,7 +38,7 @@ jobs: UBUNTU_VERSION: ${{ matrix.ubuntu-version }} run: | mv debian/Makefile . - mv debian/pgp-secret.asc .. + mv debian/pgp-secret.asc /tmp/ sed -i "s/UBUNTU_VERSION/$UBUNTU_VERSION/g" debian/changelog [ -d debian/$UBUNTU_VERSION ] && cp debian/$UBUNTU_VERSION/* debian/ @@ -50,8 +50,8 @@ jobs: env: DECRYPT_KEY: ${{ secrets.DECRYPT_KEY }} run: | - gpg --batch --quiet --passphrase "$DECRYPT_KEY" -d ../pgp-secret.asc | gpg --batch --import - rm -f ../pgp-secret.asc + gpg --batch --quiet --passphrase "$DECRYPT_KEY" -d /tmp/pgp-secret.asc | gpg --batch --import + rm -f /tmp/pgp-secret.asc - name: Sign package run: | From e7962326581710634c30fba36e5c8e9337d61258 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 10 Mar 2020 22:05:22 +0100 Subject: [PATCH 372/536] use if statement to suppress error on deploy --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cbd2664..f727ade 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,7 +40,7 @@ jobs: mv debian/Makefile . mv debian/pgp-secret.asc /tmp/ sed -i "s/UBUNTU_VERSION/$UBUNTU_VERSION/g" debian/changelog - [ -d debian/$UBUNTU_VERSION ] && cp debian/$UBUNTU_VERSION/* debian/ + if [ -d debian/$UBUNTU_VERSION ]; then cp debian/$UBUNTU_VERSION/* debian/; fi - name: Make source package run: | From d42ad8843a3cad3aaa0a54f602f37635f27f66a7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 3 May 2020 07:53:15 +0200 Subject: [PATCH 373/536] add gcc 9.3.0 --- common/gcc | 2 +- common/gcc-9.3.0 | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 common/gcc-9.3.0 diff --git a/common/gcc b/common/gcc index 770f870..4ddcde1 100644 --- a/common/gcc +++ b/common/gcc @@ -1 +1 @@ -source common/gcc-9.2.0 +source common/gcc-9.3.0 diff --git a/common/gcc-9.3.0 b/common/gcc-9.3.0 new file mode 100644 index 0000000..b1e5a35 --- /dev/null +++ b/common/gcc-9.3.0 @@ -0,0 +1,12 @@ +GCC_VERSION=9.3.0 +GCC_VERSION_SHORT=9.30 +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}" From a555bf3c0fe60c119e87e00fb91b6314427a0fd6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 3 May 2020 09:10:39 +0200 Subject: [PATCH 374/536] run test builds once a month --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 920ffe0..6af902c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: branches-ignore: djgpp-ppa pull_request: schedule: - - cron: '0 0 */14 * *' + - cron: '0 0 1 * *' jobs: build: From 93d954162fc3d6c7726fe0fe1c09edfbe8a08489 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 5 May 2020 16:33:16 +0200 Subject: [PATCH 375/536] patch djgpp gcc 9.3 and binutils 2.34 to use "b" flag for named bss sections. also move djgpp patches to subdirectories. --- build-djgpp.sh | 10 ++-- .../0001.patch} | 4 +- .../0001-byteswap.patch} | 4 +- ...lag-if-b-flag-is-given-for-COFF-sect.patch | 50 +++++++++++++++++++ .../0001.patch} | 0 .../0001.patch} | 0 ...p-emit-b-flag-for-named-bss-sections.patch | 38 ++++++++++++++ 7 files changed, 96 insertions(+), 10 deletions(-) rename patch/{patch-bnu27-bfd-init.txt => djgpp-binutils-227/0001.patch} (71%) rename patch/{patch-djgpp-binutils-2.33.1-swap.txt => djgpp-binutils-2331/0001-byteswap.patch} (88%) create mode 100644 patch/djgpp-binutils-234/0001-clear-CONTENTS-flag-if-b-flag-is-given-for-COFF-sect.patch rename patch/{patch-djgpp-gcc-8.1.0.txt => djgpp-gcc-8.1.0/0001.patch} (100%) rename patch/{patch-djgpp-gcc-8.2.0.txt => djgpp-gcc-8.2.0/0001.patch} (100%) create mode 100644 patch/djgpp-gcc-9.3.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch diff --git a/build-djgpp.sh b/build-djgpp.sh index 7b45985..a86912f 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -38,11 +38,9 @@ if [ ! -z ${BINUTILS_VERSION} ]; then echo "Unpacking binutils..." unzip -oq ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - case ${BINUTILS_VERSION} in - 227) patch gnu/binutils-*/bfd/init.c ${BASE}/patch/patch-bnu27-bfd-init.txt || exit 1 ;; - 2331) patch gnu/binutils-*/libctf/swap.h ${BASE}/patch/patch-djgpp-binutils-2.33.1-swap.txt || exit 1 ;; - 234) ;; #TODO - esac + pushd gnu/binutils-* || exit 1 + cat ${BASE}/patch/djgpp-binutils-${BINUTILS_VERSION}/* | patch -p1 -u || exit 1 + popd touch binutils-unpacked fi @@ -190,7 +188,7 @@ if [ ! -z ${GCC_VERSION} ]; then fi # apply extra patches if necessary - [ -e ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt ] && patch -p 1 -u -i ${BASE}/patch/patch-djgpp-gcc-${GCC_VERSION}.txt + cat ${BASE}/patch/djgpp-gcc-${GCC_VERSION}/* | patch -p1 -u || exit 1 popd touch gcc-unpacked diff --git a/patch/patch-bnu27-bfd-init.txt b/patch/djgpp-binutils-227/0001.patch similarity index 71% rename from patch/patch-bnu27-bfd-init.txt rename to patch/djgpp-binutils-227/0001.patch index e8f98fa..7639ad9 100644 --- a/patch/patch-bnu27-bfd-init.txt +++ b/patch/djgpp-binutils-227/0001.patch @@ -1,5 +1,5 @@ ---- init.c.bak 2017-01-31 19:11:07.478074684 +0000 -+++ init.c 2017-01-31 19:24:23.798041848 +0000 +--- a/bfd/init.c 2017-01-31 19:11:07.478074684 +0000 ++++ b/bfd/init.c 2017-01-31 19:24:23.798041848 +0000 @@ -25,9 +25,7 @@ /* This controls if the coff 64k support shall be disabled or not. diff --git a/patch/patch-djgpp-binutils-2.33.1-swap.txt b/patch/djgpp-binutils-2331/0001-byteswap.patch similarity index 88% rename from patch/patch-djgpp-binutils-2.33.1-swap.txt rename to patch/djgpp-binutils-2331/0001-byteswap.patch index 56b4e53..a0ce856 100644 --- a/patch/patch-djgpp-binutils-2.33.1-swap.txt +++ b/patch/djgpp-binutils-2331/0001-byteswap.patch @@ -1,5 +1,5 @@ ---- swap.original.h 2020-02-04 02:01:06.703925300 +0100 -+++ swap.h 2020-02-04 02:01:35.474802100 +0100 +--- a/libctf/swap.h 2020-02-04 02:01:06.703925300 +0100 ++++ b/libctf/swap.h 2020-02-04 02:01:35.474802100 +0100 @@ -23,19 +23,15 @@ #include "config.h" #include diff --git a/patch/djgpp-binutils-234/0001-clear-CONTENTS-flag-if-b-flag-is-given-for-COFF-sect.patch b/patch/djgpp-binutils-234/0001-clear-CONTENTS-flag-if-b-flag-is-given-for-COFF-sect.patch new file mode 100644 index 0000000..0a76cd7 --- /dev/null +++ b/patch/djgpp-binutils-234/0001-clear-CONTENTS-flag-if-b-flag-is-given-for-COFF-sect.patch @@ -0,0 +1,50 @@ +Subject: [PATCH] clear CONTENTS flag if "b" flag is given for COFF section +From: "J.W. Jagersma" +Date: 2020-03-24 23:20 + +The "b" flag for COFF sections only unsets the LOAD attribute. It +should also clear the CONTENTS attribute so that named bss sections +don't take up space in an object file. This can be achieved by +setting the 'bss' flag in seg_info. + +gas/ +2020-03-24 Jan W. Jagersma + + * config/obj-coff.c (obj_coff_section): Set bss flag in + seg_info if "b" flag is given. +--- + gas/config/obj-coff.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c +index 178ccaad6a..e97d9a22a1 100644 +--- a/gas/config/obj-coff.c ++++ b/gas/config/obj-coff.c +@@ -1531,6 +1531,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED) + char *name; + unsigned int exp; + flagword flags, oldflags; ++ bfd_boolean is_bss = FALSE; + asection *sec; + + if (flag_mri) +@@ -1581,6 +1582,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED) + /* Uninitialised data section. */ + flags |= SEC_ALLOC; + flags &=~ SEC_LOAD; ++ is_bss = TRUE; + break; + + case 'n': +@@ -1652,6 +1654,9 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED) + + sec = subseg_new (name, (subsegT) exp); + ++ if (is_bss) ++ seg_info (sec)->bss = 1; ++ + if (alignment >= 0) + sec->alignment_power = alignment; + +-- 2.25.2 + diff --git a/patch/patch-djgpp-gcc-8.1.0.txt b/patch/djgpp-gcc-8.1.0/0001.patch similarity index 100% rename from patch/patch-djgpp-gcc-8.1.0.txt rename to patch/djgpp-gcc-8.1.0/0001.patch diff --git a/patch/patch-djgpp-gcc-8.2.0.txt b/patch/djgpp-gcc-8.2.0/0001.patch similarity index 100% rename from patch/patch-djgpp-gcc-8.2.0.txt rename to patch/djgpp-gcc-8.2.0/0001.patch diff --git a/patch/djgpp-gcc-9.3.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch b/patch/djgpp-gcc-9.3.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch new file mode 100644 index 0000000..5f77c4e --- /dev/null +++ b/patch/djgpp-gcc-9.3.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch @@ -0,0 +1,38 @@ +From e869e1d34fde5f3bfba47b10b1db073115ee7152 Mon Sep 17 00:00:00 2001 +From: "J.W. Jagersma" +Date: Wed, 25 Mar 2020 19:56:27 +0100 +Subject: [PATCH] djgpp: emit "b" flag for named bss sections + +Unlike ELF, named sections such as .bss.* and .gnu.linkonce.b.* have no +special meaning in COFF, therefore they will have the CONTENTS, LOAD +and DATA attributes set. The result is that these sections take up +space in object files and executables. These attributes can be cleared +by emitting the "b" flag in the .section directive. + +This can probably be added in default_coff_asm_named_section too. + +gcc/ +2020-03-25 Jan W. Jagersma + + * config/i386/djgpp.c (i386_djgpp_asm_named_section): Emit "b" + attribute for SECTION_BSS. +--- + gcc/config/i386/djgpp.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gcc/config/i386/djgpp.c b/gcc/config/i386/djgpp.c +index ba6c2d4d3a4..88cf1e6506e 100644 +--- a/gcc/config/i386/djgpp.c ++++ b/gcc/config/i386/djgpp.c +@@ -36,6 +36,8 @@ i386_djgpp_asm_named_section(const char *name, unsigned int flags, + *f++ = 'w'; + if (flags & SECTION_CODE) + *f++ = 'x'; ++ if (flags & SECTION_BSS) ++ *f++ = 'b'; + + /* LTO sections need 1-byte alignment to avoid confusing the + zlib decompression algorithm with trailing zero pad bytes. */ +-- +2.26.2 + From 3cce5122df6da2593db2552aff82f7e1ea0372c8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 5 May 2020 16:37:38 +0200 Subject: [PATCH 376/536] update debian changelog --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4c6401e..34f821b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +djgpp-toolchain (0.20200505.0+gcc9.3.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * gcc version 9.3.0. + * patch binutils and gcc to use "b" flag for bss sections. + + -- jwt27 Tue, 05 May 2020 16:35:24 +0200 + djgpp-toolchain (0.20200310.0+gcc9.2.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * binutils version 2.34. From ff2cff09d415b5841c7e4ffc6dde56b7b0183a20 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 5 May 2020 17:19:36 +0200 Subject: [PATCH 377/536] select correct djgpp version when upgrading gcc If djgpp-cvs is already installed, rebuild that version instead of 2.05. --- script/check-deps-and-confirm.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 4e92f69..abce67a 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -2,8 +2,13 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then for DEP in ${DEPS}; do case $DEP in djgpp) - [ -z ${DJGPP_VERSION} ] \ - && add_pkg djgpp + if [ -z ${DJGPP_VERSION} ]; then + if [ -e ${PREFIX}/${TARGET}/etc/djgpp-cvs-installed ]; then + add_pkg djgpp-cvs + else + add_pkg djgpp + fi + fi ;; newlib) [ -z ${NEWLIB_VERSION} ] \ From d43c101d777efadf075abb0fa003190f97986d45 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 5 May 2020 17:36:13 +0200 Subject: [PATCH 378/536] patch djgpp ldscript to link .bss.* back in .bss --- patch/djgpp-binutils-234/0002-ldscript.patch | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patch/djgpp-binutils-234/0002-ldscript.patch diff --git a/patch/djgpp-binutils-234/0002-ldscript.patch b/patch/djgpp-binutils-234/0002-ldscript.patch new file mode 100644 index 0000000..fe80186 --- /dev/null +++ b/patch/djgpp-binutils-234/0002-ldscript.patch @@ -0,0 +1,22 @@ +--- a/ld/scripttempl/i386go32.sc 2020-05-05 17:31:16.921799400 +0200 ++++ b/ld/scripttempl/i386go32.sc 2020-05-05 17:31:29.717799400 +0200 +@@ -60,10 +60,6 @@ + *(.data) + ${RELOCATING+*(.data.*)} + +- /* Ugly workaround to prevent entire .bss to have attribute CONTENT */ +- /* for C++ executables. */ +- *(.bss.*) +- + ${RELOCATING+*(.gcc_exc*)} + ${RELOCATING+___EH_FRAME_BEGIN__ = . ;} + ${RELOCATING+*(.eh_fram*)} +@@ -78,7 +74,7 @@ + ${CONSTRUCTING+${RELOCATING-$DTOR}} + .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : + { +- *(.bss${RELOCATING+ .gnu.linkonce.b.*}) ++ *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) + *(COMMON) + ${RELOCATING+ end = . ; PROVIDE(_end = .) ;} + ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});} From bcd9ce346b5997c7d59e4eda77830b9b30b8f5bc Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 5 May 2020 17:43:37 +0200 Subject: [PATCH 379/536] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 890295c..453e5b2 100644 --- a/README.md +++ b/README.md @@ -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 2020-02-08: +### Current package versions, as of 2020-05-05: -* gcc 9.2.0 +* gcc 9.3.0 * binutils 2.34 * gdb 9.1 * djgpp 2.05 / cvs From 6bb6fd0ba6be0871dd8254ef975ff180007a2a7d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 5 May 2020 18:35:51 +0200 Subject: [PATCH 380/536] drop PPA for disco, launchpad no longer accepts new packages for it --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f727ade..e9f860e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, disco, eoan, focal ] + ubuntu-version: [ bionic, eoan, focal ] steps: - uses: actions/checkout@v2 From 2bc2f8ecc3fd425b78c53d7a265d556b44e582f8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 6 May 2020 17:42:11 +0200 Subject: [PATCH 381/536] add PPA for Ubuntu Groovy --- .github/workflows/deploy.yml | 2 +- debian/groovy/control | 81 ++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 debian/groovy/control diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e9f860e..f6ec5c5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, eoan, focal ] + ubuntu-version: [ bionic, eoan, focal, groovy ] steps: - uses: actions/checkout@v2 diff --git a/debian/groovy/control b/debian/groovy/control new file mode 100644 index 0000000..fe08cb4 --- /dev/null +++ b/debian/groovy/control @@ -0,0 +1,81 @@ +Source: djgpp-toolchain +Section: devel +Priority: optional +Maintainer: jwt27 +Build-Depends: + git, + bash, + make, + unzip, + wget, + bison, + flex, + texinfo, + patch, + tar, + xz-utils, + bzip2, + gzip, + dos2unix, + zlib1g-dev, + debhelper (>= 11) +Standards-Version: 4.1.2 +Homepage: https://github.com/jwt27/build-gcc + +Package: djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: binutils-djgpp, gcc-djgpp +Suggests: djgpp-doc +Description: DJGPP C library and utilities + Required for gcc-djgpp. + +Package: djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: djgpp +Description: Documentation for djgpp + +Package: gcc-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp (>= 2.34-3ubuntu1+1.4) +Suggests: gcc-djgpp-doc, gcc-djgpp-extra +Description: GNU Compiler Collection + Cross-compiler targeting djgpp. Supports C and C++. + +Package: gcc-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: gcc-djgpp +Conflicts: gcc-doc +Description: Documentation for gcc-djgpp + +Package: gcc-djgpp-extra +Architecture: all +Depends: ${misc:Depends} +Recommends: gcc-djgpp +Suggests: gdb-djgpp +Description: Extra files for gcc + Python pretty-printer script files for use with gdb. + May conflict with host gcc. + +Package: gdb-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: gdb-djgpp-doc, gcc-djgpp-extra +Description: GNU Debugger + Used to debug djgpp programs over a serial connection. + +Package: gdb-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: gdb-djgpp +Conflicts: gdb-doc +Description: Documentation for gdb-djgpp + +Package: gdb-djgpp-extra +Architecture: all +Depends: ${misc:Depends} +Recommends: gdb-djgpp +Description: Extra files for gdb-djgpp + May conflict with host gdb. From f2b1d0da18f524fb5a1598a02a2013610b57bb53 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 8 May 2020 20:59:56 +0200 Subject: [PATCH 382/536] always rebuild libc when rebuilding gcc --- build-djgpp.sh | 3 ++- script/build-avr-gcc.sh | 4 ++-- script/build-newlib-gcc.sh | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index a86912f..7e03235 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -76,8 +76,9 @@ if [ ! -z ${DJGPP_VERSION} ]; then unset COMSPEC sed -i "50cCROSS_PREFIX = ${TARGET}-" makefile.def sed -i "61cGCC = \$(CC) -g -O2 ${CFLAGS}" makefile.def - if [ -e configure-options ] && [ ! "`cat configure-options 2> /dev/null`" == "${TARGET}:${DST}:${CFLAGS_FOR_TARGET}" ]; then + if [ ! -z ${GCC_VERSION} ] || [ ! "`cat configure-options 2> /dev/null`" == "${TARGET}:${DST}:${CFLAGS_FOR_TARGET}" ]; then ${MAKE_J} clean + rm -f ../lib/*.{a,o} fi ${MAKE} misc.exe makemake.exe || exit 1 mkdir -p ../hostbin diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 407ab39..a2ac42b 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -82,10 +82,10 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then AVRLIBC_CONFIGURE_OPTIONS+=" --host=${TARGET} --prefix=${PREFIX} ${BUILD_FLAG}" strip_whitespace AVRLIBC_CONFIGURE_OPTIONS - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${AVRLIBC_CONFIGURE_OPTIONS}" ]; then + if [ ! -z ${GCC_VERSION} ] || [ ! "`cat configure-options 2> /dev/null`" == "${AVRLIBC_CONFIGURE_OPTIONS}" ]; then rm -rf * CC=avr-gcc ../configure ${AVRLIBC_CONFIGURE_OPTIONS} || exit 1 - echo ${AVRLIBC_CONFIGURE_OPTIONS} > configure-prefix + echo ${AVRLIBC_CONFIGURE_OPTIONS} > configure-options else echo "Note: avr-libc already configured. To force a rebuild, use: rm -rf $(pwd)" [ -z ${BUILD_BATCH} ] && sleep 5 diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index db54d31..536ad24 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -74,10 +74,10 @@ if [ ! -z ${NEWLIB_VERSION} ]; then NEWLIB_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG}" strip_whitespace NEWLIB_CONFIGURE_OPTIONS - if [ ! -e configure-prefix ] || [ ! "`cat configure-prefix`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then + if [ ! -z ${GCC_VERSION} ] || [ ! "`cat configure-options 2> /dev/null`" == "${NEWLIB_CONFIGURE_OPTIONS}" ]; then rm -rf * ../configure ${NEWLIB_CONFIGURE_OPTIONS} || exit 1 - echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-prefix + echo ${NEWLIB_CONFIGURE_OPTIONS} > configure-options else echo "Note: newlib already configured. To force a rebuild, use: rm -rf $(pwd)" [ -z ${BUILD_BATCH} ] && sleep 5 From 090e262d0403e257ba76358bfd0b36a961c918f1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 9 May 2020 17:35:53 +0200 Subject: [PATCH 383/536] add option --no-git-reset --- script/download.sh | 11 +++++++---- script/init.sh | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/script/download.sh b/script/download.sh index 11e6a67..aa96734 100644 --- a/script/download.sh +++ b/script/download.sh @@ -60,10 +60,13 @@ download_git() fi fi cd $repo/ || exit 1 - git reset --hard HEAD - git checkout $2 - if [ -z ${NO_DOWNLOAD} ]; then - git pull || exit 1 + if [ -z ${NO_GIT_RESET} ]; then + git reset --hard HEAD + git checkout $2 + if [ -z ${NO_DOWNLOAD} ]; then + git fetch origin + git reset --hard origin/$2 || exit 1 + fi fi mkdir -p ${BASE}/build rm -rf ${BASE}/build/$repo diff --git a/script/init.sh b/script/init.sh index 6714d77..c53721f 100644 --- a/script/init.sh +++ b/script/init.sh @@ -93,6 +93,7 @@ fi for A in "$@"; do case $A in + --no-git-reset) NO_GIT_RESET=y ;; --no-download) NO_DOWNLOAD=y ;; --only-download) ONLY_DOWNLOAD=y ;; --ignore-dependencies) IGNORE_DEPENDENCIES=y ;; From fac55a60a2c49504a4c320cddf9e3a22f81525bb Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 8 May 2020 21:59:15 +0200 Subject: [PATCH 384/536] add gcc 10.1 --- common/gcc | 2 +- common/gcc-10.1.0 | 12 +++++ debian/changelog | 6 +++ ...p-emit-b-flag-for-named-bss-sections.patch | 38 +++++++++++++++ ...ltiple-definition-errors-with-gcc-10.patch | 46 +++++++++++++++++++ 5 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 common/gcc-10.1.0 create mode 100644 patch/djgpp-gcc-10.1.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch create mode 100644 patch/djlsr205/0001-fix-multiple-definition-errors-with-gcc-10.patch diff --git a/common/gcc b/common/gcc index 4ddcde1..914335c 100644 --- a/common/gcc +++ b/common/gcc @@ -1 +1 @@ -source common/gcc-9.3.0 +source common/gcc-10.1.0 diff --git a/common/gcc-10.1.0 b/common/gcc-10.1.0 new file mode 100644 index 0000000..f704af2 --- /dev/null +++ b/common/gcc-10.1.0 @@ -0,0 +1,12 @@ +GCC_VERSION=10.1.0 +GCC_VERSION_SHORT=10.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}" diff --git a/debian/changelog b/debian/changelog index 34f821b..24dd9b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20200509.0+gcc10.1.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * gcc version 10.1.0. + + -- jwt27 Sat, 09 May 2020 17:36:20 +0200 + djgpp-toolchain (0.20200505.0+gcc9.3.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * gcc version 9.3.0. diff --git a/patch/djgpp-gcc-10.1.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch b/patch/djgpp-gcc-10.1.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch new file mode 100644 index 0000000..5f77c4e --- /dev/null +++ b/patch/djgpp-gcc-10.1.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch @@ -0,0 +1,38 @@ +From e869e1d34fde5f3bfba47b10b1db073115ee7152 Mon Sep 17 00:00:00 2001 +From: "J.W. Jagersma" +Date: Wed, 25 Mar 2020 19:56:27 +0100 +Subject: [PATCH] djgpp: emit "b" flag for named bss sections + +Unlike ELF, named sections such as .bss.* and .gnu.linkonce.b.* have no +special meaning in COFF, therefore they will have the CONTENTS, LOAD +and DATA attributes set. The result is that these sections take up +space in object files and executables. These attributes can be cleared +by emitting the "b" flag in the .section directive. + +This can probably be added in default_coff_asm_named_section too. + +gcc/ +2020-03-25 Jan W. Jagersma + + * config/i386/djgpp.c (i386_djgpp_asm_named_section): Emit "b" + attribute for SECTION_BSS. +--- + gcc/config/i386/djgpp.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gcc/config/i386/djgpp.c b/gcc/config/i386/djgpp.c +index ba6c2d4d3a4..88cf1e6506e 100644 +--- a/gcc/config/i386/djgpp.c ++++ b/gcc/config/i386/djgpp.c +@@ -36,6 +36,8 @@ i386_djgpp_asm_named_section(const char *name, unsigned int flags, + *f++ = 'w'; + if (flags & SECTION_CODE) + *f++ = 'x'; ++ if (flags & SECTION_BSS) ++ *f++ = 'b'; + + /* LTO sections need 1-byte alignment to avoid confusing the + zlib decompression algorithm with trailing zero pad bytes. */ +-- +2.26.2 + diff --git a/patch/djlsr205/0001-fix-multiple-definition-errors-with-gcc-10.patch b/patch/djlsr205/0001-fix-multiple-definition-errors-with-gcc-10.patch new file mode 100644 index 0000000..b594209 --- /dev/null +++ b/patch/djlsr205/0001-fix-multiple-definition-errors-with-gcc-10.patch @@ -0,0 +1,46 @@ +From 9fcd924b8eec562eeacf53c92a18e06aacb48fa9 Mon Sep 17 00:00:00 2001 +From: "J.W. Jagersma" +Date: Sat, 9 May 2020 16:55:26 +0200 +Subject: [PATCH] fix multiple definition errors with gcc 10 + +GCC 10 now defaults to -fno-common, which causes multiple definition +errors during linking. In libc, __stdio_cleanup_hook is defined twice, +and in fsdb, several variables are defined in a header, which is +included in multiple source files. + +To solve this, __stdio_cleanup_hook is declared extern and fsdb can be +compiled with -fcommon. +--- + src/debug/fsdb/makefile | 2 ++ + src/libc/ansi/stdlib/exit.c | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/debug/fsdb/makefile b/src/debug/fsdb/makefile +index da796d41..41f145fb 100644 +--- a/src/debug/fsdb/makefile ++++ b/src/debug/fsdb/makefile +@@ -12,6 +12,8 @@ EOBJS += unassmbl.o + + include $(TOP)/../makefile.inc + ++CFLAGS += -fcommon ++ + #relax error checking: + XGCC = $(XLGCC) + +diff --git a/src/libc/ansi/stdlib/exit.c b/src/libc/ansi/stdlib/exit.c +index 94634b11..79b40ae9 100644 +--- a/src/libc/ansi/stdlib/exit.c ++++ b/src/libc/ansi/stdlib/exit.c +@@ -15,7 +15,7 @@ + + struct __atexit *__atexit_ptr = 0; + +-void (*__stdio_cleanup_hook)(void); ++extern void (*__stdio_cleanup_hook)(void); + + /* A hook to close down the file system extensions if any where opened. + This does not force them to be linked in. */ +-- +2.26.2 + From 050b4a96ab20b3245d862f0cbf853eb3d1586d16 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 9 May 2020 17:52:09 +0200 Subject: [PATCH 385/536] add cmake in test build dependencies --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6af902c..0603928 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,7 @@ jobs: run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-9 g++-9 + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-9 g++-9 cmake echo "::set-env name=CC::gcc-9" echo "::set-env name=CXX::g++-9" @@ -94,7 +94,7 @@ jobs: if: contains(matrix.os, 'macos') run: | brew update - brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool + brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake - name: Cache sources uses: jwt27/cache@dist From 539ae0bc1155b8bfb8d4b8c85d8be4d90929c5e9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 9 May 2020 17:52:36 +0200 Subject: [PATCH 386/536] fix syntax error in sed expression --- build-avr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-avr.sh b/build-avr.sh index 400e104..cabb587 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -35,8 +35,8 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then case `uname` in MINGW*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;; esac - sed -i "s/-DCMAKE_INSTALL_PREFIX=/-DCMAKE_INSTALL_PREFIX=${DST} #/" Makefile - sed -i 's/\/bin\///' cmake/GetGitInfo.cmake + sed -i "s@-DCMAKE_INSTALL_PREFIX=@-DCMAKE_INSTALL_PREFIX=${DST} #@" Makefile + sed -i 's@/bin/@@' cmake/GetGitInfo.cmake ${MAKE_J} build || exit 1 ${MAKE_J} doc || exit 1 [ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/simulavr.log From 5d5747cc6da983e493a4258ff2009c338b2d6f60 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 9 May 2020 18:27:15 +0200 Subject: [PATCH 387/536] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 453e5b2..adcdfb7 100644 --- a/README.md +++ b/README.md @@ -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 2020-05-05: +### Current package versions, as of 2020-05-09: -* gcc 9.3.0 +* gcc 10.1.0 * binutils 2.34 * gdb 9.1 * djgpp 2.05 / cvs From 882eb4ae97737ed58d9f3cd825d3515e334831e1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 25 May 2020 20:38:31 +0200 Subject: [PATCH 388/536] remove patch for gcc 10 which has been merged in djcross-gcc --- ...p-emit-b-flag-for-named-bss-sections.patch | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 patch/djgpp-gcc-10.1.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch diff --git a/patch/djgpp-gcc-10.1.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch b/patch/djgpp-gcc-10.1.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch deleted file mode 100644 index 5f77c4e..0000000 --- a/patch/djgpp-gcc-10.1.0/0001-djgpp-emit-b-flag-for-named-bss-sections.patch +++ /dev/null @@ -1,38 +0,0 @@ -From e869e1d34fde5f3bfba47b10b1db073115ee7152 Mon Sep 17 00:00:00 2001 -From: "J.W. Jagersma" -Date: Wed, 25 Mar 2020 19:56:27 +0100 -Subject: [PATCH] djgpp: emit "b" flag for named bss sections - -Unlike ELF, named sections such as .bss.* and .gnu.linkonce.b.* have no -special meaning in COFF, therefore they will have the CONTENTS, LOAD -and DATA attributes set. The result is that these sections take up -space in object files and executables. These attributes can be cleared -by emitting the "b" flag in the .section directive. - -This can probably be added in default_coff_asm_named_section too. - -gcc/ -2020-03-25 Jan W. Jagersma - - * config/i386/djgpp.c (i386_djgpp_asm_named_section): Emit "b" - attribute for SECTION_BSS. ---- - gcc/config/i386/djgpp.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/gcc/config/i386/djgpp.c b/gcc/config/i386/djgpp.c -index ba6c2d4d3a4..88cf1e6506e 100644 ---- a/gcc/config/i386/djgpp.c -+++ b/gcc/config/i386/djgpp.c -@@ -36,6 +36,8 @@ i386_djgpp_asm_named_section(const char *name, unsigned int flags, - *f++ = 'w'; - if (flags & SECTION_CODE) - *f++ = 'x'; -+ if (flags & SECTION_BSS) -+ *f++ = 'b'; - - /* LTO sections need 1-byte alignment to avoid confusing the - zlib decompression algorithm with trailing zero pad bytes. */ --- -2.26.2 - From 15a135d22055f5899cfc7a5011b56a7bc2c8550b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 30 Jul 2020 12:38:12 +0200 Subject: [PATCH 389/536] add gcc 10.2 --- README.md | 4 ++-- common/gcc | 2 +- common/gcc-10.2.0 | 12 ++++++++++++ debian/changelog | 6 ++++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 common/gcc-10.2.0 diff --git a/README.md b/README.md index adcdfb7..557ad42 100644 --- a/README.md +++ b/README.md @@ -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 2020-05-09: +### Current package versions, as of 2020-07-30: -* gcc 10.1.0 +* gcc 10.2.0 * binutils 2.34 * gdb 9.1 * djgpp 2.05 / cvs diff --git a/common/gcc b/common/gcc index 914335c..4ba4f78 100644 --- a/common/gcc +++ b/common/gcc @@ -1 +1 @@ -source common/gcc-10.1.0 +source common/gcc-10.2.0 diff --git a/common/gcc-10.2.0 b/common/gcc-10.2.0 new file mode 100644 index 0000000..34d3f3c --- /dev/null +++ b/common/gcc-10.2.0 @@ -0,0 +1,12 @@ +GCC_VERSION=10.2.0 +GCC_VERSION_SHORT=10.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}" diff --git a/debian/changelog b/debian/changelog index 24dd9b1..e9914ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20200730.0+gcc10.2.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * gcc version 10.2.0. + + -- jwt27 Thu, 30 Jul 2020 12:36:44 +0200 + djgpp-toolchain (0.20200509.0+gcc10.1.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * gcc version 10.1.0. From e6c15f500a3318d8740c3d371d3adb7d71f8439d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 30 Jul 2020 12:43:30 +0200 Subject: [PATCH 390/536] add gdb 9.2 --- README.md | 2 +- common/gdb | 2 +- common/gdb-9.2 | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 common/gdb-9.2 diff --git a/README.md b/README.md index 557ad42..3fd17d0 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you require compatibility with distributions that use `i586`, you can either: * gcc 10.2.0 * binutils 2.34 -* gdb 9.1 +* gdb 9.2 * djgpp 2.05 / cvs * newlib 3.3.0 * avr-libc 2.0.0 diff --git a/common/gdb b/common/gdb index 7c37f86..2cb40c2 100644 --- a/common/gdb +++ b/common/gdb @@ -1,2 +1,2 @@ -source common/gdb-9.1 +source common/gdb-9.2 diff --git a/common/gdb-9.2 b/common/gdb-9.2 new file mode 100644 index 0000000..41b7366 --- /dev/null +++ b/common/gdb-9.2 @@ -0,0 +1,2 @@ +GDB_VERSION=9.2 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From 98e62e0f1b145b2537326d9de4e3640071433f0e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 9 Aug 2020 12:51:25 +0200 Subject: [PATCH 391/536] configure gdb 8 and earlier to use python2 --- script/check-deps-and-confirm.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index abce67a..3a2c97f 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -95,6 +95,22 @@ fi DST="${DESTDIR}${PREFIX}" export DESTDIR +# check python version for gdb +if [ ! -z ${GDB_VERSION} ]; then + let GDB_VERSION_MAJOR=${GDB_VERSION%%.*} + if (( ${GDB_VERSION_MAJOR} >= 9 )); then + PYTHON=python3 + else + PYTHON=python2 + fi + if ! which ${PYTHON} > /dev/null; then + echo "WARNING: ${PYTHON} not installed" + prepend GDB_CONFIGURE_OPTIONS "--with-python=no" + else + prepend GDB_CONFIGURE_OPTIONS "--with-python=`which ${PYTHON}`" + fi +fi + # check required programs REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" From f33678d07660b206fe22845d3cfd8d46475ea6d2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 Nov 2020 20:27:26 +0100 Subject: [PATCH 392/536] add gdb 10.1 --- README.md | 2 +- common/gdb | 2 +- common/gdb-10.1 | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 common/gdb-10.1 diff --git a/README.md b/README.md index 3fd17d0..c451f3b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you require compatibility with distributions that use `i586`, you can either: * gcc 10.2.0 * binutils 2.34 -* gdb 9.2 +* gdb 10.1 * djgpp 2.05 / cvs * newlib 3.3.0 * avr-libc 2.0.0 diff --git a/common/gdb b/common/gdb index 2cb40c2..9a4f159 100644 --- a/common/gdb +++ b/common/gdb @@ -1,2 +1,2 @@ -source common/gdb-9.2 +source common/gdb-10.1 diff --git a/common/gdb-10.1 b/common/gdb-10.1 new file mode 100644 index 0000000..2335d40 --- /dev/null +++ b/common/gdb-10.1 @@ -0,0 +1,2 @@ +GDB_VERSION=10.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From b26a9e68461debb31e18ca7e3e2fceb0305d8467 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 Nov 2020 20:31:49 +0100 Subject: [PATCH 393/536] add binutils 2.35.1 --- README.md | 4 ++-- binutils/binutils | 2 +- binutils/binutils-2.35 | 2 ++ binutils/binutils-2.35.1 | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 binutils/binutils-2.35 create mode 100644 binutils/binutils-2.35.1 diff --git a/README.md b/README.md index c451f3b..4bfb523 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ 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 2020-07-30: +### Current package versions, as of 2020-11-02: * gcc 10.2.0 -* binutils 2.34 +* binutils 2.35.1 * gdb 10.1 * djgpp 2.05 / cvs * newlib 3.3.0 diff --git a/binutils/binutils b/binutils/binutils index 6ac7732..6223df2 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.34 +source binutils/binutils-2.35.1 diff --git a/binutils/binutils-2.35 b/binutils/binutils-2.35 new file mode 100644 index 0000000..02b20b4 --- /dev/null +++ b/binutils/binutils-2.35 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.35 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.35.1 b/binutils/binutils-2.35.1 new file mode 100644 index 0000000..f685d21 --- /dev/null +++ b/binutils/binutils-2.35.1 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.35.1 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" From 741fe00aa782978d65dd9c3c7e11385686d81bbb Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 Nov 2020 21:12:23 +0100 Subject: [PATCH 394/536] add binutils 2.35.1 for djgpp --- build-djgpp.sh | 40 ++++++++++++++++++++++------------------ debian/changelog | 6 ++++++ djgpp/binutils | 2 +- djgpp/binutils-2.35 | 1 + djgpp/binutils-2.35.1 | 1 + 5 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 djgpp/binutils-2.35 create mode 100644 djgpp/binutils-2.35.1 diff --git a/build-djgpp.sh b/build-djgpp.sh index 7e03235..9571920 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -32,27 +32,31 @@ source ${BASE}/script/build-tools.sh cd ${BASE}/build/ || exit 1 if [ ! -z ${BINUTILS_VERSION} ]; then - mkdir -p bnu${BINUTILS_VERSION}s - cd bnu${BINUTILS_VERSION}s - if [ ! -e binutils-unpacked ]; then - echo "Unpacking binutils..." - unzip -oq ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - - pushd gnu/binutils-* || exit 1 - cat ${BASE}/patch/djgpp-binutils-${BINUTILS_VERSION}/* | patch -p1 -u || exit 1 - popd + if echo ${BINUTILS_VERSION} | grep -q '\.'; then + source ${BASE}/script/unpack-build-binutils.sh + else + mkdir -p bnu${BINUTILS_VERSION}s + cd bnu${BINUTILS_VERSION}s + if [ ! -e binutils-unpacked ]; then + echo "Unpacking binutils..." + unzip -oq ../../download/bnu${BINUTILS_VERSION}s.zip || exit 1 - touch binutils-unpacked - fi - cd gnu/binutils-* || exit 1 + pushd gnu/binutils-* || exit 1 + cat ${BASE}/patch/djgpp-binutils-${BINUTILS_VERSION}/* | patch -p1 -u || exit 1 + popd - # exec permission of some files are not set, fix it. - for EXEC_FILE in install-sh missing configure; do - echo "chmod a+x $EXEC_FILE" - chmod a+x $EXEC_FILE || exit 1 - done + touch binutils-unpacked + fi + cd gnu/binutils-* || exit 1 + + # exec permission of some files are not set, fix it. + for EXEC_FILE in install-sh missing configure; do + echo "chmod a+x $EXEC_FILE" + chmod a+x $EXEC_FILE || exit 1 + done - source ${BASE}/script/build-binutils.sh + source ${BASE}/script/build-binutils.sh + fi fi cd ${BASE}/build/ || exit 1 diff --git a/debian/changelog b/debian/changelog index e9914ab..f140d35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20201102.0+gcc10.2.0+bnu2.35.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * binutils version 2.35.1. + + -- jwt27 Mon, 02 Nov 2020 21:11:19 +0100 + djgpp-toolchain (0.20200730.0+gcc10.2.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * gcc version 10.2.0. diff --git a/djgpp/binutils b/djgpp/binutils index 479fd4a..7bfbddf 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.34 +source djgpp/binutils-2.35.1 diff --git a/djgpp/binutils-2.35 b/djgpp/binutils-2.35 new file mode 100644 index 0000000..4aaac1e --- /dev/null +++ b/djgpp/binutils-2.35 @@ -0,0 +1 @@ +source binutils/binutils-2.35 diff --git a/djgpp/binutils-2.35.1 b/djgpp/binutils-2.35.1 new file mode 100644 index 0000000..6223df2 --- /dev/null +++ b/djgpp/binutils-2.35.1 @@ -0,0 +1 @@ +source binutils/binutils-2.35.1 From a89a7ae9b6e085ce5e75a7198fa64a5355f60af8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 Nov 2020 21:16:35 +0100 Subject: [PATCH 395/536] disable scheduled test builds --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0603928..7c2f780 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,8 +4,6 @@ on: push: branches-ignore: djgpp-ppa pull_request: - schedule: - - cron: '0 0 1 * *' jobs: build: From 0206bedca3e5d21c6ccc775aa7c60ccf638d3926 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 Nov 2020 21:45:30 +0100 Subject: [PATCH 396/536] remove build status icon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bfb523..6238c3a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. [![Build Status](https://github.com/jwt27/build-gcc/workflows/Test%20builds/badge.svg?branch=master)](https://github.com/jwt27/build-gcc/actions?query=workflow%3A"Test+builds"+branch%3Amaster) +## Build gcc cross compiler on Windows, Mac OSX, Linux and FreeBSD. ### Upgrade notes: From 5546cd87dc6aede846d8d36ab4e4c1020e0d0cbf Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 Nov 2020 21:45:58 +0100 Subject: [PATCH 397/536] update test build dependencies --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c2f780..1339831 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,9 +84,9 @@ jobs: run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-9 g++-9 cmake - echo "::set-env name=CC::gcc-9" - echo "::set-env name=CXX::g++-9" + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-10 g++-10 cmake + echo "CC=gcc-10" >> $GITHUB_ENV + echo "CXX=g++-10" >> $GITHUB_ENV - name: Install dependencies (macos) if: contains(matrix.os, 'macos') From b68972d9732b1f3003cdc55dd551c1bf31de10c3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 Nov 2020 22:00:51 +0100 Subject: [PATCH 398/536] init gpg homedir before importing key --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f6ec5c5..7c305e2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -50,6 +50,7 @@ jobs: env: DECRYPT_KEY: ${{ secrets.DECRYPT_KEY }} run: | + gpg --batch -k > /dev/null gpg --batch --quiet --passphrase "$DECRYPT_KEY" -d /tmp/pgp-secret.asc | gpg --batch --import rm -f /tmp/pgp-secret.asc From 49bec9cb6db4576149db6baa309a9ad0fd3cda20 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 Nov 2020 22:16:09 +0100 Subject: [PATCH 399/536] drop ubuntu eoan build --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7c305e2..124668f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, eoan, focal, groovy ] + ubuntu-version: [ bionic, focal, groovy ] steps: - uses: actions/checkout@v2 From 7a79959dff8626087e157dc7f418d2f8c33f06e7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 20 Nov 2020 14:41:16 +0100 Subject: [PATCH 400/536] build ppa for ubuntu hirsute (fixes #19) --- .github/workflows/deploy.yml | 2 +- debian/{focal => bionic}/control | 17 ++++++- debian/control | 17 +------ debian/groovy/control | 81 -------------------------------- 4 files changed, 18 insertions(+), 99 deletions(-) rename debian/{focal => bionic}/control (82%) delete mode 100644 debian/groovy/control diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 124668f..61b0f2d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, focal, groovy ] + ubuntu-version: [ bionic, focal, groovy, hirsute ] steps: - uses: actions/checkout@v2 diff --git a/debian/focal/control b/debian/bionic/control similarity index 82% rename from debian/focal/control rename to debian/bionic/control index fe08cb4..cf62f51 100644 --- a/debian/focal/control +++ b/debian/bionic/control @@ -38,7 +38,7 @@ Description: Documentation for djgpp Package: gcc-djgpp Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp (>= 2.34-3ubuntu1+1.4) +Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp Suggests: gcc-djgpp-doc, gcc-djgpp-extra Description: GNU Compiler Collection Cross-compiler targeting djgpp. Supports C and C++. @@ -59,6 +59,21 @@ Description: Extra files for gcc Python pretty-printer script files for use with gdb. May conflict with host gcc. +Package: binutils-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: djgpp +Suggests: binutils-djgpp-doc +Description: GNU Binutils + Linker, assembler and other binary utilities targeting djgpp. + +Package: binutils-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: binutils-djgpp +Conflicts: binutils-doc +Description: Documentation for binutils-djgpp. + Package: gdb-djgpp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} diff --git a/debian/control b/debian/control index cf62f51..fe08cb4 100644 --- a/debian/control +++ b/debian/control @@ -38,7 +38,7 @@ Description: Documentation for djgpp Package: gcc-djgpp Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp +Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp (>= 2.34-3ubuntu1+1.4) Suggests: gcc-djgpp-doc, gcc-djgpp-extra Description: GNU Compiler Collection Cross-compiler targeting djgpp. Supports C and C++. @@ -59,21 +59,6 @@ Description: Extra files for gcc Python pretty-printer script files for use with gdb. May conflict with host gcc. -Package: binutils-djgpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: djgpp -Suggests: binutils-djgpp-doc -Description: GNU Binutils - Linker, assembler and other binary utilities targeting djgpp. - -Package: binutils-djgpp-doc -Architecture: all -Depends: ${misc:Depends} -Suggests: binutils-djgpp -Conflicts: binutils-doc -Description: Documentation for binutils-djgpp. - Package: gdb-djgpp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} diff --git a/debian/groovy/control b/debian/groovy/control deleted file mode 100644 index fe08cb4..0000000 --- a/debian/groovy/control +++ /dev/null @@ -1,81 +0,0 @@ -Source: djgpp-toolchain -Section: devel -Priority: optional -Maintainer: jwt27 -Build-Depends: - git, - bash, - make, - unzip, - wget, - bison, - flex, - texinfo, - patch, - tar, - xz-utils, - bzip2, - gzip, - dos2unix, - zlib1g-dev, - debhelper (>= 11) -Standards-Version: 4.1.2 -Homepage: https://github.com/jwt27/build-gcc - -Package: djgpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: binutils-djgpp, gcc-djgpp -Suggests: djgpp-doc -Description: DJGPP C library and utilities - Required for gcc-djgpp. - -Package: djgpp-doc -Architecture: all -Depends: ${misc:Depends} -Suggests: djgpp -Description: Documentation for djgpp - -Package: gcc-djgpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp (>= 2.34-3ubuntu1+1.4) -Suggests: gcc-djgpp-doc, gcc-djgpp-extra -Description: GNU Compiler Collection - Cross-compiler targeting djgpp. Supports C and C++. - -Package: gcc-djgpp-doc -Architecture: all -Depends: ${misc:Depends} -Suggests: gcc-djgpp -Conflicts: gcc-doc -Description: Documentation for gcc-djgpp - -Package: gcc-djgpp-extra -Architecture: all -Depends: ${misc:Depends} -Recommends: gcc-djgpp -Suggests: gdb-djgpp -Description: Extra files for gcc - Python pretty-printer script files for use with gdb. - May conflict with host gcc. - -Package: gdb-djgpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Suggests: gdb-djgpp-doc, gcc-djgpp-extra -Description: GNU Debugger - Used to debug djgpp programs over a serial connection. - -Package: gdb-djgpp-doc -Architecture: all -Depends: ${misc:Depends} -Suggests: gdb-djgpp -Conflicts: gdb-doc -Description: Documentation for gdb-djgpp - -Package: gdb-djgpp-extra -Architecture: all -Depends: ${misc:Depends} -Recommends: gdb-djgpp -Description: Extra files for gdb-djgpp - May conflict with host gdb. From bff1a18cd871825537e3e40d4361364aa3143f87 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 3 Feb 2021 00:08:47 +0100 Subject: [PATCH 401/536] remove package installation example for mingw32 --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index 6238c3a..b2c0332 100644 --- a/README.md +++ b/README.md @@ -65,14 +65,7 @@ Fedora : sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip ``` -MinGW : - -```sh -mingw-get update -mingw-get install msys-unzip libz-dev msys-wget msys-bison msys-flex msys-patch -``` - -MinGW64 (msys2) : +mingw-w64 (msys2) : ```sh pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib} compression From 9a08c72894c356eede29b9e8d2305f0521b00176 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 3 Feb 2021 00:10:58 +0100 Subject: [PATCH 402/536] list python headers dependency for gdb --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b2c0332..9350d82 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ Before running this script, you need to install these programs first: * zlib header/library * curl or wget * bash (for FreeBSD) +* python2 headers (for gdb) +* python3 headers (for gdb >= 9.0) Depending on your system, installation procedure maybe different. @@ -56,19 +58,19 @@ On Debian/Ubuntu, you can install these programs by : ```sh sudo apt-get update -sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip +sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev ``` Fedora : ```sh -sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip +sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel ``` mingw-w64 (msys2) : ```sh -pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib} compression +pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression ``` ### Configuration From d2f9bd2244451ac89c3efe6837e5c7bbcfb415a9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 3 Feb 2021 00:12:46 +0100 Subject: [PATCH 403/536] add newlib 4.0.0 and 4.1.0 --- README.md | 4 ++-- newlib/newlib | 2 +- newlib/newlib-4.0.0 | 2 ++ newlib/newlib-4.1.0 | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 newlib/newlib-4.0.0 create mode 100644 newlib/newlib-4.1.0 diff --git a/README.md b/README.md index 9350d82..1c769e4 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ 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 2020-11-02: +### Current package versions, as of 2021-02-02: * gcc 10.2.0 * binutils 2.35.1 * gdb 10.1 * djgpp 2.05 / cvs -* newlib 3.3.0 +* newlib 4.1.0 * avr-libc 2.0.0 * avrdude 6.3 * avarice 2.13 diff --git a/newlib/newlib b/newlib/newlib index 89dc816..0266052 100644 --- a/newlib/newlib +++ b/newlib/newlib @@ -1 +1 @@ -source newlib/newlib-3.3.0 +source newlib/newlib-4.1.0 diff --git a/newlib/newlib-4.0.0 b/newlib/newlib-4.0.0 new file mode 100644 index 0000000..6e8f923 --- /dev/null +++ b/newlib/newlib-4.0.0 @@ -0,0 +1,2 @@ +NEWLIB_VERSION=4.0.0 +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-4.1.0 b/newlib/newlib-4.1.0 new file mode 100644 index 0000000..35a9c27 --- /dev/null +++ b/newlib/newlib-4.1.0 @@ -0,0 +1,2 @@ +NEWLIB_VERSION=4.1.0 +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" From 3ed539e57f56958e0e7761f64e5c33d1cfaacee2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 3 Feb 2021 00:17:02 +0100 Subject: [PATCH 404/536] add binutils 2.35.2 and 2.36 --- README.md | 4 ++-- binutils/binutils | 2 +- binutils/binutils-2.35.2 | 2 ++ binutils/binutils-2.36 | 2 ++ debian/changelog | 6 ++++++ djgpp/binutils | 2 +- djgpp/binutils-2.35.2 | 1 + djgpp/binutils-2.36 | 1 + 8 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 binutils/binutils-2.35.2 create mode 100644 binutils/binutils-2.36 create mode 100644 djgpp/binutils-2.35.2 create mode 100644 djgpp/binutils-2.36 diff --git a/README.md b/README.md index 1c769e4..39836e1 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ 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 2021-02-02: +### Current package versions, as of 2021-02-03: * gcc 10.2.0 -* binutils 2.35.1 +* binutils 2.36 * gdb 10.1 * djgpp 2.05 / cvs * newlib 4.1.0 diff --git a/binutils/binutils b/binutils/binutils index 6223df2..465caed 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.35.1 +source binutils/binutils-2.36 diff --git a/binutils/binutils-2.35.2 b/binutils/binutils-2.35.2 new file mode 100644 index 0000000..e850354 --- /dev/null +++ b/binutils/binutils-2.35.2 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.35.2 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/binutils/binutils-2.36 b/binutils/binutils-2.36 new file mode 100644 index 0000000..237f729 --- /dev/null +++ b/binutils/binutils-2.36 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.36 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/debian/changelog b/debian/changelog index f140d35..1201a23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20210203.0+gcc10.2.0+bnu2.36.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * binutils version 2.36. + + -- jwt27 Wed, 03 Feb 2021 00:14:56 +0100 + djgpp-toolchain (0.20201102.0+gcc10.2.0+bnu2.35.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * binutils version 2.35.1. diff --git a/djgpp/binutils b/djgpp/binutils index 7bfbddf..d47349f 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.35.1 +source djgpp/binutils-2.36 diff --git a/djgpp/binutils-2.35.2 b/djgpp/binutils-2.35.2 new file mode 100644 index 0000000..f81c1fc --- /dev/null +++ b/djgpp/binutils-2.35.2 @@ -0,0 +1 @@ +source binutils/binutils-2.35.2 diff --git a/djgpp/binutils-2.36 b/djgpp/binutils-2.36 new file mode 100644 index 0000000..465caed --- /dev/null +++ b/djgpp/binutils-2.36 @@ -0,0 +1 @@ +source binutils/binutils-2.36 From 0779c9232d4e817ccc746e115da221a2a76dedf9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 1 May 2021 00:55:42 +0200 Subject: [PATCH 405/536] add binutils 2.36.1 --- README.md | 4 ++-- binutils/binutils | 2 +- binutils/binutils-2.36.1 | 2 ++ debian/changelog | 6 ++++++ djgpp/binutils | 2 +- djgpp/binutils-2.36.1 | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 binutils/binutils-2.36.1 create mode 100644 djgpp/binutils-2.36.1 diff --git a/README.md b/README.md index 39836e1..9ecb8f3 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ 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 2021-02-03: +### Current package versions, as of 2021-04-30: * gcc 10.2.0 -* binutils 2.36 +* binutils 2.36.1 * gdb 10.1 * djgpp 2.05 / cvs * newlib 4.1.0 diff --git a/binutils/binutils b/binutils/binutils index 465caed..8c7c7ec 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.36 +source binutils/binutils-2.36.1 diff --git a/binutils/binutils-2.36.1 b/binutils/binutils-2.36.1 new file mode 100644 index 0000000..fc93d87 --- /dev/null +++ b/binutils/binutils-2.36.1 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.36.1 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/debian/changelog b/debian/changelog index 1201a23..ed98eed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20210430.0+gcc10.2.0+bnu2.36.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * binutils version 2.36.1. + + -- jwt27 Fri, 30 Apr 2021 20:55:58 +0200 + djgpp-toolchain (0.20210203.0+gcc10.2.0+bnu2.36.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * binutils version 2.36. diff --git a/djgpp/binutils b/djgpp/binutils index d47349f..5b019ac 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.36 +source djgpp/binutils-2.36.1 diff --git a/djgpp/binutils-2.36.1 b/djgpp/binutils-2.36.1 new file mode 100644 index 0000000..8c7c7ec --- /dev/null +++ b/djgpp/binutils-2.36.1 @@ -0,0 +1 @@ +source binutils/binutils-2.36.1 From 7f7933c4ab2950bfc03d95edef02321e6e3127ee Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 14 Jun 2021 15:13:44 +0200 Subject: [PATCH 406/536] build ppa for ubuntu impish (fixes #23) --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 61b0f2d..8f37585 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, focal, groovy, hirsute ] + ubuntu-version: [ bionic, focal, groovy, hirsute, impish ] steps: - uses: actions/checkout@v2 From a1e378141c4aa13c42ebaf6dc45d733a57c734a7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 29 Aug 2021 01:19:43 +0200 Subject: [PATCH 407/536] add binutils 2.37 --- README.md | 4 ++-- binutils/binutils | 2 +- binutils/binutils-2.37 | 2 ++ djgpp/binutils | 2 +- djgpp/binutils-2.37 | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 binutils/binutils-2.37 create mode 100644 djgpp/binutils-2.37 diff --git a/README.md b/README.md index 9ecb8f3..2e7b6a8 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ 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 2021-04-30: +### Current package versions, as of 2021-08-29: * gcc 10.2.0 -* binutils 2.36.1 +* binutils 2.37 * gdb 10.1 * djgpp 2.05 / cvs * newlib 4.1.0 diff --git a/binutils/binutils b/binutils/binutils index 8c7c7ec..9e407ab 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.36.1 +source binutils/binutils-2.37 diff --git a/binutils/binutils-2.37 b/binutils/binutils-2.37 new file mode 100644 index 0000000..6d30a32 --- /dev/null +++ b/binutils/binutils-2.37 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.37 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/djgpp/binutils b/djgpp/binutils index 5b019ac..54c4284 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.36.1 +source djgpp/binutils-2.37 diff --git a/djgpp/binutils-2.37 b/djgpp/binutils-2.37 new file mode 100644 index 0000000..9e407ab --- /dev/null +++ b/djgpp/binutils-2.37 @@ -0,0 +1 @@ +source binutils/binutils-2.37 From 629fcd5f810aa0b26891f1c965674006f2525190 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 10 Nov 2021 11:35:43 +0100 Subject: [PATCH 408/536] add gcc 10.3.0 --- README.md | 4 ++-- common/gcc | 2 +- common/gcc-10.3.0 | 12 ++++++++++++ debian/changelog | 7 +++++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 common/gcc-10.3.0 diff --git a/README.md b/README.md index 2e7b6a8..b12929b 100644 --- a/README.md +++ b/README.md @@ -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 2021-08-29: +### Current package versions, as of 2021-11-10: -* gcc 10.2.0 +* gcc 10.3.0 * binutils 2.37 * gdb 10.1 * djgpp 2.05 / cvs diff --git a/common/gcc b/common/gcc index 4ba4f78..192ab9b 100644 --- a/common/gcc +++ b/common/gcc @@ -1 +1 @@ -source common/gcc-10.2.0 +source common/gcc-10.3.0 diff --git a/common/gcc-10.3.0 b/common/gcc-10.3.0 new file mode 100644 index 0000000..ac4bff0 --- /dev/null +++ b/common/gcc-10.3.0 @@ -0,0 +1,12 @@ +GCC_VERSION=10.3.0 +GCC_VERSION_SHORT=10.30 +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}" diff --git a/debian/changelog b/debian/changelog index ed98eed..3721d98 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +djgpp-toolchain (0.20211110.0+gcc10.3.0+bnu2.37.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * gcc version 10.3.0. + * binutils version 2.37. + + -- jwt27 Wed, 10 Nov 2021 11:35:08 +0100 + djgpp-toolchain (0.20210430.0+gcc10.2.0+bnu2.36.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * binutils version 2.36.1. From fc21542d187a82e35b12c44eff7efa88a11608f7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 10 Nov 2021 11:36:48 +0100 Subject: [PATCH 409/536] add gdb 10.2 and 11.1 --- README.md | 2 +- common/gdb | 3 +-- common/gdb-10.2 | 2 ++ common/gdb-11.1 | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 common/gdb-10.2 create mode 100644 common/gdb-11.1 diff --git a/README.md b/README.md index b12929b..f918426 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you require compatibility with distributions that use `i586`, you can either: * gcc 10.3.0 * binutils 2.37 -* gdb 10.1 +* gdb 11.1 * djgpp 2.05 / cvs * newlib 4.1.0 * avr-libc 2.0.0 diff --git a/common/gdb b/common/gdb index 9a4f159..9857464 100644 --- a/common/gdb +++ b/common/gdb @@ -1,2 +1 @@ -source common/gdb-10.1 - +source common/gdb-11.1 diff --git a/common/gdb-10.2 b/common/gdb-10.2 new file mode 100644 index 0000000..bb2f5d6 --- /dev/null +++ b/common/gdb-10.2 @@ -0,0 +1,2 @@ +GDB_VERSION=10.2 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-11.1 b/common/gdb-11.1 new file mode 100644 index 0000000..14f89a3 --- /dev/null +++ b/common/gdb-11.1 @@ -0,0 +1,2 @@ +GDB_VERSION=11.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From 0d77dc2ce88e45621d91697c8dd55ecde9f8a3a9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 10 Nov 2021 16:19:23 +0100 Subject: [PATCH 410/536] fix dead link --- script/check-deps-and-confirm.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 3a2c97f..f7b981c 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -52,16 +52,12 @@ if [ ! -z ${BUILD_DEB} ] && [ ! -z ${GCC_VERSION} ]; then GMP_VERSION=${GMP_VERSION:-6.2.0} MPFR_VERSION=${MPFR_VERSION:-4.0.2} MPC_VERSION=${MPC_VERSION:-1.1.0} - if ${CC} -v 2>&1 | grep "clang version" > /dev/null; then - ISL_VERSION=${ISL_VERSION:-0.21} - else - ISL_VERSION=${ISL_VERSION:-0.22.1} - fi + ISL_VERSION=${ISL_VERSION:-0.18} GMP_ARCHIVE="http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" MPFR_ARCHIVE="http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz" MPC_ARCHIVE="http://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz" - ISL_ARCHIVE="http://isl.gforge.inria.fr/isl-${ISL_VERSION}.tar.xz" + ISL_ARCHIVE="http://gcc.gnu.org/pub/gcc/infrastructure/isl-${ISL_VERSION}.tar.bz2" fi # check GNU sed is installed or not. From 0465881c7c11f3edde14d4a357bf501e8dd28786 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 10 Nov 2021 16:34:13 +0100 Subject: [PATCH 411/536] drop ppa for ubuntu groovy --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8f37585..28bac66 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, focal, groovy, hirsute, impish ] + ubuntu-version: [ bionic, focal, hirsute, impish ] steps: - uses: actions/checkout@v2 From 91264c4a7d35f5a3984e98bfa44f8a38dbc46d32 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 10 Nov 2021 16:35:54 +0100 Subject: [PATCH 412/536] build ppa for ubuntu jammy --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 28bac66..f6be757 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, focal, hirsute, impish ] + ubuntu-version: [ bionic, focal, hirsute, impish, jammy ] steps: - uses: actions/checkout@v2 From 402ca5a44e3c747fb62d2daf3f2c7a574a05d866 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 7 Feb 2022 17:53:51 +0100 Subject: [PATCH 413/536] sync ia16 configure flags with tkchia/build-ia16 (fixes #24) --- build-ia16.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/build-ia16.sh b/build-ia16.sh index dee048e..050b38b 100755 --- a/build-ia16.sh +++ b/build-ia16.sh @@ -6,16 +6,30 @@ source script/init.sh TARGET="ia16-elf" prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror - --disable-nls" + --disable-nls + --disable-gdb + --disable-sim + --enable-x86-hpa-segelf=yes + --enable-ld=default + --enable-gold=yes" prepend GCC_CONFIGURE_OPTIONS "--disable-nls - --enable-fat" + --enable-fat + --disable-libstdcxx-dual-abi + --disable-extern-template + --disable-wchar_t + --disable-libstdcxx-verbose" prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls" -prepend NEWLIB_CONFIGURE_OPTIONS "--enable-newlib-nano-malloc - --disable-newlib-multithread" +prepend NEWLIB_CONFIGURE_OPTIONS "--enable-newlib-elix-level=2 --disable-elks-libc + --disable-newlib-wide-orient --enable-newlib-nano-malloc + --disable-newlib-multithread --enable-newlib-global-atexit + --enable-newlib-reent-small --disable-newlib-fseek-optimization + --disable-newlib-unbuf-stream-opt --enable-target-optspace + --enable-newlib-io-c99-formats --enable-newlib-mb --enable-newlib-iconv + --enable-newlib-iconv-encodings=utf_8,utf_16,cp850,cp852,koi8_uni" DEPS="" [ ! -z ${GCC_VERSION} ] && DEPS+=" newlib binutils" From a4ddcc2143f6f2a761f2db19f76e8cf015e7f9ed Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 7 Feb 2022 18:02:43 +0100 Subject: [PATCH 414/536] run ubuntu test builds with gcc-11 --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1339831..1639435 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,9 +84,9 @@ jobs: run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-10 g++-10 cmake - echo "CC=gcc-10" >> $GITHUB_ENV - echo "CXX=g++-10" >> $GITHUB_ENV + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake + echo "CC=gcc-11" >> $GITHUB_ENV + echo "CXX=g++-11" >> $GITHUB_ENV - name: Install dependencies (macos) if: contains(matrix.os, 'macos') From ff63e88e6f94208557033b50c01fd3e0cb89f5f9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 7 Feb 2022 18:06:53 +0100 Subject: [PATCH 415/536] install help2man in test builds --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1639435..4478044 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man echo "CC=gcc-11" >> $GITHUB_ENV echo "CXX=g++-11" >> $GITHUB_ENV @@ -92,7 +92,7 @@ jobs: if: contains(matrix.os, 'macos') run: | brew update - brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake + brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man - name: Cache sources uses: jwt27/cache@dist From cb2d293eb5a114fbd128addf4426c5b8e671d3b5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 7 Feb 2022 18:12:52 +0100 Subject: [PATCH 416/536] install python2-dev in test builds --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4478044..3369824 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev echo "CC=gcc-11" >> $GITHUB_ENV echo "CXX=g++-11" >> $GITHUB_ENV From e081c75077c0710baec93d9f136c36b4c5c305f7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 15 Feb 2022 18:04:52 +0100 Subject: [PATCH 417/536] add binutils 2.38 --- binutils/binutils | 2 +- binutils/binutils-2.38 | 2 ++ debian/changelog | 6 ++++++ djgpp/binutils | 2 +- djgpp/binutils-2.38 | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 binutils/binutils-2.38 create mode 100644 djgpp/binutils-2.38 diff --git a/binutils/binutils b/binutils/binutils index 9e407ab..af3b2a9 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.37 +source binutils/binutils-2.38 diff --git a/binutils/binutils-2.38 b/binutils/binutils-2.38 new file mode 100644 index 0000000..0ff4112 --- /dev/null +++ b/binutils/binutils-2.38 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.38 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/debian/changelog b/debian/changelog index 3721d98..b04c35a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20220215.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * binutils version 2.38. + + -- jwt27 Tue, 15 Feb 2022 17:49:47 +0100 + djgpp-toolchain (0.20211110.0+gcc10.3.0+bnu2.37.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * gcc version 10.3.0. diff --git a/djgpp/binutils b/djgpp/binutils index 54c4284..c3833ad 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.37 +source djgpp/binutils-2.38 diff --git a/djgpp/binutils-2.38 b/djgpp/binutils-2.38 new file mode 100644 index 0000000..af3b2a9 --- /dev/null +++ b/djgpp/binutils-2.38 @@ -0,0 +1 @@ +source binutils/binutils-2.38 From 9393afd5e731d4070a6acfee7174f13de6323dc6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 15 Feb 2022 18:19:17 +0100 Subject: [PATCH 418/536] update pgp key --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f6be757..094e82b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -53,6 +53,7 @@ jobs: gpg --batch -k > /dev/null gpg --batch --quiet --passphrase "$DECRYPT_KEY" -d /tmp/pgp-secret.asc | gpg --batch --import rm -f /tmp/pgp-secret.asc + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 197C3D6E652B6B1C2B7F9EDF84089D0351487AB8 - name: Sign package run: | From 81da64fb18ab49433d72795d1f0d85f80b382b70 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 15 Feb 2022 18:27:10 +0100 Subject: [PATCH 419/536] drop PPA for ubuntu hirsute --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 094e82b..f8cc0a9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, focal, hirsute, impish, jammy ] + ubuntu-version: [ bionic, focal, impish, jammy ] steps: - uses: actions/checkout@v2 From e57d2cfa3449fef1af2ad677d1ba14267187f402 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 15 Feb 2022 18:30:54 +0100 Subject: [PATCH 420/536] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f918426..06fa32c 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ 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 2021-11-10: +### Current package versions, as of 2022-02-15: * gcc 10.3.0 -* binutils 2.37 +* binutils 2.38 * gdb 11.1 * djgpp 2.05 / cvs * newlib 4.1.0 From 468c285636f34eeb128f213cab817eb0b34c548a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 15 Feb 2022 19:28:24 +0100 Subject: [PATCH 421/536] fix simulavr build --- build-avr.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-avr.sh b/build-avr.sh index cabb587..74e9ca9 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -32,6 +32,8 @@ cd ${BASE}/build/ if [ ! -z ${SIMULAVR_VERSION} ]; then echo "Building simulavr" cd simulavr/ || exit 1 + [ -e .git/shallow ] && git fetch --prune --unshallow + git fetch --tags case `uname` in MINGW*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;; esac From a49575056029ecda1a2008435c54e346143ac9cf Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 15 Feb 2022 20:12:28 +0100 Subject: [PATCH 422/536] fix simulavr parallel build --- build-avr.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-avr.sh b/build-avr.sh index 74e9ca9..5d203b0 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -38,6 +38,7 @@ if [ ! -z ${SIMULAVR_VERSION} ]; then MINGW*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;; esac sed -i "s@-DCMAKE_INSTALL_PREFIX=@-DCMAKE_INSTALL_PREFIX=${DST} #@" Makefile + sed -i 's/@make/$(MAKE)/g' Makefile sed -i 's@/bin/@@' cmake/GetGitInfo.cmake ${MAKE_J} build || exit 1 ${MAKE_J} doc || exit 1 From 6a4d3df875f734bd761b1e59fcb4455c61cf66f5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 15 Feb 2022 18:55:56 +0100 Subject: [PATCH 423/536] add avr-libc 2.1.0, avrdude 6.4, avarice 2.14 --- README.md | 6 +++--- avr/all | 2 +- avr/avarice | 2 +- avr/avarice-2.13 | 2 +- avr/avarice-2.14 | 2 ++ avr/avr-libc | 2 +- avr/avr-libc-2.0.0 | 4 ++-- avr/avr-libc-2.1.0 | 3 +++ avr/avrdude | 2 +- avr/avrdude-6.3 | 2 +- avr/avrdude-6.4 | 2 ++ 11 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 avr/avarice-2.14 create mode 100644 avr/avr-libc-2.1.0 create mode 100644 avr/avrdude-6.4 diff --git a/README.md b/README.md index 06fa32c..ae89db7 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ If you require compatibility with distributions that use `i586`, you can either: * gdb 11.1 * djgpp 2.05 / cvs * newlib 4.1.0 -* avr-libc 2.0.0 -* avrdude 6.3 -* avarice 2.13 +* avr-libc 2.1.0 +* avrdude 6.4 +* avarice 2.14 * simulavr git ### Tested targets: diff --git a/avr/all b/avr/all index 8ead2f9..2e20cdc 100644 --- a/avr/all +++ b/avr/all @@ -1,5 +1,5 @@ source avr/avr-libc -source avr/binutils +source binutils/binutils source common/gcc source common/gdb source avr/avrdude diff --git a/avr/avarice b/avr/avarice index 4a57d87..5dc3bec 100644 --- a/avr/avarice +++ b/avr/avarice @@ -1 +1 @@ -source avr/avarice-2.13 +source avr/avarice-2.14 diff --git a/avr/avarice-2.13 b/avr/avarice-2.13 index f4b9841..a16ab17 100644 --- a/avr/avarice-2.13 +++ b/avr/avarice-2.13 @@ -1,2 +1,2 @@ AVARICE_VERSION=2.13 -AVARICE_ARCHIVE=https://downloads.sourceforge.net/project/avarice/avarice/avarice-2.13/avarice-2.13.tar.bz2 +AVARICE_ARCHIVE=https://downloads.sourceforge.net/project/avarice/avarice/avarice-$AVARICE_VERSION/avarice-$AVARICE_VERSION.tar.bz2 diff --git a/avr/avarice-2.14 b/avr/avarice-2.14 new file mode 100644 index 0000000..9acd741 --- /dev/null +++ b/avr/avarice-2.14 @@ -0,0 +1,2 @@ +AVARICE_VERSION=2.14 +AVARICE_ARCHIVE=https://downloads.sourceforge.net/project/avarice/avarice/avarice-$AVARICE_VERSION/avarice-$AVARICE_VERSION.tar.bz2 diff --git a/avr/avr-libc b/avr/avr-libc index c0d1809..2f2dffe 100644 --- a/avr/avr-libc +++ b/avr/avr-libc @@ -1 +1 @@ -source avr/avr-libc-2.0.0 +source avr/avr-libc-2.1.0 diff --git a/avr/avr-libc-2.0.0 b/avr/avr-libc-2.0.0 index 62a90c4..fca0762 100644 --- a/avr/avr-libc-2.0.0 +++ b/avr/avr-libc-2.0.0 @@ -1,3 +1,3 @@ AVRLIBC_VERSION=2.0.0 -AVRLIBC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 -AVRLIBC_DOC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-manpages-2.0.0.tar.bz2 +AVRLIBC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-$AVRLIBC_VERSION.tar.bz2 +AVRLIBC_DOC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-manpages-$AVRLIBC_VERSION.tar.bz2 diff --git a/avr/avr-libc-2.1.0 b/avr/avr-libc-2.1.0 new file mode 100644 index 0000000..c0ff9e4 --- /dev/null +++ b/avr/avr-libc-2.1.0 @@ -0,0 +1,3 @@ +AVRLIBC_VERSION=2.1.0 +AVRLIBC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-$AVRLIBC_VERSION.tar.bz2 +AVRLIBC_DOC_ARCHIVE=http://download.savannah.gnu.org/releases/avr-libc/avr-libc-manpages-$AVRLIBC_VERSION.tar.bz2 \ No newline at end of file diff --git a/avr/avrdude b/avr/avrdude index 361fe36..ab07735 100644 --- a/avr/avrdude +++ b/avr/avrdude @@ -1 +1 @@ -source avr/avrdude-6.3 +source avr/avrdude-6.4 diff --git a/avr/avrdude-6.3 b/avr/avrdude-6.3 index 5aeeda4..a32245a 100644 --- a/avr/avrdude-6.3 +++ b/avr/avrdude-6.3 @@ -1,2 +1,2 @@ AVRDUDE_VERSION=6.3 -AVRDUDE_ARCHIVE=http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3.tar.gz +AVRDUDE_ARCHIVE=http://download.savannah.gnu.org/releases/avrdude/avrdude-$AVRDUDE_VERSION.tar.gz diff --git a/avr/avrdude-6.4 b/avr/avrdude-6.4 new file mode 100644 index 0000000..4772cd8 --- /dev/null +++ b/avr/avrdude-6.4 @@ -0,0 +1,2 @@ +AVRDUDE_VERSION=6.4 +AVRDUDE_ARCHIVE=http://download.savannah.gnu.org/releases/avrdude/avrdude-$AVRDUDE_VERSION.tar.gz From 4f7ba27bd675145041e87b1fb280966c104f6cc9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 15 Feb 2022 20:48:13 +0100 Subject: [PATCH 424/536] fix avarice build --- build-avr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-avr.sh b/build-avr.sh index 5d203b0..ef86c5a 100755 --- a/build-avr.sh +++ b/build-avr.sh @@ -52,7 +52,7 @@ if [ ! -z ${AVARICE_VERSION} ]; then echo "Building AVaRICE" untar ${AVARICE_ARCHIVE} cd avarice-${AVARICE_VERSION} - [ -e ${BASE}/patch/patch-avarice-${AVARICE_VERSION}.txt ] && patch -p1 -u < ${BASE}/patch/patch-avarice-${AVARICE_VERSION}.txt || exit 1 + [ -e ${BASE}/patch/patch-avarice-${AVARICE_VERSION}.txt ] && ( patch -p1 -u < ${BASE}/patch/patch-avarice-${AVARICE_VERSION}.txt || exit 1 ) mkdir -p build-avr/ cd build-avr/ || exit 1 rm -rf * From 5eb25c0a28958b3675eab56834723e7d889e6f45 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 16 Feb 2022 18:20:07 +0100 Subject: [PATCH 425/536] add gcc 11.1.0, 11.2.0 --- README.md | 4 ++-- common/gcc | 2 +- common/gcc-11.1.0 | 12 ++++++++++++ common/gcc-11.2.0 | 12 ++++++++++++ djgpp/default | 2 +- djgpp/gcc | 1 + 6 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 common/gcc-11.1.0 create mode 100644 common/gcc-11.2.0 create mode 100644 djgpp/gcc diff --git a/README.md b/README.md index ae89db7..888e1a0 100644 --- a/README.md +++ b/README.md @@ -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 2022-02-15: +### Current package versions, as of 2022-02-16: -* gcc 10.3.0 +* gcc 11.2.0 (djgpp: 10.3.0) * binutils 2.38 * gdb 11.1 * djgpp 2.05 / cvs diff --git a/common/gcc b/common/gcc index 192ab9b..0110ac5 100644 --- a/common/gcc +++ b/common/gcc @@ -1 +1 @@ -source common/gcc-10.3.0 +source common/gcc-11.2.0 diff --git a/common/gcc-11.1.0 b/common/gcc-11.1.0 new file mode 100644 index 0000000..ecb6c70 --- /dev/null +++ b/common/gcc-11.1.0 @@ -0,0 +1,12 @@ +GCC_VERSION=11.1.0 +GCC_VERSION_SHORT=11.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}" diff --git a/common/gcc-11.2.0 b/common/gcc-11.2.0 new file mode 100644 index 0000000..abeeae5 --- /dev/null +++ b/common/gcc-11.2.0 @@ -0,0 +1,12 @@ +GCC_VERSION=11.2.0 +GCC_VERSION_SHORT=11.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}" diff --git a/djgpp/default b/djgpp/default index d997f2e..1d25f1e 100644 --- a/djgpp/default +++ b/djgpp/default @@ -1,3 +1,3 @@ source djgpp/djgpp source djgpp/binutils -source common/gcc +source djgpp/gcc diff --git a/djgpp/gcc b/djgpp/gcc new file mode 100644 index 0000000..192ab9b --- /dev/null +++ b/djgpp/gcc @@ -0,0 +1 @@ +source common/gcc-10.3.0 From 5e2ceecbd51f874536b5194838fb7a3aa259a621 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 9 Mar 2022 18:53:36 +0100 Subject: [PATCH 426/536] add Watt-32 package --- README.md | 3 +- build-djgpp.sh | 49 +++++++++++ djgpp/watt32 | 2 + patch/watt32-djgpp-2.05/djgpp.err | 114 ++++++++++++++++++++++++++ patch/watt32-djgpp-2.05/syserr.c | 132 ++++++++++++++++++++++++++++++ patch/watt32-djgpp-cvs/djgpp.err | 114 ++++++++++++++++++++++++++ patch/watt32-djgpp-cvs/syserr.c | 132 ++++++++++++++++++++++++++++++ script/check-deps-and-confirm.sh | 3 + script/destdir-hack.sh | 3 +- script/download.sh | 2 +- script/finalize.sh | 20 +++++ script/init.sh | 12 +++ 12 files changed, 582 insertions(+), 4 deletions(-) create mode 100644 djgpp/watt32 create mode 100644 patch/watt32-djgpp-2.05/djgpp.err create mode 100644 patch/watt32-djgpp-2.05/syserr.c create mode 100644 patch/watt32-djgpp-cvs/djgpp.err create mode 100644 patch/watt32-djgpp-cvs/syserr.c diff --git a/README.md b/README.md index 888e1a0..b9e3891 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,13 @@ 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 2022-02-16: +### Current package versions, as of 2022-03-09: * gcc 11.2.0 (djgpp: 10.3.0) * binutils 2.38 * gdb 11.1 * djgpp 2.05 / cvs +* watt-32 git * newlib 4.1.0 * avr-libc 2.1.0 * avrdude 6.4 diff --git a/build-djgpp.sh b/build-djgpp.sh index 9571920..f8ed173 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -22,6 +22,7 @@ prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls" DEPS="" +[ ! -z ${WATT32_VERSION} ] && DEPS+=" gcc djgpp" [ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" [ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" @@ -61,6 +62,25 @@ fi cd ${BASE}/build/ || exit 1 +if [ ! -z ${WATT32_VERSION} ]; then + export WATT_ROOT=${BASE}/build/Watt-32 + cd ${WATT_ROOT}/src || exit 1 + case $(uname) in + Linux) ;; + MINGW*|MSYS*) sed -i 's#/linux/#/win32/#g' configur.sh || exit 1 ;; + *) echo "Building Watt-32 on $(uname) is currently not supported." + sleep 5 + unset WATT32_VERSION + ;; + esac + if [ ! "`cat configure-options 2> /dev/null`" == "${CFLAGS_FOR_TARGET}" ]; then + W32_BIN2C_=false ${MAKE_J} -f djgpp.mak clean + fi + ./configur.sh clean || exit 1 +fi + +cd ${BASE}/build/ || exit 1 + if [ ! -z ${DJGPP_VERSION} ]; then if [ "${DJGPP_VERSION}" == "cvs" ]; then cd djgpp-cvs || exit 1 @@ -251,6 +271,35 @@ if [ ! -z ${DJGPP_VERSION} ]; then CFLAGS="$TEMP_CFLAGS" fi +cd ${BASE}/build/ || exit 1 + +if [ ! -z ${WATT32_VERSION} ]; then + echo "Building Watt-32" + cd ${WATT_ROOT}/src || exit 1 + ./configur.sh djgpp || exit 1 + cp ${BASE}/patch/watt32-djgpp-$(installed_version djgpp)/djgpp.err ../inc/sys/djgpp.err || exit 1 + cp ${BASE}/patch/watt32-djgpp-$(installed_version djgpp)/syserr.c build/djgpp/syserr.c || exit 1 + sed -i "s/BIN_PREFIX =\$/BIN_PREFIX = ${TARGET}-/g" djgpp.mak || exit 1 + sed -i "s/-mtune=i586$/-mtune=i586 ${CFLAGS_FOR_TARGET}/g" djgpp.mak || exit 1 + + echo "${CFLAGS_FOR_TARGET}" > configure-options + + case $(uname) in + Linux) BIN2C=${WATT_ROOT}/util/linux/bin2c ;; + MINGW*|MSYS*) BIN2C=${WATT_ROOT}/util/win32/bin2c ;; + esac + + PKT_STUB=pkt_stub.h W32_NASM_=nasm W32_BIN2C_="${BIN2C}" ${MAKE_J} -f djgpp.mak || exit 1 + + echo "Installing Watt-32" + ${SUDO} mkdir -p ${DST}/${TARGET}/watt/inc || exit 1 + ${SUDO} mkdir -p ${DST}/${TARGET}/watt/lib || exit 1 + ${SUDO} cp ../lib/libwatt.a ${DST}/${TARGET}/watt/lib/ || exit 1 + ${SUDO} ln -fs ../watt/lib/libwatt.a ${DST}/${TARGET}/lib/libwatt.a || exit 1 + ${SUDO} ln -fs libwatt.a ${DST}/${TARGET}/lib/libsocket.a || exit 1 + ${SUDO} cp -r ../inc/* ${DST}/${TARGET}/watt/inc/ || exit 1 +fi + if [ ! -z ${GCC_VERSION} ]; then echo "Building gcc (stage 2)" cd $BUILDDIR/djcross || exit 1 diff --git a/djgpp/watt32 b/djgpp/watt32 new file mode 100644 index 0000000..634a50f --- /dev/null +++ b/djgpp/watt32 @@ -0,0 +1,2 @@ +WATT32_VERSION=git +WATT32_GIT='https://github.com/gvanem/Watt-32.git::master' diff --git a/patch/watt32-djgpp-2.05/djgpp.err b/patch/watt32-djgpp-2.05/djgpp.err new file mode 100644 index 0000000..366f13b --- /dev/null +++ b/patch/watt32-djgpp-2.05/djgpp.err @@ -0,0 +1,114 @@ +#ifndef __SYS_WERRNO_ERR +#define __SYS_WERRNO_ERR + +/* + * THIS FILE WAS GENERATED BY c:/dj_err.exe at Tue Mar 8 18:31:30 2022. + * DO NOT EDIT. + * + * Watt-32 errnos are after vendor's errnos (1 - 41) + */ + +#ifndef __DJGPP__ +#error This file is only for use by "__DJGPP__" +#endif + +#define ERRNO_VENDOR_VERSION "2.05" + +#define EDOM 1 +#define ERANGE 2 +#define E2BIG 3 +#define EACCES 4 +#define EAGAIN 5 +#define EBADF 6 +#define EBUSY 7 +#define ECHILD 8 +#define EDEADLK 9 +#define EEXIST 10 +#define EFAULT 11 +#define EFBIG 12 +#define EINTR 13 +#define EINVAL 14 +#define EIO 15 +#define EISDIR 16 +#define EMFILE 17 +#define EMLINK 18 +#define ENAMETOOLONG 19 +#define ENFILE 20 +#define ENODEV 21 +#define ENOENT 22 +#define ENOEXEC 23 +#define ENOLCK 24 +#define ENOMEM 25 +#define ENOSPC 26 +#define ENOSYS 27 +#define ENOTDIR 28 +#define ENOTEMPTY 29 +#define ENOTTY 30 +#define ENXIO 31 +#define EPERM 32 +#define EPIPE 33 +#define EROFS 34 +#define ESPIPE 35 +#define ESRCH 36 +#define EXDEV 37 +#define ENMFILE 38 +#define ELOOP 39 +#define EOVERFLOW 40 +#define EILSEQ 41 +#define EWOULDBLOCK 42 +#define EINPROGRESS 43 +#define EALREADY 44 +#define ENOTSOCK 45 +#define EDESTADDRREQ 46 +#define EMSGSIZE 47 +#define EPROTOTYPE 48 +#define ENOPROTOOPT 49 +#define EPROTONOSUPPORT 50 +#define ESOCKTNOSUPPORT 51 +#define EOPNOTSUPP 52 +#define EPFNOSUPPORT 53 +#define EAFNOSUPPORT 54 +#define EADDRINUSE 55 +#define EADDRNOTAVAIL 56 +#define ENETDOWN 57 +#define ENETUNREACH 58 +#define ENETRESET 59 +#define ECONNABORTED 60 +#define ECONNRESET 61 +#define ENOBUFS 62 +#define EISCONN 63 +#define ENOTCONN 64 +#define ESHUTDOWN 65 +#define ETIMEDOUT 66 +#define ECONNREFUSED 67 +#define EHOSTDOWN 68 +#define EHOSTUNREACH 69 +#define ESTALE 70 +#define EREMOTE 71 +#define EBADRPC 72 +#define ERPCMISMATCH 73 +#define EPROGUNAVAIL 74 +#define EPROGMISMATCH 75 +#define EPROCUNAVAIL 76 +#define EINVFNC 77 +#define ENOPATH 78 +#define ECONTR 79 +#define EINVMEM 80 +#define EINVENV 81 +#define EINVFMT 82 +#define EINVACC 83 +#define EINVDAT 84 +#define EDEADLOCK 85 +#define ECURDIR 86 +#define ENOTSAM 87 +#define ETXTBSY 88 +#define ENOTBLK 89 +#define EUCLEAN 90 +#define ETOOMANYREFS 91 +#define EPROCLIM 92 +#define EUSERS 93 +#define EDQUOT 94 +#define EVDBAD 95 +#define ENORMTWD 96 + +#endif /* __SYS_WERRNO_ERR */ diff --git a/patch/watt32-djgpp-2.05/syserr.c b/patch/watt32-djgpp-2.05/syserr.c new file mode 100644 index 0000000..4d5e9b9 --- /dev/null +++ b/patch/watt32-djgpp-2.05/syserr.c @@ -0,0 +1,132 @@ +/* + * THIS FILE WAS GENERATED BY c:/dj_err.exe at Tue Mar 8 18:35:06 2022. + * DO NOT EDIT. + * + * Watt-32 sys_errlist replaces vendor's sys_errlist[] + */ + +#ifndef __DJGPP__ +#error This file is only for use by "__DJGPP__" +#endif + +char __syserr000[] = "Unknown error"; +char __syserr001[] = "Input to function out of range (EDOM)"; +char __syserr002[] = "Output of function out of range (ERANGE)"; +char __syserr003[] = "Argument list too long (E2BIG)"; +char __syserr004[] = "Permission denied (EACCES)"; +char __syserr005[] = "Resource temporarily unavailable (EAGAIN)"; +char __syserr006[] = "Bad file descriptor (EBADF)"; +char __syserr007[] = "Resource busy (EBUSY)"; +char __syserr008[] = "No child processes (ECHILD)"; +char __syserr009[] = "Resource deadlock avoided (EDEADLK)"; +char __syserr010[] = "File exists (EEXIST)"; +char __syserr011[] = "Bad address (EFAULT)"; +char __syserr012[] = "File too large (EFBIG)"; +char __syserr013[] = "Interrupted system call (EINTR)"; +char __syserr014[] = "Invalid argument (EINVAL)"; +char __syserr015[] = "Input or output error (EIO)"; +char __syserr016[] = "Is a directory (EISDIR)"; +char __syserr017[] = "Too many open files (EMFILE)"; +char __syserr018[] = "Too many links (EMLINK)"; +char __syserr019[] = "File name too long (ENAMETOOLONG)"; +char __syserr020[] = "Too many open files in system (ENFILE)"; +char __syserr021[] = "No such device (ENODEV)"; +char __syserr022[] = "No such file or directory (ENOENT)"; +char __syserr023[] = "Unable to execute file (ENOEXEC)"; +char __syserr024[] = "No locks available (ENOLCK)"; +char __syserr025[] = "Not enough memory (ENOMEM)"; +char __syserr026[] = "No space left on drive (ENOSPC)"; +char __syserr027[] = "Function not implemented (ENOSYS)"; +char __syserr028[] = "Not a directory (ENOTDIR)"; +char __syserr029[] = "Directory not empty (ENOTEMPTY)"; +char __syserr030[] = "Inappropriate I/O control operation (ENOTTY)"; +char __syserr031[] = "No such device or address (ENXIO)"; +char __syserr032[] = "Operation not permitted (EPERM)"; +char __syserr033[] = "Broken pipe (EPIPE)"; +char __syserr034[] = "Read-only file system (EROFS)"; +char __syserr035[] = "Invalid seek (ESPIPE)"; +char __syserr036[] = "No such process (ESRCH)"; +char __syserr037[] = "Improper link (EXDEV)"; +char __syserr038[] = "No more files (ENMFILE)"; +char __syserr039[] = "Too many levels of symbolic links (ELOOP)"; +char __syserr040[] = "Value too large (EOVERFLOW)"; +char __syserr041[] = "Invalid or incomplete multibyte or wide character (EILSEQ)"; +char __syserr042[] = "Operation would block (EWOULDBLOCK)"; +char __syserr043[] = "Operation now in progress (EINPROGRESS)"; +char __syserr044[] = "Operation already in progress (EALREADY)"; +char __syserr045[] = "Socket operation on non-socket (ENOTSOCK)"; +char __syserr046[] = "Destination address required (EDESTADDRREQ)"; +char __syserr047[] = "Message too long (EMSGSIZE)"; +char __syserr048[] = "Protocol wrong type for socket (EPROTOTYPE)"; +char __syserr049[] = "Protocol option not available (ENOPROTOOPT)"; +char __syserr050[] = "Protocol not supported (EPROTONOSUPPORT)"; +char __syserr051[] = "Socket type not supported (ESOCKTNOSUPPORT)"; +char __syserr052[] = "Operation not supported on socket (EOPNOTSUPP)"; +char __syserr053[] = "Protocol family not supported (EPFNOSUPPORT)"; +char __syserr054[] = "Address family not supported by protocol (EAFNOSUPPORT)"; +char __syserr055[] = "Address already in use (EADDRINUSE)"; +char __syserr056[] = "Can't assign requested address (EADDRNOTAVAIL)"; +char __syserr057[] = "Network is down (ENETDOWN)"; +char __syserr058[] = "Network is unreachable (ENETUNREACH)"; +char __syserr059[] = "Network dropped connection on reset (ENETRESET)"; +char __syserr060[] = "Software caused connection abort (ECONNABORTED)"; +char __syserr061[] = "Connection reset by peer (ECONNRESET)"; +char __syserr062[] = "No buffer space available (ENOBUFS)"; +char __syserr063[] = "Socket is already connected (EISCONN)"; +char __syserr064[] = "Socket is not connected (ENOTCONN)"; +char __syserr065[] = "Can't send after socket shutdown (ESHUTDOWN)"; +char __syserr066[] = "Connection timed out (ETIMEDOUT)"; +char __syserr067[] = "Connection refused (ECONNREFUSED)"; +char __syserr068[] = "Host is down (EHOSTDOWN)"; +char __syserr069[] = "No route to host (EHOSTUNREACH)"; +char __syserr070[] = "Stale NFS file handle (ESTALE)"; +char __syserr071[] = "Too many levels of remote in path (EREMOTE)"; +char __syserr072[] = "RPC struct is bad (EBADRPC)"; +char __syserr073[] = "RPC version wrong (ERPCMISMATCH)"; +char __syserr074[] = "RPC prog. not avail (EPROGUNAVAIL)"; +char __syserr075[] = "RPC Program version wrong (EPROGMISMATCH)"; +char __syserr076[] = "Bad procedure for program (EPROCUNAVAIL)"; +char __syserr077[] = "Invalid function number (EINVFNC)"; +char __syserr078[] = "Path not found (ENOPATH)"; +char __syserr079[] = "Memory area destroyed (ECONTR)"; +char __syserr080[] = "Invalid memory block address (EINVMEM)"; +char __syserr081[] = "Invalid environment (EINVENV)"; +char __syserr082[] = "Invalid format (EINVFMT)"; +char __syserr083[] = "Invalid access code (EINVACC)"; +char __syserr084[] = "Invalid data (EINVDAT)"; +char __syserr085[] = "Locking violation (EDEADLOCK)"; +char __syserr086[] = "Attempt to remove current directory (ECURDIR)"; +char __syserr087[] = "Not same device (ENOTSAM)"; +char __syserr088[] = "Text file busy (ETXTBSY)"; +char __syserr089[] = "Block device required (ENOTBLK)"; +char __syserr090[] = "Structure needs cleaning (EUCLEAN)"; +char __syserr091[] = "Too many references (ETOOMANYREFS)"; +char __syserr092[] = "Too many processes (EPROCLIM)"; +char __syserr093[] = "Too many users (EUSERS)"; +char __syserr094[] = "Disc quota exceeded (EDQUOT)"; +char __syserr095[] = "RVD related disk error (EVDBAD)"; +char __syserr096[] = "Out of remote working directory stuctures (ENORMTWD)"; + +char *SYS_ERRLIST[] = { + __syserr000, __syserr001, __syserr002, __syserr003, __syserr004, + __syserr005, __syserr006, __syserr007, __syserr008, __syserr009, + __syserr010, __syserr011, __syserr012, __syserr013, __syserr014, + __syserr015, __syserr016, __syserr017, __syserr018, __syserr019, + __syserr020, __syserr021, __syserr022, __syserr023, __syserr024, + __syserr025, __syserr026, __syserr027, __syserr028, __syserr029, + __syserr030, __syserr031, __syserr032, __syserr033, __syserr034, + __syserr035, __syserr036, __syserr037, __syserr038, __syserr039, + __syserr040, __syserr041, __syserr042, __syserr043, __syserr044, + __syserr045, __syserr046, __syserr047, __syserr048, __syserr049, + __syserr050, __syserr051, __syserr052, __syserr053, __syserr054, + __syserr055, __syserr056, __syserr057, __syserr058, __syserr059, + __syserr060, __syserr061, __syserr062, __syserr063, __syserr064, + __syserr065, __syserr066, __syserr067, __syserr068, __syserr069, + __syserr070, __syserr071, __syserr072, __syserr073, __syserr074, + __syserr075, __syserr076, __syserr077, __syserr078, __syserr079, + __syserr080, __syserr081, __syserr082, __syserr083, __syserr084, + __syserr085, __syserr086, __syserr087, __syserr088, __syserr089, + __syserr090, __syserr091, __syserr092, __syserr093, __syserr094, + __syserr095, __syserr096, +}; + diff --git a/patch/watt32-djgpp-cvs/djgpp.err b/patch/watt32-djgpp-cvs/djgpp.err new file mode 100644 index 0000000..366f13b --- /dev/null +++ b/patch/watt32-djgpp-cvs/djgpp.err @@ -0,0 +1,114 @@ +#ifndef __SYS_WERRNO_ERR +#define __SYS_WERRNO_ERR + +/* + * THIS FILE WAS GENERATED BY c:/dj_err.exe at Tue Mar 8 18:31:30 2022. + * DO NOT EDIT. + * + * Watt-32 errnos are after vendor's errnos (1 - 41) + */ + +#ifndef __DJGPP__ +#error This file is only for use by "__DJGPP__" +#endif + +#define ERRNO_VENDOR_VERSION "2.05" + +#define EDOM 1 +#define ERANGE 2 +#define E2BIG 3 +#define EACCES 4 +#define EAGAIN 5 +#define EBADF 6 +#define EBUSY 7 +#define ECHILD 8 +#define EDEADLK 9 +#define EEXIST 10 +#define EFAULT 11 +#define EFBIG 12 +#define EINTR 13 +#define EINVAL 14 +#define EIO 15 +#define EISDIR 16 +#define EMFILE 17 +#define EMLINK 18 +#define ENAMETOOLONG 19 +#define ENFILE 20 +#define ENODEV 21 +#define ENOENT 22 +#define ENOEXEC 23 +#define ENOLCK 24 +#define ENOMEM 25 +#define ENOSPC 26 +#define ENOSYS 27 +#define ENOTDIR 28 +#define ENOTEMPTY 29 +#define ENOTTY 30 +#define ENXIO 31 +#define EPERM 32 +#define EPIPE 33 +#define EROFS 34 +#define ESPIPE 35 +#define ESRCH 36 +#define EXDEV 37 +#define ENMFILE 38 +#define ELOOP 39 +#define EOVERFLOW 40 +#define EILSEQ 41 +#define EWOULDBLOCK 42 +#define EINPROGRESS 43 +#define EALREADY 44 +#define ENOTSOCK 45 +#define EDESTADDRREQ 46 +#define EMSGSIZE 47 +#define EPROTOTYPE 48 +#define ENOPROTOOPT 49 +#define EPROTONOSUPPORT 50 +#define ESOCKTNOSUPPORT 51 +#define EOPNOTSUPP 52 +#define EPFNOSUPPORT 53 +#define EAFNOSUPPORT 54 +#define EADDRINUSE 55 +#define EADDRNOTAVAIL 56 +#define ENETDOWN 57 +#define ENETUNREACH 58 +#define ENETRESET 59 +#define ECONNABORTED 60 +#define ECONNRESET 61 +#define ENOBUFS 62 +#define EISCONN 63 +#define ENOTCONN 64 +#define ESHUTDOWN 65 +#define ETIMEDOUT 66 +#define ECONNREFUSED 67 +#define EHOSTDOWN 68 +#define EHOSTUNREACH 69 +#define ESTALE 70 +#define EREMOTE 71 +#define EBADRPC 72 +#define ERPCMISMATCH 73 +#define EPROGUNAVAIL 74 +#define EPROGMISMATCH 75 +#define EPROCUNAVAIL 76 +#define EINVFNC 77 +#define ENOPATH 78 +#define ECONTR 79 +#define EINVMEM 80 +#define EINVENV 81 +#define EINVFMT 82 +#define EINVACC 83 +#define EINVDAT 84 +#define EDEADLOCK 85 +#define ECURDIR 86 +#define ENOTSAM 87 +#define ETXTBSY 88 +#define ENOTBLK 89 +#define EUCLEAN 90 +#define ETOOMANYREFS 91 +#define EPROCLIM 92 +#define EUSERS 93 +#define EDQUOT 94 +#define EVDBAD 95 +#define ENORMTWD 96 + +#endif /* __SYS_WERRNO_ERR */ diff --git a/patch/watt32-djgpp-cvs/syserr.c b/patch/watt32-djgpp-cvs/syserr.c new file mode 100644 index 0000000..4d5e9b9 --- /dev/null +++ b/patch/watt32-djgpp-cvs/syserr.c @@ -0,0 +1,132 @@ +/* + * THIS FILE WAS GENERATED BY c:/dj_err.exe at Tue Mar 8 18:35:06 2022. + * DO NOT EDIT. + * + * Watt-32 sys_errlist replaces vendor's sys_errlist[] + */ + +#ifndef __DJGPP__ +#error This file is only for use by "__DJGPP__" +#endif + +char __syserr000[] = "Unknown error"; +char __syserr001[] = "Input to function out of range (EDOM)"; +char __syserr002[] = "Output of function out of range (ERANGE)"; +char __syserr003[] = "Argument list too long (E2BIG)"; +char __syserr004[] = "Permission denied (EACCES)"; +char __syserr005[] = "Resource temporarily unavailable (EAGAIN)"; +char __syserr006[] = "Bad file descriptor (EBADF)"; +char __syserr007[] = "Resource busy (EBUSY)"; +char __syserr008[] = "No child processes (ECHILD)"; +char __syserr009[] = "Resource deadlock avoided (EDEADLK)"; +char __syserr010[] = "File exists (EEXIST)"; +char __syserr011[] = "Bad address (EFAULT)"; +char __syserr012[] = "File too large (EFBIG)"; +char __syserr013[] = "Interrupted system call (EINTR)"; +char __syserr014[] = "Invalid argument (EINVAL)"; +char __syserr015[] = "Input or output error (EIO)"; +char __syserr016[] = "Is a directory (EISDIR)"; +char __syserr017[] = "Too many open files (EMFILE)"; +char __syserr018[] = "Too many links (EMLINK)"; +char __syserr019[] = "File name too long (ENAMETOOLONG)"; +char __syserr020[] = "Too many open files in system (ENFILE)"; +char __syserr021[] = "No such device (ENODEV)"; +char __syserr022[] = "No such file or directory (ENOENT)"; +char __syserr023[] = "Unable to execute file (ENOEXEC)"; +char __syserr024[] = "No locks available (ENOLCK)"; +char __syserr025[] = "Not enough memory (ENOMEM)"; +char __syserr026[] = "No space left on drive (ENOSPC)"; +char __syserr027[] = "Function not implemented (ENOSYS)"; +char __syserr028[] = "Not a directory (ENOTDIR)"; +char __syserr029[] = "Directory not empty (ENOTEMPTY)"; +char __syserr030[] = "Inappropriate I/O control operation (ENOTTY)"; +char __syserr031[] = "No such device or address (ENXIO)"; +char __syserr032[] = "Operation not permitted (EPERM)"; +char __syserr033[] = "Broken pipe (EPIPE)"; +char __syserr034[] = "Read-only file system (EROFS)"; +char __syserr035[] = "Invalid seek (ESPIPE)"; +char __syserr036[] = "No such process (ESRCH)"; +char __syserr037[] = "Improper link (EXDEV)"; +char __syserr038[] = "No more files (ENMFILE)"; +char __syserr039[] = "Too many levels of symbolic links (ELOOP)"; +char __syserr040[] = "Value too large (EOVERFLOW)"; +char __syserr041[] = "Invalid or incomplete multibyte or wide character (EILSEQ)"; +char __syserr042[] = "Operation would block (EWOULDBLOCK)"; +char __syserr043[] = "Operation now in progress (EINPROGRESS)"; +char __syserr044[] = "Operation already in progress (EALREADY)"; +char __syserr045[] = "Socket operation on non-socket (ENOTSOCK)"; +char __syserr046[] = "Destination address required (EDESTADDRREQ)"; +char __syserr047[] = "Message too long (EMSGSIZE)"; +char __syserr048[] = "Protocol wrong type for socket (EPROTOTYPE)"; +char __syserr049[] = "Protocol option not available (ENOPROTOOPT)"; +char __syserr050[] = "Protocol not supported (EPROTONOSUPPORT)"; +char __syserr051[] = "Socket type not supported (ESOCKTNOSUPPORT)"; +char __syserr052[] = "Operation not supported on socket (EOPNOTSUPP)"; +char __syserr053[] = "Protocol family not supported (EPFNOSUPPORT)"; +char __syserr054[] = "Address family not supported by protocol (EAFNOSUPPORT)"; +char __syserr055[] = "Address already in use (EADDRINUSE)"; +char __syserr056[] = "Can't assign requested address (EADDRNOTAVAIL)"; +char __syserr057[] = "Network is down (ENETDOWN)"; +char __syserr058[] = "Network is unreachable (ENETUNREACH)"; +char __syserr059[] = "Network dropped connection on reset (ENETRESET)"; +char __syserr060[] = "Software caused connection abort (ECONNABORTED)"; +char __syserr061[] = "Connection reset by peer (ECONNRESET)"; +char __syserr062[] = "No buffer space available (ENOBUFS)"; +char __syserr063[] = "Socket is already connected (EISCONN)"; +char __syserr064[] = "Socket is not connected (ENOTCONN)"; +char __syserr065[] = "Can't send after socket shutdown (ESHUTDOWN)"; +char __syserr066[] = "Connection timed out (ETIMEDOUT)"; +char __syserr067[] = "Connection refused (ECONNREFUSED)"; +char __syserr068[] = "Host is down (EHOSTDOWN)"; +char __syserr069[] = "No route to host (EHOSTUNREACH)"; +char __syserr070[] = "Stale NFS file handle (ESTALE)"; +char __syserr071[] = "Too many levels of remote in path (EREMOTE)"; +char __syserr072[] = "RPC struct is bad (EBADRPC)"; +char __syserr073[] = "RPC version wrong (ERPCMISMATCH)"; +char __syserr074[] = "RPC prog. not avail (EPROGUNAVAIL)"; +char __syserr075[] = "RPC Program version wrong (EPROGMISMATCH)"; +char __syserr076[] = "Bad procedure for program (EPROCUNAVAIL)"; +char __syserr077[] = "Invalid function number (EINVFNC)"; +char __syserr078[] = "Path not found (ENOPATH)"; +char __syserr079[] = "Memory area destroyed (ECONTR)"; +char __syserr080[] = "Invalid memory block address (EINVMEM)"; +char __syserr081[] = "Invalid environment (EINVENV)"; +char __syserr082[] = "Invalid format (EINVFMT)"; +char __syserr083[] = "Invalid access code (EINVACC)"; +char __syserr084[] = "Invalid data (EINVDAT)"; +char __syserr085[] = "Locking violation (EDEADLOCK)"; +char __syserr086[] = "Attempt to remove current directory (ECURDIR)"; +char __syserr087[] = "Not same device (ENOTSAM)"; +char __syserr088[] = "Text file busy (ETXTBSY)"; +char __syserr089[] = "Block device required (ENOTBLK)"; +char __syserr090[] = "Structure needs cleaning (EUCLEAN)"; +char __syserr091[] = "Too many references (ETOOMANYREFS)"; +char __syserr092[] = "Too many processes (EPROCLIM)"; +char __syserr093[] = "Too many users (EUSERS)"; +char __syserr094[] = "Disc quota exceeded (EDQUOT)"; +char __syserr095[] = "RVD related disk error (EVDBAD)"; +char __syserr096[] = "Out of remote working directory stuctures (ENORMTWD)"; + +char *SYS_ERRLIST[] = { + __syserr000, __syserr001, __syserr002, __syserr003, __syserr004, + __syserr005, __syserr006, __syserr007, __syserr008, __syserr009, + __syserr010, __syserr011, __syserr012, __syserr013, __syserr014, + __syserr015, __syserr016, __syserr017, __syserr018, __syserr019, + __syserr020, __syserr021, __syserr022, __syserr023, __syserr024, + __syserr025, __syserr026, __syserr027, __syserr028, __syserr029, + __syserr030, __syserr031, __syserr032, __syserr033, __syserr034, + __syserr035, __syserr036, __syserr037, __syserr038, __syserr039, + __syserr040, __syserr041, __syserr042, __syserr043, __syserr044, + __syserr045, __syserr046, __syserr047, __syserr048, __syserr049, + __syserr050, __syserr051, __syserr052, __syserr053, __syserr054, + __syserr055, __syserr056, __syserr057, __syserr058, __syserr059, + __syserr060, __syserr061, __syserr062, __syserr063, __syserr064, + __syserr065, __syserr066, __syserr067, __syserr068, __syserr069, + __syserr070, __syserr071, __syserr072, __syserr073, __syserr074, + __syserr075, __syserr076, __syserr077, __syserr078, __syserr079, + __syserr080, __syserr081, __syserr082, __syserr083, __syserr084, + __syserr085, __syserr086, __syserr087, __syserr088, __syserr089, + __syserr090, __syserr091, __syserr092, __syserr093, __syserr094, + __syserr095, __syserr096, +}; + diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index f7b981c..d25da1c 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -110,6 +110,8 @@ fi # check required programs REQ_PROG_LIST="${CXX} ${CC} unzip bison flex ${MAKE} makeinfo patch tar xz bunzip2 gunzip" +[ ! -z "${WATT32_VERSION}" ] && REQ_PROG_LIST+=" nasm" + for REQ_PROG in $REQ_PROG_LIST; do if ! which $REQ_PROG > /dev/null; then echo "$REQ_PROG not installed" @@ -136,6 +138,7 @@ echo "You are about to build and install:" [ -z ${AVRDUDE_VERSION} ] || echo " - AVRDUDE ${AVRDUDE_VERSION}" [ -z ${AVARICE_VERSION} ] || echo " - AVaRICE ${AVARICE_VERSION}" [ -z ${SIMULAVR_VERSION} ] || echo " - SimulAVR ${SIMULAVR_VERSION}" +[ -z ${WATT32_VERSION} ] || echo " - Watt-32 ${WATT32_VERSION}" echo "" echo "With the following options:" diff --git a/script/destdir-hack.sh b/script/destdir-hack.sh index 133cb3b..cd469b3 100755 --- a/script/destdir-hack.sh +++ b/script/destdir-hack.sh @@ -3,5 +3,4 @@ DIR=$1 shift GCC=$1 shift -${GCC} -B${DIR}/lib/ -isystem ${DIR}/include/ -isystem ${DIR}/sys-include/ "$@" -exit $? +exec ${GCC} -B${DIR}/lib/ -isystem ${DIR}/watt/inc/ -isystem ${DIR}/sys-include/ -isystem ${DIR}/include/ "$@" diff --git a/script/download.sh b/script/download.sh index aa96734..a31895e 100644 --- a/script/download.sh +++ b/script/download.sh @@ -76,7 +76,7 @@ download_git() # these variables are of the form "git://url/repo.git::branch" # if 'branch' is empty then the default branch is checked out. -GIT_LIST="$DJGPP_GIT $GCC_GIT $BINUTILS_GIT $NEWLIB_GIT $SIMULAVR_GIT" +GIT_LIST="$DJGPP_GIT $GCC_GIT $BINUTILS_GIT $NEWLIB_GIT $SIMULAVR_GIT $WATT32_GIT" for REPO in $GIT_LIST; do download_git ${REPO%::*} ${REPO##*::} diff --git a/script/finalize.sh b/script/finalize.sh index e343ef4..021a091 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -43,6 +43,26 @@ case $TARGET in ;; esac +if [ ! -z ${WATT32_VERSION} ]; then + WATT_ROOT="${PREFIX}/${TARGET}/watt" + WATT_INCLUDE="${WATT_ROOT}/inc" + echo "export WATT_ROOT=\"${WATT_ROOT}\"" >> ${BASE}/build/${TARGET}-setenv + case $(uname) in + MSYS*|MINGW*) + WATT_ROOT="$(cygpath -w "$WATT_ROOT")" + WATT_INCLUDE="$(cygpath -w "$WATT_INCLUDE")" + ;; + esac + echo "set WATT_ROOT=\"${WATT_ROOT}\"" >> ${BASE}/build/${TARGET}-setenv.cmd + + ${TARGET}-gcc -dumpspecs > ${BASE}/build/specs + sed -i "/\*cpp:/{n;s#\(.*\)#-isystem ${WATT_INCLUDE} \1#}" ${BASE}/build/specs + sed -i "/\*cc1plus:/{n;s#\(.*\)#-isystem ${WATT_INCLUDE} \1#}" ${BASE}/build/specs + + echo "Installing specs file" + ${SUDO} cp ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(installed_version gcc)/ || exit 1 +fi + case $TARGET in i586-pc-msdosdjgpp) ;; *-pc-msdosdjgpp) cat << STOP > ${BASE}/build/${TARGET}-link-i586 diff --git a/script/init.sh b/script/init.sh index c53721f..fa9e8d6 100644 --- a/script/init.sh +++ b/script/init.sh @@ -66,6 +66,18 @@ strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } prepend() { eval "$1=\"$2 ${!1}\""; } +installed_version() +{ + local var=$(echo "$1" | tr '[:lower:]' '[:upper:]')_VERSION + if [ ! -z "${!var}" ]; then + echo ${!var} + return + fi + local name=$(echo "$1" | tr '[:upper:]' '[:lower:]') + local version_file=$(ls ${PREFIX}/${TARGET}/etc/${name}-*-installed 2> /dev/null) + echo $version_file | sed -n "s/^.*\/$name-\(.*\)-installed$/\1/p" +} + add_pkg() { for DIR in ${PACKAGE_SOURCES}; do From 9d114d013a4c140ec58e8d656ccf787f86a62ffe Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 9 Mar 2022 19:28:50 +0100 Subject: [PATCH 427/536] include watt32 in test builds --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3369824..fa49e0a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,10 +16,10 @@ jobs: env: - TARGET: i386-pc-msdosdjgpp - PACKAGES: binutils gcc djgpp-2.05 + PACKAGES: binutils gcc djgpp-2.05 watt32 - TARGET: i386-pc-msdosdjgpp - PACKAGES: binutils gcc djgpp-cvs + PACKAGES: binutils gcc djgpp-cvs watt32 - TARGET: i386-pc-msdosdjgpp PACKAGES: gdb From 6bab95052856d3b3ec4064e04ab81eeba4c56530 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 9 Mar 2022 19:59:38 +0100 Subject: [PATCH 428/536] install nasm for test builds --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fa49e0a..ae24ae4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev nasm echo "CC=gcc-11" >> $GITHUB_ENV echo "CXX=g++-11" >> $GITHUB_ENV @@ -92,7 +92,7 @@ jobs: if: contains(matrix.os, 'macos') run: | brew update - brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man + brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man nasm - name: Cache sources uses: jwt27/cache@dist From 6bafae82cf9f3550a37e080eebf6ca08eebbb647 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 9 Mar 2022 20:44:17 +0100 Subject: [PATCH 429/536] rename directory for watt32 errno files --- patch/{watt32-djgpp-2.05 => watt32-djgpp-205}/djgpp.err | 0 patch/{watt32-djgpp-2.05 => watt32-djgpp-205}/syserr.c | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename patch/{watt32-djgpp-2.05 => watt32-djgpp-205}/djgpp.err (100%) rename patch/{watt32-djgpp-2.05 => watt32-djgpp-205}/syserr.c (100%) diff --git a/patch/watt32-djgpp-2.05/djgpp.err b/patch/watt32-djgpp-205/djgpp.err similarity index 100% rename from patch/watt32-djgpp-2.05/djgpp.err rename to patch/watt32-djgpp-205/djgpp.err diff --git a/patch/watt32-djgpp-2.05/syserr.c b/patch/watt32-djgpp-205/syserr.c similarity index 100% rename from patch/watt32-djgpp-2.05/syserr.c rename to patch/watt32-djgpp-205/syserr.c From 23baa9413f7aa3df52d8518dcc942aa21f756523 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 10 Mar 2022 00:35:37 +0100 Subject: [PATCH 430/536] patch watt32 makefile to build on windows --- build-djgpp.sh | 7 ++++--- patch/watt32.patch | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 patch/watt32.patch diff --git a/build-djgpp.sh b/build-djgpp.sh index f8ed173..6885012 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -64,7 +64,9 @@ cd ${BASE}/build/ || exit 1 if [ ! -z ${WATT32_VERSION} ]; then export WATT_ROOT=${BASE}/build/Watt-32 - cd ${WATT_ROOT}/src || exit 1 + cd ${WATT_ROOT} || exit 1 + patch -p1 -u < ../../patch/watt32.patch || exit 1 + cd src/ || exit 1 case $(uname) in Linux) ;; MINGW*|MSYS*) sed -i 's#/linux/#/win32/#g' configur.sh || exit 1 ;; @@ -279,8 +281,6 @@ if [ ! -z ${WATT32_VERSION} ]; then ./configur.sh djgpp || exit 1 cp ${BASE}/patch/watt32-djgpp-$(installed_version djgpp)/djgpp.err ../inc/sys/djgpp.err || exit 1 cp ${BASE}/patch/watt32-djgpp-$(installed_version djgpp)/syserr.c build/djgpp/syserr.c || exit 1 - sed -i "s/BIN_PREFIX =\$/BIN_PREFIX = ${TARGET}-/g" djgpp.mak || exit 1 - sed -i "s/-mtune=i586$/-mtune=i586 ${CFLAGS_FOR_TARGET}/g" djgpp.mak || exit 1 echo "${CFLAGS_FOR_TARGET}" > configure-options @@ -289,6 +289,7 @@ if [ ! -z ${WATT32_VERSION} ]; then MINGW*|MSYS*) BIN2C=${WATT_ROOT}/util/win32/bin2c ;; esac + export TARGET CFLAGS_FOR_TARGET PKT_STUB=pkt_stub.h W32_NASM_=nasm W32_BIN2C_="${BIN2C}" ${MAKE_J} -f djgpp.mak || exit 1 echo "Installing Watt-32" diff --git a/patch/watt32.patch b/patch/watt32.patch new file mode 100644 index 0000000..3a02690 --- /dev/null +++ b/patch/watt32.patch @@ -0,0 +1,41 @@ +diff --git a/src/makefile.all b/src/makefile.all +index d347d56..9f1ee10 100644 +--- a/src/makefile.all ++++ b/src/makefile.all +@@ -251,34 +251,10 @@ PKT_STUB = pkt_stub.h + # + prefix = /dev/env/DJDIR/net/watt + +-ifeq ($(OS),Windows_NT) +- ifneq ($(DJ_PREFIX),) +- # +- # Windows hosted djgpp cross compiler. Get it from: +- # https://github.com/andrewwutw/build-djgpp/releases - djgpp-mingw-gcc*.zip +- # +- # and install to e.g. 'c:/djgpp/contrib'. +- # And then define an env-var: +- # DJ_PREFIX=c:/djgpp/contrib/win-cross/bin/i586-pc-msdosdjgpp- +- # +- # Thus the full path to 'gcc' becomes: +- # $(DJ_PREFIX)gcc.exe +- # +- # If not building on Windows, the '$(BIN_PREFIX)gcc' should simply become +- # 'gcc' and GNU-make should find that on %PATH. +- # +- BIN_PREFIX = $(DJ_PREFIX) +- +- ifeq ($(wildcard $(BIN_PREFIX)gcc.exe),) +- $(error Failed to find 'i586-pc-msdosdjgpp-gcc.exe'.) +- endif +- endif +-else +- BIN_PREFIX = +-endif ++BIN_PREFIX = $(TARGET)- + + CFLAGS = -O3 -g -I. -I../inc -DWATT32_BUILD -W -Wall -Wno-strict-aliasing \ +- -march=i386 -mtune=i586 ++ -march=i386 -mtune=i586 $(CFLAGS_FOR_TARGET) + + ifeq ($(filter 2 3 4,$(word 3, $(shell true | $(CC) -E -dD -x c - | grep 'define\ *__GNUC__'))),) + # From 9365c63fac00ba56126fbf9718c3b7c122333a84 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 10 Mar 2022 00:39:02 +0100 Subject: [PATCH 431/536] allow empty CFLAGS_FOR_TARGET --- script/init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/init.sh b/script/init.sh index fa9e8d6..83a87ae 100644 --- a/script/init.sh +++ b/script/init.sh @@ -44,8 +44,8 @@ else HOST_CXX=${CXX} fi -CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET:-"-O2 -g"} -CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET:-"-O2 -g"} +CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"-O2 -g"} +CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET-"-O2 -g"} untar() { From dcc5c09124dec42322ae3c73978545c6f3cba611 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 10 Mar 2022 22:37:42 +0100 Subject: [PATCH 432/536] new and improved method to store installed package versions --- build-djgpp.sh | 12 ++++++------ script/build-avr-gcc.sh | 3 +-- script/build-binutils.sh | 3 +-- script/build-gdb.sh | 3 +-- script/build-newlib-gcc.sh | 3 +-- script/build-tools.sh | 6 +++--- script/check-deps-and-confirm.sh | 30 ++++++------------------------ script/finalize.sh | 6 +++--- script/init.sh | 30 +++++++++++++++++++++++++----- 9 files changed, 47 insertions(+), 49 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 6885012..84d1365 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -279,8 +279,8 @@ if [ ! -z ${WATT32_VERSION} ]; then echo "Building Watt-32" cd ${WATT_ROOT}/src || exit 1 ./configur.sh djgpp || exit 1 - cp ${BASE}/patch/watt32-djgpp-$(installed_version djgpp)/djgpp.err ../inc/sys/djgpp.err || exit 1 - cp ${BASE}/patch/watt32-djgpp-$(installed_version djgpp)/syserr.c build/djgpp/syserr.c || exit 1 + cp ${BASE}/patch/watt32-djgpp-$(get_version djgpp)/djgpp.err ../inc/sys/djgpp.err || exit 1 + cp ${BASE}/patch/watt32-djgpp-$(get_version djgpp)/syserr.c build/djgpp/syserr.c || exit 1 echo "${CFLAGS_FOR_TARGET}" > configure-options @@ -299,6 +299,8 @@ if [ ! -z ${WATT32_VERSION} ]; then ${SUDO} ln -fs ../watt/lib/libwatt.a ${DST}/${TARGET}/lib/libwatt.a || exit 1 ${SUDO} ln -fs libwatt.a ${DST}/${TARGET}/lib/libsocket.a || exit 1 ${SUDO} cp -r ../inc/* ${DST}/${TARGET}/watt/inc/ || exit 1 + + set_version watt32 fi if [ ! -z ${GCC_VERSION} ]; then @@ -316,8 +318,7 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst CFLAGS="$TEMP_CFLAGS" - ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + set_version gcc fi if [ ! -z ${DJGPP_VERSION} ]; then @@ -349,8 +350,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${SUDO} cp -p hostbin/dxegen.exe ${DST}/bin/${TARGET}-dxe3gen${EXE} || exit 1 ${SUDO} cp -p hostbin/dxe3res.exe ${DST}/bin/${TARGET}-dxe3res${EXE} || exit 1 - ${SUDO} rm -f ${DST}/${TARGET}/etc/djgpp-*-installed - ${SUDO} touch ${DST}/${TARGET}/etc/djgpp-${DJGPP_VERSION}-installed + set_version djgpp fi cd ${BASE}/build diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index a2ac42b..2be9fc3 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -111,6 +111,5 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE_J} install-strip || exit 1 ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst - ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + set_version gcc fi diff --git a/script/build-binutils.sh b/script/build-binutils.sh index aa3df1e..bcc1efd 100644 --- a/script/build-binutils.sh +++ b/script/build-binutils.sh @@ -28,5 +28,4 @@ ${MAKE_J} || exit 1 echo "Installing binutils" ${SUDO} ${MAKE_J} install || exit 1 -${SUDO} rm -f ${DST}/${TARGET}/etc/binutils-*-installed -${SUDO} touch ${DST}/${TARGET}/etc/binutils-${BINUTILS_VERSION}-installed +set_version binutils diff --git a/script/build-gdb.sh b/script/build-gdb.sh index 245f95c..f53c659 100644 --- a/script/build-gdb.sh +++ b/script/build-gdb.sh @@ -28,6 +28,5 @@ if [ ! -z ${GDB_VERSION} ]; then echo "Installing gdb" ${SUDO} ${MAKE_J} install || exit 1 - ${SUDO} rm -f ${DST}/${TARGET}/etc/gdb-*-installed - ${SUDO} touch ${DST}/${TARGET}/etc/gdb-${GDB_VERSION}-installed + set_version gdb fi diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 536ad24..cd18569 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -104,6 +104,5 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE_J} install-strip || exit 1 ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst - ${SUDO} rm -f ${DST}/${TARGET}/etc/gcc-*-installed - ${SUDO} touch ${DST}/${TARGET}/etc/gcc-${GCC_VERSION}-installed + set_version gcc fi diff --git a/script/build-tools.sh b/script/build-tools.sh index 5dda755..ca7bad1 100644 --- a/script/build-tools.sh +++ b/script/build-tools.sh @@ -4,8 +4,8 @@ export PATH="${BASE}/build/tmpinst/bin:$PATH" cd ${BASE}/build || exit 1 # build GNU sed if needed. -if [ ! -z $SED_VERSION ]; then - if [ ! -e ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed ]; then +if [ ! -z "${SED_VERSION}" ]; then + if [ ! "$(${BASE}/build/tmpinst/sed-version 2> /dev/null)" == "${SED_VERSION}" ]; then echo "Building sed" untar ${SED_ARCHIVE} || exit 1 cd sed-${SED_VERSION}/ @@ -15,6 +15,6 @@ if [ ! -z $SED_VERSION ]; then ${MAKE_J} || exit 1 ${MAKE_J} DESTDIR= install || exit 1 CFLAGS="$TEMP_CFLAGS" - touch ${BASE}/build/tmpinst/sed-${SED_VERSION}-installed + echo ${SED_VERSION} > ${BASE}/build/tmpinst/sed-version fi fi diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index d25da1c..e8ffc07 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -3,36 +3,18 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then case $DEP in djgpp) if [ -z ${DJGPP_VERSION} ]; then - if [ -e ${PREFIX}/${TARGET}/etc/djgpp-cvs-installed ]; then + if [ "$(get_version djgpp)" == "cvs" ]; then add_pkg djgpp-cvs else add_pkg djgpp fi fi ;; - newlib) - [ -z ${NEWLIB_VERSION} ] \ - && add_pkg newlib - ;; - avr-libc) - [ -z ${AVRLIBC_VERSION} ] \ - && add_pkg avr-libc - ;; - binutils) - [ -z "`ls ${PREFIX}/${TARGET}/etc/binutils-*-installed 2> /dev/null`" ] \ - && [ -z ${BINUTILS_VERSION} ] \ - && add_pkg binutils - ;; - gcc) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ] \ - && [ -z ${GCC_VERSION} ] \ - && add_pkg gcc - ;; - gdb) - [ -z "`ls ${PREFIX}/${TARGET}/etc/gdb-*-installed 2> /dev/null`" ] \ - && [ -z ${GDB_VERSION} ] \ - && add_pkg gdb - ;; + newlib) [ -z "${NEWLIB_VERSION}" ] && add_pkg newlib ;; + avr-libc) [ -z "${AVRLIBC_VERSION}" ] && add_pkg avr-libc ;; + binutils) [ -z "$(get_version binutils)" ] && add_pkg binutils ;; + gcc) [ -z "$(get_version gcc)" ] && add_pkg gcc ;; + gdb) [ -z "$(get_version gdb)" ] && add_pkg gdb ;; esac done fi diff --git a/script/finalize.sh b/script/finalize.sh index 021a091..9f311fc 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -43,7 +43,7 @@ case $TARGET in ;; esac -if [ ! -z ${WATT32_VERSION} ]; then +if [ ! -z "$(get_version watt32)" ]; then WATT_ROOT="${PREFIX}/${TARGET}/watt" WATT_INCLUDE="${WATT_ROOT}/inc" echo "export WATT_ROOT=\"${WATT_ROOT}\"" >> ${BASE}/build/${TARGET}-setenv @@ -60,7 +60,7 @@ if [ ! -z ${WATT32_VERSION} ]; then sed -i "/\*cc1plus:/{n;s#\(.*\)#-isystem ${WATT_INCLUDE} \1#}" ${BASE}/build/specs echo "Installing specs file" - ${SUDO} cp ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(installed_version gcc)/ || exit 1 + ${SUDO} cp ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 fi case $TARGET in @@ -87,7 +87,7 @@ MINGW*) ;& MSYS*) cp -p ${BASE}/build/setenv-${TARGET}.cmd ${DST}/bin/ 2> /dev/null ;; esac -if [ ! -z "`ls ${DST}/${TARGET}/etc/gcc-*-installed 2> /dev/null`" ]; then +if [ ! -z "$(get_version gcc)" ]; then for x in $(echo $ENABLE_LANGUAGES | tr "," " ") do case $x in diff --git a/script/init.sh b/script/init.sh index 83a87ae..49483cb 100644 --- a/script/init.sh +++ b/script/init.sh @@ -66,16 +66,36 @@ strip_whitespace() { eval "$1=\"`echo ${!1}`\""; } prepend() { eval "$1=\"$2 ${!1}\""; } -installed_version() +uppercase() { echo "$@" | tr '[:lower:]' '[:upper:]'; } +lowercase() { echo "$@" | tr '[:upper:]' '[:lower:]'; } + +get_version() { - local var=$(echo "$1" | tr '[:lower:]' '[:upper:]')_VERSION + local var=$(uppercase $1 | tr -d '_-')_VERSION if [ ! -z "${!var}" ]; then + # Currently being installed echo ${!var} return fi - local name=$(echo "$1" | tr '[:upper:]' '[:lower:]') - local version_file=$(ls ${PREFIX}/${TARGET}/etc/${name}-*-installed 2> /dev/null) - echo $version_file | sed -n "s/^.*\/$name-\(.*\)-installed$/\1/p" + local name=$(lowercase $1) + local version=$(cat ${PREFIX}/${TARGET}/etc/build-gcc/${name}-version 2> /dev/null) + if [ ! -z "${version}" ]; then + # Already installed + echo ${version} + return + fi + local old_version_file=$(ls ${PREFIX}/${TARGET}/etc/${name}-*-installed 2> /dev/null) + # Already installed, using old-style version file + echo $old_version_file | sed -n "s/^.*\/$name-\(.*\)-installed$/\1/p" +} + +set_version() +{ + local name=$(lowercase $1) + local var=$(uppercase $1 | tr -d '_-')_VERSION + ${SUDO} rm -f ${PREFIX}/${TARGET}/etc/${name}-*-installed + ${SUDO} mkdir -p ${DST}/${TARGET}/etc/build-gcc + ${SUDO} sh -c "echo ${!var} > ${DST}/${TARGET}/etc/build-gcc/${name}-version" } add_pkg() From 066de6be7ed55123ff8a2223edc9fff1000f2904 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 10 Mar 2022 23:05:13 +0100 Subject: [PATCH 433/536] use forward slashes in gcc specs file --- script/finalize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/finalize.sh b/script/finalize.sh index 9f311fc..1ad7ea5 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -50,7 +50,7 @@ if [ ! -z "$(get_version watt32)" ]; then case $(uname) in MSYS*|MINGW*) WATT_ROOT="$(cygpath -w "$WATT_ROOT")" - WATT_INCLUDE="$(cygpath -w "$WATT_INCLUDE")" + WATT_INCLUDE="$(cygpath -m "$WATT_INCLUDE")" ;; esac echo "set WATT_ROOT=\"${WATT_ROOT}\"" >> ${BASE}/build/${TARGET}-setenv.cmd From 2a480f9fc1e68c7c258e4c0e627c4f6160b12b6e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 11 Mar 2022 00:49:27 +0100 Subject: [PATCH 434/536] remove specs file before building libc or watt32 --- build-djgpp.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-djgpp.sh b/build-djgpp.sh index 84d1365..45a0629 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -62,6 +62,9 @@ fi cd ${BASE}/build/ || exit 1 +echo "Removing old specs file" +${SUDO} rm -f ${PREFIX}/lib/gcc/${TARGET}/$(get_version gcc)/specs + if [ ! -z ${WATT32_VERSION} ]; then export WATT_ROOT=${BASE}/build/Watt-32 cd ${WATT_ROOT} || exit 1 From 8ab41999e1d25bc1c880b8c7ee764053814ec3f3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 11 Mar 2022 01:51:14 +0100 Subject: [PATCH 435/536] fix ownership and permissions of installed files --- build-djgpp.sh | 26 +++++++++++++------------- script/build-avr-gcc.sh | 4 ++-- script/build-newlib-gcc.sh | 2 +- script/finalize.sh | 19 +++++++++---------- script/init.sh | 15 +++++++++++++++ 5 files changed, 40 insertions(+), 26 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 45a0629..dfddb03 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -123,10 +123,10 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Installing djgpp headers and utilities" ${SUDO} mkdir -p ${DST}/${TARGET}/sys-include || exit 1 - ${SUDO} cp -rp include/* ${DST}/${TARGET}/sys-include/ || exit 1 + install_files include/* ${DST}/${TARGET}/sys-include/ || exit 1 ${SUDO} mkdir -p ${DST}/bin || exit 1 - ${SUDO} cp -p hostbin/stubify.exe ${DST}/bin/${TARGET}-stubify${EXE} || exit 1 - ${SUDO} cp -p hostbin/stubedit.exe ${DST}/bin/${TARGET}-stubedit${EXE} || exit 1 + install_files hostbin/stubify.exe ${DST}/bin/${TARGET}-stubify${EXE} || exit 1 + install_files hostbin/stubedit.exe ${DST}/bin/${TARGET}-stubedit${EXE} || exit 1 fi cd ${BASE}/build/ @@ -271,7 +271,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then echo "Installing djgpp libc" ${SUDO} mkdir -p ${DST}/${TARGET}/lib - ${SUDO} cp -rp ../lib/* ${DST}/${TARGET}/lib || exit 1 + install_files ../lib/* ${DST}/${TARGET}/lib || exit 1 LDFLAGS="$TEMP_LDFLAGS" CFLAGS="$TEMP_CFLAGS" fi @@ -298,10 +298,10 @@ if [ ! -z ${WATT32_VERSION} ]; then echo "Installing Watt-32" ${SUDO} mkdir -p ${DST}/${TARGET}/watt/inc || exit 1 ${SUDO} mkdir -p ${DST}/${TARGET}/watt/lib || exit 1 - ${SUDO} cp ../lib/libwatt.a ${DST}/${TARGET}/watt/lib/ || exit 1 + install_files ../lib/libwatt.a ${DST}/${TARGET}/watt/lib/ || exit 1 ${SUDO} ln -fs ../watt/lib/libwatt.a ${DST}/${TARGET}/lib/libwatt.a || exit 1 ${SUDO} ln -fs libwatt.a ${DST}/${TARGET}/lib/libsocket.a || exit 1 - ${SUDO} cp -r ../inc/* ${DST}/${TARGET}/watt/inc/ || exit 1 + install_files ../inc/* ${DST}/${TARGET}/watt/inc/ || exit 1 set_version watt32 fi @@ -344,14 +344,14 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd .. echo "Installing djgpp libraries and utilities" - ${SUDO} cp -rp lib/* ${DST}/${TARGET}/lib || exit 1 + install_files lib/* ${DST}/${TARGET}/lib || exit 1 ${SUDO} mkdir -p ${DST}/${TARGET}/share/info - ${SUDO} cp -rp info/* ${DST}/${TARGET}/share/info - ${SUDO} cp -p hostbin/exe2coff.exe ${DST}/bin/${TARGET}-exe2coff${EXE} || exit 1 - ${SUDO} cp -p hostbin/djasm.exe ${DST}/bin/${TARGET}-djasm${EXE} || exit 1 - ${SUDO} cp -p hostbin/dxegen.exe ${DST}/bin/${TARGET}-dxegen${EXE} || exit 1 - ${SUDO} cp -p hostbin/dxegen.exe ${DST}/bin/${TARGET}-dxe3gen${EXE} || exit 1 - ${SUDO} cp -p hostbin/dxe3res.exe ${DST}/bin/${TARGET}-dxe3res${EXE} || exit 1 + install_files info/* ${DST}/${TARGET}/share/info + install_files hostbin/exe2coff.exe ${DST}/bin/${TARGET}-exe2coff${EXE} || exit 1 + install_files hostbin/djasm.exe ${DST}/bin/${TARGET}-djasm${EXE} || exit 1 + install_files hostbin/dxegen.exe ${DST}/bin/${TARGET}-dxegen${EXE} || exit 1 + install_files hostbin/dxegen.exe ${DST}/bin/${TARGET}-dxe3gen${EXE} || exit 1 + install_files hostbin/dxe3res.exe ${DST}/bin/${TARGET}-dxe3res${EXE} || exit 1 set_version djgpp fi diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index 2be9fc3..b51abb7 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -11,10 +11,10 @@ if [ ! -z ${AVRLIBC_VERSION} ]; then fi cd avr-libc-${AVRLIBC_VERSION}/ ${SUDO} mkdir -p ${DST}/${TARGET}/include/ - ${SUDO} cp -rv include/* ${DST}/${TARGET}/include/ | exit 1 + install_files include/* ${DST}/${TARGET}/include/ | exit 1 echo "Installing avr-libc documentation" ${SUDO} mkdir -p ${DST}/${TARGET}/share/man/ - ${SUDO} cp -rv man/* ${DST}/${TARGET}/share/man/ | exit 1 + install_files man/* ${DST}/${TARGET}/share/man/ | exit 1 cd .. fi diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index cd18569..082c8ce 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -4,7 +4,7 @@ if [ ! -z ${NEWLIB_VERSION} ] && [ ! -e newlib-${NEWLIB_VERSION}/newlib-unpacked echo "Unpacking newlib..." untar ${NEWLIB_ARCHIVE} ${SUDO} mkdir -p ${DST}/${TARGET}/include/ - ${SUDO} cp -rv newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${DST}/${TARGET}/include/ | exit 1 + install_files newlib-${NEWLIB_VERSION}/newlib/libc/include/* ${DST}/${TARGET}/include/ | exit 1 touch newlib-${NEWLIB_VERSION}/newlib-unpacked fi diff --git a/script/finalize.sh b/script/finalize.sh index 1ad7ea5..6a1f3cb 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -6,14 +6,14 @@ SHORT_NAME_LIST="dxegen dxe3gen dxe3res exe2coff stubify stubedit djasm gdb strings ld readelf ld.bfd size addr2line setenv strip objcopy c++filt ar gprof ranlib as nm elfedit objdump" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/${TARGET}-$SHORT_NAME ]; then - ${SUDO} cp -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME + install_files -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME fi done if [ ! -z ${GCC_VERSION} ]; then - ${SUDO} cp -p bin/${TARGET}-gcc bin/${TARGET}-gcc-${GCC_VERSION} 2> /dev/null - ${SUDO} cp -p bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} 2> /dev/null - ${SUDO} cp -p ${TARGET}/bin/gcc ${TARGET}/bin/gcc-${GCC_VERSION} 2> /dev/null - ${SUDO} cp -p ${TARGET}/bin/g++ ${TARGET}/bin/g++-${GCC_VERSION} 2> /dev/null + install_files bin/${TARGET}-gcc bin/${TARGET}-gcc-${GCC_VERSION} 2> /dev/null + install_files bin/${TARGET}-g++ bin/${TARGET}-g++-${GCC_VERSION} 2> /dev/null + install_files ${TARGET}/bin/gcc ${TARGET}/bin/gcc-${GCC_VERSION} 2> /dev/null + install_files ${TARGET}/bin/g++ ${TARGET}/bin/g++-${GCC_VERSION} 2> /dev/null fi popd @@ -60,7 +60,7 @@ if [ ! -z "$(get_version watt32)" ]; then sed -i "/\*cc1plus:/{n;s#\(.*\)#-isystem ${WATT_INCLUDE} \1#}" ${BASE}/build/specs echo "Installing specs file" - ${SUDO} cp ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 + install_files ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 fi case $TARGET in @@ -74,17 +74,16 @@ done STOP echo "Installing ${TARGET}-link-i586" chmod +x ${BASE}/build/${TARGET}-link-i586 - ${SUDO} cp -p ${BASE}/build/${TARGET}-link-i586 ${DST}/bin/ + install_files ${BASE}/build/${TARGET}-link-i586 ${DST}/bin/ ;; *) ;; esac echo "Installing ${TARGET}-setenv" chmod +x ${BASE}/build/${TARGET}-setenv -${SUDO} cp -p ${BASE}/build/${TARGET}-setenv ${DST}/bin/ +install_files ${BASE}/build/${TARGET}-setenv ${DST}/bin/ case `uname` in -MINGW*) ;& -MSYS*) cp -p ${BASE}/build/setenv-${TARGET}.cmd ${DST}/bin/ 2> /dev/null ;; +MINGW*|MSYS*) install_files ${BASE}/build/setenv-${TARGET}.cmd ${DST}/bin/ 2> /dev/null ;; esac if [ ! -z "$(get_version gcc)" ]; then diff --git a/script/init.sh b/script/init.sh index 49483cb..301dc18 100644 --- a/script/init.sh +++ b/script/init.sh @@ -3,6 +3,8 @@ unset SUDO unset MAKEFLAGS unset INSTALL +umask u=rwx,g=rx,o=rx + BASE=`pwd` # number of parallel build threads @@ -47,6 +49,19 @@ fi CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"-O2 -g"} CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET-"-O2 -g"} +# check if cp understands --preserve (for MacOS) +if cp --preserve=mode,timestamps script/hello.c ./hello.c 2>&1 > /dev/null; then + CP='cp --preserve=mode,timestamps' +else + CP='cp' +fi +rm -f hello.c 2> /dev/null + +install_files() +{ + ${SUDO} ${CP} -R -f "$@" +} + untar() { [ -z $1 ] && return From 09f70eb369d3e2ea4ee286f735616dba3bbc4f76 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 11 Mar 2022 02:28:31 +0100 Subject: [PATCH 436/536] add binutils as dependency for watt32 --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index dfddb03..85a24e5 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -22,7 +22,7 @@ prepend GDB_CONFIGURE_OPTIONS "--disable-werror --disable-nls" DEPS="" -[ ! -z ${WATT32_VERSION} ] && DEPS+=" gcc djgpp" +[ ! -z ${WATT32_VERSION} ] && DEPS+=" gcc djgpp binutils" [ ! -z ${GCC_VERSION} ] && DEPS+=" djgpp binutils" [ ! -z ${DJGPP_VERSION} ] && DEPS+=" binutils gcc" From 6263970d6476b1683d0229a3cd622fa1a66c002e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 11 Mar 2022 15:33:50 +0100 Subject: [PATCH 437/536] silence identical file warnings --- script/finalize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 6a1f3cb..5ee999c 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -3,10 +3,10 @@ pushd ${DST} || exit 1 ${SUDO} mkdir -p ${TARGET}/bin SHORT_NAME_LIST="dxegen dxe3gen dxe3res exe2coff stubify stubedit djasm gdb g++ c++ cpp gcc gprof gcc-nm gcov-tool gcc-ranlib gcc-ar gcov-dump gcov - strings ld readelf ld.bfd size addr2line setenv strip objcopy c++filt ar gprof ranlib as nm elfedit objdump" + strings ld readelf ld.bfd size addr2line strip objcopy c++filt ar gprof ranlib as nm elfedit objdump" for SHORT_NAME in $SHORT_NAME_LIST; do if [ -f bin/${TARGET}-$SHORT_NAME ]; then - install_files -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME + install_files -p bin/${TARGET}-$SHORT_NAME ${TARGET}/bin/$SHORT_NAME 2> /dev/null fi done if [ ! -z ${GCC_VERSION} ]; then From d9dad56e040fd561b5c3b4851385767064cd35ae Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 11 Mar 2022 15:39:19 +0100 Subject: [PATCH 438/536] update watt-32 build procedure --- build-djgpp.sh | 13 ++++--------- patch/watt32.patch | 36 ++++-------------------------------- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 85a24e5..aa21dad 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -72,14 +72,14 @@ if [ ! -z ${WATT32_VERSION} ]; then cd src/ || exit 1 case $(uname) in Linux) ;; - MINGW*|MSYS*) sed -i 's#/linux/#/win32/#g' configur.sh || exit 1 ;; + MINGW*|MSYS*) ;; *) echo "Building Watt-32 on $(uname) is currently not supported." sleep 5 unset WATT32_VERSION ;; esac if [ ! "`cat configure-options 2> /dev/null`" == "${CFLAGS_FOR_TARGET}" ]; then - W32_BIN2C_=false ${MAKE_J} -f djgpp.mak clean + ${MAKE_J} -f djgpp.mak clean fi ./configur.sh clean || exit 1 fi @@ -281,19 +281,14 @@ cd ${BASE}/build/ || exit 1 if [ ! -z ${WATT32_VERSION} ]; then echo "Building Watt-32" cd ${WATT_ROOT}/src || exit 1 - ./configur.sh djgpp || exit 1 + DJGPP_PREFIX=${TARGET} ./configur.sh djgpp || exit 1 cp ${BASE}/patch/watt32-djgpp-$(get_version djgpp)/djgpp.err ../inc/sys/djgpp.err || exit 1 cp ${BASE}/patch/watt32-djgpp-$(get_version djgpp)/syserr.c build/djgpp/syserr.c || exit 1 echo "${CFLAGS_FOR_TARGET}" > configure-options - case $(uname) in - Linux) BIN2C=${WATT_ROOT}/util/linux/bin2c ;; - MINGW*|MSYS*) BIN2C=${WATT_ROOT}/util/win32/bin2c ;; - esac - export TARGET CFLAGS_FOR_TARGET - PKT_STUB=pkt_stub.h W32_NASM_=nasm W32_BIN2C_="${BIN2C}" ${MAKE_J} -f djgpp.mak || exit 1 + ${MAKE_J} -f djgpp.mak || exit 1 echo "Installing Watt-32" ${SUDO} mkdir -p ${DST}/${TARGET}/watt/inc || exit 1 diff --git a/patch/watt32.patch b/patch/watt32.patch index 3a02690..9f4210e 100644 --- a/patch/watt32.patch +++ b/patch/watt32.patch @@ -1,41 +1,13 @@ diff --git a/src/makefile.all b/src/makefile.all -index d347d56..9f1ee10 100644 +index d158664..f840962 100644 --- a/src/makefile.all +++ b/src/makefile.all -@@ -251,34 +251,10 @@ PKT_STUB = pkt_stub.h - # +@@ -252,7 +252,7 @@ PKT_STUB = pkt_stub.h prefix = /dev/env/DJDIR/net/watt --ifeq ($(OS),Windows_NT) -- ifneq ($(DJ_PREFIX),) -- # -- # Windows hosted djgpp cross compiler. Get it from: -- # https://github.com/andrewwutw/build-djgpp/releases - djgpp-mingw-gcc*.zip -- # -- # and install to e.g. 'c:/djgpp/contrib'. -- # And then define an env-var: -- # DJ_PREFIX=c:/djgpp/contrib/win-cross/bin/i586-pc-msdosdjgpp- -- # -- # Thus the full path to 'gcc' becomes: -- # $(DJ_PREFIX)gcc.exe -- # -- # If not building on Windows, the '$(BIN_PREFIX)gcc' should simply become -- # 'gcc' and GNU-make should find that on %PATH. -- # -- BIN_PREFIX = $(DJ_PREFIX) -- -- ifeq ($(wildcard $(BIN_PREFIX)gcc.exe),) -- $(error Failed to find 'i586-pc-msdosdjgpp-gcc.exe'.) -- endif -- endif --else -- BIN_PREFIX = --endif -+BIN_PREFIX = $(TARGET)- - CFLAGS = -O3 -g -I. -I../inc -DWATT32_BUILD -W -Wall -Wno-strict-aliasing \ - -march=i386 -mtune=i586 + -march=i386 -mtune=i586 $(CFLAGS_FOR_TARGET) - ifeq ($(filter 2 3 4,$(word 3, $(shell true | $(CC) -E -dD -x c - | grep 'define\ *__GNUC__'))),) - # + STAT_LIB = ../lib/libwatt.a + OBJDIR = build/djgpp From ae230049b7c7bde451d79a6abe9bba2566b4b7e7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 11 Mar 2022 17:22:36 +0100 Subject: [PATCH 439/536] no need to force a libc rebuild on compiler upgrade --- script/check-deps-and-confirm.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index e8ffc07..298afdc 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -1,17 +1,9 @@ if [ -z ${IGNORE_DEPENDENCIES} ]; then for DEP in ${DEPS}; do case $DEP in - djgpp) - if [ -z ${DJGPP_VERSION} ]; then - if [ "$(get_version djgpp)" == "cvs" ]; then - add_pkg djgpp-cvs - else - add_pkg djgpp - fi - fi - ;; - newlib) [ -z "${NEWLIB_VERSION}" ] && add_pkg newlib ;; - avr-libc) [ -z "${AVRLIBC_VERSION}" ] && add_pkg avr-libc ;; + djgpp) [ -z "$(get_version djgpp)" ] && add_pkg djgpp ;; + newlib) [ -z "$(get_version newlib)" ] && add_pkg newlib ;; + avr-libc) [ -z "$(get_version avr-libc)" ] && add_pkg avr-libc ;; binutils) [ -z "$(get_version binutils)" ] && add_pkg binutils ;; gcc) [ -z "$(get_version gcc)" ] && add_pkg gcc ;; gdb) [ -z "$(get_version gdb)" ] && add_pkg gdb ;; From 5fe314d33a1acdba2446fce899b98af9d69f0902 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 11 Mar 2022 18:59:37 +0100 Subject: [PATCH 440/536] add 'watt32' to 'all' --- djgpp/all | 1 + djgpp/watt32 | 3 +-- djgpp/watt32-git | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 djgpp/watt32-git diff --git a/djgpp/all b/djgpp/all index 0929192..7514244 100644 --- a/djgpp/all +++ b/djgpp/all @@ -1,2 +1,3 @@ source djgpp/default source djgpp/gdb +source djgpp/watt32 diff --git a/djgpp/watt32 b/djgpp/watt32 index 634a50f..8ea7d6d 100644 --- a/djgpp/watt32 +++ b/djgpp/watt32 @@ -1,2 +1 @@ -WATT32_VERSION=git -WATT32_GIT='https://github.com/gvanem/Watt-32.git::master' +source djgpp/watt32-git diff --git a/djgpp/watt32-git b/djgpp/watt32-git new file mode 100644 index 0000000..634a50f --- /dev/null +++ b/djgpp/watt32-git @@ -0,0 +1,2 @@ +WATT32_VERSION=git +WATT32_GIT='https://github.com/gvanem/Watt-32.git::master' From 88de695ab8bea9f721f84f3208999f394f766675 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 11 Mar 2022 19:04:02 +0100 Subject: [PATCH 441/536] use octal umask --- script/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/init.sh b/script/init.sh index 301dc18..92e5240 100644 --- a/script/init.sh +++ b/script/init.sh @@ -3,7 +3,7 @@ unset SUDO unset MAKEFLAGS unset INSTALL -umask u=rwx,g=rx,o=rx +umask 022 BASE=`pwd` From 427ecff8eb331c6454b25fb92c5e3c60fd3e2d97 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 14 Mar 2022 18:03:35 +0100 Subject: [PATCH 442/536] patch std::errc to use Watt-32 error codes --- patch/djgpp-gcc-10.3.0/watt32-errno.patch | 219 ++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 patch/djgpp-gcc-10.3.0/watt32-errno.patch diff --git a/patch/djgpp-gcc-10.3.0/watt32-errno.patch b/patch/djgpp-gcc-10.3.0/watt32-errno.patch new file mode 100644 index 0000000..d2c4ba3 --- /dev/null +++ b/patch/djgpp-gcc-10.3.0/watt32-errno.patch @@ -0,0 +1,219 @@ +diff --git a/libstdc++-v3/config/os/djgpp/error_constants.h b/libstdc++-v3/config/os/djgpp/error_constants.h +index 434de1601e4..a739488247e 100644 +--- a/libstdc++-v3/config/os/djgpp/error_constants.h ++++ b/libstdc++-v3/config/os/djgpp/error_constants.h +@@ -33,6 +33,11 @@ + #include + #include + ++// Include Watt-32 errno list, if present ++#if __has_include() ++#include ++#endif ++ + #ifndef EOPNOTSUPP + // Use same value as in wat3222br6.zip file net/watt/sys/djgpp.err + #define EOPNOTSUPP 52 +@@ -48,10 +53,22 @@ + + enum class errc + { +-// address_family_not_supported = EAFNOSUPPORT, +-// address_in_use = EADDRINUSE, +-// address_not_available = EADDRNOTAVAIL, +-// already_connected = EISCONN, ++#ifdef EAFNOSUPPORT ++ address_family_not_supported = EAFNOSUPPORT, ++#endif ++ ++#ifdef EADDRINUSE ++ address_in_use = EADDRINUSE, ++#endif ++ ++#ifdef EADDRNOTAVAIL ++ address_not_available = EADDRNOTAVAIL, ++#endif ++ ++#ifdef EISCONN ++ already_connected = EISCONN, ++#endif ++ + argument_list_too_long = E2BIG, + argument_out_of_domain = EDOM, + bad_address = EFAULT, +@@ -62,12 +79,29 @@ + #endif + + broken_pipe = EPIPE, +-// connection_aborted = ECONNABORTED, +-// connection_already_in_progress = EALREADY, +-// connection_refused = ECONNREFUSED, +-// connection_reset = ECONNRESET, ++ ++#ifdef ECONNABORTED ++ connection_aborted = ECONNABORTED, ++#endif ++ ++#ifdef EALREADY ++ connection_already_in_progress = EALREADY, ++#endif ++ ++#ifdef ECONNREFUSED ++ connection_refused = ECONNREFUSED, ++#endif ++ ++#ifdef ECONNRESET ++ connection_reset = ECONNRESET, ++#endif ++ + cross_device_link = EXDEV, +-// destination_address_required = EDESTADDRREQ, ++ ++#ifdef EDESTADDRREQ ++ destination_address_required = EDESTADDRREQ, ++#endif ++ + device_or_resource_busy = EBUSY, + directory_not_empty = ENOTEMPTY, + executable_format_error = ENOEXEC, +@@ -75,7 +109,10 @@ + file_too_large = EFBIG, + filename_too_long = ENAMETOOLONG, + function_not_supported = ENOSYS, +-// host_unreachable = EHOSTUNREACH, ++ ++#ifdef EHOSTUNREACH ++ host_unreachable = EHOSTUNREACH, ++#endif + + #ifdef EIDRM + identifier_removed = EIDRM, +@@ -88,11 +125,27 @@ + invalid_seek = ESPIPE, + io_error = EIO, + is_a_directory = EISDIR, +-// message_size = EMSGSIZE, +-// network_down = ENETDOWN, +-// network_reset = ENETRESET, +-// network_unreachable = ENETUNREACH, +-// no_buffer_space = ENOBUFS, ++ ++#ifdef EMSGSIZE ++ message_size = EMSGSIZE, ++#endif ++ ++#ifdef ENETDOWN ++ network_down = ENETDOWN, ++#endif ++ ++#ifdef ENETRESET ++ network_reset = ENETRESET, ++#endif ++ ++#ifdef ENETUNREACH ++ network_unreachable = ENETUNREACH, ++#endif ++ ++#ifdef ENOBUFS ++ no_buffer_space = ENOBUFS, ++#endif ++ + no_child_process = ECHILD, + + #ifdef ENOLINK +@@ -105,8 +158,14 @@ + no_message_available = ENODATA, + #endif + +-// no_message = ENOMSG, +-// no_protocol_option = ENOPROTOOPT, ++#ifdef ENOMSG ++ no_message = ENOMSG, ++#endif ++ ++#ifdef ENOPROTOOPT ++ no_protocol_option = ENOPROTOOPT, ++#endif ++ + no_space_on_device = ENOSPC, + + #ifdef ENOSR +@@ -118,25 +177,39 @@ + no_such_file_or_directory = ENOENT, + no_such_process = ESRCH, + not_a_directory = ENOTDIR, +-// not_a_socket = ENOTSOCK, ++ ++#ifdef ENOTSOCK ++ not_a_socket = ENOTSOCK, ++#endif + + #ifdef ENOSTR + not_a_stream = ENOSTR, + #endif + +-// not_connected = ENOTCONN, ++#ifdef ENOTCONN ++ not_connected = ENOTCONN, ++#endif ++ + not_enough_memory = ENOMEM, + ++#ifdef ENOTSUP + not_supported = ENOTSUP, ++#endif + + #ifdef ECANCELED + operation_canceled = ECANCELED, + #endif + +-// operation_in_progress = EINPROGRESS, ++#ifdef EINPROGRESS ++ operation_in_progress = EINPROGRESS, ++#endif ++ + operation_not_permitted = EPERM, + operation_not_supported = EOPNOTSUPP, +-// operation_would_block = EWOULDBLOCK, ++ ++#ifdef EWOULDBLOCK ++ operation_would_block = EWOULDBLOCK, ++#endif + + #ifdef EOWNERDEAD + owner_dead = EOWNERDEAD, +@@ -148,7 +221,10 @@ + protocol_error = EPROTO, + #endif + +-// protocol_not_supported = EPROTONOSUPPORT, ++#ifdef EPROTONOSUPPORT ++ protocol_not_supported = EPROTONOSUPPORT, ++#endif ++ + read_only_file_system = EROFS, + resource_deadlock_would_occur = EDEADLK, + resource_unavailable_try_again = EAGAIN, +@@ -166,7 +242,10 @@ + text_file_busy = ETXTBSY, + #endif + +-// timed_out = ETIMEDOUT, ++#ifdef ETIMEDOUT ++ timed_out = ETIMEDOUT, ++#endif ++ + too_many_files_open_in_system = ENFILE, + too_many_files_open = EMFILE, + too_many_links = EMLINK, +@@ -176,7 +255,9 @@ + value_too_large = EOVERFLOW, + #endif + +-// wrong_protocol_type = EPROTOTYPE ++#ifdef EPROTOTYPE ++ wrong_protocol_type = EPROTOTYPE ++#endif + }; + + _GLIBCXX_END_NAMESPACE_VERSION From 60df06ff237d66ba35efa8f963844309d2cd4640 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 16 Mar 2022 00:40:05 +0100 Subject: [PATCH 443/536] add gcc option -mno-watt to disable Watt-32 include path --- script/finalize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 5ee999c..9e1fe94 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -56,8 +56,8 @@ if [ ! -z "$(get_version watt32)" ]; then echo "set WATT_ROOT=\"${WATT_ROOT}\"" >> ${BASE}/build/${TARGET}-setenv.cmd ${TARGET}-gcc -dumpspecs > ${BASE}/build/specs - sed -i "/\*cpp:/{n;s#\(.*\)#-isystem ${WATT_INCLUDE} \1#}" ${BASE}/build/specs - sed -i "/\*cc1plus:/{n;s#\(.*\)#-isystem ${WATT_INCLUDE} \1#}" ${BASE}/build/specs + sed -i "/\*cpp:/{n;s#\(.*\)#%{!mno-watt:-isystem ${WATT_INCLUDE}} \1#}" ${BASE}/build/specs + sed -i "/\*cc1plus:/{n;s#\(.*\)#{!mno-watt:-isystem ${WATT_INCLUDE}} \1#}" ${BASE}/build/specs echo "Installing specs file" install_files ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 From 69a4e3e7522a5341959ee613c4e4176e06cee0ac Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 16 Mar 2022 00:40:45 +0100 Subject: [PATCH 444/536] set WATT_ROOT in setenv.cmd with regular slash and no quotes --- script/finalize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 9e1fe94..be1ad09 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -49,11 +49,11 @@ if [ ! -z "$(get_version watt32)" ]; then echo "export WATT_ROOT=\"${WATT_ROOT}\"" >> ${BASE}/build/${TARGET}-setenv case $(uname) in MSYS*|MINGW*) - WATT_ROOT="$(cygpath -w "$WATT_ROOT")" + WATT_ROOT="$(cygpath -m "$WATT_ROOT")" WATT_INCLUDE="$(cygpath -m "$WATT_INCLUDE")" ;; esac - echo "set WATT_ROOT=\"${WATT_ROOT}\"" >> ${BASE}/build/${TARGET}-setenv.cmd + echo "set WATT_ROOT=${WATT_ROOT}" >> ${BASE}/build/${TARGET}-setenv.cmd ${TARGET}-gcc -dumpspecs > ${BASE}/build/specs sed -i "/\*cpp:/{n;s#\(.*\)#%{!mno-watt:-isystem ${WATT_INCLUDE}} \1#}" ${BASE}/build/specs From a8de1236e59421511a28a876ecb79c45f53ccc36 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 16 Mar 2022 15:41:52 +0100 Subject: [PATCH 445/536] reduce code duplication --- script/finalize.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index be1ad09..ffda7af 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -56,8 +56,9 @@ if [ ! -z "$(get_version watt32)" ]; then echo "set WATT_ROOT=${WATT_ROOT}" >> ${BASE}/build/${TARGET}-setenv.cmd ${TARGET}-gcc -dumpspecs > ${BASE}/build/specs - sed -i "/\*cpp:/{n;s#\(.*\)#%{!mno-watt:-isystem ${WATT_INCLUDE}} \1#}" ${BASE}/build/specs - sed -i "/\*cc1plus:/{n;s#\(.*\)#{!mno-watt:-isystem ${WATT_INCLUDE}} \1#}" ${BASE}/build/specs + spec_option="%{!mno-watt:-isystem ${WATT_INCLUDE}}" + sed -i "/\*cpp:/{n;s#\(.*\)#%${spec_option} \1#}" ${BASE}/build/specs + sed -i "/\*cc1plus:/{n;s#\(.*\)#${spec_option} \1#}" ${BASE}/build/specs echo "Installing specs file" install_files ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 From 329e480485c3b639386e60244cc612b7b6550fc3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 16 Mar 2022 15:55:31 +0100 Subject: [PATCH 446/536] fix typo in specs file --- script/finalize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/finalize.sh b/script/finalize.sh index ffda7af..376ecec 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -57,7 +57,7 @@ if [ ! -z "$(get_version watt32)" ]; then ${TARGET}-gcc -dumpspecs > ${BASE}/build/specs spec_option="%{!mno-watt:-isystem ${WATT_INCLUDE}}" - sed -i "/\*cpp:/{n;s#\(.*\)#%${spec_option} \1#}" ${BASE}/build/specs + sed -i "/\*cpp:/{n;s#\(.*\)#${spec_option} \1#}" ${BASE}/build/specs sed -i "/\*cc1plus:/{n;s#\(.*\)#${spec_option} \1#}" ${BASE}/build/specs echo "Installing specs file" From 8c5ebafc29e329bd34a22626715455c43becd2ba Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 16 Mar 2022 19:10:17 +0100 Subject: [PATCH 447/536] compile target libraries with -ffunction-sections -fdata-sections --- script/init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/init.sh b/script/init.sh index 92e5240..99dda89 100644 --- a/script/init.sh +++ b/script/init.sh @@ -46,8 +46,8 @@ else HOST_CXX=${CXX} fi -CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"-O2 -g"} -CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET-"-O2 -g"} +CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} +CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} # check if cp understands --preserve (for MacOS) if cp --preserve=mode,timestamps script/hello.c ./hello.c 2>&1 > /dev/null; then From 27eb25ffd1e2fe0c189849f89bdcbb9ff7d44279 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 9 Mar 2022 19:47:14 +0100 Subject: [PATCH 448/536] add debian package for Watt-32 --- .github/workflows/deploy.yml | 2 +- build-djgpp.sh | 20 +++++++++++------- debian/Makefile | 2 +- debian/binutils-djgpp.install | 2 +- debian/bionic/control | 13 ++++++++++-- debian/changelog | 6 ++++++ debian/control | 13 ++++++++++-- debian/djgpp.install | 2 +- debian/gcc-djgpp.install | 2 +- debian/gdb-djgpp.install | 2 +- debian/libwatt-djgpp-dev.install | 4 ++++ patch/watt32.patch | 36 ++++++++++++++++++++++++++++++++ 12 files changed, 87 insertions(+), 17 deletions(-) create mode 100644 debian/libwatt-djgpp-dev.install diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f8cc0a9..c34410c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,7 +21,7 @@ jobs: - name: Download sources run: | - ./build-djgpp.sh --batch --build-deb --only-download --ignore-dependencies djgpp-cvs binutils gcc gdb + ./build-djgpp.sh --batch --build-deb --only-download --ignore-dependencies djgpp-cvs binutils gcc gdb watt32 - name: Pack git sources run: | diff --git a/build-djgpp.sh b/build-djgpp.sh index aa21dad..617639b 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -69,15 +69,21 @@ if [ ! -z ${WATT32_VERSION} ]; then export WATT_ROOT=${BASE}/build/Watt-32 cd ${WATT_ROOT} || exit 1 patch -p1 -u < ../../patch/watt32.patch || exit 1 - cd src/ || exit 1 case $(uname) in - Linux) ;; - MINGW*|MSYS*) ;; - *) echo "Building Watt-32 on $(uname) is currently not supported." - sleep 5 - unset WATT32_VERSION - ;; + MINGW*|MSYS*) WATT_UTILS=win32 ;; + *) WATT_UTILS=linux ;; esac + cd util/ || exit 1 + ${MAKE_J} ${WATT_UTILS} + for i in mkmake mkdep bin2c; do + if ! [ -x ${WATT_UTILS}/$i ]; then + echo "Missing Watt-32 tool $i. Make sure you have S-Lang installed." + sleep 10 + unset WATT32_VERSION + break + fi + done + cd ../src/ || exit 1 if [ ! "`cat configure-options 2> /dev/null`" == "${CFLAGS_FOR_TARGET}" ]; then ${MAKE_J} -f djgpp.mak clean fi diff --git a/debian/Makefile b/debian/Makefile index f224c99..fdc6f79 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -1,4 +1,4 @@ -PACKAGES=djgpp-cvs binutils gcc gdb +PACKAGES=djgpp-cvs binutils gcc gdb watt32 all: build diff --git a/debian/binutils-djgpp.install b/debian/binutils-djgpp.install index 77c420a..37cfc17 100644 --- a/debian/binutils-djgpp.install +++ b/debian/binutils-djgpp.install @@ -31,4 +31,4 @@ usr/bin/i*86-pc-msdosdjgpp-as usr/bin/i*86-pc-msdosdjgpp-nm usr/bin/i*86-pc-msdosdjgpp-elfedit usr/bin/i*86-pc-msdosdjgpp-objdump -usr/i*86-pc-msdosdjgpp/etc/binutils-*-installed +usr/i*86-pc-msdosdjgpp/etc/build-gcc/binutils-version diff --git a/debian/bionic/control b/debian/bionic/control index cf62f51..f98da4b 100644 --- a/debian/bionic/control +++ b/debian/bionic/control @@ -18,6 +18,9 @@ Build-Depends: gzip, dos2unix, zlib1g-dev, + nasm, + libslang2-dev, + pkg-config, debhelper (>= 11) Standards-Version: 4.1.2 Homepage: https://github.com/jwt27/build-gcc @@ -57,7 +60,7 @@ Recommends: gcc-djgpp Suggests: gdb-djgpp Description: Extra files for gcc Python pretty-printer script files for use with gdb. - May conflict with host gcc. + May conflict with system gcc. Package: binutils-djgpp Architecture: any @@ -93,4 +96,10 @@ Architecture: all Depends: ${misc:Depends} Recommends: gdb-djgpp Description: Extra files for gdb-djgpp - May conflict with host gdb. + May conflict with system gdb. + +Package: libwatt-djgpp-dev +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: djgpp, gcc-djgpp +Description: Watt-32 TCP socket library for DJGPP diff --git a/debian/changelog b/debian/changelog index b04c35a..7efd373 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20220316.2+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * new package: libwatt-djgpp-dev + + -- jwt27 Wed, 16 Mar 2022 19:08:24 +0100 + djgpp-toolchain (0.20220215.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * binutils version 2.38. diff --git a/debian/control b/debian/control index fe08cb4..70e9687 100644 --- a/debian/control +++ b/debian/control @@ -18,6 +18,9 @@ Build-Depends: gzip, dos2unix, zlib1g-dev, + nasm, + libslang2-dev, + pkg-config, debhelper (>= 11) Standards-Version: 4.1.2 Homepage: https://github.com/jwt27/build-gcc @@ -57,7 +60,7 @@ Recommends: gcc-djgpp Suggests: gdb-djgpp Description: Extra files for gcc Python pretty-printer script files for use with gdb. - May conflict with host gcc. + May conflict with system gcc. Package: gdb-djgpp Architecture: any @@ -78,4 +81,10 @@ Architecture: all Depends: ${misc:Depends} Recommends: gdb-djgpp Description: Extra files for gdb-djgpp - May conflict with host gdb. + May conflict with system gdb. + +Package: libwatt-djgpp-dev +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: djgpp, gcc-djgpp +Description: Watt-32 TCP socket library for DJGPP diff --git a/debian/djgpp.install b/debian/djgpp.install index 28d3efb..7554408 100644 --- a/debian/djgpp.install +++ b/debian/djgpp.install @@ -25,4 +25,4 @@ usr/bin/i*86-pc-msdosdjgpp-dxegen usr/bin/i*86-pc-msdosdjgpp-stubedit usr/bin/i*86-pc-msdosdjgpp-dxe3res usr/bin/i*86-pc-msdosdjgpp-setenv -usr/i*86-pc-msdosdjgpp/etc/djgpp-*-installed +usr/i*86-pc-msdosdjgpp/etc/build-gcc/djgpp-version diff --git a/debian/gcc-djgpp.install b/debian/gcc-djgpp.install index abbeb59..d63d00a 100644 --- a/debian/gcc-djgpp.install +++ b/debian/gcc-djgpp.install @@ -24,4 +24,4 @@ usr/bin/i*86-pc-msdosdjgpp-gcc-ar usr/bin/i*86-pc-msdosdjgpp-g++-*.*.* usr/bin/i*86-pc-msdosdjgpp-gcov-dump usr/bin/i*86-pc-msdosdjgpp-gcov -usr/i*86-pc-msdosdjgpp/etc/gcc-*-installed +usr/i*86-pc-msdosdjgpp/etc/build-gcc/gcc-version diff --git a/debian/gdb-djgpp.install b/debian/gdb-djgpp.install index a8c5b10..7eb1d9a 100644 --- a/debian/gdb-djgpp.install +++ b/debian/gdb-djgpp.install @@ -1,4 +1,4 @@ usr/i*86-pc-msdosdjgpp/bin/gdb usr/bin/i*86-pc-msdosdjgpp-gdb usr/bin/i*86-pc-msdosdjgpp-gdb-add-index -usr/i*86-pc-msdosdjgpp/etc/gdb-*-installed +usr/i*86-pc-msdosdjgpp/etc/build-gcc/gdb-version diff --git a/debian/libwatt-djgpp-dev.install b/debian/libwatt-djgpp-dev.install new file mode 100644 index 0000000..bde7e1c --- /dev/null +++ b/debian/libwatt-djgpp-dev.install @@ -0,0 +1,4 @@ +usr/i*86-pc-msdosdjgpp/watt/* +usr/i*86-pc-msdosdjgpp/lib/libwatt.a +usr/i*86-pc-msdosdjgpp/lib/libsocket.a +usr/i*86-pc-msdosdjgpp/etc/build-gcc/watt32-version diff --git a/patch/watt32.patch b/patch/watt32.patch index 9f4210e..0d1ac96 100644 --- a/patch/watt32.patch +++ b/patch/watt32.patch @@ -11,3 +11,39 @@ index d158664..f840962 100644 STAT_LIB = ../lib/libwatt.a OBJDIR = build/djgpp +diff --git a/util/makefile b/util/makefile +index 55bc368..cd53fd8 100644 +--- a/util/makefile ++++ b/util/makefile +@@ -20,11 +20,10 @@ SLANG_ROOT_DOS ?= $(DJDIR)/contrib/slang.210 + SLANG_LIB_DOS ?= $(SLANG_ROOT_DOS)/src/djgobjs/libslang.a + + SLANG_ROOT_WIN ?= $(realpath $(MINGW32))/src/TUI/Slang +-SLANG_LIB_WIN ?= $(SLANG_ROOT_WIN)/src/gw32objs/libslang.a + SLANG_LIB_WIN_CL ?= $(SLANG_ROOT_WIN)/src/mw32objs/wslang32.lib + +-SLANG_ROOT_LINUX ?= +-SLANG_LIB_LINUX ?= $(SLANG_ROOT_LINUX)/src/objs/libslang.a ++SLANG_CFLAGS = $(shell pkg-config --cflags slang) ++SLANG_LIBS = $(shell pkg-config --libs slang) + + CC = gcc + CFLAGS = -Wall -g -save-temps # -s +@@ -60,7 +59,7 @@ mkimp.c: mkimp.l + # Win32 binaries: + # + win32/mkmake.exe: mkmake.c +- $(CC) -m32 $(CFLAGS) -I$(SLANG_ROOT_WIN)/src -o $*.exe $^ $(SLANG_LIB_WIN) ++ $(CC) -m32 $(CFLAGS) $(SLANG_CFLAGS) -o $*.exe $^ $(SLANG_LIBS) + + win32/mkdep.exe: mkdep.c + $(CC) -m32 $(CFLAGS) -o $*.exe $^ +@@ -81,7 +80,7 @@ msvc/mkmake.exe: mkmake.c + # Linux binaries: + # + linux/mkmake: mkmake.c +- $(CC) $(CFLAGS) -I$(SLANG_ROOT_LINUX)/src -o $@ $^ $(SLANG_LIB_LINUX) ++ $(CC) $(CFLAGS) $(SLANG_CFLAGS) -o $@ $^ $(SLANG_LIBS) + + linux/mkdep: mkdep.c + $(CC) $(CFLAGS) -o $@ $^ From 07127cffe2984e14fecb528a9d38046f802b9972 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 16 Mar 2022 22:12:05 +0100 Subject: [PATCH 449/536] always rebuild watt32 tools on non-amd64 or non-linux platforms. --- .github/workflows/main.yml | 4 ++-- build-djgpp.sh | 18 +++++++++++------- debian/changelog | 6 ++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae24ae4..9298db8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev nasm + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev nasm libslang2-dev echo "CC=gcc-11" >> $GITHUB_ENV echo "CXX=g++-11" >> $GITHUB_ENV @@ -92,7 +92,7 @@ jobs: if: contains(matrix.os, 'macos') run: | brew update - brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man nasm + brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man nasm s-lang - name: Cache sources uses: jwt27/cache@dist diff --git a/build-djgpp.sh b/build-djgpp.sh index 617639b..8e040c4 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -69,18 +69,22 @@ if [ ! -z ${WATT32_VERSION} ]; then export WATT_ROOT=${BASE}/build/Watt-32 cd ${WATT_ROOT} || exit 1 patch -p1 -u < ../../patch/watt32.patch || exit 1 + cd util/ || exit 1 case $(uname) in MINGW*|MSYS*) WATT_UTILS=win32 ;; - *) WATT_UTILS=linux ;; + Linux) WATT_UTILS=linux ;; + *) WATT_UTILS=linux + rm -f linux/* ;; esac - cd util/ || exit 1 - ${MAKE_J} ${WATT_UTILS} + case $(uname -m) in + x86_64) ;; + *) rm -f linux/* ;; + esac + ${MAKE_J} --always-make ${WATT_UTILS} for i in mkmake mkdep bin2c; do if ! [ -x ${WATT_UTILS}/$i ]; then - echo "Missing Watt-32 tool $i. Make sure you have S-Lang installed." - sleep 10 - unset WATT32_VERSION - break + echo "Unable to build Watt-32 tool '$i'. Make sure you have S-Lang installed." + exit 1 fi done cd ../src/ || exit 1 diff --git a/debian/changelog b/debian/changelog index 7efd373..d8ba726 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20220317.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * fix build on i386. + + -- jwt27 Thu, 17 Mar 2022 00:53:38 +0100 + djgpp-toolchain (0.20220316.2+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * new package: libwatt-djgpp-dev From c7ca0f284f7813059ed69c863619627e73fd0442 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 17 Mar 2022 16:49:19 +0100 Subject: [PATCH 450/536] remove gcc specs option (doesn't work) --- script/finalize.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/finalize.sh b/script/finalize.sh index 376ecec..4997a1c 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -56,9 +56,10 @@ if [ ! -z "$(get_version watt32)" ]; then echo "set WATT_ROOT=${WATT_ROOT}" >> ${BASE}/build/${TARGET}-setenv.cmd ${TARGET}-gcc -dumpspecs > ${BASE}/build/specs - spec_option="%{!mno-watt:-isystem ${WATT_INCLUDE}}" - sed -i "/\*cpp:/{n;s#\(.*\)#${spec_option} \1#}" ${BASE}/build/specs - sed -i "/\*cc1plus:/{n;s#\(.*\)#${spec_option} \1#}" ${BASE}/build/specs + + for i in cpp cc1plus; do + sed -i "/\*$i:/{n;s#\(.*\)#-isystem ${WATT_INCLUDE} \1#}" ${BASE}/build/specs + done echo "Installing specs file" install_files ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 From 4581cb7f18658442ca7a3e2c8565dcff6965d30a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 17 Mar 2022 16:53:14 +0100 Subject: [PATCH 451/536] remove merged watt32 patch --- patch/watt32.patch | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/patch/watt32.patch b/patch/watt32.patch index 0d1ac96..9f4210e 100644 --- a/patch/watt32.patch +++ b/patch/watt32.patch @@ -11,39 +11,3 @@ index d158664..f840962 100644 STAT_LIB = ../lib/libwatt.a OBJDIR = build/djgpp -diff --git a/util/makefile b/util/makefile -index 55bc368..cd53fd8 100644 ---- a/util/makefile -+++ b/util/makefile -@@ -20,11 +20,10 @@ SLANG_ROOT_DOS ?= $(DJDIR)/contrib/slang.210 - SLANG_LIB_DOS ?= $(SLANG_ROOT_DOS)/src/djgobjs/libslang.a - - SLANG_ROOT_WIN ?= $(realpath $(MINGW32))/src/TUI/Slang --SLANG_LIB_WIN ?= $(SLANG_ROOT_WIN)/src/gw32objs/libslang.a - SLANG_LIB_WIN_CL ?= $(SLANG_ROOT_WIN)/src/mw32objs/wslang32.lib - --SLANG_ROOT_LINUX ?= --SLANG_LIB_LINUX ?= $(SLANG_ROOT_LINUX)/src/objs/libslang.a -+SLANG_CFLAGS = $(shell pkg-config --cflags slang) -+SLANG_LIBS = $(shell pkg-config --libs slang) - - CC = gcc - CFLAGS = -Wall -g -save-temps # -s -@@ -60,7 +59,7 @@ mkimp.c: mkimp.l - # Win32 binaries: - # - win32/mkmake.exe: mkmake.c -- $(CC) -m32 $(CFLAGS) -I$(SLANG_ROOT_WIN)/src -o $*.exe $^ $(SLANG_LIB_WIN) -+ $(CC) -m32 $(CFLAGS) $(SLANG_CFLAGS) -o $*.exe $^ $(SLANG_LIBS) - - win32/mkdep.exe: mkdep.c - $(CC) -m32 $(CFLAGS) -o $*.exe $^ -@@ -81,7 +80,7 @@ msvc/mkmake.exe: mkmake.c - # Linux binaries: - # - linux/mkmake: mkmake.c -- $(CC) $(CFLAGS) -I$(SLANG_ROOT_LINUX)/src -o $@ $^ $(SLANG_LIB_LINUX) -+ $(CC) $(CFLAGS) $(SLANG_CFLAGS) -o $@ $^ $(SLANG_LIBS) - - linux/mkdep: mkdep.c - $(CC) $(CFLAGS) -o $@ $^ From a40f15032ceda22d117b3358b086070242e8340b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 17 Mar 2022 20:03:20 +0100 Subject: [PATCH 452/536] silence warning on Mac --- script/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/init.sh b/script/init.sh index 99dda89..3c9acf6 100644 --- a/script/init.sh +++ b/script/init.sh @@ -50,7 +50,7 @@ CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-section CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} # check if cp understands --preserve (for MacOS) -if cp --preserve=mode,timestamps script/hello.c ./hello.c 2>&1 > /dev/null; then +if cp --preserve=mode,timestamps script/hello.c ./hello.c > /dev/null 2>&1; then CP='cp --preserve=mode,timestamps' else CP='cp' From 326af408ed2a812cdc55402f27fd62d331793ec6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 May 2022 17:23:31 +0200 Subject: [PATCH 453/536] add gdb 11.2, 12.1 --- common/gdb-11.2 | 2 ++ common/gdb-12.1 | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 common/gdb-11.2 create mode 100644 common/gdb-12.1 diff --git a/common/gdb-11.2 b/common/gdb-11.2 new file mode 100644 index 0000000..b70465c --- /dev/null +++ b/common/gdb-11.2 @@ -0,0 +1,2 @@ +GDB_VERSION=11.2 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-12.1 b/common/gdb-12.1 new file mode 100644 index 0000000..0025bbe --- /dev/null +++ b/common/gdb-12.1 @@ -0,0 +1,2 @@ +GDB_VERSION=12.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From 71345ccd2ed3dd46928f9507cc2580764fbdeb2f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 May 2022 17:25:30 +0200 Subject: [PATCH 454/536] build PPA for ubuntu kinetic [fixes #26] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c34410c..d0ba3f5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, focal, impish, jammy ] + ubuntu-version: [ bionic, focal, impish, jammy, kinetic ] steps: - uses: actions/checkout@v2 From 515d0ba29e20baa664eac31d711bda38c72f8848 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 2 May 2022 17:30:08 +0200 Subject: [PATCH 455/536] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9e3891..33f0f73 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ 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 2022-03-09: +### Current package versions, as of 2022-05-02: * gcc 11.2.0 (djgpp: 10.3.0) * binutils 2.38 -* gdb 11.1 +* gdb 12.1 * djgpp 2.05 / cvs * watt-32 git * newlib 4.1.0 From dfda7c1ce6ef3c1792028f377824918b1a898cc8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 16 May 2022 21:04:53 +0200 Subject: [PATCH 456/536] update default gdb version --- common/gdb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/gdb b/common/gdb index 9857464..ee8577f 100644 --- a/common/gdb +++ b/common/gdb @@ -1 +1 @@ -source common/gdb-11.1 +source common/gdb-12.1 From 4e31477f502a158581461f7c20dadcf49e08fb9b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 23 May 2022 16:43:38 +0200 Subject: [PATCH 457/536] add gcc 12.1.0 --- README.md | 4 ++-- common/gcc | 2 +- common/gcc-12.1.0 | 12 ++++++++++++ debian/changelog | 6 ++++++ djgpp/gcc | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 common/gcc-12.1.0 diff --git a/README.md b/README.md index 33f0f73..2898c15 100644 --- a/README.md +++ b/README.md @@ -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 2022-05-02: +### Current package versions, as of 2022-05-23: -* gcc 11.2.0 (djgpp: 10.3.0) +* gcc 12.1.0 * binutils 2.38 * gdb 12.1 * djgpp 2.05 / cvs diff --git a/common/gcc b/common/gcc index 0110ac5..e18231e 100644 --- a/common/gcc +++ b/common/gcc @@ -1 +1 @@ -source common/gcc-11.2.0 +source common/gcc-12.1.0 diff --git a/common/gcc-12.1.0 b/common/gcc-12.1.0 new file mode 100644 index 0000000..6d0a414 --- /dev/null +++ b/common/gcc-12.1.0 @@ -0,0 +1,12 @@ +GCC_VERSION=12.1.0 +GCC_VERSION_SHORT=12.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}" diff --git a/debian/changelog b/debian/changelog index d8ba726..98eb557 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (0.20220523.0+gcc12.1.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low + + * gcc version 12.1.0 + + -- jwt27 Mon, 23 May 2022 16:43:08 +0200 + djgpp-toolchain (0.20220317.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low * fix build on i386. diff --git a/djgpp/gcc b/djgpp/gcc index 192ab9b..e18231e 100644 --- a/djgpp/gcc +++ b/djgpp/gcc @@ -1 +1 @@ -source common/gcc-10.3.0 +source common/gcc-12.1.0 From 47ac4438434e49ead648473f3044096d7fdcc58f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 23 May 2022 16:46:30 +0200 Subject: [PATCH 458/536] drop --always-make flag for watt32 utils --- build-djgpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 8e040c4..d9d1556 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -80,7 +80,7 @@ if [ ! -z ${WATT32_VERSION} ]; then x86_64) ;; *) rm -f linux/* ;; esac - ${MAKE_J} --always-make ${WATT_UTILS} + ${MAKE_J} ${WATT_UTILS} for i in mkmake mkdep bin2c; do if ! [ -x ${WATT_UTILS}/$i ]; then echo "Unable to build Watt-32 tool '$i'. Make sure you have S-Lang installed." From e056685b19036ebd9459f781f60521c56baafeb8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 23 May 2022 16:47:30 +0200 Subject: [PATCH 459/536] set pkg-config path in setenv script --- script/finalize.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/finalize.sh b/script/finalize.sh index 4997a1c..027d2f1 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -28,6 +28,8 @@ export PATH="${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH" export GCC_EXEC_PREFIX="${PREFIX}/lib/gcc/" export MANPATH="${PREFIX}/${TARGET}/share/man:${PREFIX}/share/man:\$MANPATH" export INFOPATH="${PREFIX}/${TARGET}/share/info:${PREFIX}/share/info:\$INFOPATH" +export PKG_CONFIG_LIBDIR="${PREFIX}/${TARGET}/lib/pkgconfig:${PREFIX}/${TARGET}/share/pkgconfig" +unset PKG_CONFIG_PATH STOP cat << STOP > ${BASE}/build/${TARGET}-setenv.cmd From d53af9b9f911bc7c5e4561200b44b34f36ef4417 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 28 May 2022 21:30:41 +0200 Subject: [PATCH 460/536] list M4 as dependency --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2898c15..92d675d 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Before running this script, you need to install these programs first: * bash (for FreeBSD) * python2 headers (for gdb) * python3 headers (for gdb >= 9.0) +* m4 Depending on your system, installation procedure maybe different. @@ -59,19 +60,19 @@ On Debian/Ubuntu, you can install these programs by : ```sh sudo apt-get update -sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev +sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev m4 ``` Fedora : ```sh -sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel +sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 ``` mingw-w64 (msys2) : ```sh -pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression +pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression m4 ``` ### Configuration From c1e277480b52966fd6f69054e22609110b542071 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Aug 2022 23:29:19 +0200 Subject: [PATCH 461/536] use msys2 perl on mingw-w64 (fixes #27) --- script/init.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/init.sh b/script/init.sh index 3c9acf6..9053175 100644 --- a/script/init.sh +++ b/script/init.sh @@ -57,6 +57,11 @@ else fi rm -f hello.c 2> /dev/null +# Make sure MSYS2 Perl is used on mingw-w64 (see issue #27) +case $(uname) in +MINGW*) export PERL=/usr/bin/perl ;; +esac + install_files() { ${SUDO} ${CP} -R -f "$@" From 9530ad04b7ca53c0ca37684b23cf1e99411a0ac2 Mon Sep 17 00:00:00 2001 From: nathanradavies <84192926+nathanradavies@users.noreply.github.com> Date: Tue, 31 May 2022 12:01:08 -0500 Subject: [PATCH 462/536] Update README.md Add notation concerning needing dos2unix to build djgpp. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 92d675d..cd44f2f 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Before running this script, you need to install these programs first: * python2 headers (for gdb) * python3 headers (for gdb >= 9.0) * m4 +* dos2unix Depending on your system, installation procedure maybe different. @@ -60,7 +61,7 @@ On Debian/Ubuntu, you can install these programs by : ```sh sudo apt-get update -sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev m4 +sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev m4 dos2unix ``` Fedora : From d7a173f00773d8d7fc0cef4fe0ff6455541d4766 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 11 Aug 2022 23:37:10 +0200 Subject: [PATCH 463/536] list dos2unix dependency for fedora/msys2 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd44f2f..3c70b6a 100644 --- a/README.md +++ b/README.md @@ -67,13 +67,13 @@ sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 g Fedora : ```sh -sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 +sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 dos2unix ``` mingw-w64 (msys2) : ```sh -pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression m4 +pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression m4 dos2unix ``` ### Configuration From 8c9b99009e796be1776399c83ff1dc818e91836d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Aug 2022 16:24:39 +0200 Subject: [PATCH 464/536] debian: use separate version numbers for binary packages --- .github/workflows/deploy.yml | 3 +- .gitignore | 9 ++ debian/Makefile | 5 +- debian/binutils-djgpp.install | 1 - debian/bionic/control | 105 ------------------ debian/changelog | 43 ++++--- debian/control | 55 +++++++-- .../{djgpp.copyright => djgpp-dev.copyright} | 0 debian/djgpp-dev.install | 11 ++ debian/{djgpp.install => djgpp-utils.install} | 12 -- debian/gcc-djgpp.install | 1 - debian/libwatt-djgpp-dev.install | 1 - debian/rules | 32 ++++++ 13 files changed, 127 insertions(+), 151 deletions(-) delete mode 100644 debian/bionic/control rename debian/{djgpp.copyright => djgpp-dev.copyright} (100%) create mode 100644 debian/djgpp-dev.install rename debian/{djgpp.install => djgpp-utils.install} (55%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d0ba3f5..9d19cbd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,8 +39,7 @@ jobs: run: | mv debian/Makefile . mv debian/pgp-secret.asc /tmp/ - sed -i "s/UBUNTU_VERSION/$UBUNTU_VERSION/g" debian/changelog - if [ -d debian/$UBUNTU_VERSION ]; then cp debian/$UBUNTU_VERSION/* debian/; fi + sed -i "s/unstable/$UBUNTU_VERSION/g" debian/changelog - name: Make source package run: | diff --git a/.gitignore b/.gitignore index 01f9cf1..b55146b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,12 @@ build/ download/ install/ /Makefile +debian/*/* +debian/*.log +debian/*.substvars +debian/files +debian/debhelper-build-stamp +debian/*copyright +!debian/source/ +!debian/djgpp-dev.copyright +!debian/gcc-djgpp.copyright diff --git a/debian/Makefile b/debian/Makefile index fdc6f79..62448d3 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -8,13 +8,14 @@ build: install: sed -i 's/\/usr\/bin\/i386/usr\/bin\/i386/' install/usr/bin/i386-pc-msdosdjgpp-link-i586 cd install && ./usr/bin/i386-pc-msdosdjgpp-link-i586 - cp -rp install/* $(DESTDIR)/ + mv install/* $(DESTDIR)/ clean: cp LICENSE debian/copyright cp LICENSE debian/binutils-djgpp.copyright cp LICENSE debian/gdb-djgpp.copyright - cp debian/djgpp.copyright debian/djgpp-doc.copyright + cp debian/djgpp-dev.copyright debian/djgpp-utils.copyright + cp debian/djgpp-dev.copyright debian/djgpp-doc.copyright cp debian/gcc-djgpp.copyright debian/gcc-djgpp-doc.copyright cp debian/gcc-djgpp.copyright debian/gcc-djgpp-extra.copyright cp debian/binutils-djgpp.copyright debian/binutils-djgpp-doc.copyright diff --git a/debian/binutils-djgpp.install b/debian/binutils-djgpp.install index 37cfc17..1211c9b 100644 --- a/debian/binutils-djgpp.install +++ b/debian/binutils-djgpp.install @@ -31,4 +31,3 @@ usr/bin/i*86-pc-msdosdjgpp-as usr/bin/i*86-pc-msdosdjgpp-nm usr/bin/i*86-pc-msdosdjgpp-elfedit usr/bin/i*86-pc-msdosdjgpp-objdump -usr/i*86-pc-msdosdjgpp/etc/build-gcc/binutils-version diff --git a/debian/bionic/control b/debian/bionic/control deleted file mode 100644 index f98da4b..0000000 --- a/debian/bionic/control +++ /dev/null @@ -1,105 +0,0 @@ -Source: djgpp-toolchain -Section: devel -Priority: optional -Maintainer: jwt27 -Build-Depends: - git, - bash, - make, - unzip, - wget, - bison, - flex, - texinfo, - patch, - tar, - xz-utils, - bzip2, - gzip, - dos2unix, - zlib1g-dev, - nasm, - libslang2-dev, - pkg-config, - debhelper (>= 11) -Standards-Version: 4.1.2 -Homepage: https://github.com/jwt27/build-gcc - -Package: djgpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: binutils-djgpp, gcc-djgpp -Suggests: djgpp-doc -Description: DJGPP C library and utilities - Required for gcc-djgpp. - -Package: djgpp-doc -Architecture: all -Depends: ${misc:Depends} -Suggests: djgpp -Description: Documentation for djgpp - -Package: gcc-djgpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp -Suggests: gcc-djgpp-doc, gcc-djgpp-extra -Description: GNU Compiler Collection - Cross-compiler targeting djgpp. Supports C and C++. - -Package: gcc-djgpp-doc -Architecture: all -Depends: ${misc:Depends} -Suggests: gcc-djgpp -Conflicts: gcc-doc -Description: Documentation for gcc-djgpp - -Package: gcc-djgpp-extra -Architecture: all -Depends: ${misc:Depends} -Recommends: gcc-djgpp -Suggests: gdb-djgpp -Description: Extra files for gcc - Python pretty-printer script files for use with gdb. - May conflict with system gcc. - -Package: binutils-djgpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: djgpp -Suggests: binutils-djgpp-doc -Description: GNU Binutils - Linker, assembler and other binary utilities targeting djgpp. - -Package: binutils-djgpp-doc -Architecture: all -Depends: ${misc:Depends} -Suggests: binutils-djgpp -Conflicts: binutils-doc -Description: Documentation for binutils-djgpp. - -Package: gdb-djgpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Suggests: gdb-djgpp-doc, gcc-djgpp-extra -Description: GNU Debugger - Used to debug djgpp programs over a serial connection. - -Package: gdb-djgpp-doc -Architecture: all -Depends: ${misc:Depends} -Suggests: gdb-djgpp -Conflicts: gdb-doc -Description: Documentation for gdb-djgpp - -Package: gdb-djgpp-extra -Architecture: all -Depends: ${misc:Depends} -Recommends: gdb-djgpp -Description: Extra files for gdb-djgpp - May conflict with system gdb. - -Package: libwatt-djgpp-dev -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: djgpp, gcc-djgpp -Description: Watt-32 TCP socket library for DJGPP diff --git a/debian/changelog b/debian/changelog index 98eb557..a7e9ca6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,96 +1,107 @@ -djgpp-toolchain (0.20220523.0+gcc12.1.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (1~unstable) unstable; urgency=low + + * Binary packages for each component now have correct version numbers, and + the source package version is changed to just a single number. + * As a result of the above change, binutils-djgpp from this package now + overrides the one that comes with Debian. + * Target libraries are no longer stripped. + * Package 'djgpp' has been split into 'djgpp-dev' and 'djgpp-utils'. + + -- jwt27 Mon, 15 Aug 2022 16:24:08 +0200 + +djgpp-toolchain (0.20220523.0+gcc12.1.0+bnu2.38.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * gcc version 12.1.0 -- jwt27 Mon, 23 May 2022 16:43:08 +0200 -djgpp-toolchain (0.20220317.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20220317.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * fix build on i386. -- jwt27 Thu, 17 Mar 2022 00:53:38 +0100 -djgpp-toolchain (0.20220316.2+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20220316.2+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * new package: libwatt-djgpp-dev -- jwt27 Wed, 16 Mar 2022 19:08:24 +0100 -djgpp-toolchain (0.20220215.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20220215.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * binutils version 2.38. -- jwt27 Tue, 15 Feb 2022 17:49:47 +0100 -djgpp-toolchain (0.20211110.0+gcc10.3.0+bnu2.37.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20211110.0+gcc10.3.0+bnu2.37.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * gcc version 10.3.0. * binutils version 2.37. -- jwt27 Wed, 10 Nov 2021 11:35:08 +0100 -djgpp-toolchain (0.20210430.0+gcc10.2.0+bnu2.36.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20210430.0+gcc10.2.0+bnu2.36.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low * binutils version 2.36.1. -- jwt27 Fri, 30 Apr 2021 20:55:58 +0200 -djgpp-toolchain (0.20210203.0+gcc10.2.0+bnu2.36.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20210203.0+gcc10.2.0+bnu2.36.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * binutils version 2.36. -- jwt27 Wed, 03 Feb 2021 00:14:56 +0100 -djgpp-toolchain (0.20201102.0+gcc10.2.0+bnu2.35.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20201102.0+gcc10.2.0+bnu2.35.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low * binutils version 2.35.1. -- jwt27 Mon, 02 Nov 2020 21:11:19 +0100 -djgpp-toolchain (0.20200730.0+gcc10.2.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20200730.0+gcc10.2.0+bnu2.34.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * gcc version 10.2.0. -- jwt27 Thu, 30 Jul 2020 12:36:44 +0200 -djgpp-toolchain (0.20200509.0+gcc10.1.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20200509.0+gcc10.1.0+bnu2.34.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * gcc version 10.1.0. -- jwt27 Sat, 09 May 2020 17:36:20 +0200 -djgpp-toolchain (0.20200505.0+gcc9.3.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20200505.0+gcc9.3.0+bnu2.34.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * gcc version 9.3.0. * patch binutils and gcc to use "b" flag for bss sections. -- jwt27 Tue, 05 May 2020 16:35:24 +0200 -djgpp-toolchain (0.20200310.0+gcc9.2.0+bnu2.34.0+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20200310.0+gcc9.2.0+bnu2.34.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low * binutils version 2.34. -- jwt27 Tue, 10 Mar 2020 21:31:14 +0100 -djgpp-toolchain (0.20200229.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20200229.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low * make gcc-djgpp in focal depend on 2.34-3ubuntu1+1.4 -- jwt27 Sat, 29 Feb 2020 16:37:17 +0100 -djgpp-toolchain (0.20200213.2+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20200213.2+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low * remove binutils-djgpp and binutils-djgpp-doc for focal and require upstream binutils-djgpp. -- jwt27 Thu, 13 Feb 2020 21:51:35 +0100 -djgpp-toolchain (0.20200213.1+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=low +djgpp-toolchain (0.20200213.1+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low * fix package names in control file. -- jwt27 Thu, 13 Feb 2020 16:27:55 +0100 -djgpp-toolchain (0.20200213.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~UBUNTU_VERSION) UBUNTU_VERSION; urgency=medium +djgpp-toolchain (0.20200213.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~unstable) unstable; urgency=medium * Initial Release. diff --git a/debian/control b/debian/control index 70e9687..04c2a73 100644 --- a/debian/control +++ b/debian/control @@ -25,26 +25,44 @@ Build-Depends: Standards-Version: 4.1.2 Homepage: https://github.com/jwt27/build-gcc -Package: djgpp +Package: djgpp-dev Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: binutils-djgpp, gcc-djgpp +Depends: ${misc:Depends} +Recommends: binutils-djgpp, gcc-djgpp, djgpp-utils Suggests: djgpp-doc -Description: DJGPP C library and utilities - Required for gcc-djgpp. +Breaks: djgpp +Replaces: djgpp +Description: DJGPP development kit -- libraries + +Package: djgpp-utils +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: binutils-djgpp, gcc-djgpp, djgpp-dev +Breaks: djgpp +Replaces: djgpp +Description: DJGPP development kit -- utilities + Various utilities used to develop djgpp applications: + * djasm + * dxegen + * dxe3gen + * dxe3res + * exe2coff + * stubedit + * stubify Package: djgpp-doc Architecture: all Depends: ${misc:Depends} -Suggests: djgpp -Description: Documentation for djgpp +Suggests: djgpp-dev +Description: DJGPP development kit -- documentation Package: gcc-djgpp Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp, binutils-djgpp (>= 2.34-3ubuntu1+1.4) +Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp-utils, binutils-djgpp (>= 2.35.2) +Recommends: djgpp-dev Suggests: gcc-djgpp-doc, gcc-djgpp-extra Description: GNU Compiler Collection - Cross-compiler targeting djgpp. Supports C and C++. + Cross-compiler targeting djgpp. Supports C and C++. Package: gcc-djgpp-doc Architecture: all @@ -62,6 +80,21 @@ Description: Extra files for gcc Python pretty-printer script files for use with gdb. May conflict with system gcc. +Package: binutils-djgpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: djgpp-utils +Suggests: binutils-djgpp-doc +Description: GNU Binutils + Linker, assembler and other binary utilities targeting djgpp. + +Package: binutils-djgpp-doc +Architecture: all +Depends: ${misc:Depends} +Suggests: binutils-djgpp +Conflicts: binutils-doc +Description: Documentation for binutils-djgpp. + Package: gdb-djgpp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -85,6 +118,6 @@ Description: Extra files for gdb-djgpp Package: libwatt-djgpp-dev Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: djgpp, gcc-djgpp +Depends: ${misc:Depends} +Recommends: djgpp-dev, gcc-djgpp Description: Watt-32 TCP socket library for DJGPP diff --git a/debian/djgpp.copyright b/debian/djgpp-dev.copyright similarity index 100% rename from debian/djgpp.copyright rename to debian/djgpp-dev.copyright diff --git a/debian/djgpp-dev.install b/debian/djgpp-dev.install new file mode 100644 index 0000000..61c801a --- /dev/null +++ b/debian/djgpp-dev.install @@ -0,0 +1,11 @@ +usr/i*86-pc-msdosdjgpp/lib/libg.a +usr/i*86-pc-msdosdjgpp/lib/libm.a +usr/i*86-pc-msdosdjgpp/lib/libemu.a +usr/i*86-pc-msdosdjgpp/lib/libpc.a +usr/i*86-pc-msdosdjgpp/lib/crt0.o +usr/i*86-pc-msdosdjgpp/lib/djgpp.djl +usr/i*86-pc-msdosdjgpp/lib/gcrt0.o +usr/i*86-pc-msdosdjgpp/lib/libc.a +usr/i*86-pc-msdosdjgpp/lib/libdbg.a +usr/i*86-pc-msdosdjgpp/lib/libtz.a +usr/i*86-pc-msdosdjgpp/sys-include/* diff --git a/debian/djgpp.install b/debian/djgpp-utils.install similarity index 55% rename from debian/djgpp.install rename to debian/djgpp-utils.install index 7554408..195b1c7 100644 --- a/debian/djgpp.install +++ b/debian/djgpp-utils.install @@ -1,15 +1,4 @@ -usr/i*86-pc-msdosdjgpp/lib/libg.a usr/i*86-pc-msdosdjgpp/lib/dxe.ld -usr/i*86-pc-msdosdjgpp/lib/libm.a -usr/i*86-pc-msdosdjgpp/lib/libemu.a -usr/i*86-pc-msdosdjgpp/lib/libpc.a -usr/i*86-pc-msdosdjgpp/lib/crt0.o -usr/i*86-pc-msdosdjgpp/lib/djgpp.djl -usr/i*86-pc-msdosdjgpp/lib/gcrt0.o -usr/i*86-pc-msdosdjgpp/lib/libc.a -usr/i*86-pc-msdosdjgpp/lib/libdbg.a -usr/i*86-pc-msdosdjgpp/lib/libtz.a -usr/i*86-pc-msdosdjgpp/sys-include/* usr/i*86-pc-msdosdjgpp/bin/stubedit usr/i*86-pc-msdosdjgpp/bin/dxe3gen usr/i*86-pc-msdosdjgpp/bin/dxe3res @@ -25,4 +14,3 @@ usr/bin/i*86-pc-msdosdjgpp-dxegen usr/bin/i*86-pc-msdosdjgpp-stubedit usr/bin/i*86-pc-msdosdjgpp-dxe3res usr/bin/i*86-pc-msdosdjgpp-setenv -usr/i*86-pc-msdosdjgpp/etc/build-gcc/djgpp-version diff --git a/debian/gcc-djgpp.install b/debian/gcc-djgpp.install index d63d00a..8b1c2de 100644 --- a/debian/gcc-djgpp.install +++ b/debian/gcc-djgpp.install @@ -24,4 +24,3 @@ usr/bin/i*86-pc-msdosdjgpp-gcc-ar usr/bin/i*86-pc-msdosdjgpp-g++-*.*.* usr/bin/i*86-pc-msdosdjgpp-gcov-dump usr/bin/i*86-pc-msdosdjgpp-gcov -usr/i*86-pc-msdosdjgpp/etc/build-gcc/gcc-version diff --git a/debian/libwatt-djgpp-dev.install b/debian/libwatt-djgpp-dev.install index bde7e1c..1561f1e 100644 --- a/debian/libwatt-djgpp-dev.install +++ b/debian/libwatt-djgpp-dev.install @@ -1,4 +1,3 @@ usr/i*86-pc-msdosdjgpp/watt/* usr/i*86-pc-msdosdjgpp/lib/libwatt.a usr/i*86-pc-msdosdjgpp/lib/libsocket.a -usr/i*86-pc-msdosdjgpp/etc/build-gcc/watt32-version diff --git a/debian/rules b/debian/rules index 46ee596..f4a8dce 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,39 @@ #!/usr/bin/make -f +include /usr/share/dpkg/pkg-info.mk + +SHELL := /usr/bin/bash + +SRC_VERSION := $(shell echo $(DEB_VERSION) | cut -d~ -f 1) + +git_date = $(shell date --date='$(shell cd $(1) && git log -1 --format=%cI)' -u +%4Y%m%d.%H%M) + +GCC_VERSION := $(shell source ./djgpp/gcc && echo $$GCC_VERSION) +BINUTILS_VERSION := $(shell source ./djgpp/binutils && echo $$BINUTILS_VERSION) +GDB_VERSION := $(shell source ./djgpp/gdb && echo $$GDB_VERSION) +DJGPP_VERSION := 2.05.cvs-$(call git_date, download/djgpp-cvs) +WATT32_VERSION := 2.2.11.git-$(call git_date, download/Watt-32) + %: dh $@ +override_dh_gencontrol: + dh_gencontrol + dh_gencontrol -pdjgpp-dev -- -v$(DJGPP_VERSION)+$(SRC_VERSION) + dh_gencontrol -pdjgpp-utils -- -v$(DJGPP_VERSION)+$(SRC_VERSION) + dh_gencontrol -pdjgpp-doc -- -v$(DJGPP_VERSION)+$(SRC_VERSION) + dh_gencontrol -pgcc-djgpp -- -v$(GCC_VERSION)+$(SRC_VERSION) + dh_gencontrol -pgcc-djgpp-doc -- -v$(GCC_VERSION)+$(SRC_VERSION) + dh_gencontrol -pgcc-djgpp-extra -- -v$(GCC_VERSION)+$(SRC_VERSION) + dh_gencontrol -pbinutils-djgpp -- -v$(BINUTILS_VERSION)+$(SRC_VERSION) + dh_gencontrol -pbinutils-djgpp-doc -- -v$(BINUTILS_VERSION)+$(SRC_VERSION) + dh_gencontrol -pgdb-djgpp -- -v$(GDB_VERSION)+$(SRC_VERSION) + dh_gencontrol -pgdb-djgpp-doc -- -v$(GDB_VERSION)+$(SRC_VERSION) + dh_gencontrol -pgdb-djgpp-extra -- -v$(GDB_VERSION)+$(SRC_VERSION) + dh_gencontrol -plibwatt-djgpp-dev -- -v$(WATT32_VERSION)+$(SRC_VERSION) + +override_dh_strip: + dh_strip --exclude=.a + override_dh_auto_build: CFLAGS=-O2 CXXFLAGS=-O2 CPPFLAGS= CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" dh_auto_build $@ From f3c4ed99ad781c7e3c6983aaf79db5d9d288e8f1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Aug 2022 16:40:04 +0200 Subject: [PATCH 465/536] drop PPA for ubuntu Impish --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9d19cbd..f4788a9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ubuntu-version: [ bionic, focal, impish, jammy, kinetic ] + ubuntu-version: [ bionic, focal, jammy, kinetic ] steps: - uses: actions/checkout@v2 From 93e4a354c8000d7065c12624d54dc02d07c7eee0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Aug 2022 16:44:23 +0200 Subject: [PATCH 466/536] correct bash path in debian/rules --- debian/changelog | 6 ++++++ debian/rules | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a7e9ca6..df176e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (2~unstable) unstable; urgency=low + + * Correct bash path in rules script. + + -- jwt27 Mon, 15 Aug 2022 16:41:32 +0200 + djgpp-toolchain (1~unstable) unstable; urgency=low * Binary packages for each component now have correct version numbers, and diff --git a/debian/rules b/debian/rules index f4a8dce..df8bccc 100755 --- a/debian/rules +++ b/debian/rules @@ -2,7 +2,7 @@ include /usr/share/dpkg/pkg-info.mk -SHELL := /usr/bin/bash +SHELL := /bin/bash SRC_VERSION := $(shell echo $(DEB_VERSION) | cut -d~ -f 1) From 1732d1ad12121120d93f1e3f01d0c586cf211fe8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Aug 2022 17:22:38 +0200 Subject: [PATCH 467/536] keep ubuntu release name in binary package version numbers --- .github/workflows/deploy.yml | 2 +- debian/changelog | 42 ++++++++++++++++++++---------------- debian/rules | 26 +++++++++++----------- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f4788a9..a9a0c88 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,7 +39,7 @@ jobs: run: | mv debian/Makefile . mv debian/pgp-secret.asc /tmp/ - sed -i "s/unstable/$UBUNTU_VERSION/g" debian/changelog + sed -i "s/) unstable/~$UBUNTU_VERSION) $UBUNTU_VERSION/g" debian/changelog - name: Make source package run: | diff --git a/debian/changelog b/debian/changelog index df176e8..2b0f50c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,16 @@ -djgpp-toolchain (2~unstable) unstable; urgency=low +djgpp-toolchain (3) unstable; urgency=low + + * Keep ubuntu release name in binary package version numbers. + + -- jwt27 Mon, 15 Aug 2022 17:21:34 +0200 + +djgpp-toolchain (2) unstable; urgency=low * Correct bash path in rules script. -- jwt27 Mon, 15 Aug 2022 16:41:32 +0200 -djgpp-toolchain (1~unstable) unstable; urgency=low +djgpp-toolchain (1) unstable; urgency=low * Binary packages for each component now have correct version numbers, and the source package version is changed to just a single number. @@ -15,99 +21,99 @@ djgpp-toolchain (1~unstable) unstable; urgency=low -- jwt27 Mon, 15 Aug 2022 16:24:08 +0200 -djgpp-toolchain (0.20220523.0+gcc12.1.0+bnu2.38.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20220523.0+gcc12.1.0+bnu2.38.0+gdb8.2.1+djcvs) unstable; urgency=low * gcc version 12.1.0 -- jwt27 Mon, 23 May 2022 16:43:08 +0200 -djgpp-toolchain (0.20220317.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20220317.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs) unstable; urgency=low * fix build on i386. -- jwt27 Thu, 17 Mar 2022 00:53:38 +0100 -djgpp-toolchain (0.20220316.2+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20220316.2+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs) unstable; urgency=low * new package: libwatt-djgpp-dev -- jwt27 Wed, 16 Mar 2022 19:08:24 +0100 -djgpp-toolchain (0.20220215.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20220215.0+gcc10.3.0+bnu2.38.0+gdb8.2.1+djcvs) unstable; urgency=low * binutils version 2.38. -- jwt27 Tue, 15 Feb 2022 17:49:47 +0100 -djgpp-toolchain (0.20211110.0+gcc10.3.0+bnu2.37.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20211110.0+gcc10.3.0+bnu2.37.0+gdb8.2.1+djcvs) unstable; urgency=low * gcc version 10.3.0. * binutils version 2.37. -- jwt27 Wed, 10 Nov 2021 11:35:08 +0100 -djgpp-toolchain (0.20210430.0+gcc10.2.0+bnu2.36.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20210430.0+gcc10.2.0+bnu2.36.1+gdb8.2.1+djcvs) unstable; urgency=low * binutils version 2.36.1. -- jwt27 Fri, 30 Apr 2021 20:55:58 +0200 -djgpp-toolchain (0.20210203.0+gcc10.2.0+bnu2.36.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20210203.0+gcc10.2.0+bnu2.36.0+gdb8.2.1+djcvs) unstable; urgency=low * binutils version 2.36. -- jwt27 Wed, 03 Feb 2021 00:14:56 +0100 -djgpp-toolchain (0.20201102.0+gcc10.2.0+bnu2.35.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20201102.0+gcc10.2.0+bnu2.35.1+gdb8.2.1+djcvs) unstable; urgency=low * binutils version 2.35.1. -- jwt27 Mon, 02 Nov 2020 21:11:19 +0100 -djgpp-toolchain (0.20200730.0+gcc10.2.0+bnu2.34.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20200730.0+gcc10.2.0+bnu2.34.0+gdb8.2.1+djcvs) unstable; urgency=low * gcc version 10.2.0. -- jwt27 Thu, 30 Jul 2020 12:36:44 +0200 -djgpp-toolchain (0.20200509.0+gcc10.1.0+bnu2.34.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20200509.0+gcc10.1.0+bnu2.34.0+gdb8.2.1+djcvs) unstable; urgency=low * gcc version 10.1.0. -- jwt27 Sat, 09 May 2020 17:36:20 +0200 -djgpp-toolchain (0.20200505.0+gcc9.3.0+bnu2.34.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20200505.0+gcc9.3.0+bnu2.34.0+gdb8.2.1+djcvs) unstable; urgency=low * gcc version 9.3.0. * patch binutils and gcc to use "b" flag for bss sections. -- jwt27 Tue, 05 May 2020 16:35:24 +0200 -djgpp-toolchain (0.20200310.0+gcc9.2.0+bnu2.34.0+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20200310.0+gcc9.2.0+bnu2.34.0+gdb8.2.1+djcvs) unstable; urgency=low * binutils version 2.34. -- jwt27 Tue, 10 Mar 2020 21:31:14 +0100 -djgpp-toolchain (0.20200229.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20200229.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) unstable; urgency=low * make gcc-djgpp in focal depend on 2.34-3ubuntu1+1.4 -- jwt27 Sat, 29 Feb 2020 16:37:17 +0100 -djgpp-toolchain (0.20200213.2+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20200213.2+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) unstable; urgency=low * remove binutils-djgpp and binutils-djgpp-doc for focal and require upstream binutils-djgpp. -- jwt27 Thu, 13 Feb 2020 21:51:35 +0100 -djgpp-toolchain (0.20200213.1+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~unstable) unstable; urgency=low +djgpp-toolchain (0.20200213.1+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) unstable; urgency=low * fix package names in control file. -- jwt27 Thu, 13 Feb 2020 16:27:55 +0100 -djgpp-toolchain (0.20200213.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs~unstable) unstable; urgency=medium +djgpp-toolchain (0.20200213.0+gcc9.2.0+bnu2.33.1+gdb8.2.1+djcvs) unstable; urgency=medium * Initial Release. diff --git a/debian/rules b/debian/rules index df8bccc..864b680 100755 --- a/debian/rules +++ b/debian/rules @@ -4,8 +4,6 @@ include /usr/share/dpkg/pkg-info.mk SHELL := /bin/bash -SRC_VERSION := $(shell echo $(DEB_VERSION) | cut -d~ -f 1) - git_date = $(shell date --date='$(shell cd $(1) && git log -1 --format=%cI)' -u +%4Y%m%d.%H%M) GCC_VERSION := $(shell source ./djgpp/gcc && echo $$GCC_VERSION) @@ -19,18 +17,18 @@ WATT32_VERSION := 2.2.11.git-$(call git_date, download/Watt-32) override_dh_gencontrol: dh_gencontrol - dh_gencontrol -pdjgpp-dev -- -v$(DJGPP_VERSION)+$(SRC_VERSION) - dh_gencontrol -pdjgpp-utils -- -v$(DJGPP_VERSION)+$(SRC_VERSION) - dh_gencontrol -pdjgpp-doc -- -v$(DJGPP_VERSION)+$(SRC_VERSION) - dh_gencontrol -pgcc-djgpp -- -v$(GCC_VERSION)+$(SRC_VERSION) - dh_gencontrol -pgcc-djgpp-doc -- -v$(GCC_VERSION)+$(SRC_VERSION) - dh_gencontrol -pgcc-djgpp-extra -- -v$(GCC_VERSION)+$(SRC_VERSION) - dh_gencontrol -pbinutils-djgpp -- -v$(BINUTILS_VERSION)+$(SRC_VERSION) - dh_gencontrol -pbinutils-djgpp-doc -- -v$(BINUTILS_VERSION)+$(SRC_VERSION) - dh_gencontrol -pgdb-djgpp -- -v$(GDB_VERSION)+$(SRC_VERSION) - dh_gencontrol -pgdb-djgpp-doc -- -v$(GDB_VERSION)+$(SRC_VERSION) - dh_gencontrol -pgdb-djgpp-extra -- -v$(GDB_VERSION)+$(SRC_VERSION) - dh_gencontrol -plibwatt-djgpp-dev -- -v$(WATT32_VERSION)+$(SRC_VERSION) + dh_gencontrol -pdjgpp-dev -- -v$(DJGPP_VERSION)+$(DEB_VERSION) + dh_gencontrol -pdjgpp-utils -- -v$(DJGPP_VERSION)+$(DEB_VERSION) + dh_gencontrol -pdjgpp-doc -- -v$(DJGPP_VERSION)+$(DEB_VERSION) + dh_gencontrol -pgcc-djgpp -- -v$(GCC_VERSION)+$(DEB_VERSION) + dh_gencontrol -pgcc-djgpp-doc -- -v$(GCC_VERSION)+$(DEB_VERSION) + dh_gencontrol -pgcc-djgpp-extra -- -v$(GCC_VERSION)+$(DEB_VERSION) + dh_gencontrol -pbinutils-djgpp -- -v$(BINUTILS_VERSION)+$(DEB_VERSION) + dh_gencontrol -pbinutils-djgpp-doc -- -v$(BINUTILS_VERSION)+$(DEB_VERSION) + dh_gencontrol -pgdb-djgpp -- -v$(GDB_VERSION)+$(DEB_VERSION) + dh_gencontrol -pgdb-djgpp-doc -- -v$(GDB_VERSION)+$(DEB_VERSION) + dh_gencontrol -pgdb-djgpp-extra -- -v$(GDB_VERSION)+$(DEB_VERSION) + dh_gencontrol -plibwatt-djgpp-dev -- -v$(WATT32_VERSION)+$(DEB_VERSION) override_dh_strip: dh_strip --exclude=.a From 2b4905168b949bcee9faf354614ebc2d1ecab477 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 15 Aug 2022 23:34:52 +0200 Subject: [PATCH 468/536] make djgpp-cvs the default version --- djgpp/djgpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djgpp/djgpp b/djgpp/djgpp index 5e947ba..ffe2eee 100644 --- a/djgpp/djgpp +++ b/djgpp/djgpp @@ -1 +1 @@ -source djgpp/djgpp-2.05 +source djgpp/djgpp-cvs From c89051434824cf80631dd421b9cf5b19ba789503 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 16 Aug 2022 17:43:07 +0200 Subject: [PATCH 469/536] enhance setenv script --- README.md | 79 ++++++++++++++++++++++++++++++---------------- debian/changelog | 7 ++++ debian/control | 1 + script/finalize.sh | 39 +++++++++++++++++++---- 4 files changed, 91 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 3c70b6a..63f3bb4 100644 --- a/README.md +++ b/README.md @@ -59,21 +59,21 @@ Depending on your system, installation procedure maybe different. On Debian/Ubuntu, you can install these programs by : -```sh -sudo apt-get update -sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev m4 dos2unix +```console +$ sudo apt-get update +$ sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev m4 dos2unix ``` Fedora : -```sh -sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 dos2unix +```console +$ sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 dos2unix ``` mingw-w64 (msys2) : -```sh -pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression m4 dos2unix +```console +$ pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression m4 dos2unix ``` ### Configuration @@ -115,47 +115,70 @@ build-avr.sh # builds a toolchain targeting AVR microcontrollers (fixed T ``` To build DJGPP, just run: -```sh -./build-djgpp.sh [options...] [packages...] +```console +$ ./build-djgpp.sh [options...] [packages...] ``` Run with no arguments to see a list of supported packages and versions. For example, to build gcc 9.2.0 with the latest djgpp C library from CVS and latest binutils: -```sh -./build-djgpp.sh --prefix=/usr/local djgpp-cvs binutils gcc-9.2.0 +```console +$ ./build-djgpp.sh --prefix=/usr/local djgpp-cvs binutils gcc-9.2.0 ``` To install or upgrade all packages: -```sh -./build-djgpp.sh --prefix=/usr/local all +```console +$ ./build-djgpp.sh --prefix=/usr/local all ``` It will download all necessary files, build DJGPP compiler, binutils, and gdb, and install it. ### Using -In order to use your new compiler, you must add its `bin/` directory to your `PATH`. -You can then access the compiler through its target-prefixed name: (`$PREFIX` and `$TARGET` in these examples are the variables you used to build) +(In the following examples, it is assumed that you built the toolchain with +options `--prefix=/home/me/.local` and `--target=i386-pc-msdosdjgpp`. +Substitute as necessary for your configuration.) -```sh -$ PATH=$PREFIX/bin/:$PATH -$ $TARGET-g++ hello.cpp +To use your new compiler, you must add its `bin` directory to your `PATH`. +You can then access the toolchain through its target-prefixed name: + +```console +$ PATH="/home/me/.local/bin:$PATH" +$ i386-pc-msdosdjgpp-g++ hello.cpp ``` -To use the short name variant, and access documentation with `man` and `info`, use the installed setenv script: +A `setenv` script will also be installed. This sets up environment variables +so that you can use the toolchain as if you were working on the target machine. +The toolchain utilities are then accessible through their short names (`gcc`, +`ld`, etc), and you can access target-specific documentation and locate target +libraries (via `man`/`info` and `pkg-config`, respectively). + +This script can be used either with no arguments, to start a new shell: + +```console +$ i386-pc-msdosdjgpp-setenv +Entering new shell for target environment: i386-pc-msdosdjgpp +$ which gcc +/home/me/.local/i386-pc-msdosdjgpp/bin//gcc +$ gcc -v 2>&1 | grep 'Target' +Target: i386-pc-msdosdjgpp +``` -```sh -$ source $TARGET-setenv -$ g++ hello.cpp +With a single command: + +```console +$ i386-pc-msdosdjgpp-setenv info libc + # (shows documentation for djgpp's C library) ``` -If you are using Windows command prompt : +Or `source`d into the current shell: (Bash only) -```bat -> PATH=$PREFIX/bin;%PATH% -> $TARGET-g++ hello.cpp -> $TARGET-setenv -> g++ hello.cpp +```console +$ which gcc +/usr/bin/gcc +$ source i386-pc-msdosdjgpp-setenv +Environment variables set up for target: i386-pc-msdosdjgpp +$ which gcc +/home/me/.local/i386-pc-msdosdjgpp/bin/gcc ``` ### Supported DJGPP utilities diff --git a/debian/changelog b/debian/changelog index 2b0f50c..f3517ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +djgpp-toolchain (4) unstable; urgency=low + + * Enhanced setenv script. It now has the ability to start a new shell or + execute an single command in the target environment. + + -- jwt27 Tue, 16 Aug 2022 18:51:10 +0200 + djgpp-toolchain (3) unstable; urgency=low * Keep ubuntu release name in binary package version numbers. diff --git a/debian/control b/debian/control index 04c2a73..e63b442 100644 --- a/debian/control +++ b/debian/control @@ -47,6 +47,7 @@ Description: DJGPP development kit -- utilities * dxe3gen * dxe3res * exe2coff + * setenv * stubedit * stubify diff --git a/script/finalize.sh b/script/finalize.sh index 027d2f1..a3c94c4 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -19,12 +19,26 @@ popd cat << STOP > ${BASE}/build/${TARGET}-setenv #!/usr/bin/env bash -if ! (return 2> /dev/null); then - echo "This script must be executed with 'source' to set environment variables:" - echo "source \$0" - exit 1 -fi -export PATH="${PREFIX}/${TARGET}/bin/:${PREFIX}/bin/:\$PATH" +case "\$1" in +-*) cat << EOF >&2 +Usage: [source] \$(basename \$0) [command [arguments ...]] + +Set up environment variables for convenient access to the cross-compiling +toolchain targeting ${TARGET}. +This allows you to invoke the toolchain utilities via their short names (eg. +'gcc'), access target-specific documentation via 'man' and 'info', and locate +target libraries via 'pkg-config'. + +This script may be invoked in one of three ways: + * With no arguments: starts a new shell. + * With a command : executes the specified command. + * Via 'source' : exports variables into the current shell (Bash only). +EOF +exit 1 +;; +esac + +export PATH="${PREFIX}/${TARGET}/bin:${PREFIX}/bin:\$PATH" export GCC_EXEC_PREFIX="${PREFIX}/lib/gcc/" export MANPATH="${PREFIX}/${TARGET}/share/man:${PREFIX}/share/man:\$MANPATH" export INFOPATH="${PREFIX}/${TARGET}/share/info:${PREFIX}/share/info:\$INFOPATH" @@ -67,6 +81,18 @@ if [ ! -z "$(get_version watt32)" ]; then install_files ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 fi +cat << STOP >> ${BASE}/build/${TARGET}-setenv +if [ -z "\$BASH_VERSION" ] || [ "\${BASH_SOURCE[0]}" = "\$0" ]; then + if [ ! -z "\$1" ]; then + exec "\$@" + else + echo 'Entering new shell for target environment: ${TARGET}' >&2 + exec \$SHELL + fi +fi +echo 'Environment variables set up for target: ${TARGET}' >&2 +STOP + case $TARGET in i586-pc-msdosdjgpp) ;; *-pc-msdosdjgpp) cat << STOP > ${BASE}/build/${TARGET}-link-i586 @@ -80,7 +106,6 @@ STOP chmod +x ${BASE}/build/${TARGET}-link-i586 install_files ${BASE}/build/${TARGET}-link-i586 ${DST}/bin/ ;; -*) ;; esac echo "Installing ${TARGET}-setenv" From 940d915677836a23c19de87751e1ec521a6964fa Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Aug 2022 22:52:47 +0200 Subject: [PATCH 470/536] add gcc 12.2.0 --- README.md | 4 ++-- common/gcc | 2 +- common/gcc-12.2.0 | 12 ++++++++++++ debian/changelog | 6 ++++++ djgpp/gcc | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 common/gcc-12.2.0 diff --git a/README.md b/README.md index 63f3bb4..15b9bc7 100644 --- a/README.md +++ b/README.md @@ -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 2022-05-23: +### Current package versions, as of 2022-08-23: -* gcc 12.1.0 +* gcc 12.2.0 * binutils 2.38 * gdb 12.1 * djgpp 2.05 / cvs diff --git a/common/gcc b/common/gcc index e18231e..5fcb86e 100644 --- a/common/gcc +++ b/common/gcc @@ -1 +1 @@ -source common/gcc-12.1.0 +source common/gcc-12.2.0 diff --git a/common/gcc-12.2.0 b/common/gcc-12.2.0 new file mode 100644 index 0000000..e7e0269 --- /dev/null +++ b/common/gcc-12.2.0 @@ -0,0 +1,12 @@ +GCC_VERSION=12.2.0 +GCC_VERSION_SHORT=12.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}" diff --git a/debian/changelog b/debian/changelog index f3517ec..abf80aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (5) unstable; urgency=low + + * gcc version 12.2.0 + + -- jwt27 Tue, 23 Aug 2022 22:48:50 +0200 + djgpp-toolchain (4) unstable; urgency=low * Enhanced setenv script. It now has the ability to start a new shell or diff --git a/djgpp/gcc b/djgpp/gcc index e18231e..8a63372 100644 --- a/djgpp/gcc +++ b/djgpp/gcc @@ -1 +1 @@ -source common/gcc-12.1.0 +source common/gcc From 0d0d5a8a48e91ab12010887e15af960c3667f456 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 23 Aug 2022 22:54:48 +0200 Subject: [PATCH 471/536] add binutils 2.39 --- README.md | 2 +- binutils/binutils | 2 +- binutils/binutils-2.39 | 2 ++ debian/changelog | 1 + djgpp/binutils | 2 +- djgpp/binutils-2.39 | 1 + 6 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 binutils/binutils-2.39 create mode 100644 djgpp/binutils-2.39 diff --git a/README.md b/README.md index 15b9bc7..5f50740 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you require compatibility with distributions that use `i586`, you can either: ### Current package versions, as of 2022-08-23: * gcc 12.2.0 -* binutils 2.38 +* binutils 2.39 * gdb 12.1 * djgpp 2.05 / cvs * watt-32 git diff --git a/binutils/binutils b/binutils/binutils index af3b2a9..b64a522 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.38 +source binutils/binutils-2.39 diff --git a/binutils/binutils-2.39 b/binutils/binutils-2.39 new file mode 100644 index 0000000..412728e --- /dev/null +++ b/binutils/binutils-2.39 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.39 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/debian/changelog b/debian/changelog index abf80aa..b2ef36c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ djgpp-toolchain (5) unstable; urgency=low * gcc version 12.2.0 + * binutils version 2.39 -- jwt27 Tue, 23 Aug 2022 22:48:50 +0200 diff --git a/djgpp/binutils b/djgpp/binutils index c3833ad..4ccbc02 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.38 +source djgpp/binutils-2.39 diff --git a/djgpp/binutils-2.39 b/djgpp/binutils-2.39 new file mode 100644 index 0000000..b64a522 --- /dev/null +++ b/djgpp/binutils-2.39 @@ -0,0 +1 @@ +source binutils/binutils-2.39 From e1e6a876e9f0849d905c72d8aed5c83599af388e Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 18 Sep 2022 17:25:42 +0200 Subject: [PATCH 472/536] export {C,CXX}FLAGS_FOR_TARGET --- script/init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/init.sh b/script/init.sh index 9053175..b930b3c 100644 --- a/script/init.sh +++ b/script/init.sh @@ -46,8 +46,8 @@ else HOST_CXX=${CXX} fi -CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} -CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} +export CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} +export CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} # check if cp understands --preserve (for MacOS) if cp --preserve=mode,timestamps script/hello.c ./hello.c > /dev/null 2>&1; then From b1168668a0a12f36b4c5cf5e31db4c77c4e1bbb0 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 17 Sep 2022 23:46:37 +0200 Subject: [PATCH 473/536] improve debian package system --- .github/workflows/deploy.yml | 15 ---------- debian/Makefile | 27 ------------------ debian/changelog | 7 +++++ debian/rules | 38 ++++++++++++++++++++++---- script/download.sh | 53 +++++++++++++++++++++++++++--------- 5 files changed, 79 insertions(+), 61 deletions(-) delete mode 100644 debian/Makefile diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a9a0c88..b74d8f5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,25 +19,10 @@ jobs: sudo apt-get update sudo apt-get install curl git debhelper devscripts dput gpg - - name: Download sources - run: | - ./build-djgpp.sh --batch --build-deb --only-download --ignore-dependencies djgpp-cvs binutils gcc gdb watt32 - - - name: Pack git sources - run: | - find download/*/* ! -wholename '*/.git/*' -delete || true - cd download/ - for DIR in */; do - DIR=${DIR%/} - tar -c -f $DIR-git.tar $DIR - done - rm -rf */ - - name: Setup package files env: UBUNTU_VERSION: ${{ matrix.ubuntu-version }} run: | - mv debian/Makefile . mv debian/pgp-secret.asc /tmp/ sed -i "s/) unstable/~$UBUNTU_VERSION) $UBUNTU_VERSION/g" debian/changelog diff --git a/debian/Makefile b/debian/Makefile deleted file mode 100644 index 62448d3..0000000 --- a/debian/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -PACKAGES=djgpp-cvs binutils gcc gdb watt32 - -all: build - -build: - ./build-djgpp.sh --batch --build-deb --no-download --prefix=/usr --destdir=`pwd`/install $(PACKAGES) - -install: - sed -i 's/\/usr\/bin\/i386/usr\/bin\/i386/' install/usr/bin/i386-pc-msdosdjgpp-link-i586 - cd install && ./usr/bin/i386-pc-msdosdjgpp-link-i586 - mv install/* $(DESTDIR)/ - -clean: - cp LICENSE debian/copyright - cp LICENSE debian/binutils-djgpp.copyright - cp LICENSE debian/gdb-djgpp.copyright - cp debian/djgpp-dev.copyright debian/djgpp-utils.copyright - cp debian/djgpp-dev.copyright debian/djgpp-doc.copyright - cp debian/gcc-djgpp.copyright debian/gcc-djgpp-doc.copyright - cp debian/gcc-djgpp.copyright debian/gcc-djgpp-extra.copyright - cp debian/binutils-djgpp.copyright debian/binutils-djgpp-doc.copyright - cp debian/gdb-djgpp.copyright debian/gdb-djgpp-doc.copyright - cp debian/gdb-djgpp.copyright debian/gdb-djgpp-extra.copyright - -rm -rf build/ install/ - -find download/*/* ! -wholename '*/.git/*' -delete - -.PHONY: all build install clean diff --git a/debian/changelog b/debian/changelog index b2ef36c..76ab21c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +djgpp-toolchain (6) unstable; urgency=low + + * Improve Debian package system. + * Compile target libraries with '-ffunction-sections -fdata-sections'. + + -- jwt27 Sun, 18 Sep 2022 17:29:03 +0200 + djgpp-toolchain (5) unstable; urgency=low * gcc version 12.2.0 diff --git a/debian/rules b/debian/rules index 864b680..dfe07a0 100755 --- a/debian/rules +++ b/debian/rules @@ -4,13 +4,15 @@ include /usr/share/dpkg/pkg-info.mk SHELL := /bin/bash +PACKAGES := djgpp-cvs binutils gcc gdb watt32 + git_date = $(shell date --date='$(shell cd $(1) && git log -1 --format=%cI)' -u +%4Y%m%d.%H%M) -GCC_VERSION := $(shell source ./djgpp/gcc && echo $$GCC_VERSION) -BINUTILS_VERSION := $(shell source ./djgpp/binutils && echo $$BINUTILS_VERSION) -GDB_VERSION := $(shell source ./djgpp/gdb && echo $$GDB_VERSION) -DJGPP_VERSION := 2.05.cvs-$(call git_date, download/djgpp-cvs) -WATT32_VERSION := 2.2.11.git-$(call git_date, download/Watt-32) +GCC_VERSION = $(shell source ./djgpp/gcc && echo $$GCC_VERSION) +BINUTILS_VERSION = $(shell source ./djgpp/binutils && echo $$BINUTILS_VERSION) +GDB_VERSION = $(shell source ./djgpp/gdb && echo $$GDB_VERSION) +DJGPP_VERSION = 2.05.cvs-$(call git_date, download/djgpp-cvs) +WATT32_VERSION = 2.2.11.git-$(call git_date, download/Watt-32) %: dh $@ @@ -33,5 +35,29 @@ override_dh_gencontrol: override_dh_strip: dh_strip --exclude=.a +override_dh_auto_clean: + cp LICENSE debian/copyright + cp LICENSE debian/binutils-djgpp.copyright + cp LICENSE debian/gdb-djgpp.copyright + cp debian/djgpp-dev.copyright debian/djgpp-utils.copyright + cp debian/djgpp-dev.copyright debian/djgpp-doc.copyright + cp debian/gcc-djgpp.copyright debian/gcc-djgpp-doc.copyright + cp debian/gcc-djgpp.copyright debian/gcc-djgpp-extra.copyright + cp debian/binutils-djgpp.copyright debian/binutils-djgpp-doc.copyright + cp debian/gdb-djgpp.copyright debian/gdb-djgpp-doc.copyright + cp debian/gdb-djgpp.copyright debian/gdb-djgpp-extra.copyright + ./build-djgpp.sh --batch --build-deb --only-download $(PACKAGES) + -rm -rf build/ install/ + +override_dh_auto_configure: + override_dh_auto_build: - CFLAGS=-O2 CXXFLAGS=-O2 CPPFLAGS= CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" dh_auto_build $@ + CFLAGS="$(CFLAGS) -Wno-error=format-security" \ + CXXFLAGS="$(CXXFLAGS) -Wno-error=format-security" \ + ./build-djgpp.sh --batch --build-deb --no-download --prefix=/usr --destdir=$(CURDIR)/install $(PACKAGES) + +override_dh_auto_install: + sed -i 's#in /#in #' install/usr/bin/i386-pc-msdosdjgpp-link-i586 + cd install/ && ./usr/bin/i386-pc-msdosdjgpp-link-i586 + mkdir -p debian/tmp + mv -f install/* debian/tmp/ diff --git a/script/download.sh b/script/download.sh index a31895e..d2ba63e 100644 --- a/script/download.sh +++ b/script/download.sh @@ -5,10 +5,30 @@ ARCHIVE_LIST="$BINUTILS_ARCHIVE $DJCRX_ARCHIVE $DJLSR_ARCHIVE $DJDEV_ARCHIVE $AVRLIBC_ARCHIVE $AVRLIBC_DOC_ARCHIVE $AVRDUDE_ARCHIVE $AVARICE_ARCHIVE $GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE $ISL_ARCHIVE" +# these variables are of the form "git://url/repo.git::branch" +# if 'branch' is empty then the default branch is checked out. +GIT_LIST="$DJGPP_GIT $GCC_GIT $BINUTILS_GIT $NEWLIB_GIT $SIMULAVR_GIT $WATT32_GIT" + +mkdir -p download +cd download/ || exit 1 + +# Remove files that don't belong in the Debian package. +if [ ! -z "$BUILD_DEB" ]; then + for FILE in $(find * -maxdepth 0 -type f); do + for ARCHIVE in $ARCHIVE_LIST; do + [ "$FILE" == "$(basename $ARCHIVE)" ] && continue 2 + done + for REPO in $GIT_LIST; do + REPO=${REPO%::*} + REPO=${REPO%.*} + [ "$FILE" == "$(basename $REPO)-git.tar" ] && continue 2 + done + rm -f $FILE + done +fi + if [ -z ${NO_DOWNLOAD} ]; then echo "Download source files..." - mkdir -p download - cd download || exit 1 for ARCHIVE in $ARCHIVE_LIST; do FILE=`basename $ARCHIVE` @@ -35,13 +55,10 @@ if [ -z ${NO_DOWNLOAD} ]; then done fi done - cd .. fi download_git() { - mkdir -p ${BASE}/download - pushd ${BASE}/download || exit 1 local repo=$(basename $1) repo=${repo%.*} if [ ! -d $repo/ ] || [ "`cd $repo/ && git remote get-url origin`" != "$1" ]; then @@ -68,29 +85,39 @@ download_git() git reset --hard origin/$2 || exit 1 fi fi + cd ${BASE}/download/ || exit 1 + if [ ! -z ${ONLY_DOWNLOAD} ] && [ ! -z ${BUILD_DEB} ]; then + # Pack git sources for Debian package. + find $repo/* ! -wholename '*/.git/*' -delete 2>&1 > /dev/null + tar -c -f $repo-git.tar $repo + return + fi mkdir -p ${BASE}/build rm -rf ${BASE}/build/$repo - ln -fs ../download/$repo ${BASE}/build/$repo - popd + ln -fs ../download/$repo ${BASE}/build/$repo || exit 1 } -# these variables are of the form "git://url/repo.git::branch" -# if 'branch' is empty then the default branch is checked out. -GIT_LIST="$DJGPP_GIT $GCC_GIT $BINUTILS_GIT $NEWLIB_GIT $SIMULAVR_GIT $WATT32_GIT" - for REPO in $GIT_LIST; do download_git ${REPO%::*} ${REPO##*::} done for ARCHIVE in $ARCHIVE_LIST; do FILE=`basename $ARCHIVE` - if ! [ -f download/$FILE ]; then + if ! [ -f $FILE ]; then echo "Missing: $FILE" exit 1 fi done -[ ! -z ${ONLY_DOWNLOAD} ] && exit 0 +if [ ! -z ${ONLY_DOWNLOAD} ]; then + if [ ! -z ${BUILD_DEB} ]; then + # Remove git sources that don't belong in the Debian package. + rm -rf ${BASE}/download/*/ + fi + exit 0 +fi + +cd ${BASE}/ || exit 1 echo "Creating install directory: ${DST}" [ -d ${DST} ] || ${SUDO} mkdir -p ${DST} || exit 1 From cc01ee2b85a0cadfa4ca201caf4a72ac4f8354c2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 18 Sep 2022 20:02:31 +0200 Subject: [PATCH 474/536] debian: configure gcc with --libexecdir=/usr/lib --- debian/changelog | 3 ++- debian/gcc-djgpp.install | 1 - debian/rules | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 76ab21c..a70d46b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ djgpp-toolchain (6) unstable; urgency=low * Improve Debian package system. * Compile target libraries with '-ffunction-sections -fdata-sections'. + * Configure gcc with '--libexecdir=/usr/lib'. - -- jwt27 Sun, 18 Sep 2022 17:29:03 +0200 + -- jwt27 Sun, 18 Sep 2022 20:00:31 +0200 djgpp-toolchain (5) unstable; urgency=low diff --git a/debian/gcc-djgpp.install b/debian/gcc-djgpp.install index 8b1c2de..12dbb59 100644 --- a/debian/gcc-djgpp.install +++ b/debian/gcc-djgpp.install @@ -1,4 +1,3 @@ -usr/libexec/gcc/i*86-pc-msdosdjgpp/* usr/lib/gcc/i*86-pc-msdosdjgpp/* usr/i*86-pc-msdosdjgpp/bin/g++ usr/i*86-pc-msdosdjgpp/bin/gcc-nm diff --git a/debian/rules b/debian/rules index dfe07a0..9e8549d 100755 --- a/debian/rules +++ b/debian/rules @@ -52,6 +52,7 @@ override_dh_auto_clean: override_dh_auto_configure: override_dh_auto_build: + GCC_CONFIGURE_OPTIONS='--libexecdir=/usr/lib' \ CFLAGS="$(CFLAGS) -Wno-error=format-security" \ CXXFLAGS="$(CXXFLAGS) -Wno-error=format-security" \ ./build-djgpp.sh --batch --build-deb --no-download --prefix=/usr --destdir=$(CURDIR)/install $(PACKAGES) From a199e7f26bce618526983c6e99b4af0a6f3be73b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 18 Sep 2022 23:47:22 +0200 Subject: [PATCH 475/536] debian: add convenience package 'djgpp' --- debian/changelog | 3 ++- debian/control | 19 +++++++++++++++---- debian/djgpp.install | 0 debian/rules | 1 + 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 debian/djgpp.install diff --git a/debian/changelog b/debian/changelog index a70d46b..9360289 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,9 @@ djgpp-toolchain (6) unstable; urgency=low * Improve Debian package system. * Compile target libraries with '-ffunction-sections -fdata-sections'. * Configure gcc with '--libexecdir=/usr/lib'. + * Add convenience package 'djgpp'. - -- jwt27 Sun, 18 Sep 2022 20:00:31 +0200 + -- jwt27 Sun, 18 Sep 2022 23:46:06 +0200 djgpp-toolchain (5) unstable; urgency=low diff --git a/debian/control b/debian/control index e63b442..23e09fd 100644 --- a/debian/control +++ b/debian/control @@ -25,21 +25,32 @@ Build-Depends: Standards-Version: 4.1.2 Homepage: https://github.com/jwt27/build-gcc +Package: djgpp +Architecture: any +Tag: role::metapackage +Depends: + djgpp-dev, + djgpp-utils, + djgpp-doc, + gcc-djgpp, + binutils-djgpp, + gdb-djgpp, + libwatt-djgpp-dev +Description: DJGPP toolchain + This convenience package installs all available components of the djgpp + toolchain, including documentation and additional libraries. + Package: djgpp-dev Architecture: any Depends: ${misc:Depends} Recommends: binutils-djgpp, gcc-djgpp, djgpp-utils Suggests: djgpp-doc -Breaks: djgpp -Replaces: djgpp Description: DJGPP development kit -- libraries Package: djgpp-utils Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: binutils-djgpp, gcc-djgpp, djgpp-dev -Breaks: djgpp -Replaces: djgpp Description: DJGPP development kit -- utilities Various utilities used to develop djgpp applications: * djasm diff --git a/debian/djgpp.install b/debian/djgpp.install new file mode 100644 index 0000000..e69de29 diff --git a/debian/rules b/debian/rules index 9e8549d..c6b6a01 100755 --- a/debian/rules +++ b/debian/rules @@ -19,6 +19,7 @@ WATT32_VERSION = 2.2.11.git-$(call git_date, download/Watt-32) override_dh_gencontrol: dh_gencontrol + dh_gencontrol -pdjgpp -- -v0+$(DEB_VERSION) dh_gencontrol -pdjgpp-dev -- -v$(DJGPP_VERSION)+$(DEB_VERSION) dh_gencontrol -pdjgpp-utils -- -v$(DJGPP_VERSION)+$(DEB_VERSION) dh_gencontrol -pdjgpp-doc -- -v$(DJGPP_VERSION)+$(DEB_VERSION) From dafe7f32d8324a1d9f61ca07178d48d1d849c9b8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 19 Sep 2022 01:59:17 +0200 Subject: [PATCH 476/536] debian: install documentation in exec-prefix --- debian/binutils-djgpp-doc.info | 5 ----- debian/binutils-djgpp-doc.install | 5 +++++ debian/changelog | 3 ++- debian/control | 10 +++++----- debian/djgpp-doc.info | 3 --- debian/djgpp-doc.install | 3 +++ debian/gcc-djgpp-doc.info | 6 ------ debian/gcc-djgpp-doc.install | 9 +++++++++ debian/gcc-djgpp-doc.manpages | 3 --- debian/gdb-djgpp-doc.info | 4 ---- debian/gdb-djgpp-doc.install | 3 +++ 11 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 debian/binutils-djgpp-doc.info create mode 100644 debian/binutils-djgpp-doc.install delete mode 100644 debian/djgpp-doc.info create mode 100644 debian/djgpp-doc.install delete mode 100644 debian/gcc-djgpp-doc.info create mode 100644 debian/gcc-djgpp-doc.install delete mode 100644 debian/gcc-djgpp-doc.manpages delete mode 100644 debian/gdb-djgpp-doc.info create mode 100644 debian/gdb-djgpp-doc.install diff --git a/debian/binutils-djgpp-doc.info b/debian/binutils-djgpp-doc.info deleted file mode 100644 index 5bc7c10..0000000 --- a/debian/binutils-djgpp-doc.info +++ /dev/null @@ -1,5 +0,0 @@ -usr/share/info/gprof.info -usr/share/info/binutils.info -usr/share/info/as.info -usr/share/info/ld.info -usr/share/info/bfd.info diff --git a/debian/binutils-djgpp-doc.install b/debian/binutils-djgpp-doc.install new file mode 100644 index 0000000..7f83f40 --- /dev/null +++ b/debian/binutils-djgpp-doc.install @@ -0,0 +1,5 @@ +usr/share/info/gprof.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/binutils.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/as.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/ld.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/bfd.info usr/i386-pc-msdosdjgpp/share/info diff --git a/debian/changelog b/debian/changelog index 9360289..f154249 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ djgpp-toolchain (6) unstable; urgency=low * Compile target libraries with '-ffunction-sections -fdata-sections'. * Configure gcc with '--libexecdir=/usr/lib'. * Add convenience package 'djgpp'. + * Install documentation in exec-prefix (/usr/i386-pc-msdosdjgpp/). - -- jwt27 Sun, 18 Sep 2022 23:46:06 +0200 + -- jwt27 Mon, 19 Sep 2022 02:04:59 +0200 djgpp-toolchain (5) unstable; urgency=low diff --git a/debian/control b/debian/control index 23e09fd..2754f31 100644 --- a/debian/control +++ b/debian/control @@ -33,12 +33,15 @@ Depends: djgpp-utils, djgpp-doc, gcc-djgpp, + gcc-djgpp-doc, binutils-djgpp, + binutils-djgpp-doc, gdb-djgpp, + gdb-djgpp-doc, libwatt-djgpp-dev Description: DJGPP toolchain - This convenience package installs all available components of the djgpp - toolchain, including documentation and additional libraries. + This meta-package installs all available components of the djgpp toolchain, + including documentation and additional libraries. Package: djgpp-dev Architecture: any @@ -80,7 +83,6 @@ Package: gcc-djgpp-doc Architecture: all Depends: ${misc:Depends} Suggests: gcc-djgpp -Conflicts: gcc-doc Description: Documentation for gcc-djgpp Package: gcc-djgpp-extra @@ -104,7 +106,6 @@ Package: binutils-djgpp-doc Architecture: all Depends: ${misc:Depends} Suggests: binutils-djgpp -Conflicts: binutils-doc Description: Documentation for binutils-djgpp. Package: gdb-djgpp @@ -118,7 +119,6 @@ Package: gdb-djgpp-doc Architecture: all Depends: ${misc:Depends} Suggests: gdb-djgpp -Conflicts: gdb-doc Description: Documentation for gdb-djgpp Package: gdb-djgpp-extra diff --git a/debian/djgpp-doc.info b/debian/djgpp-doc.info deleted file mode 100644 index 4df371b..0000000 --- a/debian/djgpp-doc.info +++ /dev/null @@ -1,3 +0,0 @@ -usr/i*86-pc-msdosdjgpp/share/info/libm.info -usr/i*86-pc-msdosdjgpp/share/info/libc.info -usr/i*86-pc-msdosdjgpp/share/info/kb.info diff --git a/debian/djgpp-doc.install b/debian/djgpp-doc.install new file mode 100644 index 0000000..41e03f7 --- /dev/null +++ b/debian/djgpp-doc.install @@ -0,0 +1,3 @@ +usr/i386-pc-msdosdjgpp/share/info/libm.info +usr/i386-pc-msdosdjgpp/share/info/libc.info +usr/i386-pc-msdosdjgpp/share/info/kb.info diff --git a/debian/gcc-djgpp-doc.info b/debian/gcc-djgpp-doc.info deleted file mode 100644 index 05d04ca..0000000 --- a/debian/gcc-djgpp-doc.info +++ /dev/null @@ -1,6 +0,0 @@ -usr/share/info/libquadmath.info -usr/share/info/gccint.info -usr/share/info/gcc.info -usr/share/info/cpp.info -usr/share/info/cppinternals.info -usr/share/info/gccinstall.info diff --git a/debian/gcc-djgpp-doc.install b/debian/gcc-djgpp-doc.install new file mode 100644 index 0000000..d85cbb6 --- /dev/null +++ b/debian/gcc-djgpp-doc.install @@ -0,0 +1,9 @@ +usr/share/info/libquadmath.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/gccint.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/gcc.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/cpp.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/cppinternals.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/gccinstall.info usr/i386-pc-msdosdjgpp/share/info +usr/share/man/man7/fsf-funding.7 usr/i386-pc-msdosdjgpp/share/man/man7 +usr/share/man/man7/gpl.7 usr/i386-pc-msdosdjgpp/share/man/man7 +usr/share/man/man7/gfdl.7 usr/i386-pc-msdosdjgpp/share/man/man7 diff --git a/debian/gcc-djgpp-doc.manpages b/debian/gcc-djgpp-doc.manpages deleted file mode 100644 index 5627044..0000000 --- a/debian/gcc-djgpp-doc.manpages +++ /dev/null @@ -1,3 +0,0 @@ -usr/share/man/man7/fsf-funding.7 -usr/share/man/man7/gpl.7 -usr/share/man/man7/gfdl.7 diff --git a/debian/gdb-djgpp-doc.info b/debian/gdb-djgpp-doc.info deleted file mode 100644 index 26107be..0000000 --- a/debian/gdb-djgpp-doc.info +++ /dev/null @@ -1,4 +0,0 @@ -usr/share/info/annotate.info -usr/share/info/gdb.info -usr/share/info/bfd.info -usr/share/info/stabs.info diff --git a/debian/gdb-djgpp-doc.install b/debian/gdb-djgpp-doc.install new file mode 100644 index 0000000..474b217 --- /dev/null +++ b/debian/gdb-djgpp-doc.install @@ -0,0 +1,3 @@ +usr/share/info/annotate.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/gdb.info usr/i386-pc-msdosdjgpp/share/info +usr/share/info/stabs.info usr/i386-pc-msdosdjgpp/share/info From 0d4c453d5ffd522669c085a17127529e2250aba7 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 19 Sep 2022 17:11:17 +0200 Subject: [PATCH 477/536] debian: drop 'extra' packages and install their contents in exec-prefix --- debian/binutils-djgpp-doc.install | 10 ++++----- debian/binutils-djgpp.manpages | 36 +++++++++++++++---------------- debian/changelog | 3 ++- debian/control | 20 ++--------------- debian/gcc-djgpp-doc.install | 18 ++++++++-------- debian/gcc-djgpp-extra.install | 4 ---- debian/gcc-djgpp.install | 4 ++++ debian/gcc-djgpp.manpages | 12 +++++------ debian/gdb-djgpp-doc.install | 6 +++--- debian/gdb-djgpp-extra.install | 18 ---------------- debian/gdb-djgpp.install | 17 +++++++++++++++ debian/gdb-djgpp.manpages | 8 +++---- debian/rules | 7 ++---- 13 files changed, 72 insertions(+), 91 deletions(-) delete mode 100644 debian/gcc-djgpp-extra.install delete mode 100644 debian/gdb-djgpp-extra.install diff --git a/debian/binutils-djgpp-doc.install b/debian/binutils-djgpp-doc.install index 7f83f40..ec0fcc9 100644 --- a/debian/binutils-djgpp-doc.install +++ b/debian/binutils-djgpp-doc.install @@ -1,5 +1,5 @@ -usr/share/info/gprof.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/binutils.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/as.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/ld.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/bfd.info usr/i386-pc-msdosdjgpp/share/info +usr/i386-pc-msdosdjgpp/share/info/gprof.info +usr/i386-pc-msdosdjgpp/share/info/binutils.info +usr/i386-pc-msdosdjgpp/share/info/as.info +usr/i386-pc-msdosdjgpp/share/info/ld.info +usr/i386-pc-msdosdjgpp/share/info/bfd.info diff --git a/debian/binutils-djgpp.manpages b/debian/binutils-djgpp.manpages index 002157f..15db6d9 100644 --- a/debian/binutils-djgpp.manpages +++ b/debian/binutils-djgpp.manpages @@ -1,18 +1,18 @@ -usr/share/man/man1/i*86-pc-msdosdjgpp-gprof.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-ar.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-ranlib.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-windmc.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-objdump.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-c++filt.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-strings.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-readelf.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-ld.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-size.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-objcopy.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-as.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-strip.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-dlltool.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-addr2line.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-nm.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-elfedit.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-windres.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-gprof.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-ar.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-ranlib.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-windmc.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-objdump.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-c++filt.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-strings.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-readelf.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-ld.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-size.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-objcopy.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-as.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-strip.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-dlltool.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-addr2line.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-nm.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-elfedit.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-windres.1 diff --git a/debian/changelog b/debian/changelog index f154249..bbd7639 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,9 @@ djgpp-toolchain (6) unstable; urgency=low * Configure gcc with '--libexecdir=/usr/lib'. * Add convenience package 'djgpp'. * Install documentation in exec-prefix (/usr/i386-pc-msdosdjgpp/). + * Drop 'extra' packages and install their contents in exec-prefix. - -- jwt27 Mon, 19 Sep 2022 02:04:59 +0200 + -- jwt27 Mon, 19 Sep 2022 17:20:39 +0200 djgpp-toolchain (5) unstable; urgency=low diff --git a/debian/control b/debian/control index 2754f31..a779cac 100644 --- a/debian/control +++ b/debian/control @@ -75,7 +75,7 @@ Package: gcc-djgpp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp-utils, binutils-djgpp (>= 2.35.2) Recommends: djgpp-dev -Suggests: gcc-djgpp-doc, gcc-djgpp-extra +Suggests: gcc-djgpp-doc Description: GNU Compiler Collection Cross-compiler targeting djgpp. Supports C and C++. @@ -85,15 +85,6 @@ Depends: ${misc:Depends} Suggests: gcc-djgpp Description: Documentation for gcc-djgpp -Package: gcc-djgpp-extra -Architecture: all -Depends: ${misc:Depends} -Recommends: gcc-djgpp -Suggests: gdb-djgpp -Description: Extra files for gcc - Python pretty-printer script files for use with gdb. - May conflict with system gcc. - Package: binutils-djgpp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -111,7 +102,7 @@ Description: Documentation for binutils-djgpp. Package: gdb-djgpp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Suggests: gdb-djgpp-doc, gcc-djgpp-extra +Suggests: gdb-djgpp-doc Description: GNU Debugger Used to debug djgpp programs over a serial connection. @@ -121,13 +112,6 @@ Depends: ${misc:Depends} Suggests: gdb-djgpp Description: Documentation for gdb-djgpp -Package: gdb-djgpp-extra -Architecture: all -Depends: ${misc:Depends} -Recommends: gdb-djgpp -Description: Extra files for gdb-djgpp - May conflict with system gdb. - Package: libwatt-djgpp-dev Architecture: any Depends: ${misc:Depends} diff --git a/debian/gcc-djgpp-doc.install b/debian/gcc-djgpp-doc.install index d85cbb6..fb93c7d 100644 --- a/debian/gcc-djgpp-doc.install +++ b/debian/gcc-djgpp-doc.install @@ -1,9 +1,9 @@ -usr/share/info/libquadmath.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/gccint.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/gcc.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/cpp.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/cppinternals.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/gccinstall.info usr/i386-pc-msdosdjgpp/share/info -usr/share/man/man7/fsf-funding.7 usr/i386-pc-msdosdjgpp/share/man/man7 -usr/share/man/man7/gpl.7 usr/i386-pc-msdosdjgpp/share/man/man7 -usr/share/man/man7/gfdl.7 usr/i386-pc-msdosdjgpp/share/man/man7 +usr/i386-pc-msdosdjgpp/share/info/libquadmath.info +usr/i386-pc-msdosdjgpp/share/info/gccint.info +usr/i386-pc-msdosdjgpp/share/info/gcc.info +usr/i386-pc-msdosdjgpp/share/info/cpp.info +usr/i386-pc-msdosdjgpp/share/info/cppinternals.info +usr/i386-pc-msdosdjgpp/share/info/gccinstall.info +usr/i386-pc-msdosdjgpp/share/man/man7/fsf-funding.7 +usr/i386-pc-msdosdjgpp/share/man/man7/gpl.7 +usr/i386-pc-msdosdjgpp/share/man/man7/gfdl.7 diff --git a/debian/gcc-djgpp-extra.install b/debian/gcc-djgpp-extra.install deleted file mode 100644 index f4dee1f..0000000 --- a/debian/gcc-djgpp-extra.install +++ /dev/null @@ -1,4 +0,0 @@ -usr/share/gcc-*.*.*/python/libstdcxx/v6/printers.py -usr/share/gcc-*.*.*/python/libstdcxx/v6/__init__.py -usr/share/gcc-*.*.*/python/libstdcxx/v6/xmethods.py -usr/share/gcc-*.*.*/python/libstdcxx/__init__.py diff --git a/debian/gcc-djgpp.install b/debian/gcc-djgpp.install index 12dbb59..5aec057 100644 --- a/debian/gcc-djgpp.install +++ b/debian/gcc-djgpp.install @@ -23,3 +23,7 @@ usr/bin/i*86-pc-msdosdjgpp-gcc-ar usr/bin/i*86-pc-msdosdjgpp-g++-*.*.* usr/bin/i*86-pc-msdosdjgpp-gcov-dump usr/bin/i*86-pc-msdosdjgpp-gcov +usr/i386-pc-msdosdjgpp/share/gcc-*/python/libstdcxx/v6/printers.py +usr/i386-pc-msdosdjgpp/share/gcc-*/python/libstdcxx/v6/__init__.py +usr/i386-pc-msdosdjgpp/share/gcc-*/python/libstdcxx/v6/xmethods.py +usr/i386-pc-msdosdjgpp/share/gcc-*/python/libstdcxx/__init__.py diff --git a/debian/gcc-djgpp.manpages b/debian/gcc-djgpp.manpages index dece22e..f78d75a 100644 --- a/debian/gcc-djgpp.manpages +++ b/debian/gcc-djgpp.manpages @@ -1,6 +1,6 @@ -usr/share/man/man1/i*86-pc-msdosdjgpp-gcov-dump.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-cpp.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-gcov.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-g++.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-gcov-tool.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-gcc.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-gcov-dump.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-cpp.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-gcov.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-g++.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-gcov-tool.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-gcc.1 diff --git a/debian/gdb-djgpp-doc.install b/debian/gdb-djgpp-doc.install index 474b217..40619ae 100644 --- a/debian/gdb-djgpp-doc.install +++ b/debian/gdb-djgpp-doc.install @@ -1,3 +1,3 @@ -usr/share/info/annotate.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/gdb.info usr/i386-pc-msdosdjgpp/share/info -usr/share/info/stabs.info usr/i386-pc-msdosdjgpp/share/info +usr/i386-pc-msdosdjgpp/share/info/annotate.info +usr/i386-pc-msdosdjgpp/share/info/gdb.info +usr/i386-pc-msdosdjgpp/share/info/stabs.info diff --git a/debian/gdb-djgpp-extra.install b/debian/gdb-djgpp-extra.install deleted file mode 100644 index 2c4a474..0000000 --- a/debian/gdb-djgpp-extra.install +++ /dev/null @@ -1,18 +0,0 @@ -usr/share/gdb/system-gdbinit/elinos.py -usr/share/gdb/system-gdbinit/wrs-linux.py -usr/share/gdb/syscalls/aarch64-linux.xml -usr/share/gdb/syscalls/s390-linux.xml -usr/share/gdb/syscalls/mips-n32-linux.xml -usr/share/gdb/syscalls/sparc64-linux.xml -usr/share/gdb/syscalls/s390x-linux.xml -usr/share/gdb/syscalls/ppc64-linux.xml -usr/share/gdb/syscalls/arm-linux.xml -usr/share/gdb/syscalls/amd64-linux.xml -usr/share/gdb/syscalls/mips-n64-linux.xml -usr/share/gdb/syscalls/freebsd.xml -usr/share/gdb/syscalls/i386-linux.xml -usr/share/gdb/syscalls/ppc-linux.xml -usr/share/gdb/syscalls/sparc-linux.xml -usr/share/gdb/syscalls/mips-o32-linux.xml -usr/share/gdb/syscalls/gdb-syscalls.dtd -usr/include/gdb/jit-reader.h diff --git a/debian/gdb-djgpp.install b/debian/gdb-djgpp.install index 7eb1d9a..b8c921a 100644 --- a/debian/gdb-djgpp.install +++ b/debian/gdb-djgpp.install @@ -2,3 +2,20 @@ usr/i*86-pc-msdosdjgpp/bin/gdb usr/bin/i*86-pc-msdosdjgpp-gdb usr/bin/i*86-pc-msdosdjgpp-gdb-add-index usr/i*86-pc-msdosdjgpp/etc/build-gcc/gdb-version +usr/i386-pc-msdosdjgpp/share/gdb/system-gdbinit/elinos.py +usr/i386-pc-msdosdjgpp/share/gdb/system-gdbinit/wrs-linux.py +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/aarch64-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/s390-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/mips-n32-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/sparc64-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/s390x-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/ppc64-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/arm-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/amd64-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/mips-n64-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/freebsd.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/i386-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/ppc-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/sparc-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/mips-o32-linux.xml +usr/i386-pc-msdosdjgpp/share/gdb/syscalls/gdb-syscalls.dtd diff --git a/debian/gdb-djgpp.manpages b/debian/gdb-djgpp.manpages index dab0bac..d7d1810 100644 --- a/debian/gdb-djgpp.manpages +++ b/debian/gdb-djgpp.manpages @@ -1,4 +1,4 @@ -usr/share/man/man5/i*86-pc-msdosdjgpp-gdbinit.5 -usr/share/man/man1/i*86-pc-msdosdjgpp-gdbserver.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-gdb.1 -usr/share/man/man1/i*86-pc-msdosdjgpp-gdb-add-index.1 +usr/i386-pc-msdosdjgpp/share/man/man5/i386-pc-msdosdjgpp-gdbinit.5 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-gdbserver.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-gdb.1 +usr/i386-pc-msdosdjgpp/share/man/man1/i386-pc-msdosdjgpp-gdb-add-index.1 diff --git a/debian/rules b/debian/rules index c6b6a01..40fd366 100755 --- a/debian/rules +++ b/debian/rules @@ -25,12 +25,10 @@ override_dh_gencontrol: dh_gencontrol -pdjgpp-doc -- -v$(DJGPP_VERSION)+$(DEB_VERSION) dh_gencontrol -pgcc-djgpp -- -v$(GCC_VERSION)+$(DEB_VERSION) dh_gencontrol -pgcc-djgpp-doc -- -v$(GCC_VERSION)+$(DEB_VERSION) - dh_gencontrol -pgcc-djgpp-extra -- -v$(GCC_VERSION)+$(DEB_VERSION) dh_gencontrol -pbinutils-djgpp -- -v$(BINUTILS_VERSION)+$(DEB_VERSION) dh_gencontrol -pbinutils-djgpp-doc -- -v$(BINUTILS_VERSION)+$(DEB_VERSION) dh_gencontrol -pgdb-djgpp -- -v$(GDB_VERSION)+$(DEB_VERSION) dh_gencontrol -pgdb-djgpp-doc -- -v$(GDB_VERSION)+$(DEB_VERSION) - dh_gencontrol -pgdb-djgpp-extra -- -v$(GDB_VERSION)+$(DEB_VERSION) dh_gencontrol -plibwatt-djgpp-dev -- -v$(WATT32_VERSION)+$(DEB_VERSION) override_dh_strip: @@ -43,17 +41,16 @@ override_dh_auto_clean: cp debian/djgpp-dev.copyright debian/djgpp-utils.copyright cp debian/djgpp-dev.copyright debian/djgpp-doc.copyright cp debian/gcc-djgpp.copyright debian/gcc-djgpp-doc.copyright - cp debian/gcc-djgpp.copyright debian/gcc-djgpp-extra.copyright cp debian/binutils-djgpp.copyright debian/binutils-djgpp-doc.copyright cp debian/gdb-djgpp.copyright debian/gdb-djgpp-doc.copyright - cp debian/gdb-djgpp.copyright debian/gdb-djgpp-extra.copyright ./build-djgpp.sh --batch --build-deb --only-download $(PACKAGES) -rm -rf build/ install/ override_dh_auto_configure: override_dh_auto_build: - GCC_CONFIGURE_OPTIONS='--libexecdir=/usr/lib' \ + GCC_CONFIGURE_OPTIONS='--datarootdir=/usr/i386-pc-msdosdjgpp/share --libexecdir=/usr/lib' \ + GDB_CONFIGURE_OPTIONS='--datarootdir=/usr/i386-pc-msdosdjgpp/share' \ CFLAGS="$(CFLAGS) -Wno-error=format-security" \ CXXFLAGS="$(CXXFLAGS) -Wno-error=format-security" \ ./build-djgpp.sh --batch --build-deb --no-download --prefix=/usr --destdir=$(CURDIR)/install $(PACKAGES) From 97458ce0f65c1e12151e098ba0caf97f18e32f4b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 19 Sep 2022 18:43:56 +0200 Subject: [PATCH 478/536] debian: add convenience package 'djgpp-doc' --- debian/changelog | 4 ++-- debian/control | 24 +++++++++++++++++------- debian/djgpp-dev-doc.install | 3 +++ debian/djgpp-doc.install | 3 --- debian/rules | 7 ++++--- 5 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 debian/djgpp-dev-doc.install diff --git a/debian/changelog b/debian/changelog index bbd7639..2c75fd8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,11 +3,11 @@ djgpp-toolchain (6) unstable; urgency=low * Improve Debian package system. * Compile target libraries with '-ffunction-sections -fdata-sections'. * Configure gcc with '--libexecdir=/usr/lib'. - * Add convenience package 'djgpp'. + * Add convenience packages 'djgpp' and 'djgpp-doc'. * Install documentation in exec-prefix (/usr/i386-pc-msdosdjgpp/). * Drop 'extra' packages and install their contents in exec-prefix. - -- jwt27 Mon, 19 Sep 2022 17:20:39 +0200 + -- jwt27 Mon, 19 Sep 2022 19:20:38 +0200 djgpp-toolchain (5) unstable; urgency=low diff --git a/debian/control b/debian/control index a779cac..b17610d 100644 --- a/debian/control +++ b/debian/control @@ -31,23 +31,33 @@ Tag: role::metapackage Depends: djgpp-dev, djgpp-utils, - djgpp-doc, gcc-djgpp, - gcc-djgpp-doc, binutils-djgpp, - binutils-djgpp-doc, gdb-djgpp, - gdb-djgpp-doc, libwatt-djgpp-dev +Suggests: djgpp-doc Description: DJGPP toolchain This meta-package installs all available components of the djgpp toolchain, - including documentation and additional libraries. + including additional libraries. For documentation see djgpp-doc. + +Package: djgpp-doc +Architecture: any +Tag: role::metapackage +Depends: + djgpp-dev-doc, + gcc-djgpp-doc, + binutils-djgpp-doc, + gdb-djgpp-doc +Suggests: djgpp +Description: DJGPP toolchain documentation + This meta-package installs the documentation for all available components of + the djgpp toolchain. Package: djgpp-dev Architecture: any Depends: ${misc:Depends} Recommends: binutils-djgpp, gcc-djgpp, djgpp-utils -Suggests: djgpp-doc +Suggests: djgpp-dev-doc Description: DJGPP development kit -- libraries Package: djgpp-utils @@ -65,7 +75,7 @@ Description: DJGPP development kit -- utilities * stubedit * stubify -Package: djgpp-doc +Package: djgpp-dev-doc Architecture: all Depends: ${misc:Depends} Suggests: djgpp-dev diff --git a/debian/djgpp-dev-doc.install b/debian/djgpp-dev-doc.install new file mode 100644 index 0000000..41e03f7 --- /dev/null +++ b/debian/djgpp-dev-doc.install @@ -0,0 +1,3 @@ +usr/i386-pc-msdosdjgpp/share/info/libm.info +usr/i386-pc-msdosdjgpp/share/info/libc.info +usr/i386-pc-msdosdjgpp/share/info/kb.info diff --git a/debian/djgpp-doc.install b/debian/djgpp-doc.install index 41e03f7..e69de29 100644 --- a/debian/djgpp-doc.install +++ b/debian/djgpp-doc.install @@ -1,3 +0,0 @@ -usr/i386-pc-msdosdjgpp/share/info/libm.info -usr/i386-pc-msdosdjgpp/share/info/libc.info -usr/i386-pc-msdosdjgpp/share/info/kb.info diff --git a/debian/rules b/debian/rules index 40fd366..5c1c19d 100755 --- a/debian/rules +++ b/debian/rules @@ -20,9 +20,10 @@ WATT32_VERSION = 2.2.11.git-$(call git_date, download/Watt-32) override_dh_gencontrol: dh_gencontrol dh_gencontrol -pdjgpp -- -v0+$(DEB_VERSION) - dh_gencontrol -pdjgpp-dev -- -v$(DJGPP_VERSION)+$(DEB_VERSION) + dh_gencontrol -pdjgpp-doc -- -v0+$(DEB_VERSION) dh_gencontrol -pdjgpp-utils -- -v$(DJGPP_VERSION)+$(DEB_VERSION) - dh_gencontrol -pdjgpp-doc -- -v$(DJGPP_VERSION)+$(DEB_VERSION) + dh_gencontrol -pdjgpp-dev -- -v$(DJGPP_VERSION)+$(DEB_VERSION) + dh_gencontrol -pdjgpp-dev-doc -- -v$(DJGPP_VERSION)+$(DEB_VERSION) dh_gencontrol -pgcc-djgpp -- -v$(GCC_VERSION)+$(DEB_VERSION) dh_gencontrol -pgcc-djgpp-doc -- -v$(GCC_VERSION)+$(DEB_VERSION) dh_gencontrol -pbinutils-djgpp -- -v$(BINUTILS_VERSION)+$(DEB_VERSION) @@ -39,7 +40,7 @@ override_dh_auto_clean: cp LICENSE debian/binutils-djgpp.copyright cp LICENSE debian/gdb-djgpp.copyright cp debian/djgpp-dev.copyright debian/djgpp-utils.copyright - cp debian/djgpp-dev.copyright debian/djgpp-doc.copyright + cp debian/djgpp-dev.copyright debian/djgpp-dev-doc.copyright cp debian/gcc-djgpp.copyright debian/gcc-djgpp-doc.copyright cp debian/binutils-djgpp.copyright debian/binutils-djgpp-doc.copyright cp debian/gdb-djgpp.copyright debian/gdb-djgpp-doc.copyright From 78753afd3256af6b07d7f364f12d92384ce05b3c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 19 Sep 2022 19:15:44 +0200 Subject: [PATCH 479/536] add variable to pass options to all autotools configure scripts --- README.md | 3 ++- debian/rules | 3 +-- script/init.sh | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5f50740..152c20f 100644 --- a/README.md +++ b/README.md @@ -91,12 +91,13 @@ The following command line options are recognized: Several environment variables also control the build process: ```sh -MAKE_JOBS= # Number of parallel build threads (auto-detected) GCC_CONFIGURE_OPTIONS= # Extra options to pass to gcc's ./configure BINUTILS_CONFIGURE_OPTIONS= # Same, for binutils GDB_CONFIGURE_OPTIONS= # Same, for gdb NEWLIB_CONFIGURE_OPTIONS= # Same, for newlib AVRLIBC_CONFIGURE_OPTIONS= # Same, for avr-libc +GLOBAL_CONFIGURE_OPTIONS= # Extra options added to all variables listed above +MAKE_JOBS= # Number of parallel build threads (auto-detected) CFLAGS_FOR_TARGET= # CFLAGS used to build target libraries HOST= # The platform you are building for, when building a cross-cross compiler BUILD= # The platform you are building on (auto-detected) diff --git a/debian/rules b/debian/rules index 5c1c19d..a747f88 100755 --- a/debian/rules +++ b/debian/rules @@ -50,8 +50,7 @@ override_dh_auto_clean: override_dh_auto_configure: override_dh_auto_build: - GCC_CONFIGURE_OPTIONS='--datarootdir=/usr/i386-pc-msdosdjgpp/share --libexecdir=/usr/lib' \ - GDB_CONFIGURE_OPTIONS='--datarootdir=/usr/i386-pc-msdosdjgpp/share' \ + GLOBAL_CONFIGURE_OPTIONS='--datarootdir=/usr/i386-pc-msdosdjgpp/share --libexecdir=/usr/lib' \ CFLAGS="$(CFLAGS) -Wno-error=format-security" \ CXXFLAGS="$(CXXFLAGS) -Wno-error=format-security" \ ./build-djgpp.sh --batch --build-deb --no-download --prefix=/usr --destdir=$(CURDIR)/install $(PACKAGES) diff --git a/script/init.sh b/script/init.sh index b930b3c..9be8287 100644 --- a/script/init.sh +++ b/script/init.sh @@ -143,6 +143,12 @@ if [ -z $1 ]; then exit 1 fi +prepend GCC_CONFIGURE_OPTIONS "$GLOBAL_CONFIGURE_OPTIONS" +prepend GDB_CONFIGURE_OPTIONS "$GLOBAL_CONFIGURE_OPTIONS" +prepend BINUTILS_CONFIGURE_OPTIONS "$GLOBAL_CONFIGURE_OPTIONS" +prepend NEWLIB_CONFIGURE_OPTIONS "$GLOBAL_CONFIGURE_OPTIONS" +prepend AVRLIBC_CONFIGURE_OPTIONS "$GLOBAL_CONFIGURE_OPTIONS" + for A in "$@"; do case $A in --no-git-reset) NO_GIT_RESET=y ;; From 48596c4754b4fc780f7d37e808e42c1803065eb2 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 21 Sep 2022 21:10:24 +0200 Subject: [PATCH 480/536] debian: set environment vars from dpgk-buildflags --- debian/rules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index a747f88..ad829f4 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,7 @@ #!/usr/bin/make -f -include /usr/share/dpkg/pkg-info.mk +DPKG_EXPORT_BUILDFLAGS := 1 +include /usr/share/dpkg/default.mk SHELL := /bin/bash From aab3dbc3a98a58a2c427c5ec71ea786909275490 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 21 Sep 2022 21:11:10 +0200 Subject: [PATCH 481/536] debian: remove hyphens from package version numbers --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index ad829f4..7557a28 100755 --- a/debian/rules +++ b/debian/rules @@ -12,8 +12,8 @@ git_date = $(shell date --date='$(shell cd $(1) && git log -1 --format=%cI)' -u GCC_VERSION = $(shell source ./djgpp/gcc && echo $$GCC_VERSION) BINUTILS_VERSION = $(shell source ./djgpp/binutils && echo $$BINUTILS_VERSION) GDB_VERSION = $(shell source ./djgpp/gdb && echo $$GDB_VERSION) -DJGPP_VERSION = 2.05.cvs-$(call git_date, download/djgpp-cvs) -WATT32_VERSION = 2.2.11.git-$(call git_date, download/Watt-32) +DJGPP_VERSION = 2.05.cvs.$(call git_date, download/djgpp-cvs) +WATT32_VERSION = 2.2.11.git.$(call git_date, download/Watt-32) %: dh $@ From 2fd53ee8c3f08cda64674438413eb90730156b7d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 24 Sep 2022 17:38:39 +0200 Subject: [PATCH 482/536] prevent accidentally uploading unreleased packages --- .github/workflows/deploy.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b74d8f5..5eb290d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,8 +5,21 @@ on: branches: djgpp-ppa jobs: + check: + runs-on: ubuntu-latest + outputs: + good: ${{ steps.docheck.outputs.good }} + steps: + - uses: actions/checkout@v2 + - id: docheck + name: Check release state + run: | + echo "::set-output name=good::$([ -z "$(head -n 1 debian/changelog | grep 'UNRELEASED')" ] && echo 'true' || echo 'false')" + build: runs-on: ubuntu-latest + needs: check + if: needs.check.outputs.good == 'true' strategy: matrix: ubuntu-version: [ bionic, focal, jammy, kinetic ] @@ -28,7 +41,7 @@ jobs: - name: Make source package run: | - debuild -S -us -uc -d + debuild -S --no-sign -d - name: Import signing key env: From 7a8152e73079aae8c8b23f29a9ea11592a7f08c4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 24 Sep 2022 22:33:12 +0200 Subject: [PATCH 483/536] debian: move meta-packages to new repo --- debian/changelog | 6 ++++++ debian/control | 50 +++++++++++++----------------------------------- 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2c75fd8..d98027c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (7) UNRELEASED; urgency=low + + * Move meta-packages to new repository. + + -- jwt27 Sat, 24 Sep 2022 18:36:43 +0200 + djgpp-toolchain (6) unstable; urgency=low * Improve Debian package system. diff --git a/debian/control b/debian/control index b17610d..ef751b3 100644 --- a/debian/control +++ b/debian/control @@ -25,34 +25,6 @@ Build-Depends: Standards-Version: 4.1.2 Homepage: https://github.com/jwt27/build-gcc -Package: djgpp -Architecture: any -Tag: role::metapackage -Depends: - djgpp-dev, - djgpp-utils, - gcc-djgpp, - binutils-djgpp, - gdb-djgpp, - libwatt-djgpp-dev -Suggests: djgpp-doc -Description: DJGPP toolchain - This meta-package installs all available components of the djgpp toolchain, - including additional libraries. For documentation see djgpp-doc. - -Package: djgpp-doc -Architecture: any -Tag: role::metapackage -Depends: - djgpp-dev-doc, - gcc-djgpp-doc, - binutils-djgpp-doc, - gdb-djgpp-doc -Suggests: djgpp -Description: DJGPP toolchain documentation - This meta-package installs the documentation for all available components of - the djgpp toolchain. - Package: djgpp-dev Architecture: any Depends: ${misc:Depends} @@ -76,24 +48,28 @@ Description: DJGPP development kit -- utilities * stubify Package: djgpp-dev-doc -Architecture: all +Architecture: any Depends: ${misc:Depends} Suggests: djgpp-dev Description: DJGPP development kit -- documentation Package: gcc-djgpp Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, djgpp-utils, binutils-djgpp (>= 2.35.2) +Depends: ${shlibs:Depends}, ${misc:Depends}, + djgpp-utils, + binutils-djgpp (>= 2.35.2) Recommends: djgpp-dev Suggests: gcc-djgpp-doc Description: GNU Compiler Collection - Cross-compiler targeting djgpp. Supports C and C++. + Cross-compiler targeting djgpp. This package contains both gcc, g++, and + libstdc++. + If you need compiler support for other languages, please let me know. Package: gcc-djgpp-doc -Architecture: all +Architecture: any Depends: ${misc:Depends} Suggests: gcc-djgpp -Description: Documentation for gcc-djgpp +Description: GNU Compiler Collection -- documentation Package: binutils-djgpp Architecture: any @@ -104,10 +80,10 @@ Description: GNU Binutils Linker, assembler and other binary utilities targeting djgpp. Package: binutils-djgpp-doc -Architecture: all +Architecture: any Depends: ${misc:Depends} Suggests: binutils-djgpp -Description: Documentation for binutils-djgpp. +Description: GNU Binutils -- documentation Package: gdb-djgpp Architecture: any @@ -117,10 +93,10 @@ Description: GNU Debugger Used to debug djgpp programs over a serial connection. Package: gdb-djgpp-doc -Architecture: all +Architecture: any Depends: ${misc:Depends} Suggests: gdb-djgpp -Description: Documentation for gdb-djgpp +Description: GNU Debugger -- documentation Package: libwatt-djgpp-dev Architecture: any From dbdb0bc78f3d6bf22e3f80e0e3d1b96005455c7c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 24 Sep 2022 23:09:42 +0200 Subject: [PATCH 484/536] search for libraries in ${EXEC_PREFIX}/local/ --- debian/changelog | 6 ++++-- script/finalize.sh | 26 ++++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index d98027c..464acf9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ -djgpp-toolchain (7) UNRELEASED; urgency=low +djgpp-toolchain (7) unstable; urgency=low * Move meta-packages to new repository. + * The compiler now looks for locally-installed libraries in + /usr/i386-pc-msdosdjgpp/local/. - -- jwt27 Sat, 24 Sep 2022 18:36:43 +0200 + -- jwt27 Sat, 24 Sep 2022 23:09:08 +0200 djgpp-toolchain (6) unstable; urgency=low diff --git a/script/finalize.sh b/script/finalize.sh index a3c94c4..16035b9 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -38,11 +38,11 @@ exit 1 ;; esac -export PATH="${PREFIX}/${TARGET}/bin:${PREFIX}/bin:\$PATH" +export PATH="${PREFIX}/${TARGET}/local/bin:${PREFIX}/${TARGET}/bin:${PREFIX}/bin:\$PATH" export GCC_EXEC_PREFIX="${PREFIX}/lib/gcc/" -export MANPATH="${PREFIX}/${TARGET}/share/man:${PREFIX}/share/man:\$MANPATH" -export INFOPATH="${PREFIX}/${TARGET}/share/info:${PREFIX}/share/info:\$INFOPATH" -export PKG_CONFIG_LIBDIR="${PREFIX}/${TARGET}/lib/pkgconfig:${PREFIX}/${TARGET}/share/pkgconfig" +export MANPATH="${PREFIX}/${TARGET}/local/share/man:${PREFIX}/${TARGET}/share/man:${PREFIX}/share/man:\$MANPATH" +export INFOPATH="${PREFIX}/${TARGET}/local/share/info:${PREFIX}/${TARGET}/share/info:${PREFIX}/share/info:\$INFOPATH" +export PKG_CONFIG_LIBDIR="${PREFIX}/${TARGET}/local/lib/pkgconfig:${PREFIX}/${TARGET}/local/share/pkgconfig:${PREFIX}/${TARGET}/lib/pkgconfig:${PREFIX}/${TARGET}/share/pkgconfig" unset PKG_CONFIG_PATH STOP @@ -59,6 +59,15 @@ case $TARGET in ;; esac +prepend_specs() +{ + sed -i "/\*$1:/{n;s#\(.*\)#$2 \1#}" ${BASE}/build/specs +} + +if [ ! -z "$(get_version gcc)" ]; then + ${TARGET}-gcc -dumpspecs > ${BASE}/build/specs +fi + if [ ! -z "$(get_version watt32)" ]; then WATT_ROOT="${PREFIX}/${TARGET}/watt" WATT_INCLUDE="${WATT_ROOT}/inc" @@ -71,11 +80,16 @@ if [ ! -z "$(get_version watt32)" ]; then esac echo "set WATT_ROOT=${WATT_ROOT}" >> ${BASE}/build/${TARGET}-setenv.cmd - ${TARGET}-gcc -dumpspecs > ${BASE}/build/specs + for i in cpp cc1plus; do + prepend_specs $i "-isystem ${WATT_INCLUDE}" + done +fi +if [ ! -z "$(get_version gcc)" ]; then for i in cpp cc1plus; do - sed -i "/\*$i:/{n;s#\(.*\)#-isystem ${WATT_INCLUDE} \1#}" ${BASE}/build/specs + prepend_specs $i "-I${PREFIX}/${TARGET}/local/include" done + prepend_specs link "-L${PREFIX}/${TARGET}/local/lib" echo "Installing specs file" install_files ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 From 210a9a92cba194cc0cd01318e17253386eb0e608 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 25 Sep 2022 01:49:53 +0200 Subject: [PATCH 485/536] debian: remove pgp key before build --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 7557a28..714b12f 100755 --- a/debian/rules +++ b/debian/rules @@ -46,7 +46,7 @@ override_dh_auto_clean: cp debian/binutils-djgpp.copyright debian/binutils-djgpp-doc.copyright cp debian/gdb-djgpp.copyright debian/gdb-djgpp-doc.copyright ./build-djgpp.sh --batch --build-deb --only-download $(PACKAGES) - -rm -rf build/ install/ + -rm -rf build/ install/ debian/pgp-secret.asc override_dh_auto_configure: From e64f1071f94fe4ccbe412cb12e6a76bfd6bcc4d1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 25 Sep 2022 02:23:42 +0200 Subject: [PATCH 486/536] debian: fix stupid build error --- debian/changelog | 4 ++-- debian/djgpp-doc.install | 0 debian/djgpp.install | 0 debian/rules | 2 -- 4 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 debian/djgpp-doc.install delete mode 100644 debian/djgpp.install diff --git a/debian/changelog b/debian/changelog index 464acf9..b4d04f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -djgpp-toolchain (7) unstable; urgency=low +djgpp-toolchain (7.1) unstable; urgency=low * Move meta-packages to new repository. * The compiler now looks for locally-installed libraries in /usr/i386-pc-msdosdjgpp/local/. - -- jwt27 Sat, 24 Sep 2022 23:09:08 +0200 + -- jwt27 Sun, 25 Sep 2022 02:21:08 +0200 djgpp-toolchain (6) unstable; urgency=low diff --git a/debian/djgpp-doc.install b/debian/djgpp-doc.install deleted file mode 100644 index e69de29..0000000 diff --git a/debian/djgpp.install b/debian/djgpp.install deleted file mode 100644 index e69de29..0000000 diff --git a/debian/rules b/debian/rules index 714b12f..804f563 100755 --- a/debian/rules +++ b/debian/rules @@ -20,8 +20,6 @@ WATT32_VERSION = 2.2.11.git.$(call git_date, download/Watt-32) override_dh_gencontrol: dh_gencontrol - dh_gencontrol -pdjgpp -- -v0+$(DEB_VERSION) - dh_gencontrol -pdjgpp-doc -- -v0+$(DEB_VERSION) dh_gencontrol -pdjgpp-utils -- -v$(DJGPP_VERSION)+$(DEB_VERSION) dh_gencontrol -pdjgpp-dev -- -v$(DJGPP_VERSION)+$(DEB_VERSION) dh_gencontrol -pdjgpp-dev-doc -- -v$(DJGPP_VERSION)+$(DEB_VERSION) From 10d9fec9beca79b93e05ca1f95162b216bf37df3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 28 Sep 2022 18:53:42 +0200 Subject: [PATCH 487/536] debian: add virtual packages for gcc and libc --- debian/changelog | 6 ++++++ debian/control | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/debian/changelog b/debian/changelog index b4d04f0..2baf498 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (8) UNRELEASED; urgency=low + + * Add virtual packages for gcc and libc. + + -- jwt27 Wed, 28 Sep 2022 18:29:52 +0200 + djgpp-toolchain (7.1) unstable; urgency=low * Move meta-packages to new repository. diff --git a/debian/control b/debian/control index ef751b3..59dc99f 100644 --- a/debian/control +++ b/debian/control @@ -30,6 +30,8 @@ Architecture: any Depends: ${misc:Depends} Recommends: binutils-djgpp, gcc-djgpp, djgpp-utils Suggests: djgpp-dev-doc +Provides: libc-djgpp-dev (= ${binary:Version}) +Conflicts: libc-djgpp-dev Description: DJGPP development kit -- libraries Package: djgpp-utils @@ -60,6 +62,16 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, binutils-djgpp (>= 2.35.2) Recommends: djgpp-dev Suggests: gcc-djgpp-doc +Provides: + gcc-i386-pc-msdosdjgpp (= ${binary:Version}), + g++-i386-pc-msdosdjgpp (= ${binary:Version}), + g++-djgpp (= ${binary:Version}), + libstdc++-djgpp-dev (= ${binary:Version}) +Conflicts: + gcc-i386-pc-msdosdjgpp, + g++-i386-pc-msdosdjgpp, + g++-djgpp, + libstdc++-djgpp-dev Description: GNU Compiler Collection Cross-compiler targeting djgpp. This package contains both gcc, g++, and libstdc++. From 20a7874943d91af0b80216be8a993a573d11cc6f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Wed, 28 Sep 2022 18:54:38 +0200 Subject: [PATCH 488/536] debian: set architecture for doc packages to 'all' --- debian/changelog | 5 +++-- debian/control | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2baf498..c84d793 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -djgpp-toolchain (8) UNRELEASED; urgency=low +djgpp-toolchain (8) unstable; urgency=low * Add virtual packages for gcc and libc. + * Set architecture for doc packages to 'all'. - -- jwt27 Wed, 28 Sep 2022 18:29:52 +0200 + -- jwt27 Wed, 28 Sep 2022 18:54:18 +0200 djgpp-toolchain (7.1) unstable; urgency=low diff --git a/debian/control b/debian/control index 59dc99f..9e7c14e 100644 --- a/debian/control +++ b/debian/control @@ -50,7 +50,7 @@ Description: DJGPP development kit -- utilities * stubify Package: djgpp-dev-doc -Architecture: any +Architecture: all Depends: ${misc:Depends} Suggests: djgpp-dev Description: DJGPP development kit -- documentation @@ -78,7 +78,7 @@ Description: GNU Compiler Collection If you need compiler support for other languages, please let me know. Package: gcc-djgpp-doc -Architecture: any +Architecture: all Depends: ${misc:Depends} Suggests: gcc-djgpp Description: GNU Compiler Collection -- documentation @@ -92,7 +92,7 @@ Description: GNU Binutils Linker, assembler and other binary utilities targeting djgpp. Package: binutils-djgpp-doc -Architecture: any +Architecture: all Depends: ${misc:Depends} Suggests: binutils-djgpp Description: GNU Binutils -- documentation @@ -105,7 +105,7 @@ Description: GNU Debugger Used to debug djgpp programs over a serial connection. Package: gdb-djgpp-doc -Architecture: any +Architecture: all Depends: ${misc:Depends} Suggests: gdb-djgpp Description: GNU Debugger -- documentation From 4de66c236954bd7b196e08ea91fb6b4717c9ea24 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 20 Nov 2022 23:03:00 +0100 Subject: [PATCH 489/536] update go32 stub in binutils to match libc version --- debian/changelog | 6 + patch/binutils-2.39/go32stub.patch | 249 +++++++++++++++++++++++++++++ script/unpack-build-binutils.sh | 11 +- 3 files changed, 262 insertions(+), 4 deletions(-) create mode 100644 patch/binutils-2.39/go32stub.patch diff --git a/debian/changelog b/debian/changelog index c84d793..c143226 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (9) UNRELEASED; urgency=medium + + * Update go32 stub in binutils to match libc version. + + -- jwt27 Sun, 20 Nov 2022 23:02:05 +0100 + djgpp-toolchain (8) unstable; urgency=low * Add virtual packages for gcc and libc. diff --git a/patch/binutils-2.39/go32stub.patch b/patch/binutils-2.39/go32stub.patch new file mode 100644 index 0000000..5a4df0e --- /dev/null +++ b/patch/binutils-2.39/go32stub.patch @@ -0,0 +1,249 @@ +diff --git a/bfd/go32stub.h b/bfd/go32stub.h +index 333eec068be..55cf60c89ba 100644 +--- a/bfd/go32stub.h ++++ b/bfd/go32stub.h +@@ -1,128 +1,128 @@ + 0x4d,0x5a,0x00,0x00,0x04,0x00,0x00,0x00,0x20,0x00,0x27,0x00,0xff,0xff,0x00,0x00, +-0x60,0x07,0x00,0x00,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x0a,0x73,0x74, +-0x75,0x62,0x2e,0x68,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x20,0x66, +-0x72,0x6f,0x6d,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x79,0x20, +-0x64,0x6a,0x61,0x73,0x6d,0x2c,0x20,0x6f,0x6e,0x20,0x57,0x65,0x64,0x20,0x4a,0x75, +-0x6e,0x20,0x32,0x38,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x32,0x30, +-0x30,0x30,0x0d,0x0a,0x54,0x68,0x65,0x20,0x53,0x54,0x55,0x42,0x2e,0x45,0x58,0x45, +-0x20,0x73,0x74,0x75,0x62,0x20,0x6c,0x6f,0x61,0x64,0x65,0x72,0x20,0x69,0x73,0x20, +-0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20,0x31,0x39, +-0x39,0x33,0x2d,0x31,0x39,0x39,0x35,0x20,0x44,0x4a,0x20,0x44,0x65,0x6c,0x6f,0x72, +-0x69,0x65,0x2e,0x20,0x0d,0x0a,0x50,0x65,0x72,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e, +-0x20,0x67,0x72,0x61,0x6e,0x74,0x65,0x64,0x20,0x74,0x6f,0x20,0x75,0x73,0x65,0x20, +-0x66,0x6f,0x72,0x20,0x61,0x6e,0x79,0x20,0x70,0x75,0x72,0x70,0x6f,0x73,0x65,0x20, +-0x70,0x72,0x6f,0x76,0x69,0x64,0x65,0x64,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x6f, +-0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x0d,0x0a,0x72,0x65,0x6d,0x61,0x69,0x6e, +-0x73,0x20,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x20,0x61,0x6e,0x64,0x20,0x75,0x6e, +-0x6d,0x6f,0x64,0x69,0x66,0x69,0x65,0x64,0x2e,0x20,0x0d,0x0a,0x54,0x68,0x69,0x73, +-0x20,0x6f,0x6e,0x6c,0x79,0x20,0x61,0x70,0x70,0x6c,0x69,0x65,0x73,0x20,0x74,0x6f, +-0x20,0x74,0x68,0x65,0x20,0x73,0x74,0x75,0x62,0x2c,0x20,0x61,0x6e,0x64,0x20,0x6e, +-0x6f,0x74,0x20,0x6e,0x65,0x63,0x65,0x73,0x73,0x61,0x72,0x69,0x6c,0x79,0x20,0x74, +-0x68,0x65,0x20,0x77,0x68,0x6f,0x6c,0x65,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d, +-0x2e,0x0a,0x0d,0x0a,0x24,0x49,0x64,0x3a,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73, +-0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x32,0x38,0x2f,0x31,0x30, +-0x30,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x62,0x79,0x20,0x64,0x6a, +-0x61,0x73,0x6d,0x20,0x24,0x0a,0x0d,0x0a,0x40,0x28,0x23,0x29,0x20,0x73,0x74,0x75, +-0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x32, +-0x38,0x2f,0x31,0x30,0x30,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x62, +-0x79,0x20,0x64,0x6a,0x61,0x73,0x6d,0x0a,0x0d,0x0a,0x1a,0x00,0x00,0x00,0x00,0x00, ++0x60,0x07,0x00,0x00,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x0d,0x0a,0x73,0x74,0x75,0x62,0x2e,0x68,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74, ++0x65,0x64,0x20,0x66,0x72,0x6f,0x6d,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d, ++0x20,0x62,0x79,0x20,0x64,0x6a,0x61,0x73,0x6d,0x2c,0x20,0x6f,0x6e,0x20,0x57,0x65, ++0x64,0x20,0x53,0x65,0x70,0x20,0x32,0x38,0x20,0x31,0x39,0x3a,0x30,0x36,0x3a,0x35, ++0x39,0x20,0x32,0x30,0x32,0x32,0x0d,0x0a,0x54,0x68,0x65,0x20,0x53,0x54,0x55,0x42, ++0x2e,0x45,0x58,0x45,0x20,0x73,0x74,0x75,0x62,0x20,0x6c,0x6f,0x61,0x64,0x65,0x72, ++0x20,0x69,0x73,0x20,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x43, ++0x29,0x20,0x31,0x39,0x39,0x33,0x2d,0x31,0x39,0x39,0x35,0x20,0x44,0x4a,0x20,0x44, ++0x65,0x6c,0x6f,0x72,0x69,0x65,0x2e,0x20,0x0d,0x0a,0x50,0x65,0x72,0x6d,0x69,0x73, ++0x73,0x69,0x6f,0x6e,0x20,0x67,0x72,0x61,0x6e,0x74,0x65,0x64,0x20,0x74,0x6f,0x20, ++0x75,0x73,0x65,0x20,0x66,0x6f,0x72,0x20,0x61,0x6e,0x79,0x20,0x70,0x75,0x72,0x70, ++0x6f,0x73,0x65,0x20,0x70,0x72,0x6f,0x76,0x69,0x64,0x65,0x64,0x20,0x74,0x68,0x69, ++0x73,0x20,0x63,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x0d,0x0a,0x72,0x65, ++0x6d,0x61,0x69,0x6e,0x73,0x20,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x20,0x61,0x6e, ++0x64,0x20,0x75,0x6e,0x6d,0x6f,0x64,0x69,0x66,0x69,0x65,0x64,0x2e,0x20,0x0d,0x0a, ++0x54,0x68,0x69,0x73,0x20,0x6f,0x6e,0x6c,0x79,0x20,0x61,0x70,0x70,0x6c,0x69,0x65, ++0x73,0x20,0x74,0x6f,0x20,0x74,0x68,0x65,0x20,0x73,0x74,0x75,0x62,0x2c,0x20,0x61, ++0x6e,0x64,0x20,0x6e,0x6f,0x74,0x20,0x6e,0x65,0x63,0x65,0x73,0x73,0x61,0x72,0x69, ++0x6c,0x79,0x20,0x74,0x68,0x65,0x20,0x77,0x68,0x6f,0x6c,0x65,0x20,0x70,0x72,0x6f, ++0x67,0x72,0x61,0x6d,0x2e,0x0a,0x0d,0x0a,0x24,0x49,0x64,0x3a,0x20,0x73,0x74,0x75, ++0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x32,0x30,0x32,0x32, ++0x2d,0x30,0x39,0x2d,0x32,0x38,0x20,0x31,0x39,0x3a,0x30,0x36,0x3a,0x35,0x39,0x20, ++0x62,0x79,0x20,0x64,0x6a,0x61,0x73,0x6d,0x20,0x24,0x0a,0x0d,0x0a,0x40,0x28,0x23, ++0x29,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x75,0x69,0x6c,0x74, ++0x20,0x32,0x30,0x32,0x32,0x2d,0x30,0x39,0x2d,0x32,0x38,0x20,0x31,0x39,0x3a,0x30, ++0x36,0x3a,0x35,0x39,0x20,0x62,0x79,0x20,0x64,0x6a,0x61,0x73,0x6d,0x0a,0x0d,0x0a, ++0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +-0x67,0x6f,0x33,0x32,0x73,0x74,0x75,0x62,0x2c,0x20,0x76,0x20,0x32,0x2e,0x30,0x32, ++0x67,0x6f,0x33,0x32,0x73,0x74,0x75,0x62,0x2c,0x20,0x76,0x20,0x32,0x2e,0x30,0x35, + 0x54,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x43,0x57,0x53,0x44,0x50,0x4d,0x49,0x2e,0x45,0x58,0x45,0x00, + 0x00,0x00,0x00,0x00,0x0e,0x1f,0x8c,0x1e,0x24,0x00,0x8c,0x06,0x60,0x07,0xfc,0xb4, +-0x30,0xcd,0x21,0x3c,0x03,0x73,0x08,0xb0,0x6d,0xba,0xa7,0x05,0xe9,0xd4,0x03,0xa2, ++0x30,0xcd,0x21,0x3c,0x03,0x73,0x08,0xb0,0x6d,0xba,0xc2,0x05,0xe9,0xe0,0x03,0xa2, + 0x69,0x08,0xbe,0x20,0x00,0x8b,0x04,0x09,0xc0,0x75,0x02,0xb4,0xfe,0xbb,0x70,0x08, + 0x39,0xc3,0x73,0x02,0x89,0xc3,0x89,0x1c,0xfe,0xc7,0xb9,0x04,0xff,0xd3,0xeb,0xb4, + 0x4a,0xcd,0x21,0x73,0x08,0xd3,0xe3,0xfe,0xcf,0x89,0x1c,0xeb,0xd8,0x26,0x8e,0x06, +-0x2c,0x00,0x31,0xff,0x30,0xc0,0xa9,0xf2,0xae,0x26,0x81,0x3d,0x50,0x41,0x75,0x15, +-0xaf,0x26,0x81,0x3d,0x54,0x48,0x75,0x0d,0xaf,0x26,0x80,0x3d,0x3d,0x75,0x06,0x47, +-0x89,0x3e,0x8c,0x04,0x4f,0xae,0x75,0xdf,0xaf,0xb4,0x3e,0xbb,0x13,0x00,0xcd,0x21, +-0xb4,0x3e,0xbb,0x12,0x00,0xcd,0x21,0x06,0x57,0x31,0xc9,0x74,0x12,0xb0,0x6e,0xba, +-0x7e,0x05,0xe9,0x5e,0x03,0x09,0xc9,0x75,0xf4,0x41,0xe8,0xa1,0x03,0x72,0xee,0xb8, +-0x87,0x16,0xcd,0x2f,0x09,0xc0,0x75,0xed,0x80,0xe3,0x01,0x74,0xe8,0x89,0x3e,0x00, +-0x06,0x8c,0x06,0x02,0x06,0x89,0x36,0x04,0x06,0x5f,0x07,0xe8,0xd3,0x02,0x89,0x3e, +-0x2a,0x00,0x89,0x36,0x62,0x07,0x80,0x3e,0x2c,0x00,0x00,0x74,0x23,0xb9,0x08,0x00, +-0xbf,0x2c,0x00,0x8a,0x05,0x47,0x08,0xc0,0x74,0x05,0x88,0x07,0x43,0xe2,0xf4,0x66, +-0xc7,0x07,0x2e,0x45,0x58,0x45,0x83,0xc3,0x04,0xc6,0x07,0x00,0x89,0x1e,0x62,0x07, +-0xb8,0x00,0x3d,0xba,0x64,0x07,0xcd,0x21,0x0f,0x82,0xb3,0x02,0xa3,0x06,0x06,0x89, +-0xc3,0xb9,0x06,0x00,0xba,0xb5,0x07,0xb4,0x3f,0xcd,0x21,0x31,0xd2,0x31,0xc9,0xa1, +-0xb5,0x07,0x3d,0x4c,0x01,0x74,0x1b,0x3d,0x4d,0x5a,0x0f,0x85,0x98,0x02,0x8b,0x16, +-0xb9,0x07,0xc1,0xe2,0x09,0x8b,0x1e,0xb7,0x07,0x09,0xdb,0x74,0x05,0x80,0xee,0x02, +-0x01,0xda,0x89,0x16,0xbb,0x07,0x89,0x0e,0xbd,0x07,0xb8,0x00,0x42,0x8b,0x1e,0x06, +-0x06,0xcd,0x21,0xb9,0xa8,0x00,0xba,0xbf,0x07,0xb4,0x3f,0xcd,0x21,0x3d,0xa8,0x00, +-0x75,0x06,0x81,0x3e,0xbf,0x07,0x4c,0x01,0x0f,0x85,0x61,0x02,0x66,0xa1,0xe3,0x07, +-0x66,0xa3,0x10,0x06,0x66,0x8b,0x0e,0xbb,0x07,0x66,0xa1,0x03,0x08,0x66,0x01,0xc8, +-0x66,0xa3,0x08,0x06,0x66,0xa1,0x2b,0x08,0x66,0x01,0xc8,0x66,0xa3,0x0c,0x06,0x66, +-0x8b,0x1e,0x4b,0x08,0x66,0xa1,0x4f,0x08,0x66,0x01,0xc3,0x66,0xb8,0x01,0x00,0x01, +-0x00,0x66,0x39,0xc3,0x73,0x03,0x66,0x89,0xc3,0x66,0x81,0xc3,0xff,0xff,0x00,0x00, +-0x31,0xdb,0x66,0x89,0x1e,0x1c,0x00,0xe8,0xf5,0x02,0x8b,0x1e,0x04,0x06,0x09,0xdb, +-0x74,0x0a,0xb4,0x48,0xcd,0x21,0x0f,0x82,0x15,0x02,0x8e,0xc0,0xe8,0x08,0x03,0xb8, +-0x01,0x00,0xff,0x1e,0x00,0x06,0x0f,0x82,0x0f,0x02,0x8c,0x06,0x26,0x00,0x8c,0x0e, +-0x28,0x00,0x8c,0xd8,0xa3,0x22,0x00,0x8e,0xc0,0x31,0xc0,0xb9,0x01,0x00,0xcd,0x31, +-0x72,0x07,0xa3,0x14,0x06,0x31,0xc0,0xcd,0x31,0x0f,0x82,0xf3,0x01,0xa3,0x16,0x06, +-0x66,0x8b,0x0e,0x1c,0x00,0xb8,0x01,0x05,0x8b,0x1e,0x1e,0x00,0xcd,0x31,0x0f,0x82, +-0xe5,0x01,0x89,0x1e,0x1a,0x06,0x89,0x0e,0x18,0x06,0x89,0x36,0x1a,0x00,0x89,0x3e, +-0x18,0x00,0xb8,0x07,0x00,0x8b,0x1e,0x14,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18, +-0x06,0xcd,0x31,0xb8,0x09,0x00,0x8c,0xc9,0x83,0xe1,0x03,0xc1,0xe1,0x05,0x51,0x81, +-0xc9,0x9b,0xc0,0xcd,0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff, +-0xcd,0x31,0xb8,0x07,0x00,0x8b,0x1e,0x16,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18, +-0x06,0xcd,0x31,0xb8,0x09,0x00,0x59,0x81,0xc9,0x93,0xc0,0xcd,0x31,0xb8,0x08,0x00, +-0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x00,0x01,0xbb,0x00,0x0f, +-0xcd,0x31,0x73,0x10,0x3d,0x08,0x00,0x0f,0x85,0x73,0x01,0xb8,0x00,0x01,0xcd,0x31, +-0x0f,0x82,0x6a,0x01,0xa3,0x1c,0x06,0x89,0x16,0x1e,0x06,0xc1,0xe3,0x04,0x89,0x1e, +-0x20,0x06,0x66,0x8b,0x36,0x08,0x06,0x66,0x8b,0x3e,0xfb,0x07,0x66,0x8b,0x0e,0xff, +-0x07,0xe8,0x49,0x00,0x66,0x8b,0x36,0x0c,0x06,0x66,0x8b,0x3e,0x23,0x08,0x66,0x8b, +-0x0e,0x27,0x08,0xe8,0x37,0x00,0x8e,0x06,0x16,0x06,0x66,0x8b,0x3e,0x4b,0x08,0x66, +-0x8b,0x0e,0x4f,0x08,0x66,0x31,0xc0,0x66,0xc1,0xe9,0x02,0x67,0xf3,0x66,0xab,0xb4, +-0x3e,0x8b,0x1e,0x06,0x06,0xcd,0x21,0xb8,0x01,0x01,0x8b,0x16,0x1e,0x06,0xcd,0x31, +-0x1e,0x0f,0xa1,0x8e,0x1e,0x16,0x06,0x66,0x64,0xff,0x2e,0x10,0x06,0x66,0x89,0xf0, +-0x66,0x25,0xff,0x01,0x00,0x00,0x66,0x01,0xc1,0x29,0xc6,0x66,0x29,0xc7,0x66,0x89, +-0x0e,0x26,0x06,0x66,0x89,0x3e,0x22,0x06,0xe8,0x0f,0x01,0x89,0x36,0x3e,0x06,0x66, +-0xc1,0xee,0x10,0x89,0x36,0x42,0x06,0x8b,0x1e,0x06,0x06,0x89,0x1e,0x3a,0x06,0xc7, +-0x06,0x46,0x06,0x00,0x42,0xe8,0x03,0x01,0xa1,0x1c,0x06,0xa3,0x4e,0x06,0xc7,0x06, +-0x3e,0x06,0x00,0x00,0xc6,0x06,0x47,0x06,0x3f,0xa1,0x28,0x06,0x09,0xc0,0x75,0x09, +-0xa1,0x26,0x06,0x3b,0x06,0x20,0x06,0x76,0x03,0xa1,0x20,0x06,0xa3,0x42,0x06,0xe8, +-0xd9,0x00,0x66,0x31,0xc9,0x8b,0x0e,0x46,0x06,0x66,0x8b,0x3e,0x22,0x06,0x66,0x01, +-0x0e,0x22,0x06,0x66,0x29,0x0e,0x26,0x06,0x66,0x31,0xf6,0xc1,0xe9,0x02,0x1e,0x06, +-0x8e,0x06,0x16,0x06,0x8e,0x1e,0x1e,0x06,0x67,0xf3,0x66,0xa5,0x07,0x1f,0x66,0x03, +-0x0e,0x26,0x06,0x75,0xaf,0xc3,0x3c,0x3a,0x74,0x06,0x3c,0x2f,0x74,0x02,0x3c,0x5c, +-0xc3,0xbe,0x64,0x07,0x89,0xf3,0x26,0x8a,0x05,0x47,0x88,0x04,0x38,0xe0,0x74,0x0e, +-0x08,0xc0,0x74,0x0a,0x46,0xe8,0xde,0xff,0x75,0xec,0x89,0xf3,0x74,0xe8,0xc3,0xb0, +-0x66,0xba,0x48,0x05,0xeb,0x0c,0xb0,0x67,0xba,0x55,0x05,0xeb,0x05,0xb0,0x68,0xba, +-0x5f,0x05,0x52,0x8b,0x1e,0x62,0x07,0xc6,0x07,0x24,0xbb,0x64,0x07,0xeb,0x28,0xe8, +-0xf5,0x00,0xb0,0x69,0xba,0x99,0x05,0xeb,0x1a,0xb0,0x6a,0xba,0xb2,0x05,0xeb,0x13, +-0xb0,0x6b,0xba,0xc4,0x05,0xeb,0x0c,0xb0,0x6c,0xba,0xd6,0x05,0xeb,0x05,0xb0,0x69, +-0xba,0x99,0x05,0x52,0xbb,0x3b,0x05,0xe8,0x15,0x00,0x5b,0xe8,0x11,0x00,0xbb,0x67, +-0x04,0xe8,0x0b,0x00,0xb4,0x4c,0xcd,0x21,0x43,0x50,0xb4,0x02,0xcd,0x21,0x58,0x8a, +-0x17,0x80,0xfa,0x24,0x75,0xf2,0xc3,0x0d,0x0a,0x24,0x50,0x51,0x57,0x31,0xc0,0xbf, +-0x2a,0x06,0xb9,0x19,0x00,0xf3,0xab,0x5f,0x59,0x58,0xc3,0xb8,0x00,0x03,0xbb,0x21, +-0x00,0x31,0xc9,0x66,0xbf,0x2a,0x06,0x00,0x00,0xcd,0x31,0xc3,0x00,0x00,0x30,0xe4, +-0xe8,0x4e,0xff,0x89,0xde,0x8b,0x3e,0x8c,0x04,0xeb,0x17,0xb4,0x3b,0xe8,0x41,0xff, +-0x81,0xfe,0x64,0x07,0x74,0x12,0x8a,0x44,0xff,0xe8,0x2a,0xff,0x74,0x04,0xc6,0x04, +-0x5c,0x46,0xe8,0x03,0x00,0x72,0xe4,0xc3,0xe8,0x34,0x00,0xbb,0x44,0x00,0x8a,0x07, +-0x88,0x04,0x43,0x46,0x08,0xc0,0x75,0xf6,0x06,0x57,0x1e,0x07,0xe8,0x9b,0xff,0xbb, +-0x2a,0x06,0x8c,0x5f,0x04,0x89,0x5f,0x02,0xba,0x64,0x07,0xb8,0x00,0x4b,0xcd,0x21, +-0x5f,0x07,0x72,0x09,0xb4,0x4d,0xcd,0x21,0x2d,0x00,0x03,0xf7,0xd8,0xeb,0x28,0x80, +-0x3e,0x69,0x08,0x05,0x72,0x20,0xb8,0x00,0x58,0xcd,0x21,0xa2,0x67,0x08,0xb8,0x02, +-0x58,0xcd,0x21,0xa2,0x68,0x08,0xb8,0x01,0x58,0xbb,0x80,0x00,0xcd,0x21,0xb8,0x03, +-0x58,0xbb,0x01,0x00,0xcd,0x21,0xc3,0x9c,0x80,0x3e,0x69,0x08,0x05,0x72,0x1a,0x50, +-0x53,0xb8,0x03,0x58,0x8a,0x1e,0x68,0x08,0x30,0xff,0xcd,0x21,0xb8,0x01,0x58,0x8a, +-0x1e,0x67,0x08,0x30,0xff,0xcd,0x21,0x5b,0x58,0x9d,0xc3,0x4c,0x6f,0x61,0x64,0x20, +-0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0x24,0x3a,0x20,0x63,0x61,0x6e,0x27,0x74,0x20, +-0x6f,0x70,0x65,0x6e,0x24,0x3a,0x20,0x6e,0x6f,0x74,0x20,0x45,0x58,0x45,0x24,0x3a, +-0x20,0x6e,0x6f,0x74,0x20,0x43,0x4f,0x46,0x46,0x20,0x28,0x43,0x68,0x65,0x63,0x6b, +-0x20,0x66,0x6f,0x72,0x20,0x76,0x69,0x72,0x75,0x73,0x65,0x73,0x29,0x24,0x6e,0x6f, +-0x20,0x44,0x50,0x4d,0x49,0x20,0x2d,0x20,0x47,0x65,0x74,0x20,0x63,0x73,0x64,0x70, +-0x6d,0x69,0x2a,0x62,0x2e,0x7a,0x69,0x70,0x24,0x6e,0x6f,0x20,0x44,0x4f,0x53,0x20, +-0x6d,0x65,0x6d,0x6f,0x72,0x79,0x24,0x6e,0x65,0x65,0x64,0x20,0x44,0x4f,0x53,0x20, +-0x33,0x24,0x63,0x61,0x6e,0x27,0x74,0x20,0x73,0x77,0x69,0x74,0x63,0x68,0x20,0x6d, +-0x6f,0x64,0x65,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x73,0x65,0x6c,0x65, +-0x63,0x74,0x6f,0x72,0x73,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x6d,0x65, +-0x6d,0x6f,0x72,0x79,0x24,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, +-0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90 ++0x2c,0x00,0x8c,0xc7,0x09,0xff,0x75,0x08,0xb0,0x6f,0xba,0x8f,0x05,0xe9,0x9f,0x03, ++0x31,0xff,0x30,0xc0,0xeb,0x02,0xf2,0xae,0x26,0x81,0x3d,0x50,0x41,0x75,0x15,0xaf, ++0x26,0x81,0x3d,0x54,0x48,0x75,0x0d,0xaf,0x26,0x80,0x3d,0x3d,0x75,0x06,0x47,0x89, ++0x3e,0x98,0x04,0x4f,0xae,0x75,0xdf,0xaf,0x06,0x57,0xb4,0x3e,0xbb,0x13,0x00,0xcd, ++0x21,0xb4,0x3e,0xbb,0x12,0x00,0xcd,0x21,0x31,0xc9,0x74,0x12,0xb0,0x6e,0xba,0x99, ++0x05,0xe9,0x5b,0x03,0x09,0xc9,0x75,0xf4,0x41,0xe8,0x9e,0x03,0x72,0xee,0xb8,0x87, ++0x16,0xcd,0x2f,0x09,0xc0,0x75,0xed,0x80,0xe3,0x01,0x74,0xe8,0x89,0x3e,0x00,0x06, ++0x8c,0x06,0x02,0x06,0x89,0x36,0x04,0x06,0x5f,0x07,0xe8,0xd0,0x02,0x89,0x3e,0x2a, ++0x00,0x89,0x36,0x62,0x07,0x80,0x3e,0x2c,0x00,0x00,0x74,0x23,0xb9,0x08,0x00,0xbf, ++0x2c,0x00,0x8a,0x05,0x47,0x08,0xc0,0x74,0x05,0x88,0x07,0x43,0xe2,0xf4,0x66,0xc7, ++0x07,0x2e,0x45,0x58,0x45,0x83,0xc3,0x04,0xc6,0x07,0x00,0x89,0x1e,0x62,0x07,0xb8, ++0x00,0x3d,0xba,0x64,0x07,0xcd,0x21,0x0f,0x82,0xb0,0x02,0xa3,0x06,0x06,0x89,0xc3, ++0xb9,0x06,0x00,0xba,0xb5,0x07,0xb4,0x3f,0xcd,0x21,0x31,0xd2,0x31,0xc9,0xa1,0xb5, ++0x07,0x3d,0x4c,0x01,0x74,0x1b,0x3d,0x4d,0x5a,0x0f,0x85,0x95,0x02,0x8b,0x16,0xb9, ++0x07,0xc1,0xe2,0x09,0x8b,0x1e,0xb7,0x07,0x09,0xdb,0x74,0x05,0x80,0xee,0x02,0x01, ++0xda,0x89,0x16,0xbb,0x07,0x89,0x0e,0xbd,0x07,0xb8,0x00,0x42,0x8b,0x1e,0x06,0x06, ++0xcd,0x21,0xb9,0xa8,0x00,0xba,0xbf,0x07,0xb4,0x3f,0xcd,0x21,0x3d,0xa8,0x00,0x75, ++0x06,0x81,0x3e,0xbf,0x07,0x4c,0x01,0x0f,0x85,0x5e,0x02,0x66,0xa1,0xe3,0x07,0x66, ++0xa3,0x10,0x06,0x66,0x8b,0x0e,0xbb,0x07,0x66,0xa1,0x03,0x08,0x66,0x01,0xc8,0x66, ++0xa3,0x08,0x06,0x66,0x03,0x0e,0x2b,0x08,0x66,0x89,0x0e,0x0c,0x06,0x66,0x8b,0x1e, ++0x4b,0x08,0x66,0x03,0x1e,0x4f,0x08,0x66,0xb8,0x01,0x00,0x01,0x00,0x66,0x39,0xc3, ++0x73,0x03,0x66,0x89,0xc3,0x66,0x81,0xc3,0xff,0xff,0x00,0x00,0x31,0xdb,0x66,0x89, ++0x1e,0x1c,0x00,0xe8,0xfa,0x02,0x8b,0x1e,0x04,0x06,0x09,0xdb,0x74,0x0a,0xb4,0x48, ++0xcd,0x21,0x0f,0x82,0x15,0x02,0x8e,0xc0,0xe8,0x0d,0x03,0xb8,0x01,0x00,0xff,0x1e, ++0x00,0x06,0x0f,0x82,0x0f,0x02,0x8c,0x06,0x26,0x00,0x8c,0x0e,0x28,0x00,0x8c,0xd8, ++0xa3,0x22,0x00,0x8e,0xc0,0x31,0xc0,0xb9,0x01,0x00,0xcd,0x31,0x72,0x07,0xa3,0x14, ++0x06,0x31,0xc0,0xcd,0x31,0x0f,0x82,0xf3,0x01,0xa3,0x16,0x06,0x66,0x8b,0x0e,0x1c, ++0x00,0xb8,0x01,0x05,0x8b,0x1e,0x1e,0x00,0xcd,0x31,0x0f,0x82,0xe5,0x01,0x89,0x1e, ++0x1a,0x06,0x89,0x0e,0x18,0x06,0x89,0x36,0x1a,0x00,0x89,0x3e,0x18,0x00,0xb8,0x07, ++0x00,0x8b,0x1e,0x14,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18,0x06,0xcd,0x31,0xb8, ++0x09,0x00,0x8c,0xc9,0x83,0xe1,0x03,0xc1,0xe1,0x05,0x51,0x81,0xc9,0x9b,0xc0,0xcd, ++0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x07, ++0x00,0x8b,0x1e,0x16,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18,0x06,0xcd,0x31,0xb8, ++0x09,0x00,0x59,0x81,0xc9,0x93,0xc0,0xcd,0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00, ++0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x00,0x01,0xbb,0x00,0x0f,0xcd,0x31,0x73,0x10, ++0x3d,0x08,0x00,0x0f,0x85,0x73,0x01,0xb8,0x00,0x01,0xcd,0x31,0x0f,0x82,0x6a,0x01, ++0xa3,0x1c,0x06,0x89,0x16,0x1e,0x06,0xc1,0xe3,0x04,0x89,0x1e,0x20,0x06,0x66,0x8b, ++0x36,0x08,0x06,0x66,0x8b,0x3e,0xfb,0x07,0x66,0x8b,0x0e,0xff,0x07,0xe8,0x49,0x00, ++0x66,0x8b,0x36,0x0c,0x06,0x66,0x8b,0x3e,0x23,0x08,0x66,0x8b,0x0e,0x27,0x08,0xe8, ++0x37,0x00,0x8e,0x06,0x16,0x06,0x66,0x8b,0x3e,0x4b,0x08,0x66,0x8b,0x0e,0x4f,0x08, ++0x66,0x31,0xc0,0x66,0xc1,0xe9,0x02,0x67,0xf3,0x66,0xab,0xb4,0x3e,0x8b,0x1e,0x06, ++0x06,0xcd,0x21,0xb8,0x01,0x01,0x8b,0x16,0x1e,0x06,0xcd,0x31,0x1e,0x0f,0xa1,0x8e, ++0x1e,0x16,0x06,0x66,0x64,0xff,0x2e,0x10,0x06,0x66,0x89,0xf0,0x66,0x25,0xff,0x01, ++0x00,0x00,0x66,0x01,0xc1,0x29,0xc6,0x66,0x29,0xc7,0x66,0x89,0x0e,0x26,0x06,0x66, ++0x89,0x3e,0x22,0x06,0xe8,0x0f,0x01,0x89,0x36,0x3e,0x06,0x66,0xc1,0xee,0x10,0x89, ++0x36,0x42,0x06,0x8b,0x1e,0x06,0x06,0x89,0x1e,0x3a,0x06,0xc7,0x06,0x46,0x06,0x00, ++0x42,0xe8,0x03,0x01,0xa1,0x1c,0x06,0xa3,0x4e,0x06,0xc7,0x06,0x3e,0x06,0x00,0x00, ++0xc6,0x06,0x47,0x06,0x3f,0xa1,0x28,0x06,0x09,0xc0,0x75,0x09,0xa1,0x26,0x06,0x3b, ++0x06,0x20,0x06,0x76,0x03,0xa1,0x20,0x06,0xa3,0x42,0x06,0xe8,0xd9,0x00,0x66,0x31, ++0xc9,0x8b,0x0e,0x46,0x06,0x66,0x8b,0x3e,0x22,0x06,0x66,0x01,0x0e,0x22,0x06,0x66, ++0x29,0x0e,0x26,0x06,0x66,0x31,0xf6,0xc1,0xe9,0x02,0x1e,0x06,0x8e,0x06,0x16,0x06, ++0x8e,0x1e,0x1e,0x06,0x67,0xf3,0x66,0xa5,0x07,0x1f,0x66,0x03,0x0e,0x26,0x06,0x75, ++0xaf,0xc3,0x3c,0x3a,0x74,0x06,0x3c,0x2f,0x74,0x02,0x3c,0x5c,0xc3,0xbe,0x64,0x07, ++0x89,0xf3,0x26,0x8a,0x05,0x47,0x88,0x04,0x38,0xe0,0x74,0x0e,0x08,0xc0,0x74,0x0a, ++0x46,0xe8,0xde,0xff,0x75,0xec,0x89,0xf3,0x74,0xe8,0xc3,0xb0,0x66,0xba,0x59,0x05, ++0xeb,0x0c,0xb0,0x67,0xba,0x66,0x05,0xeb,0x05,0xb0,0x68,0xba,0x70,0x05,0x52,0x8b, ++0x1e,0x62,0x07,0xc6,0x07,0x24,0xbb,0x64,0x07,0xeb,0x28,0xe8,0xfa,0x00,0xb0,0x69, ++0xba,0xb4,0x05,0xeb,0x1a,0xb0,0x6a,0xba,0xcd,0x05,0xeb,0x13,0xb0,0x6b,0xba,0xdf, ++0x05,0xeb,0x0c,0xb0,0x6c,0xba,0xf1,0x05,0xeb,0x05,0xb0,0x69,0xba,0xb4,0x05,0x52, ++0xbb,0x4c,0x05,0xe8,0x15,0x00,0x5b,0xe8,0x11,0x00,0xbb,0x73,0x04,0xe8,0x0b,0x00, ++0xb4,0x4c,0xcd,0x21,0x43,0x50,0xb4,0x02,0xcd,0x21,0x58,0x8a,0x17,0x80,0xfa,0x24, ++0x75,0xf2,0xc3,0x0d,0x0a,0x24,0x50,0x51,0x57,0x31,0xc0,0xbf,0x2a,0x06,0xb9,0x19, ++0x00,0xf3,0xab,0x5f,0x59,0x58,0xc3,0xb8,0x00,0x03,0xbb,0x21,0x00,0x31,0xc9,0x66, ++0xbf,0x2a,0x06,0x00,0x00,0xcd,0x31,0xc3,0x00,0x00,0x30,0xe4,0xe8,0x4e,0xff,0x89, ++0xde,0x8b,0x3e,0x98,0x04,0xeb,0x1c,0xb4,0x3b,0xe8,0x41,0xff,0x08,0xc0,0x75,0x01, ++0x4f,0x81,0xfe,0x64,0x07,0x74,0x12,0x8a,0x44,0xff,0xe8,0x25,0xff,0x74,0x04,0xc6, ++0x04,0x5c,0x46,0xe8,0x03,0x00,0x72,0xdf,0xc3,0xe8,0x34,0x00,0xbb,0x44,0x00,0x8a, ++0x07,0x88,0x04,0x43,0x46,0x08,0xc0,0x75,0xf6,0x06,0x57,0x1e,0x07,0xe8,0x96,0xff, ++0xbb,0x2a,0x06,0x8c,0x5f,0x04,0x89,0x5f,0x02,0xba,0x64,0x07,0xb8,0x00,0x4b,0xcd, ++0x21,0x5f,0x07,0x72,0x09,0xb4,0x4d,0xcd,0x21,0x2d,0x00,0x03,0xf7,0xd8,0xeb,0x28, ++0x80,0x3e,0x69,0x08,0x05,0x72,0x20,0xb8,0x00,0x58,0xcd,0x21,0xa2,0x67,0x08,0xb8, ++0x02,0x58,0xcd,0x21,0xa2,0x68,0x08,0xb8,0x01,0x58,0xbb,0x80,0x00,0xcd,0x21,0xb8, ++0x03,0x58,0xbb,0x01,0x00,0xcd,0x21,0xc3,0x9c,0x80,0x3e,0x69,0x08,0x05,0x72,0x1a, ++0x50,0x53,0xb8,0x03,0x58,0x8a,0x1e,0x68,0x08,0x30,0xff,0xcd,0x21,0xb8,0x01,0x58, ++0x8a,0x1e,0x67,0x08,0x30,0xff,0xcd,0x21,0x5b,0x58,0x9d,0xc3,0x4c,0x6f,0x61,0x64, ++0x20,0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0x24,0x3a,0x20,0x63,0x61,0x6e,0x27,0x74, ++0x20,0x6f,0x70,0x65,0x6e,0x24,0x3a,0x20,0x6e,0x6f,0x74,0x20,0x45,0x58,0x45,0x24, ++0x3a,0x20,0x6e,0x6f,0x74,0x20,0x43,0x4f,0x46,0x46,0x20,0x28,0x43,0x68,0x65,0x63, ++0x6b,0x20,0x66,0x6f,0x72,0x20,0x76,0x69,0x72,0x75,0x73,0x65,0x73,0x29,0x24,0x6e, ++0x6f,0x20,0x65,0x6e,0x76,0x73,0x65,0x67,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49, ++0x20,0x2d,0x20,0x47,0x65,0x74,0x20,0x63,0x73,0x64,0x70,0x6d,0x69,0x2a,0x62,0x2e, ++0x7a,0x69,0x70,0x24,0x6e,0x6f,0x20,0x44,0x4f,0x53,0x20,0x6d,0x65,0x6d,0x6f,0x72, ++0x79,0x24,0x6e,0x65,0x65,0x64,0x20,0x44,0x4f,0x53,0x20,0x33,0x24,0x63,0x61,0x6e, ++0x27,0x74,0x20,0x73,0x77,0x69,0x74,0x63,0x68,0x20,0x6d,0x6f,0x64,0x65,0x24,0x6e, ++0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x73,0x65,0x6c,0x65,0x63,0x74,0x6f,0x72,0x73, ++0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x6d,0x65,0x6d,0x6f,0x72,0x79,0x24 diff --git a/script/unpack-build-binutils.sh b/script/unpack-build-binutils.sh index 216b6ee..2e00156 100644 --- a/script/unpack-build-binutils.sh +++ b/script/unpack-build-binutils.sh @@ -5,14 +5,17 @@ if [ ! -z ${BINUTILS_VERSION} ]; then echo "Unpacking binutils..." untar ${BINUTILS_ARCHIVE} || exit 1 + cd binutils-${BINUTILS_VERSION}/ || exit 1 case ${BINUTILS_VERSION} in - 2.33.1) patch binutils-${BINUTILS_VERSION}/libctf/swap.h ${BASE}/patch/patch-binutils-2.33.1-swap.txt || exit 1 ;; - 2.34) patch binutils-${BINUTILS_VERSION}/libctf/swap.h ${BASE}/patch/patch-binutils-2.34-swap.txt || exit 1 ;; + 2.33.1) patch libctf/swap.h ${BASE}/patch/patch-binutils-2.33.1-swap.txt || exit 1 ;; + 2.34) patch libctf/swap.h ${BASE}/patch/patch-binutils-2.34-swap.txt || exit 1 ;; esac + cat ${BASE}/patch/binutils-${BINUTILS_VERSION}/* | patch -p1 -u || exit 1 - touch binutils-${BINUTILS_VERSION}/binutils-unpacked + touch binutils-unpacked + else + cd binutils-${BINUTILS_VERSION}/ || exit 1 fi - cd binutils-${BINUTILS_VERSION} || exit 1 source ${BASE}/script/build-binutils.sh fi From ec3d79cb37b741cf1ffdc0bd5a20f6f1a253c840 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 17:56:02 +0100 Subject: [PATCH 490/536] actions: use checkout@v3 --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/main.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5eb290d..3f80d76 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,7 +10,7 @@ jobs: outputs: good: ${{ steps.docheck.outputs.good }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - id: docheck name: Check release state run: | @@ -25,7 +25,7 @@ jobs: ubuntu-version: [ bionic, focal, jammy, kinetic ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install dependencies run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9298db8..84b5bcf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: PACKAGES: binutils gcc newlib steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Clear apt package cache if: contains(matrix.os, 'ubuntu') From fa47c325cdfccd9e21bbb783748fe1f9169eba4d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 17:56:37 +0100 Subject: [PATCH 491/536] build ppa for ubuntu lunar [fixes: #31] --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3f80d76..ad1fb6e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: if: needs.check.outputs.good == 'true' strategy: matrix: - ubuntu-version: [ bionic, focal, jammy, kinetic ] + ubuntu-version: [ bionic, focal, jammy, kinetic, lunar ] steps: - uses: actions/checkout@v3 From c1154321ad464ef7fb633c307aacc72f0d600512 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 17:59:25 +0100 Subject: [PATCH 492/536] release debian package v9 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c143226..05571a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -djgpp-toolchain (9) UNRELEASED; urgency=medium +djgpp-toolchain (9) unstable; urgency=medium * Update go32 stub in binutils to match libc version. From 35ae86454f273df4c3cf9a256abfa4ee8bd3463c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 18:03:03 +0100 Subject: [PATCH 493/536] run test builds with gcc 12 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84b5bcf..47e38f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,8 +85,8 @@ jobs: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev nasm libslang2-dev - echo "CC=gcc-11" >> $GITHUB_ENV - echo "CXX=g++-11" >> $GITHUB_ENV + echo "CC=gcc-12" >> $GITHUB_ENV + echo "CXX=g++-12" >> $GITHUB_ENV - name: Install dependencies (macos) if: contains(matrix.os, 'macos') From f260f8a33c9ccbb708b58f661d3488270dcb6c23 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 18:19:10 +0100 Subject: [PATCH 494/536] actions: use cache@v3 --- .github/workflows/main.yml | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 47e38f2..d58c8ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,34 +42,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Clear apt package cache - if: contains(matrix.os, 'ubuntu') - run: | - sudo apt-get clean - - name: Clear brew package cache if: contains(matrix.os, 'macos') run: | rm -rf $(brew --cache) - - name: Cache apt package lists - uses: jwt27/cache@dist - if: contains(matrix.os, 'ubuntu') - with: - path: /var/lib/apt/lists - key: testbuild-apt-lists-${{ github.sha }} - restore-keys: | - testbuild-apt-lists- - - - name: Cache apt package cache - uses: jwt27/cache@dist - if: contains(matrix.os, 'ubuntu') - with: - path: /var/cache/apt - key: testbuild-apt-cache-${{ github.sha }} - restore-keys: | - testbuild-apt-cache- - - name: Cache brew package cache uses: jwt27/cache@dist if: contains(matrix.os, 'macos') @@ -95,7 +72,7 @@ jobs: brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man nasm s-lang - name: Cache sources - uses: jwt27/cache@dist + uses: actions/cache@v3 with: path: download key: testbuild-sources-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}-${{ github.sha }} @@ -109,7 +86,7 @@ jobs: run: ./script/select-script.sh --only-download - name: Cache build output - uses: jwt27/cache@dist + uses: actions/cache@v3 if: matrix.build-type == 'rebuild' id: cache-build with: From 71a881f08c27f0e1935de9f57f78557f8aff29af Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 18:31:43 +0100 Subject: [PATCH 495/536] use ccache in test builds --- .github/workflows/main.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d58c8ce..87727a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,15 +61,17 @@ jobs: run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev nasm libslang2-dev + sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev nasm libslang2-dev ccache echo "CC=gcc-12" >> $GITHUB_ENV echo "CXX=g++-12" >> $GITHUB_ENV + echo "PATH='/usr/lib/ccache:$PATH'" >> $GITHUB_ENV - name: Install dependencies (macos) if: contains(matrix.os, 'macos') run: | brew update - brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man nasm s-lang + brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man nasm s-lang ccache + echo "PATH='$(brew --prefix)/opt/ccache/libexec:$PATH'" >> $GITHUB_ENV - name: Cache sources uses: actions/cache@v3 @@ -79,6 +81,14 @@ jobs: restore-keys: | testbuild-sources-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}- + - name: Cache ccache + uses: actions/cache@v3 + with: + path: ~/.ccache + key: testbuild-ccache-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}-${{ github.sha }} + restore-keys: | + testbuild-ccache-${{ matrix.os }}-${{ matrix.env.TARGET }}-${{ matrix.env.PACKAGES }}- + - name: Download sources env: TARGET: ${{ matrix.env.TARGET }} From 7aceaf11528d9e362fb6bba0eb0d69bbbe1a5b53 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 20:47:42 +0100 Subject: [PATCH 496/536] actions: use GITHUB_PATH --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87727a4..5bcf5a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,14 +64,14 @@ jobs: sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev nasm libslang2-dev ccache echo "CC=gcc-12" >> $GITHUB_ENV echo "CXX=g++-12" >> $GITHUB_ENV - echo "PATH='/usr/lib/ccache:$PATH'" >> $GITHUB_ENV + echo "/usr/lib/ccache" >> $GITHUB_PATH - name: Install dependencies (macos) if: contains(matrix.os, 'macos') run: | brew update brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man nasm s-lang ccache - echo "PATH='$(brew --prefix)/opt/ccache/libexec:$PATH'" >> $GITHUB_ENV + echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH - name: Cache sources uses: actions/cache@v3 From 40cbd08e5ab91381abdfd9232bf7bf7bae5f0cc5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 21:22:48 +0100 Subject: [PATCH 497/536] fix gcc specs file path --- script/finalize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/finalize.sh b/script/finalize.sh index 16035b9..9624eee 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -92,7 +92,7 @@ if [ ! -z "$(get_version gcc)" ]; then prepend_specs link "-L${PREFIX}/${TARGET}/local/lib" echo "Installing specs file" - install_files ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(get_version gcc)/ || exit 1 + install_files ${BASE}/build/specs ${DST}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/ || exit 1 fi cat << STOP >> ${BASE}/build/${TARGET}-setenv From 1ba0f3335088473592dd9c0a42d466ca8a6cf69b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 5 Dec 2022 22:46:18 +0100 Subject: [PATCH 498/536] actions: fix ccache dir --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5bcf5a8..e55ce9f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,6 +64,8 @@ jobs: sudo apt-get install bison flex curl make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip dos2unix libtool-bin gcc-11 g++-11 cmake help2man python2-dev nasm libslang2-dev ccache echo "CC=gcc-12" >> $GITHUB_ENV echo "CXX=g++-12" >> $GITHUB_ENV + mkdir -p ~/.ccache + echo "CCACHE_DIR=~/.ccache" >> $GITHUB_ENV echo "/usr/lib/ccache" >> $GITHUB_PATH - name: Install dependencies (macos) @@ -71,6 +73,8 @@ jobs: run: | brew update brew install bash bison flex curl make texinfo zlib bzip2 gzip xz unzip dos2unix libtool cmake help2man nasm s-lang ccache + mkdir -p ~/.ccache + echo "CCACHE_DIR=~/.ccache" >> $GITHUB_ENV echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH - name: Cache sources From 66720ae746a237c1455c7ab7153c03573ca2aa13 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 17 Dec 2022 16:41:02 +0100 Subject: [PATCH 499/536] fix stupid typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 152c20f..e11620b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ * 2020-02-13: default target for djgpp has changed to `i386-pc-msdosdjgpp`. If you require compatibility with distributions that use `i586`, you can either: - run `sudo i386-pc-msdosdjgpp-link-i586` after installing, or - - build with `./build-djgpp.sh --prefix=i586-pc-msdosdjgpp`. + - build with `./build-djgpp.sh --target=i586-pc-msdosdjgpp`. * 2020-02-07: setenv script is now installed to `$PREFIX/bin/$TARGET-setenv`. * 2019-06-06: `master` is now the default branch again. From e95b5439ce1e809a71de2503f20f3b608520f119 Mon Sep 17 00:00:00 2001 From: cwwcww <58440900+cwwcww@users.noreply.github.com> Date: Sun, 26 Feb 2023 14:20:25 +0300 Subject: [PATCH 500/536] Add missing nasm dependency --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e11620b..6524255 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ Before running this script, you need to install these programs first: * python3 headers (for gdb >= 9.0) * m4 * dos2unix +* nasm Depending on your system, installation procedure maybe different. @@ -61,19 +62,19 @@ On Debian/Ubuntu, you can install these programs by : ```console $ sudo apt-get update -$ sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev m4 dos2unix +$ sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 gzip xz-utils unzip python{2,3}-dev m4 dos2unix nasm ``` Fedora : ```console -$ sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 dos2unix +$ sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 dos2unix nasm ``` mingw-w64 (msys2) : ```console -$ pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression m4 dos2unix +$ pacman -Syuu base-devel mingw-w64-x86_64-{toolchain,curl,zlib,python{2,3}} compression m4 dos2unix nasm ``` ### Configuration From 2d331b72c7e6bcd800074ca6fa3c27e687e6957d Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Apr 2023 14:05:46 +0200 Subject: [PATCH 501/536] mention dxe3gen 1.0.5 --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 05571a0..27cce04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +djgpp-toolchain (10) UNRELEASED; urgency=medium + + * dxe3gen version 1.0.5. This now uses gcc to invoke the assembler and + linker. As a result, it is no longer necessary to set any environment + variables before use. + + -- jwt27 Tue, 04 Apr 2023 13:51:31 +0200 + djgpp-toolchain (9) unstable; urgency=medium * Update go32 stub in binutils to match libc version. From d2bfc4df04d763faa1249016b9de2b8a601421a3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Apr 2023 14:06:09 +0200 Subject: [PATCH 502/536] list `which` as dependency on fedora [#33] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6524255..c92d272 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ $ sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev tar bzip2 Fedora : ```console -$ sudo yum install gcc-c++ bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 dos2unix nasm +$ sudo yum install gcc-c++ which bison flex texinfo patch zlib-devel tar bzip2 gzip xz unzip python-devel m4 dos2unix nasm ``` mingw-w64 (msys2) : From 9a0083bc1e7735ecd49afea47f984748e1d9022f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Apr 2023 14:13:58 +0200 Subject: [PATCH 503/536] add gdb 13.1 --- README.md | 4 ++-- common/gdb | 2 +- common/gdb-13.1 | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 common/gdb-13.1 diff --git a/README.md b/README.md index c92d272..c3efc78 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ 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 2022-08-23: +### Current package versions, as of 2023-04-04: * gcc 12.2.0 * binutils 2.39 -* gdb 12.1 +* gdb 13.1 * djgpp 2.05 / cvs * watt-32 git * newlib 4.1.0 diff --git a/common/gdb b/common/gdb index ee8577f..f0a28fc 100644 --- a/common/gdb +++ b/common/gdb @@ -1 +1 @@ -source common/gdb-12.1 +source common/gdb-13.1 diff --git a/common/gdb-13.1 b/common/gdb-13.1 new file mode 100644 index 0000000..26d4922 --- /dev/null +++ b/common/gdb-13.1 @@ -0,0 +1,2 @@ +GDB_VERSION=13.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" From ae57313088db38153112d4b365af6ec5df143eba Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 4 Apr 2023 14:15:42 +0200 Subject: [PATCH 504/536] add binutils 2.40 --- README.md | 2 +- binutils/binutils | 2 +- binutils/binutils-2.40 | 2 ++ debian/changelog | 3 ++- djgpp/binutils | 2 +- djgpp/binutils-2.40 | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 binutils/binutils-2.40 create mode 100644 djgpp/binutils-2.40 diff --git a/README.md b/README.md index c3efc78..d6d8323 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you require compatibility with distributions that use `i586`, you can either: ### Current package versions, as of 2023-04-04: * gcc 12.2.0 -* binutils 2.39 +* binutils 2.40 * gdb 13.1 * djgpp 2.05 / cvs * watt-32 git diff --git a/binutils/binutils b/binutils/binutils index b64a522..c6f8fa6 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.39 +source binutils/binutils-2.40 diff --git a/binutils/binutils-2.40 b/binutils/binutils-2.40 new file mode 100644 index 0000000..c74dc47 --- /dev/null +++ b/binutils/binutils-2.40 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.40 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/debian/changelog b/debian/changelog index 27cce04..f60110e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,9 @@ djgpp-toolchain (10) UNRELEASED; urgency=medium * dxe3gen version 1.0.5. This now uses gcc to invoke the assembler and linker. As a result, it is no longer necessary to set any environment variables before use. + * binutils version 2.40. - -- jwt27 Tue, 04 Apr 2023 13:51:31 +0200 + -- jwt27 Tue, 04 Apr 2023 14:14:40 +0200 djgpp-toolchain (9) unstable; urgency=medium diff --git a/djgpp/binutils b/djgpp/binutils index 4ccbc02..dbcf7fe 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.39 +source djgpp/binutils-2.40 diff --git a/djgpp/binutils-2.40 b/djgpp/binutils-2.40 new file mode 100644 index 0000000..c6f8fa6 --- /dev/null +++ b/djgpp/binutils-2.40 @@ -0,0 +1 @@ +source binutils/binutils-2.40 From 60708b6649a8ddb03b2f1cb30208fde74cd41d4c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Apr 2023 19:27:15 +0200 Subject: [PATCH 505/536] list available packages if none are given, without counting options Fixes: #34 --- script/init.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/script/init.sh b/script/init.sh index 9be8287..be11c80 100644 --- a/script/init.sh +++ b/script/init.sh @@ -118,11 +118,14 @@ set_version() ${SUDO} sh -c "echo ${!var} > ${DST}/${TARGET}/etc/build-gcc/${name}-version" } +unset ANY_PACKAGES_SPECIFIED + add_pkg() { for DIR in ${PACKAGE_SOURCES}; do if [ -e $DIR/$1 ]; then source $DIR/$1 + ANY_PACKAGES_SPECIFIED=y return fi done @@ -130,19 +133,6 @@ add_pkg() exit 1 } -if [ -z $1 ]; then - echo "Usage: $0 [options...] [packages...]" - echo "Supported options:" - echo " --prefix=[...]" - echo " --target=[...]" - echo " --enable-languages=[...]" - echo "Supported packages:" - for DIR in ${PACKAGE_SOURCES}; do - ls $DIR - done - exit 1 -fi - prepend GCC_CONFIGURE_OPTIONS "$GLOBAL_CONFIGURE_OPTIONS" prepend GDB_CONFIGURE_OPTIONS "$GLOBAL_CONFIGURE_OPTIONS" prepend BINUTILS_CONFIGURE_OPTIONS "$GLOBAL_CONFIGURE_OPTIONS" @@ -165,6 +155,19 @@ for A in "$@"; do esac done +if [ -z ${ANY_PACKAGES_SPECIFIED} ]; then + echo "Usage: $0 [options...] [packages...]" + echo "Supported options:" + echo " --prefix=[...]" + echo " --target=[...]" + echo " --enable-languages=[...]" + echo "Supported packages:" + for DIR in ${PACKAGE_SOURCES}; do + ls $DIR + done + exit 1 +fi + # install directory PREFIX=${PREFIX-/usr/local/cross} From 1629582d7a25599afe2f93d53c964f0aa1da8a34 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Apr 2023 19:39:29 +0200 Subject: [PATCH 506/536] add newlib 4.2.0, 4.3.0 --- README.md | 4 ++-- newlib/newlib | 2 +- newlib/newlib-4.2.0.20211231 | 2 ++ newlib/newlib-4.3.0.20230120 | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 newlib/newlib-4.2.0.20211231 create mode 100644 newlib/newlib-4.3.0.20230120 diff --git a/README.md b/README.md index d6d8323..2be4ad9 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,14 @@ 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 2023-04-04: +### Current package versions, as of 2023-04-08: * gcc 12.2.0 * binutils 2.40 * gdb 13.1 * djgpp 2.05 / cvs * watt-32 git -* newlib 4.1.0 +* newlib 4.3.0.20230120 * avr-libc 2.1.0 * avrdude 6.4 * avarice 2.14 diff --git a/newlib/newlib b/newlib/newlib index 0266052..075a9d8 100644 --- a/newlib/newlib +++ b/newlib/newlib @@ -1 +1 @@ -source newlib/newlib-4.1.0 +source newlib/newlib-4.3.0.20230120 diff --git a/newlib/newlib-4.2.0.20211231 b/newlib/newlib-4.2.0.20211231 new file mode 100644 index 0000000..da0c556 --- /dev/null +++ b/newlib/newlib-4.2.0.20211231 @@ -0,0 +1,2 @@ +NEWLIB_VERSION=4.2.0.20211231 +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" diff --git a/newlib/newlib-4.3.0.20230120 b/newlib/newlib-4.3.0.20230120 new file mode 100644 index 0000000..d7e3b06 --- /dev/null +++ b/newlib/newlib-4.3.0.20230120 @@ -0,0 +1,2 @@ +NEWLIB_VERSION=4.3.0.20230120 +NEWLIB_ARCHIVE="http://sourceware.org/pub/newlib/newlib-${NEWLIB_VERSION}.tar.gz" From ec552ae1134e3c3544ef0f9335aa5a1f29c5c784 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Apr 2023 19:42:10 +0200 Subject: [PATCH 507/536] add avrdude 7.0 --- README.md | 2 +- avr/avrdude | 2 +- avr/avrdude-7.0 | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 avr/avrdude-7.0 diff --git a/README.md b/README.md index 2be4ad9..c0ce6a9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you require compatibility with distributions that use `i586`, you can either: * watt-32 git * newlib 4.3.0.20230120 * avr-libc 2.1.0 -* avrdude 6.4 +* avrdude 7.0 * avarice 2.14 * simulavr git diff --git a/avr/avrdude b/avr/avrdude index ab07735..d7ffd94 100644 --- a/avr/avrdude +++ b/avr/avrdude @@ -1 +1 @@ -source avr/avrdude-6.4 +source avr/avrdude-7.0 diff --git a/avr/avrdude-7.0 b/avr/avrdude-7.0 new file mode 100644 index 0000000..cc0e852 --- /dev/null +++ b/avr/avrdude-7.0 @@ -0,0 +1,2 @@ +AVRDUDE_VERSION=7.0 +AVRDUDE_ARCHIVE=http://download.savannah.gnu.org/releases/avrdude/avrdude-$AVRDUDE_VERSION.tar.gz From a8aca0ea0e565e53256b3446644d72d2f5b26d49 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Apr 2023 19:45:46 +0200 Subject: [PATCH 508/536] reword --- script/init.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/init.sh b/script/init.sh index be11c80..3dae258 100644 --- a/script/init.sh +++ b/script/init.sh @@ -155,13 +155,13 @@ for A in "$@"; do esac done -if [ -z ${ANY_PACKAGES_SPECIFIED} ]; then +if [ -z "${ANY_PACKAGES_SPECIFIED}" ]; then echo "Usage: $0 [options...] [packages...]" - echo "Supported options:" + echo "Commonly used options:" echo " --prefix=[...]" echo " --target=[...]" echo " --enable-languages=[...]" - echo "Supported packages:" + echo "Available packages:" for DIR in ${PACKAGE_SOURCES}; do ls $DIR done From f3b70baa76245082405eca5cdc68bde30d4a3306 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 8 Apr 2023 19:48:43 +0200 Subject: [PATCH 509/536] rename meta-package 'default' -> 'minimal' --- djgpp/{default => minimal} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename djgpp/{default => minimal} (100%) diff --git a/djgpp/default b/djgpp/minimal similarity index 100% rename from djgpp/default rename to djgpp/minimal From 8ecffc59b5e44ad7caf59606a7d95a944824994b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 18 May 2023 14:25:02 +0200 Subject: [PATCH 510/536] add 'all'/'minimal' packages for all targets --- avr/all | 4 +--- avr/minimal | 3 +++ ia16/all | 1 + ia16/minimal | 3 +++ newlib/all | 4 +--- newlib/minimal | 3 +++ 6 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 avr/minimal create mode 100644 ia16/all create mode 100644 ia16/minimal create mode 100644 newlib/minimal diff --git a/avr/all b/avr/all index 2e20cdc..062a5da 100644 --- a/avr/all +++ b/avr/all @@ -1,6 +1,4 @@ -source avr/avr-libc -source binutils/binutils -source common/gcc +source avr/minimal source common/gdb source avr/avrdude source avr/avarice diff --git a/avr/minimal b/avr/minimal new file mode 100644 index 0000000..99ce0bc --- /dev/null +++ b/avr/minimal @@ -0,0 +1,3 @@ +source avr/avr-libc +source binutils/binutils +source common/gcc diff --git a/ia16/all b/ia16/all new file mode 100644 index 0000000..aa0a34d --- /dev/null +++ b/ia16/all @@ -0,0 +1 @@ +source ia16/minimal diff --git a/ia16/minimal b/ia16/minimal new file mode 100644 index 0000000..a8a7da8 --- /dev/null +++ b/ia16/minimal @@ -0,0 +1,3 @@ +source ia16/binutils +source ia16/gcc +source ia16/newlib diff --git a/newlib/all b/newlib/all index fd71014..7d45f41 100644 --- a/newlib/all +++ b/newlib/all @@ -1,4 +1,2 @@ -source newlib/newlib -source binutils/binutils -source common/gcc +source newlib/minimal source common/gdb diff --git a/newlib/minimal b/newlib/minimal new file mode 100644 index 0000000..064af8f --- /dev/null +++ b/newlib/minimal @@ -0,0 +1,3 @@ +source newlib/newlib +source binutils/binutils +source common/gcc From ccdf2108682a3b4e000f8cf1e83110fb120ea497 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 18 May 2023 14:30:32 +0200 Subject: [PATCH 511/536] build PPA for Ubuntu Mantic fixes: #35 --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ad1fb6e..24c1237 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: if: needs.check.outputs.good == 'true' strategy: matrix: - ubuntu-version: [ bionic, focal, jammy, kinetic, lunar ] + ubuntu-version: [ bionic, focal, jammy, kinetic, lunar, mantic ] steps: - uses: actions/checkout@v3 From 2ff1d9bd8f47bd5667c5e24eec48ae812357772f Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 18 May 2023 14:33:01 +0200 Subject: [PATCH 512/536] release debian package v10 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f60110e..b76b10f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -djgpp-toolchain (10) UNRELEASED; urgency=medium +djgpp-toolchain (10) unstable; urgency=medium * dxe3gen version 1.0.5. This now uses gcc to invoke the assembler and linker. As a result, it is no longer necessary to set any environment variables before use. * binutils version 2.40. - -- jwt27 Tue, 04 Apr 2023 14:14:40 +0200 + -- jwt27 Thu, 18 May 2023 14:32:45 +0200 djgpp-toolchain (9) unstable; urgency=medium From 857bb1a33f4b14d17e43738905ef55fae9a5961b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Fri, 30 Jun 2023 23:29:48 +0200 Subject: [PATCH 513/536] update watt32 errno lists --- patch/watt32-djgpp-205/djgpp.err | 4 +++- patch/watt32-djgpp-205/syserr.c | 8 +++++--- patch/watt32-djgpp-cvs/djgpp.err | 4 +++- patch/watt32-djgpp-cvs/syserr.c | 8 +++++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/patch/watt32-djgpp-205/djgpp.err b/patch/watt32-djgpp-205/djgpp.err index 366f13b..2286893 100644 --- a/patch/watt32-djgpp-205/djgpp.err +++ b/patch/watt32-djgpp-205/djgpp.err @@ -2,7 +2,8 @@ #define __SYS_WERRNO_ERR /* - * THIS FILE WAS GENERATED BY c:/dj_err.exe at Tue Mar 8 18:31:30 2022. + * THIS FILE WAS GENERATED BY %WATT_ROOT%\c:/dj_err.exe + * at Fri Jun 30 23:24:47 2023. * DO NOT EDIT. * * Watt-32 errnos are after vendor's errnos (1 - 41) @@ -110,5 +111,6 @@ #define EDQUOT 94 #define EVDBAD 95 #define ENORMTWD 96 +#define ECANCELED 97 #endif /* __SYS_WERRNO_ERR */ diff --git a/patch/watt32-djgpp-205/syserr.c b/patch/watt32-djgpp-205/syserr.c index 4d5e9b9..5321891 100644 --- a/patch/watt32-djgpp-205/syserr.c +++ b/patch/watt32-djgpp-205/syserr.c @@ -1,8 +1,9 @@ /* - * THIS FILE WAS GENERATED BY c:/dj_err.exe at Tue Mar 8 18:35:06 2022. + * THIS FILE WAS GENERATED BY %WATT_ROOT%\c:/dj_err.exe + * at Fri Jun 30 23:24:49 2023. * DO NOT EDIT. * - * Watt-32 sys_errlist replaces vendor's sys_errlist[] + * The Watt-32 'sys_errlist[]' that replaces vendor's 'sys_errlist[]' */ #ifndef __DJGPP__ @@ -106,6 +107,7 @@ char __syserr093[] = "Too many users (EUSERS)"; char __syserr094[] = "Disc quota exceeded (EDQUOT)"; char __syserr095[] = "RVD related disk error (EVDBAD)"; char __syserr096[] = "Out of remote working directory stuctures (ENORMTWD)"; +char __syserr097[] = "Operation canceled (ECANCELED)"; char *SYS_ERRLIST[] = { __syserr000, __syserr001, __syserr002, __syserr003, __syserr004, @@ -127,6 +129,6 @@ char *SYS_ERRLIST[] = { __syserr080, __syserr081, __syserr082, __syserr083, __syserr084, __syserr085, __syserr086, __syserr087, __syserr088, __syserr089, __syserr090, __syserr091, __syserr092, __syserr093, __syserr094, - __syserr095, __syserr096, + __syserr095, __syserr096, __syserr097, }; diff --git a/patch/watt32-djgpp-cvs/djgpp.err b/patch/watt32-djgpp-cvs/djgpp.err index 366f13b..2286893 100644 --- a/patch/watt32-djgpp-cvs/djgpp.err +++ b/patch/watt32-djgpp-cvs/djgpp.err @@ -2,7 +2,8 @@ #define __SYS_WERRNO_ERR /* - * THIS FILE WAS GENERATED BY c:/dj_err.exe at Tue Mar 8 18:31:30 2022. + * THIS FILE WAS GENERATED BY %WATT_ROOT%\c:/dj_err.exe + * at Fri Jun 30 23:24:47 2023. * DO NOT EDIT. * * Watt-32 errnos are after vendor's errnos (1 - 41) @@ -110,5 +111,6 @@ #define EDQUOT 94 #define EVDBAD 95 #define ENORMTWD 96 +#define ECANCELED 97 #endif /* __SYS_WERRNO_ERR */ diff --git a/patch/watt32-djgpp-cvs/syserr.c b/patch/watt32-djgpp-cvs/syserr.c index 4d5e9b9..5321891 100644 --- a/patch/watt32-djgpp-cvs/syserr.c +++ b/patch/watt32-djgpp-cvs/syserr.c @@ -1,8 +1,9 @@ /* - * THIS FILE WAS GENERATED BY c:/dj_err.exe at Tue Mar 8 18:35:06 2022. + * THIS FILE WAS GENERATED BY %WATT_ROOT%\c:/dj_err.exe + * at Fri Jun 30 23:24:49 2023. * DO NOT EDIT. * - * Watt-32 sys_errlist replaces vendor's sys_errlist[] + * The Watt-32 'sys_errlist[]' that replaces vendor's 'sys_errlist[]' */ #ifndef __DJGPP__ @@ -106,6 +107,7 @@ char __syserr093[] = "Too many users (EUSERS)"; char __syserr094[] = "Disc quota exceeded (EDQUOT)"; char __syserr095[] = "RVD related disk error (EVDBAD)"; char __syserr096[] = "Out of remote working directory stuctures (ENORMTWD)"; +char __syserr097[] = "Operation canceled (ECANCELED)"; char *SYS_ERRLIST[] = { __syserr000, __syserr001, __syserr002, __syserr003, __syserr004, @@ -127,6 +129,6 @@ char *SYS_ERRLIST[] = { __syserr080, __syserr081, __syserr082, __syserr083, __syserr084, __syserr085, __syserr086, __syserr087, __syserr088, __syserr089, __syserr090, __syserr091, __syserr092, __syserr093, __syserr094, - __syserr095, __syserr096, + __syserr095, __syserr096, __syserr097, }; From ad50164848d9dbf85e383a0b76f15c5a88ec95cb Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Jul 2023 18:50:07 +0200 Subject: [PATCH 514/536] add -mtune=pentium in debian build --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/rules b/debian/rules index 804f563..35c7f95 100755 --- a/debian/rules +++ b/debian/rules @@ -52,6 +52,8 @@ override_dh_auto_build: GLOBAL_CONFIGURE_OPTIONS='--datarootdir=/usr/i386-pc-msdosdjgpp/share --libexecdir=/usr/lib' \ CFLAGS="$(CFLAGS) -Wno-error=format-security" \ CXXFLAGS="$(CXXFLAGS) -Wno-error=format-security" \ + CFLAGS_FOR_TARGET='-O2 -g -ffunction-sections -fdata-sections -mtune=pentium' \ + CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET" \ ./build-djgpp.sh --batch --build-deb --no-download --prefix=/usr --destdir=$(CURDIR)/install $(PACKAGES) override_dh_auto_install: From b78ddaf8919925aeae7b476408f0c6b1b9197e90 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Jul 2023 18:51:21 +0200 Subject: [PATCH 515/536] install wrapper script for pkg-config --- debian/changelog | 6 ++++++ debian/djgpp-utils.install | 1 + script/finalize.sh | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/debian/changelog b/debian/changelog index b76b10f..52f6958 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (11) UNRELEASED; urgency=medium + + * Add wrapper script for pkg-config: i386-pc-msdosdjgpp-pkg-config + + -- jwt27 Thu, 06 Jul 2023 18:50:44 +0200 + djgpp-toolchain (10) unstable; urgency=medium * dxe3gen version 1.0.5. This now uses gcc to invoke the assembler and diff --git a/debian/djgpp-utils.install b/debian/djgpp-utils.install index 195b1c7..1936b72 100644 --- a/debian/djgpp-utils.install +++ b/debian/djgpp-utils.install @@ -14,3 +14,4 @@ usr/bin/i*86-pc-msdosdjgpp-dxegen usr/bin/i*86-pc-msdosdjgpp-stubedit usr/bin/i*86-pc-msdosdjgpp-dxe3res usr/bin/i*86-pc-msdosdjgpp-setenv +usr/bin/i*86-pc-msdosdjgpp-pkg-config diff --git a/script/finalize.sh b/script/finalize.sh index 9624eee..af2ff8e 100644 --- a/script/finalize.sh +++ b/script/finalize.sh @@ -122,6 +122,11 @@ STOP ;; esac +cat << STOP > ${BASE}/build/${TARGET}-pkg-config +#!/usr/bin/env bash +exec ${TARGET}-setenv pkg-config "\$@" +STOP + echo "Installing ${TARGET}-setenv" chmod +x ${BASE}/build/${TARGET}-setenv install_files ${BASE}/build/${TARGET}-setenv ${DST}/bin/ @@ -129,6 +134,10 @@ case `uname` in MINGW*|MSYS*) install_files ${BASE}/build/setenv-${TARGET}.cmd ${DST}/bin/ 2> /dev/null ;; esac +echo "Installing ${TARGET}-pkg-config" +chmod +x ${BASE}/build/${TARGET}-pkg-config +install_files ${BASE}/build/${TARGET}-pkg-config ${DST}/bin/ + if [ ! -z "$(get_version gcc)" ]; then for x in $(echo $ENABLE_LANGUAGES | tr "," " ") do From 1919e91ba10ffb81c31e5b320b2f3473068541f5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 6 Jul 2023 23:43:55 +0200 Subject: [PATCH 516/536] mention libc patch --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 52f6958..3e36990 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ djgpp-toolchain (11) UNRELEASED; urgency=medium * Add wrapper script for pkg-config: i386-pc-msdosdjgpp-pkg-config + * Fix libc bug in ioctl()/fcntl() that prevented arguments from being passed + through to fsext handlers (socket library). - -- jwt27 Thu, 06 Jul 2023 18:50:44 +0200 + -- jwt27 Thu, 06 Jul 2023 23:43:08 +0200 djgpp-toolchain (10) unstable; urgency=medium From db607561c076971bcdc807acc3bce4162e48b6b3 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 10 Jul 2023 20:13:50 +0200 Subject: [PATCH 517/536] ensure old specs file is removed before build --- build-djgpp.sh | 3 --- script/download.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index d9d1556..080608a 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -62,9 +62,6 @@ fi cd ${BASE}/build/ || exit 1 -echo "Removing old specs file" -${SUDO} rm -f ${PREFIX}/lib/gcc/${TARGET}/$(get_version gcc)/specs - if [ ! -z ${WATT32_VERSION} ]; then export WATT_ROOT=${BASE}/build/Watt-32 cd ${WATT_ROOT} || exit 1 diff --git a/script/download.sh b/script/download.sh index d2ba63e..059dcd9 100644 --- a/script/download.sh +++ b/script/download.sh @@ -125,5 +125,18 @@ echo "Creating install directory: ${DST}" export PATH="${DST}/bin:${PREFIX}/bin:$PATH" +remove_if_exists() +{ + if [ -e $1 ]; then + ${SUDO} rm -f $1 || exit 1 + fi +} + +if which ${TARGET}-gcc 2>&1 > /dev/null; then + echo "Removing previously-installed specs file" + remove_if_exists "${DST}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs" + remove_if_exists "${PREFIX}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs" +fi + rm -rf ${BASE}/tests mkdir -p ${BASE}/tests From a3019746cf45be352e9c2b9404e0b3e8f2b725ca Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 20 Jul 2023 18:36:38 +0200 Subject: [PATCH 518/536] remove unused var BUILD_DXEGEN --- script/check-deps-and-confirm.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 298afdc..63aa4ce 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -107,7 +107,6 @@ echo "You are about to build and install:" [ -z ${BINUTILS_VERSION} ] || echo " - binutils ${BINUTILS_VERSION}" [ -z ${GCC_VERSION} ] || echo " - gcc ${GCC_VERSION}" [ -z ${GDB_VERSION} ] || echo " - gdb ${GDB_VERSION}" -[ -z ${BUILD_DXEGEN} ] || echo " - DXE tools ${DJGPP_VERSION}" [ -z ${AVRLIBC_VERSION} ] || echo " - avr-libc ${AVRLIBC_VERSION}" [ -z ${AVRDUDE_VERSION} ] || echo " - AVRDUDE ${AVRDUDE_VERSION}" [ -z ${AVARICE_VERSION} ] || echo " - AVaRICE ${AVARICE_VERSION}" From 1cc896140ad5e98fd3ec8418b16ab59c362b4b01 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 29 Oct 2023 13:12:46 +0100 Subject: [PATCH 519/536] build PPA for Ubuntu Noble fixes: #38 --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 24c1237..4617364 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: if: needs.check.outputs.good == 'true' strategy: matrix: - ubuntu-version: [ bionic, focal, jammy, kinetic, lunar, mantic ] + ubuntu-version: [ bionic, focal, jammy, kinetic, lunar, mantic, noble ] steps: - uses: actions/checkout@v3 From 9ec3bf7954ae76df059f1709ba391f4188f54f57 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 29 Oct 2023 13:46:37 +0100 Subject: [PATCH 520/536] fix setting CXXFLAGS_FOR_TARGET --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 35c7f95..3432f82 100755 --- a/debian/rules +++ b/debian/rules @@ -53,7 +53,7 @@ override_dh_auto_build: CFLAGS="$(CFLAGS) -Wno-error=format-security" \ CXXFLAGS="$(CXXFLAGS) -Wno-error=format-security" \ CFLAGS_FOR_TARGET='-O2 -g -ffunction-sections -fdata-sections -mtune=pentium' \ - CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET" \ + CXXFLAGS_FOR_TARGET='-O2 -g -ffunction-sections -fdata-sections -mtune=pentium' \ ./build-djgpp.sh --batch --build-deb --no-download --prefix=/usr --destdir=$(CURDIR)/install $(PACKAGES) override_dh_auto_install: From 4fffc514339a0d7901a21eed0f6692f9cb1ea849 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 29 Oct 2023 14:25:45 +0100 Subject: [PATCH 521/536] add binutils 2.41 --- README.md | 4 ++-- binutils/binutils | 2 +- binutils/binutils-2.41 | 2 ++ debian/changelog | 1 + djgpp/binutils | 2 +- djgpp/binutils-2.41 | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 binutils/binutils-2.41 create mode 100644 djgpp/binutils-2.41 diff --git a/README.md b/README.md index c0ce6a9..739d521 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ 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 2023-04-08: +### Current package versions, as of 2023-10-29: * gcc 12.2.0 -* binutils 2.40 +* binutils 2.41 * gdb 13.1 * djgpp 2.05 / cvs * watt-32 git diff --git a/binutils/binutils b/binutils/binutils index c6f8fa6..7507509 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.40 +source binutils/binutils-2.41 diff --git a/binutils/binutils-2.41 b/binutils/binutils-2.41 new file mode 100644 index 0000000..a17e3ee --- /dev/null +++ b/binutils/binutils-2.41 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.41 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/debian/changelog b/debian/changelog index 3e36990..69c51e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ djgpp-toolchain (11) UNRELEASED; urgency=medium * Add wrapper script for pkg-config: i386-pc-msdosdjgpp-pkg-config * Fix libc bug in ioctl()/fcntl() that prevented arguments from being passed through to fsext handlers (socket library). + * binutils version 2.41. -- jwt27 Thu, 06 Jul 2023 23:43:08 +0200 diff --git a/djgpp/binutils b/djgpp/binutils index dbcf7fe..b2b1f52 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.40 +source djgpp/binutils-2.41 diff --git a/djgpp/binutils-2.41 b/djgpp/binutils-2.41 new file mode 100644 index 0000000..7507509 --- /dev/null +++ b/djgpp/binutils-2.41 @@ -0,0 +1 @@ +source binutils/binutils-2.41 From 7fdf00d56accef42f8892fae880b73a6a53878a4 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 29 Oct 2023 15:39:12 +0100 Subject: [PATCH 522/536] fix building zic.exe --- build-djgpp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 080608a..398ed9a 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -111,7 +111,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then cd src unset COMSPEC sed -i "50cCROSS_PREFIX = ${TARGET}-" makefile.def - sed -i "61cGCC = \$(CC) -g -O2 ${CFLAGS}" makefile.def + sed -i "61cGCC = ${CC} -g -O2 ${CFLAGS}" makefile.def if [ ! -z ${GCC_VERSION} ] || [ ! "`cat configure-options 2> /dev/null`" == "${TARGET}:${DST}:${CFLAGS_FOR_TARGET}" ]; then ${MAKE_J} clean rm -f ../lib/*.{a,o} @@ -339,7 +339,7 @@ if [ ! -z ${DJGPP_VERSION} ]; then ${MAKE_J} -C libemu || exit 1 ${MAKE_J} -C libm || exit 1 ${MAKE_J} -C docs || exit 1 - ${MAKE_J} -C ../zoneinfo/src 2> /dev/null + ${MAKE_J} -C ../zoneinfo/src ${MAKE_J} -f makempty || exit 1 LDFLAGS="$TEMP_LDFLAGS" CFLAGS="$TEMP_CFLAGS" From b9a1276d37c03d9c8df5d383be4d2c66d9ac5ca1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 29 Oct 2023 14:27:03 +0100 Subject: [PATCH 523/536] release debian package v11 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 69c51e8..af3f72f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -djgpp-toolchain (11) UNRELEASED; urgency=medium +djgpp-toolchain (11) unstable; urgency=medium * Add wrapper script for pkg-config: i386-pc-msdosdjgpp-pkg-config * Fix libc bug in ioctl()/fcntl() that prevented arguments from being passed through to fsext handlers (socket library). * binutils version 2.41. - -- jwt27 Thu, 06 Jul 2023 23:43:08 +0200 + -- jwt27 Sun, 29 Oct 2023 14:26:37 +0100 djgpp-toolchain (10) unstable; urgency=medium From 8895d28835f39d3a2be3c09f39144aba5a6c55f5 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 29 Oct 2023 16:06:58 +0100 Subject: [PATCH 524/536] drop PPA for Ubuntu Kinetic --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4617364..df8c611 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: if: needs.check.outputs.good == 'true' strategy: matrix: - ubuntu-version: [ bionic, focal, jammy, kinetic, lunar, mantic, noble ] + ubuntu-version: [ bionic, focal, jammy, lunar, mantic, noble ] steps: - uses: actions/checkout@v3 From d449b6970903a7da8c8dc7244585537f9f516483 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sun, 29 Oct 2023 16:10:00 +0100 Subject: [PATCH 525/536] use new syntax for workflow outputs --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index df8c611..7fdc741 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: - id: docheck name: Check release state run: | - echo "::set-output name=good::$([ -z "$(head -n 1 debian/changelog | grep 'UNRELEASED')" ] && echo 'true' || echo 'false')" + echo "good=$([ -z "$(head -n 1 debian/changelog | grep 'UNRELEASED')" ] && echo 'true' || echo 'false')" >> "$GITHUB_OUTPUT" build: runs-on: ubuntu-latest From c760da70fd9f46556b1907dbdc87705511212ed8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 13 Nov 2023 17:18:34 +0100 Subject: [PATCH 526/536] pull gcc dependencies from ftpmirror.gnu.org --- script/check-deps-and-confirm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 63aa4ce..9e9618a 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -28,9 +28,9 @@ if [ ! -z ${BUILD_DEB} ] && [ ! -z ${GCC_VERSION} ]; then MPC_VERSION=${MPC_VERSION:-1.1.0} ISL_VERSION=${ISL_VERSION:-0.18} - GMP_ARCHIVE="http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" - MPFR_ARCHIVE="http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz" - MPC_ARCHIVE="http://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz" + GMP_ARCHIVE="http://ftpmirror.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" + MPFR_ARCHIVE="http://ftpmirror.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz" + MPC_ARCHIVE="http://ftpmirror.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz" ISL_ARCHIVE="http://gcc.gnu.org/pub/gcc/infrastructure/isl-${ISL_VERSION}.tar.bz2" fi From 9fad7f89971d9f871e4b57c1dbc94e074b5c79f6 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 13 Nov 2023 17:19:57 +0100 Subject: [PATCH 527/536] update gcc dependencies --- script/check-deps-and-confirm.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/check-deps-and-confirm.sh b/script/check-deps-and-confirm.sh index 9e9618a..8dce597 100644 --- a/script/check-deps-and-confirm.sh +++ b/script/check-deps-and-confirm.sh @@ -23,10 +23,10 @@ case $TARGET in esac if [ ! -z ${BUILD_DEB} ] && [ ! -z ${GCC_VERSION} ]; then - GMP_VERSION=${GMP_VERSION:-6.2.0} - MPFR_VERSION=${MPFR_VERSION:-4.0.2} - MPC_VERSION=${MPC_VERSION:-1.1.0} - ISL_VERSION=${ISL_VERSION:-0.18} + GMP_VERSION=${GMP_VERSION:-6.2.1} + MPFR_VERSION=${MPFR_VERSION:-4.1.0} + MPC_VERSION=${MPC_VERSION:-1.2.0} + ISL_VERSION=${ISL_VERSION:-0.24} GMP_ARCHIVE="http://ftpmirror.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" MPFR_ARCHIVE="http://ftpmirror.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.xz" From c9d5c7d4c69112d99efe1934dd7c6670767894a9 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 13 Nov 2023 17:20:15 +0100 Subject: [PATCH 528/536] no need for a separate function here --- script/download.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/script/download.sh b/script/download.sh index 059dcd9..4f1642d 100644 --- a/script/download.sh +++ b/script/download.sh @@ -125,17 +125,13 @@ echo "Creating install directory: ${DST}" export PATH="${DST}/bin:${PREFIX}/bin:$PATH" -remove_if_exists() -{ - if [ -e $1 ]; then - ${SUDO} rm -f $1 || exit 1 - fi -} - if which ${TARGET}-gcc 2>&1 > /dev/null; then echo "Removing previously-installed specs file" - remove_if_exists "${DST}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs" - remove_if_exists "${PREFIX}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs" + for i in {"${DST}","${PREFIX}"}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs; do + if [ -e "$i" ]; then + ${SUDO} rm -f "$i" || exit 1 + fi + done fi rm -rf ${BASE}/tests From 8dce76c338fa7269b712b99d7a7f8541ef25aff1 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Mon, 13 Nov 2023 17:22:51 +0100 Subject: [PATCH 529/536] set 'Architecture: all' for library packages --- debian/changelog | 6 ++++++ debian/control | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index af3f72f..bc4fe2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +djgpp-toolchain (12) UNRELEASED; urgency=medium + + * Set 'Architecture: all' for library packages. + + -- jwt27 Mon, 13 Nov 2023 17:22:09 +0100 + djgpp-toolchain (11) unstable; urgency=medium * Add wrapper script for pkg-config: i386-pc-msdosdjgpp-pkg-config diff --git a/debian/control b/debian/control index 9e7c14e..726af89 100644 --- a/debian/control +++ b/debian/control @@ -26,7 +26,7 @@ Standards-Version: 4.1.2 Homepage: https://github.com/jwt27/build-gcc Package: djgpp-dev -Architecture: any +Architecture: all Depends: ${misc:Depends} Recommends: binutils-djgpp, gcc-djgpp, djgpp-utils Suggests: djgpp-dev-doc @@ -111,7 +111,7 @@ Suggests: gdb-djgpp Description: GNU Debugger -- documentation Package: libwatt-djgpp-dev -Architecture: any +Architecture: all Depends: ${misc:Depends} Recommends: djgpp-dev, gcc-djgpp Description: Watt-32 TCP socket library for DJGPP From d11f5b3a0bcefec654d8fc431b5135c287b6011b Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 30 Dec 2023 18:53:46 +0100 Subject: [PATCH 530/536] export flags variables --- script/init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/init.sh b/script/init.sh index 3dae258..448d2b4 100644 --- a/script/init.sh +++ b/script/init.sh @@ -48,6 +48,7 @@ fi export CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} export CXXFLAGS_FOR_TARGET=${CXXFLAGS_FOR_TARGET-"-O2 -g -ffunction-sections -fdata-sections"} +export CFLAGS CXXFLAGS LDFLAGS # check if cp understands --preserve (for MacOS) if cp --preserve=mode,timestamps script/hello.c ./hello.c > /dev/null 2>&1; then From e7135d260a0e930d31a5d40fda3bbac79f8caf78 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 30 Dec 2023 18:54:29 +0100 Subject: [PATCH 531/536] define WIN32_LEAN_AND_MEAN on mingw --- script/init.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/init.sh b/script/init.sh index 448d2b4..5e5cfcd 100644 --- a/script/init.sh +++ b/script/init.sh @@ -58,9 +58,14 @@ else fi rm -f hello.c 2> /dev/null -# Make sure MSYS2 Perl is used on mingw-w64 (see issue #27) case $(uname) in -MINGW*) export PERL=/usr/bin/perl ;; +MINGW*) + # Make sure MSYS2 Perl is used on mingw-w64 (see issue #27) + export PERL=/usr/bin/perl + # Required to build gcc on recent mingw-w64 (see issue #41) + CFLAGS+=' -DWIN32_LEAN_AND_MEAN' + CXXFLAGS+=' -DWIN32_LEAN_AND_MEAN' + ;; esac install_files() From 2705fa24f4188caf63a28a0da9130e471090f25a Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Sat, 27 Jan 2024 18:49:18 +0100 Subject: [PATCH 532/536] define WIN32_LEAN_AND_MEAN only while compiling gcc fixes: #41 --- build-djgpp.sh | 10 +++++++++- script/build-avr-gcc.sh | 13 ++++++++++++- script/build-newlib-gcc.sh | 13 ++++++++++++- script/init.sh | 4 ++-- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/build-djgpp.sh b/build-djgpp.sh index 398ed9a..980977d 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -239,7 +239,9 @@ if [ ! -z ${GCC_VERSION} ]; then cd djcross || exit 1 TEMP_CFLAGS="$CFLAGS" + TEMP_CXXFLAGS="$CXXFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + export CXXFLAGS="$CXXFLAGS $GCC_EXTRA_CXXFLAGS" GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES}" @@ -260,7 +262,8 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Installing gcc (stage 1)" ${SUDO} ${MAKE_J} install-gcc || exit 1 - export CFLAGS="$TEMP_CFLAGS" + CFLAGS="$TEMP_CFLAGS" + CXXFLAGS="$TEMP_CXXFLAGS" fi if [ ! -z ${DJGPP_VERSION} ]; then @@ -313,7 +316,10 @@ if [ ! -z ${GCC_VERSION} ]; then cd $BUILDDIR/djcross || exit 1 TEMP_CFLAGS="$CFLAGS" + TEMP_CXXFLAGS="$CXXFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + export CXXFLAGS="$CXXFLAGS $GCC_EXTRA_CXXFLAGS" + export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" ${MAKE_J} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE_J} -s check-gcc | tee ${BASE}/tests/gcc.log @@ -321,7 +327,9 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE_J} install-strip || \ ${SUDO} ${MAKE_J} install-strip || exit 1 ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst + CFLAGS="$TEMP_CFLAGS" + CXXFLAGS="$TEMP_CXXFLAGS" set_version gcc fi diff --git a/script/build-avr-gcc.sh b/script/build-avr-gcc.sh index b51abb7..3fd3de7 100644 --- a/script/build-avr-gcc.sh +++ b/script/build-avr-gcc.sh @@ -48,7 +48,9 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 TEMP_CFLAGS="$CFLAGS" + TEMP_CXXFLAGS="$CXXFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + export CXXFLAGS="$CXXFLAGS $GCC_EXTRA_CXXFLAGS" GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES} @@ -69,7 +71,8 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Installing gcc (stage 1)" ${SUDO} ${MAKE_J} install-gcc || exit 1 - export CFLAGS="$TEMP_CFLAGS" + CFLAGS="$TEMP_CFLAGS" + CXXFLAGS="$TEMP_CXXFLAGS" fi cd ${BASE}/build/ @@ -103,6 +106,11 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Building gcc (stage 2)" cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + TEMP_CFLAGS="$CFLAGS" + TEMP_CXXFLAGS="$CXXFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + export CXXFLAGS="$CXXFLAGS $GCC_EXTRA_CXXFLAGS" + export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" ${MAKE_J} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE_J} -s check-gcc | tee ${BASE}/tests/gcc.log @@ -111,5 +119,8 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE_J} install-strip || exit 1 ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst + CFLAGS="$TEMP_CFLAGS" + CXXFLAGS="$TEMP_CXXFLAGS" + set_version gcc fi diff --git a/script/build-newlib-gcc.sh b/script/build-newlib-gcc.sh index 082c8ce..cc028bf 100644 --- a/script/build-newlib-gcc.sh +++ b/script/build-newlib-gcc.sh @@ -40,7 +40,9 @@ if [ ! -z ${GCC_VERSION} ]; then cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 TEMP_CFLAGS="$CFLAGS" + TEMP_CXXFLAGS="$CXXFLAGS" export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + export CXXFLAGS="$CXXFLAGS $GCC_EXTRA_CXXFLAGS" GCC_CONFIGURE_OPTIONS+=" --target=${TARGET} --prefix=${PREFIX} ${HOST_FLAG} ${BUILD_FLAG} --enable-languages=${ENABLE_LANGUAGES} @@ -61,7 +63,8 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Installing gcc (stage 1)" ${SUDO} ${MAKE_J} install-gcc || exit 1 - export CFLAGS="$TEMP_CFLAGS" + CFLAGS="$TEMP_CFLAGS" + CXXFLAGS="$TEMP_CXXFLAGS" fi cd ${BASE}/build/ @@ -96,7 +99,12 @@ if [ ! -z ${GCC_VERSION} ]; then echo "Building gcc (stage 2)" cd gcc-${GCC_VERSION}/build-${TARGET} || exit 1 + TEMP_CFLAGS="$CFLAGS" + TEMP_CXXFLAGS="$CXXFLAGS" + export CFLAGS="$CFLAGS $GCC_EXTRA_CFLAGS" + export CXXFLAGS="$CXXFLAGS $GCC_EXTRA_CXXFLAGS" export STAGE_CC_WRAPPER="${BASE}/script/destdir-hack.sh ${DST}/${TARGET}" + ${MAKE_J} || exit 1 [ ! -z $MAKE_CHECK_GCC ] && ${MAKE_J} -s check-gcc | tee ${BASE}/tests/gcc.log echo "Installing gcc" @@ -104,5 +112,8 @@ if [ ! -z ${GCC_VERSION} ]; then ${SUDO} ${MAKE_J} install-strip || exit 1 ${SUDO} ${MAKE_J} -C mpfr install DESTDIR=${BASE}/build/tmpinst + CFLAGS="$TEMP_CFLAGS" + CXXFLAGS="$TEMP_CXXFLAGS" + set_version gcc fi diff --git a/script/init.sh b/script/init.sh index 5e5cfcd..5c3eb13 100644 --- a/script/init.sh +++ b/script/init.sh @@ -63,8 +63,8 @@ MINGW*) # Make sure MSYS2 Perl is used on mingw-w64 (see issue #27) export PERL=/usr/bin/perl # Required to build gcc on recent mingw-w64 (see issue #41) - CFLAGS+=' -DWIN32_LEAN_AND_MEAN' - CXXFLAGS+=' -DWIN32_LEAN_AND_MEAN' + GCC_EXTRA_CFLAGS+=' -DWIN32_LEAN_AND_MEAN' + GCC_EXTRA_CXXFLAGS+=' -DWIN32_LEAN_AND_MEAN' ;; esac From 8a4b8c86ada63cce4f5bbad18f11fc476d1263b8 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 30 May 2024 19:23:18 +0200 Subject: [PATCH 533/536] improve package list display, drop duplicates --- script/init.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/script/init.sh b/script/init.sh index 5c3eb13..c5edb8e 100644 --- a/script/init.sh +++ b/script/init.sh @@ -168,9 +168,7 @@ if [ -z "${ANY_PACKAGES_SPECIFIED}" ]; then echo " --target=[...]" echo " --enable-languages=[...]" echo "Available packages:" - for DIR in ${PACKAGE_SOURCES}; do - ls $DIR - done + find ${PACKAGE_SOURCES} -type f | xargs -n 1 basename | sort -u | column exit 1 fi From bbbf0853bdca4a23054979ba4b1b6d79fab75d57 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 30 May 2024 19:29:32 +0200 Subject: [PATCH 534/536] remove dummy binutils package files for djgpp --- build-djgpp.sh | 2 +- djgpp/binutils | 2 +- djgpp/binutils-2.35 | 1 - djgpp/binutils-2.35.1 | 1 - djgpp/binutils-2.35.2 | 1 - djgpp/binutils-2.36 | 1 - djgpp/binutils-2.36.1 | 1 - djgpp/binutils-2.37 | 1 - djgpp/binutils-2.38 | 1 - djgpp/binutils-2.39 | 1 - djgpp/binutils-2.40 | 1 - djgpp/binutils-2.41 | 1 - 12 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 djgpp/binutils-2.35 delete mode 100644 djgpp/binutils-2.35.1 delete mode 100644 djgpp/binutils-2.35.2 delete mode 100644 djgpp/binutils-2.36 delete mode 100644 djgpp/binutils-2.36.1 delete mode 100644 djgpp/binutils-2.37 delete mode 100644 djgpp/binutils-2.38 delete mode 100644 djgpp/binutils-2.39 delete mode 100644 djgpp/binutils-2.40 delete mode 100644 djgpp/binutils-2.41 diff --git a/build-djgpp.sh b/build-djgpp.sh index 980977d..0ca92d0 100755 --- a/build-djgpp.sh +++ b/build-djgpp.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash DJGPP_DOWNLOAD_BASE="http://www.mirrorservice.org/sites/ftp.delorie.com/pub" -PACKAGE_SOURCES="djgpp common" +PACKAGE_SOURCES="djgpp binutils common" source script/init.sh case $TARGET in diff --git a/djgpp/binutils b/djgpp/binutils index b2b1f52..aecc137 100644 --- a/djgpp/binutils +++ b/djgpp/binutils @@ -1 +1 @@ -source djgpp/binutils-2.41 +source binutils/binutils diff --git a/djgpp/binutils-2.35 b/djgpp/binutils-2.35 deleted file mode 100644 index 4aaac1e..0000000 --- a/djgpp/binutils-2.35 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.35 diff --git a/djgpp/binutils-2.35.1 b/djgpp/binutils-2.35.1 deleted file mode 100644 index 6223df2..0000000 --- a/djgpp/binutils-2.35.1 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.35.1 diff --git a/djgpp/binutils-2.35.2 b/djgpp/binutils-2.35.2 deleted file mode 100644 index f81c1fc..0000000 --- a/djgpp/binutils-2.35.2 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.35.2 diff --git a/djgpp/binutils-2.36 b/djgpp/binutils-2.36 deleted file mode 100644 index 465caed..0000000 --- a/djgpp/binutils-2.36 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.36 diff --git a/djgpp/binutils-2.36.1 b/djgpp/binutils-2.36.1 deleted file mode 100644 index 8c7c7ec..0000000 --- a/djgpp/binutils-2.36.1 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.36.1 diff --git a/djgpp/binutils-2.37 b/djgpp/binutils-2.37 deleted file mode 100644 index 9e407ab..0000000 --- a/djgpp/binutils-2.37 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.37 diff --git a/djgpp/binutils-2.38 b/djgpp/binutils-2.38 deleted file mode 100644 index af3b2a9..0000000 --- a/djgpp/binutils-2.38 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.38 diff --git a/djgpp/binutils-2.39 b/djgpp/binutils-2.39 deleted file mode 100644 index b64a522..0000000 --- a/djgpp/binutils-2.39 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.39 diff --git a/djgpp/binutils-2.40 b/djgpp/binutils-2.40 deleted file mode 100644 index c6f8fa6..0000000 --- a/djgpp/binutils-2.40 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.40 diff --git a/djgpp/binutils-2.41 b/djgpp/binutils-2.41 deleted file mode 100644 index 7507509..0000000 --- a/djgpp/binutils-2.41 +++ /dev/null @@ -1 +0,0 @@ -source binutils/binutils-2.41 From 3906d947671aeb0e893ae384aa2dc6becbb77d07 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 30 May 2024 19:36:48 +0200 Subject: [PATCH 535/536] add binutils 2.42 --- README.md | 4 ++-- binutils/binutils | 2 +- binutils/binutils-2.42 | 2 ++ debian/changelog | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 binutils/binutils-2.42 diff --git a/README.md b/README.md index 739d521..5ff13d8 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ 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 2023-10-29: +### Current package versions, as of 2024-05-30: * gcc 12.2.0 -* binutils 2.41 +* binutils 2.42 * gdb 13.1 * djgpp 2.05 / cvs * watt-32 git diff --git a/binutils/binutils b/binutils/binutils index 7507509..b2012ab 100644 --- a/binutils/binutils +++ b/binutils/binutils @@ -1 +1 @@ -source binutils/binutils-2.41 +source binutils/binutils-2.42 diff --git a/binutils/binutils-2.42 b/binutils/binutils-2.42 new file mode 100644 index 0000000..65b0a31 --- /dev/null +++ b/binutils/binutils-2.42 @@ -0,0 +1,2 @@ +BINUTILS_VERSION=2.42 +BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.xz" diff --git a/debian/changelog b/debian/changelog index bc4fe2f..0ca17b2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ djgpp-toolchain (12) UNRELEASED; urgency=medium * Set 'Architecture: all' for library packages. + * binutils version 2.42. - -- jwt27 Mon, 13 Nov 2023 17:22:09 +0100 + -- jwt27 Thu, 30 May 2024 19:31:25 +0200 djgpp-toolchain (11) unstable; urgency=medium From 42f5bbf9b715824b79350f42f91e6079c97f1f66 Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Thu, 30 May 2024 19:42:16 +0200 Subject: [PATCH 536/536] add gdb 13.2, 14.1, 14.2 --- README.md | 2 +- common/gdb | 2 +- common/gdb-13.2 | 2 ++ common/gdb-14.1 | 2 ++ common/gdb-14.2 | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 common/gdb-13.2 create mode 100644 common/gdb-14.1 create mode 100644 common/gdb-14.2 diff --git a/README.md b/README.md index 5ff13d8..fbc3a4a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you require compatibility with distributions that use `i586`, you can either: * gcc 12.2.0 * binutils 2.42 -* gdb 13.1 +* gdb 14.2 * djgpp 2.05 / cvs * watt-32 git * newlib 4.3.0.20230120 diff --git a/common/gdb b/common/gdb index f0a28fc..d926d3a 100644 --- a/common/gdb +++ b/common/gdb @@ -1 +1 @@ -source common/gdb-13.1 +source common/gdb-14.2 diff --git a/common/gdb-13.2 b/common/gdb-13.2 new file mode 100644 index 0000000..68ec0c8 --- /dev/null +++ b/common/gdb-13.2 @@ -0,0 +1,2 @@ +GDB_VERSION=13.2 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-14.1 b/common/gdb-14.1 new file mode 100644 index 0000000..27d549f --- /dev/null +++ b/common/gdb-14.1 @@ -0,0 +1,2 @@ +GDB_VERSION=14.1 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" diff --git a/common/gdb-14.2 b/common/gdb-14.2 new file mode 100644 index 0000000..aec973f --- /dev/null +++ b/common/gdb-14.2 @@ -0,0 +1,2 @@ +GDB_VERSION=14.2 +GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz"