From 5fc6ae5de6194252e4177a4fd0d71804d634b342 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 08:48:23 +0100 Subject: [PATCH 1/6] Added XZ archive support XZ archives are more modern and smaller. --- README.md | 4 ++-- common.sh | 1 + prepare-debian-ubuntu.sh | 2 +- prepare-mac-os.sh | 5 ++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3aaf560..d62f91a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ How do I use it? 1. Set up your environment by installing the following software: - autoconf, automake, bison, flex, gcc, g++/gcc-c++, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, wget, mpc, gmp, libelf, mpfr, git + autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, mpc, gmp, libelf, mpfr, git 2. Set the PSPDEV and PATH environmental variables: @@ -37,7 +37,7 @@ Ubuntu 1. Install the required packages by running. - sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget + sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget bzip2 gzip xz-utils 2. Build and install the toolchain and SDK. diff --git a/common.sh b/common.sh index 9fa05fb..a01f3a6 100755 --- a/common.sh +++ b/common.sh @@ -20,6 +20,7 @@ function auto_extract "tar") tar --no-same-owner -xf $path ;; "gz"|"tgz") tar --no-same-owner -xzf $path ;; "bz2"|"tbz2") tar --no-same-owner -xjf $path ;; + "xz"|"txz") tar --no-same-owner -xJf $path ;; "zip") unzip $path ;; *) echo "I don't know how to extract $ext archives!"; return 1 ;; esac diff --git a/prepare-debian-ubuntu.sh b/prepare-debian-ubuntu.sh index 3fdb6ba..34629bd 100755 --- a/prepare-debian-ubuntu.sh +++ b/prepare-debian-ubuntu.sh @@ -1,7 +1,7 @@ #!/bin/bash # Install build dependencies -sudo apt-get install $@ g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip +sudo apt-get install $@ g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip bzip2 gzip xz-utils # Make `/bin/sh` an alias for `/bin/bash` instead of `/bin/dash` - which is # faster, but doesn't play nice with some autotools scripts in psp-ports. diff --git a/prepare-mac-os.sh b/prepare-mac-os.sh index 888eb0f..0325c70 100755 --- a/prepare-mac-os.sh +++ b/prepare-mac-os.sh @@ -10,13 +10,12 @@ install_libusb() { } if [ -e "/opt/local/bin/port" ]; then - sudo port install automake cmake doxygen libelf libmpc libusb wget + sudo port install automake cmake doxygen libelf libmpc libusb wget xz install_libusb elif [ -e "/usr/local/bin/brew" ]; then CURRENT_USER=$(stat -f '%Su' /dev/console) - sudo -u $CURRENT_USER brew install automake cmake doxygen libelf libmpc libusb libusb-compat wget + sudo -u $CURRENT_USER brew install automake cmake doxygen libelf libmpc libusb libusb-compat wget xz else echo "Go install MacPorts from http://www.macports.org/ or Homebrew from http://brew.sh/ first, then we can talk" fi - From da0051c13e5e78c58ee673de1aac11d63f3151c1 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 09:30:11 +0100 Subject: [PATCH 2/6] When checking dependencies, check for (g)libtoolize instead of (g)libtool The libtool script is installed in a separate package on some systems and is not necessary for psptoolchain. --- depends/check-dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/check-dependencies.sh b/depends/check-dependencies.sh index 33ca682..4c7db25 100755 --- a/depends/check-dependencies.sh +++ b/depends/check-dependencies.sh @@ -105,10 +105,10 @@ if [ "$(uname)" == "Darwin" ]; then # GNU libtool will be prepended with letter 'g' to prevent conflicts with # the one comes along with OS X. - check_program glibtool + check_program glibtoolize else check_header readline readline.h readline/readline.h - check_program libtool + check_program libtoolize fi if [ ${#missing_depends[@]} -ne 0 ]; then From 1cd68b03d00b6d2ae0fa74f05a72405395f9a3ff Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 14:54:37 +0100 Subject: [PATCH 3/6] GMP, MPFR, MPC and ISL are not longer a build requirement Now, they're installed automatically under the hood. --- README.md | 4 ++-- depends/check-dependencies.sh | 5 ----- prepare-debian-ubuntu.sh | 2 +- prepare-mac-os.sh | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d62f91a..870aa63 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ How do I use it? 1. Set up your environment by installing the following software: - autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, mpc, gmp, libelf, mpfr, git + autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, libelf git 2. Set the PSPDEV and PATH environmental variables: @@ -37,7 +37,7 @@ Ubuntu 1. Install the required packages by running. - sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget bzip2 gzip xz-utils + sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget bzip2 gzip xz-utils 2. Build and install the toolchain and SDK. diff --git a/depends/check-dependencies.sh b/depends/check-dependencies.sh index 4c7db25..503245b 100755 --- a/depends/check-dependencies.sh +++ b/depends/check-dependencies.sh @@ -62,11 +62,6 @@ function check_aclocal missing_depends+=($1); return 1 } - - -# check_header gmp gmp.h -# check_header mpc mpc.h -# check_header mpfr mpfr.h check_header libelf elf.h libelf.h libelf/libelf.h gelf.h libelf/gelf.h check_header libusb usb.h check_header ncurses ncurses.h ncurses/ncurses.h diff --git a/prepare-debian-ubuntu.sh b/prepare-debian-ubuntu.sh index 34629bd..1c88d62 100755 --- a/prepare-debian-ubuntu.sh +++ b/prepare-debian-ubuntu.sh @@ -1,7 +1,7 @@ #!/bin/bash # Install build dependencies -sudo apt-get install $@ g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip bzip2 gzip xz-utils +sudo apt-get install $@ g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip bzip2 gzip xz-utils # Make `/bin/sh` an alias for `/bin/bash` instead of `/bin/dash` - which is # faster, but doesn't play nice with some autotools scripts in psp-ports. diff --git a/prepare-mac-os.sh b/prepare-mac-os.sh index 0325c70..4bbed9a 100755 --- a/prepare-mac-os.sh +++ b/prepare-mac-os.sh @@ -10,12 +10,12 @@ install_libusb() { } if [ -e "/opt/local/bin/port" ]; then - sudo port install automake cmake doxygen libelf libmpc libusb wget xz + sudo port install automake cmake doxygen libelf libusb wget xz install_libusb elif [ -e "/usr/local/bin/brew" ]; then CURRENT_USER=$(stat -f '%Su' /dev/console) - sudo -u $CURRENT_USER brew install automake cmake doxygen libelf libmpc libusb libusb-compat wget xz + sudo -u $CURRENT_USER brew install automake cmake doxygen libelf libusb libusb-compat wget xz else echo "Go install MacPorts from http://www.macports.org/ or Homebrew from http://brew.sh/ first, then we can talk" fi From 1fd4b5a208967b13c56fc967316f47b99f0cefa7 Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Sun, 3 May 2020 14:42:20 +0200 Subject: [PATCH 4/6] Update README Fix dependencies mentioned multiple times --- README.md | 18 +++++++++--------- prepare-debian-ubuntu.sh | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 870aa63..ee15840 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ How do I use it? 1. Set up your environment by installing the following software: - autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, libelf git + autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, libelf, git 2. Set the PSPDEV and PATH environmental variables: @@ -32,16 +32,16 @@ How do I use it? > After you are done use `swapoff -a` disable the swapfile. Finally you can > remove it with `rm`. -Ubuntu ------- +Ubuntu/Debian +------------- -1. Install the required packages by running. +1. Install the required packages by running: - sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget bzip2 gzip xz-utils + sudo ./prepare-debian-ubuntu.sh 2. Build and install the toolchain and SDK. - sudo ./toolchain-sudo.sh + sudo ./toolchain-sudo.sh > NOTE: If you do not wish for the toolchain to be installed in /usr/local/pspdev then edit toolchain-sudo.sh and change the INSTALLDIR variable. @@ -49,13 +49,13 @@ OSX --- 1. Install [`port`][MacPorts] or [`brew`][HomeBrew]. -2. Run `prepare-mac-os.sh`. This will auto-install all the libraries you will need before building. +2. Install all the libraries you will need before building by running: - sudo ./prepare-mac-os.sh + sudo ./prepare-mac-os.sh 3. Build and install the toolchain and SDK. - sudo ./toolchain-sudo.sh + sudo ./toolchain-sudo.sh Where do I go from here? ======================== diff --git a/prepare-debian-ubuntu.sh b/prepare-debian-ubuntu.sh index 1c88d62..6afa649 100755 --- a/prepare-debian-ubuntu.sh +++ b/prepare-debian-ubuntu.sh @@ -1,7 +1,7 @@ #!/bin/bash # Install build dependencies -sudo apt-get install $@ g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip bzip2 gzip xz-utils +sudo apt-get install $@ g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl wget unzip bzip2 gzip xz-utils # Make `/bin/sh` an alias for `/bin/bash` instead of `/bin/dash` - which is # faster, but doesn't play nice with some autotools scripts in psp-ports. From 4281d21f1979ec8d599aacdd4fccf9eecc87cbfb Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Sun, 3 May 2020 15:19:06 +0200 Subject: [PATCH 5/6] Remove old gcc patch --- patches/patch-gcc_cp_cfns.h | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 patches/patch-gcc_cp_cfns.h diff --git a/patches/patch-gcc_cp_cfns.h b/patches/patch-gcc_cp_cfns.h deleted file mode 100644 index 79d3dcf..0000000 --- a/patches/patch-gcc_cp_cfns.h +++ /dev/null @@ -1,22 +0,0 @@ ---- gcc/cp/cfns.h.orig 2015-02-13 08:27:46.000000000 +0200 -+++ gcc/cp/cfns.h 2015-02-13 10:23:53.000000000 +0200 -@@ -53,6 +53,9 @@ - static unsigned int hash (const char *, unsigned int); - #ifdef __GNUC__ - __inline -+#ifdef __GNUC_STDC_INLINE__ -+__attribute__ ((__gnu_inline__)) -+#endif - #endif - const char * libc_name_p (const char *, unsigned int); - /* maximum key range = 391, duplicates = 0 */ -@@ -96,7 +99,7 @@ - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400 - }; -- register int hval = len; -+ register int hval = (int)len; - - switch (hval) - { - From 55858d25a78ebe4018326bba214189cae8873ffa Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Sun, 3 May 2020 15:25:57 +0200 Subject: [PATCH 6/6] Split long shell script lines --- prepare-debian-ubuntu.sh | 5 ++++- scripts/001-binutils.sh | 3 ++- scripts/002-gcc-stage1.sh | 6 +++++- scripts/003-pspsdk-stage1.sh | 5 ++++- scripts/004-newlib-1.20.0.sh | 4 +--- scripts/005-gcc-stage2.sh | 6 +++++- scripts/006-pspsdk-stage2.sh | 5 ++++- scripts/007-gdb-7.3.1.sh | 5 ++++- scripts/008-insight-6.8.sh | 5 ++++- 9 files changed, 33 insertions(+), 11 deletions(-) diff --git a/prepare-debian-ubuntu.sh b/prepare-debian-ubuntu.sh index 6afa649..4429f7c 100755 --- a/prepare-debian-ubuntu.sh +++ b/prepare-debian-ubuntu.sh @@ -1,7 +1,10 @@ #!/bin/bash # Install build dependencies -sudo apt-get install $@ g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl wget unzip bzip2 gzip xz-utils +sudo apt-get install $@ g++ build-essential autoconf automake cmake doxygen \ + bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo \ + libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git \ + tcl wget unzip bzip2 gzip xz-utils # Make `/bin/sh` an alias for `/bin/bash` instead of `/bin/dash` - which is # faster, but doesn't play nice with some autotools scripts in psp-ports. diff --git a/scripts/001-binutils.sh b/scripts/001-binutils.sh index 725514d..7111848 100755 --- a/scripts/001-binutils.sh +++ b/scripts/001-binutils.sh @@ -22,7 +22,8 @@ cd build-psp CFLAGS="$CFLAGS -I/opt/local/include" \ CPPFLAGS="$CPPFLAGS -I/opt/local/include" \ LDFLAGS="$LDFLAGS -L/opt/local/lib" \ - ../configure --prefix="$PSPDEV" --target="psp" --enable-install-libbfd --enable-plugins --disable-werror --with-system-zlib + ../configure --prefix="$PSPDEV" --target="psp" --enable-install-libbfd \ + --enable-plugins --disable-werror --with-system-zlib # Compile and install. ( -r is required for building under osx ) make -j $(num_cpus) clean diff --git a/scripts/002-gcc-stage1.sh b/scripts/002-gcc-stage1.sh index 43a45c4..1aa1fb5 100755 --- a/scripts/002-gcc-stage1.sh +++ b/scripts/002-gcc-stage1.sh @@ -35,7 +35,11 @@ cd build-psp ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c" --enable-lto --with-newlib --without-headers --disable-libssp + CFLAGS="$CFLAGS -I/opt/local/include" \ + CPPFLAGS="$CPPFLAGS -I/opt/local/include" \ + LDFLAGS="$LDFLAGS -L/opt/local/lib" \ + ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c" \ + --enable-lto --with-newlib --without-headers --disable-libssp ## Compile and install. make -j $(num_cpus) clean diff --git a/scripts/003-pspsdk-stage1.sh b/scripts/003-pspsdk-stage1.sh index 91005d9..a0a77e9 100755 --- a/scripts/003-pspsdk-stage1.sh +++ b/scripts/003-pspsdk-stage1.sh @@ -14,7 +14,10 @@ ./bootstrap ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ./configure --with-pspdev="$PSPDEV" + CFLAGS="$CFLAGS -I/opt/local/include" \ + CPPFLAGS="$CPPFLAGS -I/opt/local/include" \ + LDFLAGS="$LDFLAGS -L/opt/local/lib" \ + ./configure --with-pspdev="$PSPDEV" ## Build and install. make -j $(num_cpus) clean diff --git a/scripts/004-newlib-1.20.0.sh b/scripts/004-newlib-1.20.0.sh index be65b29..cb5e1c0 100755 --- a/scripts/004-newlib-1.20.0.sh +++ b/scripts/004-newlib-1.20.0.sh @@ -16,9 +16,7 @@ clone_git_repo github.com pspdev newlib newlib-1_20_0-PSP ## Configure the build. ../configure --prefix="$PSPDEV" --target="psp" \ - --enable-newlib-iconv \ - --enable-newlib-multithread \ - --enable-newlib-mb \ + --enable-newlib-iconv --enable-newlib-multithread --enable-newlib-mb ## Compile and install. make -j $(num_cpus) clean diff --git a/scripts/005-gcc-stage2.sh b/scripts/005-gcc-stage2.sh index c53b50d..8afa0c6 100755 --- a/scripts/005-gcc-stage2.sh +++ b/scripts/005-gcc-stage2.sh @@ -37,7 +37,11 @@ ## Configure the build. ## If you want to build gdc add "d" to --enable-languages option. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,c++" --enable-lto --with-newlib --enable-cxx-flags="-G0" + CFLAGS="$CFLAGS -I/opt/local/include" \ + CPPFLAGS="$CPPFLAGS -I/opt/local/include" \ + LDFLAGS="$LDFLAGS -L/opt/local/lib" \ + ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,c++" \ + --enable-lto --with-newlib --enable-cxx-flags="-G0" ## Compile and install. make -j $(num_cpus) clean diff --git a/scripts/006-pspsdk-stage2.sh b/scripts/006-pspsdk-stage2.sh index 80e768c..1c5b589 100755 --- a/scripts/006-pspsdk-stage2.sh +++ b/scripts/006-pspsdk-stage2.sh @@ -14,7 +14,10 @@ ./bootstrap ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ./configure --with-pspdev="$PSPDEV" + CFLAGS="$CFLAGS -I/opt/local/include" \ + CPPFLAGS="$CPPFLAGS -I/opt/local/include" \ + LDFLAGS="$LDFLAGS -L/opt/local/lib" \ + ./configure --with-pspdev="$PSPDEV" ## Build and install. make -j $(num_cpus) clean diff --git a/scripts/007-gdb-7.3.1.sh b/scripts/007-gdb-7.3.1.sh index 3f7217c..7f2cf0b 100755 --- a/scripts/007-gdb-7.3.1.sh +++ b/scripts/007-gdb-7.3.1.sh @@ -19,7 +19,10 @@ cd build-psp ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --disable-werror --disable-nls + CFLAGS="$CFLAGS -I/opt/local/include" \ + CPPFLAGS="$CPPFLAGS -I/opt/local/include" \ + LDFLAGS="$LDFLAGS -L/opt/local/lib" \ + ../configure --prefix="$PSPDEV" --target="psp" --disable-werror --disable-nls ## Compile and install. make -j $(num_cpus) clean diff --git a/scripts/008-insight-6.8.sh b/scripts/008-insight-6.8.sh index e77835c..5cc97d1 100755 --- a/scripts/008-insight-6.8.sh +++ b/scripts/008-insight-6.8.sh @@ -17,7 +17,10 @@ exit; cd build-psp ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --disable-nls --disable-werror + CFLAGS="$CFLAGS -I/opt/local/include" \ + CPPFLAGS="$CPPFLAGS -I/opt/local/include" \ + LDFLAGS="$LDFLAGS -L/opt/local/lib" \ + ../configure --prefix="$PSPDEV" --target="psp" --disable-nls --disable-werror ## Compile and install. make -j $(num_cpus) clean