Created
April 23, 2023 09:47
-
-
Save lpproj/59a023c6e857342b0b4e5872187dac7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a patch against gcc-ia16 build scripts (https://github.com/tkchia/build-ia16): | |
- fix build break at ./build.sh gcc-windows or gcc-djgpp (with elkslibc) | |
- build GNU libiconv for gcc-windows to support --input-charset and --exec-charset | |
(before building, wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz && tar -xzf libiconv-1.17.tar.gz) | |
diff --git a/build.sh b/build.sh | |
--- a/build.sh | |
+++ b/build.sh | |
@@ -32,6 +32,9 @@ WITHCXX=true | |
# Set this to false to disable C++ for DJGPP/MS-DOS. | |
WITHCXXDJGPP=false | |
+WINCFLAGS="-s -O2 -march=i486 -mtune=generic" | |
+DJGPPCFLAGS="-s -O2 -march=i386 -mtune=pentium" | |
+ | |
in_list () { | |
local needle=$1 | |
local haystackname=$2 | |
@@ -779,34 +782,41 @@ if in_list prereqs-windows BUILDLIST; then | |
rm -rf build-gmp-windows | |
mkdir build-gmp-windows | |
pushd build-gmp-windows | |
- ../gmp-6.1.2/configure --target=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix="$PREFIX-prereqs" --disable-shared 2>&1 | tee build.log | |
+ ../gmp-6.1.2/configure CFLAGS="$WINCFLAGS" --target=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix="$PREFIX-prereqs" --disable-shared 2>&1 | tee build.log | |
cont_build_log "make $PARALLEL" | |
cont_build_log "make $PARALLEL install" | |
popd | |
rm -rf build-mpfr-windows | |
mkdir build-mpfr-windows | |
pushd build-mpfr-windows | |
- ../mpfr-3.1.5/configure --target=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix="$PREFIX-prereqs" --with-gmp="$PREFIX-prereqs" --disable-shared 2>&1 | tee -a build.log | |
+ ../mpfr-3.1.5/configure CFLAGS="$WINCFLAGS" --target=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix="$PREFIX-prereqs" --with-gmp="$PREFIX-prereqs" --disable-shared 2>&1 | tee -a build.log | |
cont_build_log "make $PARALLEL" | |
cont_build_log "make $PARALLEL install" | |
popd | |
rm -rf build-mpc-windows | |
mkdir build-mpc-windows | |
pushd build-mpc-windows | |
- ../mpc-1.0.3/configure --target=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix="$PREFIX-prereqs" --with-gmp="$PREFIX-prereqs" --with-mpfr="$PREFIX-prereqs" --disable-shared 2>&1 | tee -a build.log | |
+ ../mpc-1.0.3/configure CFLAGS="$WINCFLAGS" --target=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix="$PREFIX-prereqs" --with-gmp="$PREFIX-prereqs" --with-mpfr="$PREFIX-prereqs" --disable-shared 2>&1 | tee -a build.log | |
cont_build_log "make $PARALLEL" | |
cont_build_log "make $PARALLEL install" | |
popd | |
rm -rf build-isl-windows | |
mkdir build-isl-windows | |
pushd build-isl-windows | |
- ../isl-0.16.1/configure --target=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix="$PREFIX-prereqs" --disable-shared --with-gmp-prefix="$PREFIX-prereqs" 2>&1 | tee -a build.log | |
+ ../isl-0.16.1/configure CFLAGS="$WINCFLAGS" --target=i686-w64-mingw32 --host=i686-w64-mingw32 --prefix="$PREFIX-prereqs" --disable-shared --with-gmp-prefix="$PREFIX-prereqs" 2>&1 | tee -a build.log | |
cont_build_log "make $PARALLEL" | |
cont_build_log "make $PARALLEL install" | |
popd | |
mkdir "$PREFIX-windows/ia16-elf" | |
cp -R "$PREFIX/ia16-elf/lib" "$PREFIX-windows/ia16-elf" | |
cp -R "$PREFIX/ia16-elf/include" "$PREFIX-windows/ia16-elf" | |
+ rm -rf build-libiconv-windows | |
+ mkdir build-libiconv-windows | |
+ pushd build-libiconv-windows | |
+ ../libiconv-1.17/configure CFLAGS="$WINCFLAGS" --target=i686-w64-mingw32 --host=i686-w64-mingw32 --enable-static --disable-shared --disable-nls --disable-dependency-tracking --prefix="$PREFIX-prereqs" 2>&1 | tee -a build.log | |
+ cont_build_log "make $PARALLEL" | |
+ cont_build_log "make $PARALLEL install" | |
+ popd | |
fi | |
if in_list binutils-windows BUILDLIST; then | |
@@ -818,9 +828,11 @@ if in_list binutils-windows BUILDLIST; then | |
rm -rf build-binutils-windows | |
mkdir build-binutils-windows | |
pushd build-binutils-windows | |
+ CFLAGS="$WINCFLAGS" CXXFLAGS="$WINCFLAGS" \ | |
../binutils-ia16/configure --host=i686-w64-mingw32 --target=ia16-elf \ | |
--prefix="$PREFIX" $BINUTILSOPTS --disable-libctf --disable-gdb \ | |
--disable-libdecnumber --disable-readline --disable-sim --disable-nls \ | |
+ --with-libiconv-prefix="$PREFIX-prereqs" \ | |
2>&1 | tee build.log | |
make $PARALLEL 'CFLAGS=-s -O2' 'CXXFLAGS=-s -O2' 'BOOT_CFLAGS=-s -O2' 2>&1 | tee -a build.log | |
make $PARALLEL install prefix=$PREFIX-windows 2>&1 | tee -a build.log | |
@@ -838,10 +850,14 @@ if in_list gcc-windows BUILDLIST; then | |
pushd build-windows | |
OLDPATH=$PATH | |
export PATH=$PREFIX-windows/bin:$PATH | |
+ ac_cv_prog_CC_FOR_TARGET="${HERE}/build2/gcc/xgcc -B${HERE}/build2/gcc/ -B${PREFIX}/ia16-elf/bin/ -B${PREFIX}/ia16-elf/lib/ -isystem ${PREFIX}/ia16-elf/include -isystem ${PREFIX}/ia16-elf/sys-include" \ | |
+ ac_cv_prog_CXX_FOR_TARGET="${HERE}/build2/gcc/xgcc -B${HERE}/build2/gcc/ -nostdinc++ -B${HERE}/build2/gcc/ -B${PREFIX}/ia16-elf/bin/ -B${PREFIX}/ia16-elf/lib/ -isystem ${PREFIX}/ia16-elf/include -isystem ${PREFIX}/ia16-elf/sys-include" \ | |
+ ac_cv_lib_dl_dlopen="no" \ | |
../gcc-ia16/configure --host=i686-w64-mingw32 --target=ia16-elf \ | |
--prefix="$PREFIX" --enable-libssp --enable-languages=$LANGUAGES \ | |
--disable-libquadmath --with-gmp="$PREFIX-prereqs" \ | |
--with-mpfr="$PREFIX-prereqs" --with-mpc="$PREFIX-prereqs" \ | |
+ --with-libiconv-prefix="$PREFIX-prereqs" --disable-nls \ | |
$EXTRABUILD2OPTS --with-isl="$PREFIX-prereqs" 2>&1 | tee build.log | |
make $PARALLEL 'CFLAGS=-s -O2' 'CXXFLAGS=-s -O2' 'BOOT_CFLAGS=-s -O2' 2>&1 | tee -a build.log | |
make $PARALLEL install prefix=$PREFIX-windows 2>&1 | tee -a build.log | |
@@ -878,6 +894,7 @@ if in_list prereqs-djgpp BUILDLIST; then | |
# super-humongous integers, so we can disable the use of FFT... | |
../gmp-6.1.2/configure --target=i586-pc-msdosdjgpp \ | |
--host=i586-pc-msdosdjgpp --prefix="$PREFIX-djgpp-prereqs" \ | |
+ CFLAGS="$DJGPPCFLAGS" \ | |
--disable-shared --disable-fft 2>&1 | tee build.log | |
cont_build_log "make $PARALLEL" | |
cont_build_log "make $PARALLEL install" | |
@@ -888,6 +905,7 @@ if in_list prereqs-djgpp BUILDLIST; then | |
pushd build-mpfr-djgpp | |
../mpfr-3.1.5/configure --target=i586-pc-msdosdjgpp \ | |
--host=i586-pc-msdosdjgpp --prefix="$PREFIX-djgpp-prereqs" \ | |
+ CFLAGS="$DJGPPCFLAGS" \ | |
--with-gmp="$PREFIX-djgpp-prereqs" --disable-shared 2>&1 | tee build.log | |
cont_build_log "make $PARALLEL" | |
cont_build_log "make $PARALLEL install" | |
@@ -898,6 +916,7 @@ if in_list prereqs-djgpp BUILDLIST; then | |
pushd build-mpc-djgpp | |
../mpc-1.0.3/configure --target=i586-pc-msdosdjgpp \ | |
--host=i586-pc-msdosdjgpp --prefix="$PREFIX-djgpp-prereqs" \ | |
+ CFLAGS="$DJGPPCFLAGS" \ | |
--with-gmp="$PREFIX-djgpp-prereqs" --with-mpfr="$PREFIX-djgpp-prereqs" \ | |
--disable-shared 2>&1 | tee build.log | |
cont_build_log "make $PARALLEL" | |
@@ -909,11 +928,16 @@ if in_list prereqs-djgpp BUILDLIST; then | |
pushd build-isl-djgpp | |
../isl-0.16.1/configure --target=i586-pc-msdosdjgpp \ | |
--host=i586-pc-msdosdjgpp --prefix="$PREFIX-djgpp-prereqs" \ | |
+ CFLAGS="$DJGPPCFLAGS" \ | |
--disable-shared --with-gmp-prefix="$PREFIX-djgpp-prereqs" 2>&1 | \ | |
tee build.log | |
cont_build_log "make $PARALLEL" | |
cont_build_log "make $PARALLEL install" | |
popd | |
+ # | |
+ # libiconv is too big for most environment of pure DOS | |
+ #rm -rf build-libiconv-djgpp | |
+ | |
fi | |
if either_in_list prereqs-djgpp some-prereqs-djgpp BUILDLIST; then | |
@@ -1028,6 +1052,7 @@ if in_list binutils-djgpp BUILDLIST; then | |
--datadir="$PREFIX-djgpp"/ia16-elf \ | |
--infodir="$PREFIX-djgpp"/ia16-elf/info \ | |
--localedir="$PREFIX-djgpp"/ia16-elf/locale \ | |
+ CFLAGS="$DJGPPCFLAGS" CXXFLAGS="$DJGPPCFLAGS" \ | |
$BINUTILSOPTS --disable-libctf --disable-gdb --disable-libdecnumber \ | |
--disable-readline --disable-sim --disable-nls --disable-plugins \ | |
--disable-lto --disable-werror 2>&1 | tee build.log | |
@@ -1130,6 +1155,9 @@ if in_list gcc-djgpp BUILDLIST; then | |
# | |
# Note: the switch here is --disable-plugin. The Binutils use | |
# --disable-plugins. (!) | |
+ ac_cv_prog_CC_FOR_TARGET="${HERE}/build2/gcc/xgcc -B${HERE}/build2/gcc/ -B${PREFIX}/ia16-elf/bin/ -B${PREFIX}/ia16-elf/lib/ -isystem ${PREFIX}/ia16-elf/include -isystem ${PREFIX}/ia16-elf/sys-include" \ | |
+ ac_cv_prog_CXX_FOR_TARGET="${HERE}/build2/gcc/xgcc -B${HERE}/build2/gcc/ -nostdinc++ -B${HERE}/build2/gcc/ -B${PREFIX}/ia16-elf/bin/ -B${PREFIX}/ia16-elf/lib/ -isystem ${PREFIX}/ia16-elf/include -isystem ${PREFIX}/ia16-elf/sys-include" \ | |
+ ac_cv_lib_dl_dlopen="no" \ | |
../gcc-ia16/configure --host=i586-pc-msdosdjgpp --target=ia16-elf \ | |
--program-prefix=i16 --with-gcc-major-version-only \ | |
--prefix="$PREFIX-djgpp" --datadir="$PREFIX-djgpp"/ia16-elf \ | |
diff --git a/fetch.sh b/fetch.sh | |
--- a/fetch.sh | |
+++ b/fetch.sh | |
@@ -73,6 +73,12 @@ then | |
wget https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.16.1.tar.bz2 | |
tar -xjf isl-0.16.1.tar.bz2 | |
fi | |
+if ! tar -tzf libiconv-1.17.tar.gz >/dev/null 2>&1 | |
+then | |
+ rm -f libiconv-1.17.tar.gz | |
+ wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz | |
+ tar -xzf libiconv-1.17.tar.gz | |
+fi | |
do_git_clone causeway "${1-gitlab.com}" tkchia/causeway.git "$2" | |
do_git_clone libi86 "${1-gitlab.com}" tkchia/libi86.git "$2" | |
# ^- GitLab, not GitHub! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment