From ac00f97be37b980922ae4172524493158435f92c Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sat, 2 Mar 2024 13:24:16 -0300 Subject: [PATCH 01/36] reviewing scripts --- depends/check-wget.sh | 21 ++++ libraries-sudo.sh | 1 + makefile | 10 ++ patches/libcurl-7.31.0.patch | 20 ---- patches/polarssl-1.3.9-ipv6.patch | 12 ++ ...2.8-net.patch => polarssl-1.3.9-net.patch} | 0 ...ming.patch => polarssl-1.3.9-timing.patch} | 0 readme.md | 24 ++++ scripts/001-zlib-1.2.11.sh | 2 +- scripts/002-libpng-1.4.4.sh | 6 +- scripts/003-jpeg-8b.sh | 6 +- scripts/004-freetype-2.4.3.sh | 6 +- scripts/005-pixman-0.20.0.sh | 6 +- scripts/006-cairo-1.10.0.sh | 6 +- scripts/007-libogg-1.2.1.sh | 6 +- scripts/008-libvorbis-1.3.2.sh | 6 +- scripts/009-libzip-0.9.3.sh | 6 +- scripts/010-tiff-3.9.4.sh | 9 +- scripts/011-libmikmod-3.1.11.sh | 2 +- ...-libxml2-2.7.8.sh => 012-libxml2-2.8.0.sh} | 13 ++- scripts/013-sdl_psl1ght.sh | 3 +- scripts/014-sdl_psl1ght_libs.sh | 3 +- ...{015-polarssl.sh => 015-polarssl-1.3.9.sh} | 14 ++- ...ibcurl-7.31.0.sh => 016-libcurl-7.64.1.sh} | 13 +-- scripts/017-libmad-0.15.1b.sh | 6 +- scripts/018-flac-1.2.1.sh | 6 +- scripts/019-faad2-2.7.sh | 6 +- scripts/020-libtheora-1.1.1.sh | 6 +- scripts/021-NoRSX.sh | 2 +- scripts/022-libjson.sh | 6 +- scripts/026-ps3soundlib.sh | 12 ++ scripts/027-tiny3d_libfont.sh | 20 ++++ scripts/028-mbedTLS-2.16.6.sh | 105 ++++++++++++++++++ scripts/029-libunrar.sh | 12 ++ scripts/030-libnfs.sh | 16 +++ scripts/031-libsmb2.sh | 13 +++ scripts/032-libun7zip.sh | 12 ++ scripts/033-libtinytar.sh | 12 ++ scripts/034-libya2d.sh | 12 ++ scripts/035-bzip2.sh | 11 ++ scripts/036-dbglogger.sh | 11 ++ scripts/037-mini18n.sh | 12 ++ scripts/038-libansilove.sh | 12 ++ scripts/039-pthreads-emb.sh | 14 +++ scripts/040-sdl2_psl1ght.sh | 15 +++ 45 files changed, 428 insertions(+), 88 deletions(-) create mode 100644 makefile delete mode 100644 patches/libcurl-7.31.0.patch create mode 100644 patches/polarssl-1.3.9-ipv6.patch rename patches/{polarssl-1.2.8-net.patch => polarssl-1.3.9-net.patch} (100%) rename patches/{polarssl-1.2.8-timing.patch => polarssl-1.3.9-timing.patch} (100%) create mode 100644 readme.md rename scripts/{012-libxml2-2.7.8.sh => 012-libxml2-2.8.0.sh} (59%) rename scripts/{015-polarssl.sh => 015-polarssl-1.3.9.sh} (81%) rename scripts/{016-libcurl-7.31.0.sh => 016-libcurl-7.64.1.sh} (73%) create mode 100755 scripts/026-ps3soundlib.sh create mode 100755 scripts/027-tiny3d_libfont.sh create mode 100755 scripts/028-mbedTLS-2.16.6.sh create mode 100755 scripts/029-libunrar.sh create mode 100755 scripts/030-libnfs.sh create mode 100755 scripts/031-libsmb2.sh create mode 100755 scripts/032-libun7zip.sh create mode 100755 scripts/033-libtinytar.sh create mode 100755 scripts/034-libya2d.sh create mode 100755 scripts/035-bzip2.sh create mode 100755 scripts/036-dbglogger.sh create mode 100755 scripts/037-mini18n.sh create mode 100755 scripts/038-libansilove.sh create mode 100755 scripts/039-pthreads-emb.sh create mode 100755 scripts/040-sdl2_psl1ght.sh diff --git a/depends/check-wget.sh b/depends/check-wget.sh index 23576e12..6ef701a4 100755 --- a/depends/check-wget.sh +++ b/depends/check-wget.sh @@ -3,3 +3,24 @@ ## Check for wget. wget -V 1> /dev/null || { echo "ERROR: Install wget before continuing."; exit 1; } + +## Setup global wget configuration +## https://www.gnu.org/software/wget/manual/html_node/Wgetrc-Commands.html +echo " +# If this is set to off, the server certificate is not checked against the specified client authorities. The default is “on” +check_certificate = off +# Tune HTTPS security (auto, SSLv2, SSLv3, TLSv1, PFS) +secureprotocol = auto +# You can lower (or raise) the default number of retries when downloading a file (default is 20). +tries = 30 +# Set all applicable timeout values to n, the same as ‘-T n’. +timeout = 15 +# Specifies the maximum number of redirections to follow for a resource. See ‘--max-redirect=number’. +max_redirect = 50 +# no_clobber option, will not overwrite existing files. Instead, it will skip downloading files that already exist locally. +no_clobber = on +# If set to on, force continuation of preexistent partially retrieved files. See ‘-c’ before setting it. +continue = on +# quiet (default is no) +quiet = on +" > /etc/wgetrc diff --git a/libraries-sudo.sh b/libraries-sudo.sh index b322430f..b3469b10 100755 --- a/libraries-sudo.sh +++ b/libraries-sudo.sh @@ -6,6 +6,7 @@ cd "`dirname $0`" || { echo "ERROR: Could not enter the ps3libraries directory." ## Set up the environment. export PS3DEV=/usr/local/ps3dev +export PSL1GHT=$PS3DEV export PATH=$PATH:$PS3DEV/bin export PATH=$PATH:$PS3DEV/ppu/bin export PATH=$PATH:$PS3DEV/spu/bin diff --git a/makefile b/makefile new file mode 100644 index 00000000..c1b30b5a --- /dev/null +++ b/makefile @@ -0,0 +1,10 @@ +IMAGE=hldtux/ps3dev + +test: + DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run -i --rm -v "`pwd`:/src" ${IMAGE} ./libraries.sh + +run: + DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run -it --rm -v "`pwd`:/src" ${IMAGE} bash + +clean: + rm -rf build \ No newline at end of file diff --git a/patches/libcurl-7.31.0.patch b/patches/libcurl-7.31.0.patch deleted file mode 100644 index 92368583..00000000 --- a/patches/libcurl-7.31.0.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c ---- a/src/tool_dirhie.c -+++ b/src/tool_dirhie.c -@@ -118,6 +118,7 @@ - if not ending with DIR_CHAR, we need to prune it */ - if(tempdir2 != NULL) { - size_t dlen = strlen(dirbuildup); -+ struct stat st; - if(dlen) - sprintf(&dirbuildup[dlen], "%s%s", DIR_CHAR, tempdir); - else { -@@ -126,7 +127,7 @@ - else - sprintf(dirbuildup, "%s%s", DIR_CHAR, tempdir); - } -- if(access(dirbuildup, F_OK) == -1) { -+ if(stat(dirbuildup, &st) == -1) { - if(-1 == mkdir(dirbuildup,(mode_t)0000750)) { - show_dir_errno(errors, dirbuildup); - result = CURLE_WRITE_ERROR; diff --git a/patches/polarssl-1.3.9-ipv6.patch b/patches/polarssl-1.3.9-ipv6.patch new file mode 100644 index 00000000..fac71a34 --- /dev/null +++ b/patches/polarssl-1.3.9-ipv6.patch @@ -0,0 +1,12 @@ +--- a/include/polarssl/config.h ++++ b/include/polarssl/config.h +@@ -112,7 +112,7 @@ + * + * Comment if your system does not support the IPv6 socket interface + */ +-#define POLARSSL_HAVE_IPV6 ++//#define POLARSSL_HAVE_IPV6 + + /** + * \def POLARSSL_PLATFORM_MEMORY + diff --git a/patches/polarssl-1.2.8-net.patch b/patches/polarssl-1.3.9-net.patch similarity index 100% rename from patches/polarssl-1.2.8-net.patch rename to patches/polarssl-1.3.9-net.patch diff --git a/patches/polarssl-1.2.8-timing.patch b/patches/polarssl-1.3.9-timing.patch similarity index 100% rename from patches/polarssl-1.2.8-timing.patch rename to patches/polarssl-1.3.9-timing.patch diff --git a/readme.md b/readme.md new file mode 100644 index 00000000..a34d73a7 --- /dev/null +++ b/readme.md @@ -0,0 +1,24 @@ + +### What does this do? + +This program will automatically build and install libraries used in the creation +of homebrew software for the Sony Playstation 3 videogame system. + +### How do I use it? + +1. Set up your environment by installing the following software: + +- autoconf +- automake +- libtool +- make +- pkg-config +- ps3toolchain +- psl1ght-sdl1 +- wget + +2. Run the library script: + +```sh +./libraries.sh +``` diff --git a/scripts/001-zlib-1.2.11.sh b/scripts/001-zlib-1.2.11.sh index e999243b..47cf7fef 100755 --- a/scripts/001-zlib-1.2.11.sh +++ b/scripts/001-zlib-1.2.11.sh @@ -2,7 +2,7 @@ # zlib-1.2.11.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue https://www.zlib.net/fossils/zlib-1.2.11.tar.gz +wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz ## Unpack the source code. rm -Rf zlib-1.2.11 && tar xfvz zlib-1.2.11.tar.gz && cd zlib-1.2.11 diff --git a/scripts/002-libpng-1.4.4.sh b/scripts/002-libpng-1.4.4.sh index 5d4d1f7a..f55a64c8 100755 --- a/scripts/002-libpng-1.4.4.sh +++ b/scripts/002-libpng-1.4.4.sh @@ -2,11 +2,11 @@ # libpng-1.4.4.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://download.sourceforge.net/libpng/libpng-1.4.4.tar.gz +wget http://phoenixnap.dl.sourceforge.net/project/libpng/libpng14/older-releases/1.4.4/libpng-1.4.4.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf libpng-1.4.4 && tar xfvz libpng-1.4.4.tar.gz && cd libpng-1.4.4 diff --git a/scripts/003-jpeg-8b.sh b/scripts/003-jpeg-8b.sh index 8bde2a9a..3ff86353 100755 --- a/scripts/003-jpeg-8b.sh +++ b/scripts/003-jpeg-8b.sh @@ -2,11 +2,11 @@ # jpeg-8b.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://www.ijg.org/files/jpegsrc.v8b.tar.gz +wget http://www.ijg.org/files/jpegsrc.v8b.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf jpeg-8b && tar xfvz jpegsrc.v8b.tar.gz && cd jpeg-8b diff --git a/scripts/004-freetype-2.4.3.sh b/scripts/004-freetype-2.4.3.sh index fdd15a53..01328860 100755 --- a/scripts/004-freetype-2.4.3.sh +++ b/scripts/004-freetype-2.4.3.sh @@ -2,11 +2,11 @@ # freetype-2.4.3.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.4.3.tar.gz +wget http://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.4.3.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf freetype-2.4.3 && tar xfvz freetype-2.4.3.tar.gz && cd freetype-2.4.3 diff --git a/scripts/005-pixman-0.20.0.sh b/scripts/005-pixman-0.20.0.sh index f065ea33..fc61287e 100755 --- a/scripts/005-pixman-0.20.0.sh +++ b/scripts/005-pixman-0.20.0.sh @@ -2,11 +2,11 @@ # pixman-0.20.0.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://cairographics.org/releases/pixman-0.20.0.tar.gz +wget http://cairographics.org/releases/pixman-0.20.0.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf pixman-0.20.0 && tar xfvz pixman-0.20.0.tar.gz && cd pixman-0.20.0 diff --git a/scripts/006-cairo-1.10.0.sh b/scripts/006-cairo-1.10.0.sh index 8b20b45a..0f5a7d1a 100755 --- a/scripts/006-cairo-1.10.0.sh +++ b/scripts/006-cairo-1.10.0.sh @@ -2,11 +2,11 @@ # cairo-1.10.0.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://cairographics.org/releases/cairo-1.10.0.tar.gz +wget http://cairographics.org/releases/cairo-1.10.0.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf cairo-1.10.0 && tar xfvz cairo-1.10.0.tar.gz && cd cairo-1.10.0 diff --git a/scripts/007-libogg-1.2.1.sh b/scripts/007-libogg-1.2.1.sh index 0eb8d41e..9d721586 100755 --- a/scripts/007-libogg-1.2.1.sh +++ b/scripts/007-libogg-1.2.1.sh @@ -2,11 +2,11 @@ # libogg-1.2.1.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://downloads.xiph.org/releases/ogg/libogg-1.2.1.tar.gz +wget http://downloads.xiph.org/releases/ogg/libogg-1.2.1.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf libogg-1.2.1 && tar xfvz libogg-1.2.1.tar.gz && cd libogg-1.2.1 diff --git a/scripts/008-libvorbis-1.3.2.sh b/scripts/008-libvorbis-1.3.2.sh index d8fc06b8..1cb1686b 100755 --- a/scripts/008-libvorbis-1.3.2.sh +++ b/scripts/008-libvorbis-1.3.2.sh @@ -2,11 +2,11 @@ # libvorbis-1.3.2.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.gz +wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf libvorbis-1.3.2 && tar xfvz libvorbis-1.3.2.tar.gz && cd libvorbis-1.3.2 diff --git a/scripts/009-libzip-0.9.3.sh b/scripts/009-libzip-0.9.3.sh index c2ac7a0a..806e2473 100755 --- a/scripts/009-libzip-0.9.3.sh +++ b/scripts/009-libzip-0.9.3.sh @@ -2,11 +2,11 @@ # libzip-0.9.3.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://www.nih.at/libzip/libzip-0.9.3.tar.bz2 +wget https://libzip.org/download/libzip-0.9.3.tar.bz2 ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf libzip-0.9.3 && tar xfvj libzip-0.9.3.tar.bz2 && cd libzip-0.9.3 diff --git a/scripts/010-tiff-3.9.4.sh b/scripts/010-tiff-3.9.4.sh index 87c4f17c..2781f4e8 100755 --- a/scripts/010-tiff-3.9.4.sh +++ b/scripts/010-tiff-3.9.4.sh @@ -2,14 +2,11 @@ # tiff-3.9.4.sh by Jon Limle ## Download the source code. -wget --tries 5 --timeout 15 --continue \ - http://download.osgeo.org/libtiff/old/tiff-3.9.4.tar.gz \ -|| wget --continue \ - https://github.com/downloads/ps3dev/ps3libraries/tiff-3.9.4.tar.gz +wget --tries 5 --timeout 15 https://ftp.osuosl.org/pub/blfs/conglomeration/tiff/tiff-3.9.4.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf tiff-3.9.4 && tar xfvz ./tiff-3.9.4.tar.gz && cd tiff-3.9.4 diff --git a/scripts/011-libmikmod-3.1.11.sh b/scripts/011-libmikmod-3.1.11.sh index 79b3352c..1f8bb83f 100755 --- a/scripts/011-libmikmod-3.1.11.sh +++ b/scripts/011-libmikmod-3.1.11.sh @@ -2,7 +2,7 @@ # libmikmod-3.1.11.sh by Marcus Comstedt ## Download the source code. -wget --continue http://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz +wget http://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz ## Unpack the source code. rm -Rf libmikmod-3.1.11 && tar xfvz ./libmikmod-3.1.11.tar.gz && cd libmikmod-3.1.11 diff --git a/scripts/012-libxml2-2.7.8.sh b/scripts/012-libxml2-2.8.0.sh similarity index 59% rename from scripts/012-libxml2-2.7.8.sh rename to scripts/012-libxml2-2.8.0.sh index 178cd4ff..ea85fe9d 100755 --- a/scripts/012-libxml2-2.7.8.sh +++ b/scripts/012-libxml2-2.8.0.sh @@ -1,15 +1,18 @@ #!/bin/sh -e -# libxml2-2.7.8.sh by Naomi Peori (naomi@peori.ca) +# libxml2-2.8.0.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --continue http://xmlsoft.org/download/libxml2-2.7.8.tar.gz +wget http://xmlsoft.org/download/libxml2-2.8.0.tar.gz -O libxml2.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. -rm -Rf libxml2-2.7.8 && tar xfvz libxml2-2.7.8.tar.gz && cd libxml2-2.7.8 +rm -Rf libxml2 && mkdir libxml2 && tar --strip-components=1 --directory=libxml2 -xvzf libxml2.tar.gz + +## Create the build directory. +cd libxml2 ## Replace config.guess and config.sub cp ../config.guess ../config.sub . diff --git a/scripts/013-sdl_psl1ght.sh b/scripts/013-sdl_psl1ght.sh index 2c0f4391..cacf209b 100755 --- a/scripts/013-sdl_psl1ght.sh +++ b/scripts/013-sdl_psl1ght.sh @@ -2,7 +2,8 @@ # sdl_psl1ght.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --no-check-certificate https://github.com/zeldin/SDL_PSL1GHT/tarball/master -O sdl_psl1ght.tar.gz +# SDL1 +wget https://github.com/zeldin/SDL_PSL1GHT/tarball/master -O sdl_psl1ght.tar.gz ## Unpack the source code. rm -Rf sdl_psl1ght && mkdir sdl_psl1ght && tar --strip-components=1 --directory=sdl_psl1ght -xvzf sdl_psl1ght.tar.gz diff --git a/scripts/014-sdl_psl1ght_libs.sh b/scripts/014-sdl_psl1ght_libs.sh index e34f6a2a..d3235abf 100755 --- a/scripts/014-sdl_psl1ght_libs.sh +++ b/scripts/014-sdl_psl1ght_libs.sh @@ -2,7 +2,8 @@ # sdl_psl1ght_libs.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget --no-check-certificate https://github.com/zeldin/SDL_PSL1GHT_Libs/tarball/master -O sdl_psl1ght_libs.tar.gz +# SDL1 +wget https://github.com/zeldin/SDL_PSL1GHT_Libs/tarball/master -O sdl_psl1ght_libs.tar.gz ## Unpack the source code. rm -Rf sdl_psl1ght_libs && mkdir sdl_psl1ght_libs && tar --strip-components=1 --directory=sdl_psl1ght_libs -xvzf sdl_psl1ght_libs.tar.gz diff --git a/scripts/015-polarssl.sh b/scripts/015-polarssl-1.3.9.sh similarity index 81% rename from scripts/015-polarssl.sh rename to scripts/015-polarssl-1.3.9.sh index d9daf8e7..cc69b94e 100755 --- a/scripts/015-polarssl.sh +++ b/scripts/015-polarssl-1.3.9.sh @@ -22,7 +22,7 @@ ########################################################################### # Change values here # -VERSION="1.2.8" +VERSION="1.3.9" # ########################################################################### # @@ -32,20 +32,22 @@ ARCH="powerpc64" PLATFORM="PS3" ## Download the source code. -wget --continue --no-check-certificate -O polarssl-${VERSION}.tgz https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/polarssl-${VERSION}.tar.gz +wget -O polarssl-${VERSION}.gpl.tgz https://src.fedoraproject.org/repo/pkgs/polarssl/polarssl-1.3.9-gpl.tgz/48af7d1f0d5de512cbd6dacf5407884c/polarssl-${VERSION}-gpl.tgz ## Unpack the source code. -rm -Rf polarssl-${VERSION} && tar xfvz polarssl-${VERSION}.tgz && cd mbedtls-polarssl-${VERSION}/library +rm -Rf polarssl-${VERSION} && tar xfvz polarssl-${VERSION}.gpl.tgz && cd polarssl-${VERSION} ## Patch the source code. echo "Patching net.c and timing.c for compatibility..." -cat ../../../patches/polarssl-1.2.8-net.patch | patch -p1 -cat ../../../patches/polarssl-1.2.8-timing.patch | patch -p1 +cat ../../patches/polarssl-1.3.9-ipv6.patch | patch -p1 +cd library +cat ../../../patches/polarssl-1.3.9-net.patch | patch -p1 +cat ../../../patches/polarssl-1.3.9-timing.patch | patch -p1 echo "Building polarssl for ${PLATFORM} ${SDKVERSION} ${ARCH}" echo "Patching Makefile..." -sed -i.bak '4d' ${CURRENTPATH}/mbedtls-polarssl-${VERSION}/library/Makefile +sed -i.bak '4d' ${CURRENTPATH}/polarssl-${VERSION}/library/Makefile echo "Please stand by..." diff --git a/scripts/016-libcurl-7.31.0.sh b/scripts/016-libcurl-7.64.1.sh similarity index 73% rename from scripts/016-libcurl-7.31.0.sh rename to scripts/016-libcurl-7.64.1.sh index 095b545e..42c81c93 100755 --- a/scripts/016-libcurl-7.31.0.sh +++ b/scripts/016-libcurl-7.64.1.sh @@ -2,22 +2,20 @@ # libcurl-7.31.0 by KaKaRoTo # modified by mhaqs for 7.31.0 release and cpp compatibility +VERSION=7.64.1 ## Download the source code. -wget --continue http://curl.haxx.se/download/curl-7.31.0.tar.gz +wget http://curl.haxx.se/download/curl-${VERSION}.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. -rm -Rf curl-7.31.0 && tar xfvz curl-7.31.0.tar.gz && cd curl-7.31.0 +rm -Rf curl-${VERSION} && tar xfvz curl-${VERSION}.tar.gz && cd curl-${VERSION} ## Replace config.guess and config.sub cp ../config.guess ../config.sub . -## Patch the source code. -cat ../../patches/libcurl-7.31.0.patch | patch -p1 - ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -29,6 +27,7 @@ AR="ppu-ar" CC="ppu-gcc" RANLIB="ppu-ranlib" \ LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib" LIBS="-lnet -lsysutil -lsysmodule -lm " \ PKG_CONFIG_LIBDIR="$PSL1GHT/ppu/lib/pkgconfig" PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" \ + --disable-threaded-resolver --disable-ipv6 \ --includedir="$PS3DEV/portlibs/ppu/include" --libdir="$PS3DEV/portlibs/ppu/lib" --without-ssl --with-polarssl="$PS3DEV/portlibs/ppu/include/polarssl" --with-ca-bundle="/usr/ssl/certs/ca-bundle.crt" ## Compile and install. diff --git a/scripts/017-libmad-0.15.1b.sh b/scripts/017-libmad-0.15.1b.sh index 94ec1b64..2d1b4249 100755 --- a/scripts/017-libmad-0.15.1b.sh +++ b/scripts/017-libmad-0.15.1b.sh @@ -2,11 +2,11 @@ # libmad-0.15.1b.sh by dhewg (dhewg@wiibrew.org) ## Download the source code. -wget --continue http://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz +wget https://downloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf libmad-0.15.1b && tar xfvz libmad-0.15.1b.tar.gz && cd libmad-0.15.1b diff --git a/scripts/018-flac-1.2.1.sh b/scripts/018-flac-1.2.1.sh index 6a8cbddf..76d5fcbe 100755 --- a/scripts/018-flac-1.2.1.sh +++ b/scripts/018-flac-1.2.1.sh @@ -2,11 +2,11 @@ # flac-1.2.1.sh by dhewg (dhewg@wiibrew.org) ## Download the source code. -wget --continue http://downloads.sourceforge.net/project/flac/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz +wget http://downloads.sourceforge.net/project/flac/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf flac-1.2.1 && tar xfvz flac-1.2.1.tar.gz && cd flac-1.2.1 diff --git a/scripts/019-faad2-2.7.sh b/scripts/019-faad2-2.7.sh index 5e83d54b..09793b96 100755 --- a/scripts/019-faad2-2.7.sh +++ b/scripts/019-faad2-2.7.sh @@ -2,11 +2,11 @@ # faad2-2.7.sh by dhewg (dhewg@wiibrew.org) ## Download the source code. -wget --continue http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz +wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf faad2-2.7 && tar xfvz faad2-2.7.tar.gz && cd faad2-2.7 diff --git a/scripts/020-libtheora-1.1.1.sh b/scripts/020-libtheora-1.1.1.sh index bc2e660c..6a1ebab2 100755 --- a/scripts/020-libtheora-1.1.1.sh +++ b/scripts/020-libtheora-1.1.1.sh @@ -2,11 +2,11 @@ # libtheora-1.1.1.sh by dhewg (dhewg@wiibrew.org) ## Download the source code. -wget --continue http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 +wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf libtheora-1.1.1 && tar xfvj libtheora-1.1.1.tar.bz2 && cd libtheora-1.1.1 diff --git a/scripts/021-NoRSX.sh b/scripts/021-NoRSX.sh index ea0505d5..00218ff1 100755 --- a/scripts/021-NoRSX.sh +++ b/scripts/021-NoRSX.sh @@ -2,7 +2,7 @@ # libNoRSX.sh by wargio (wargio@libero.it) ## Download the source code. -wget --no-check-certificate https://github.com/wargio/NoRSX/tarball/master -O NoRSX.tar.gz +wget https://github.com/wargio/NoRSX/tarball/master -O NoRSX.tar.gz ## Unpack the source code. rm -Rf NoRSX && mkdir NoRSX && tar --strip-components=1 --directory=NoRSX -xvzf NoRSX.tar.gz && cd NoRSX diff --git a/scripts/022-libjson.sh b/scripts/022-libjson.sh index 13b74829..6adcea81 100755 --- a/scripts/022-libjson.sh +++ b/scripts/022-libjson.sh @@ -1,11 +1,11 @@ #!/bin/sh -e # libjson-c.sh by Mohammad Haseeb (mmhaqs@gmail.com) -wget --no-check-certificate https://codeload.github.com/json-c/json-c/tar.gz/json-c-0.11-20130402 -O jsonc.tar.gz +wget https://codeload.github.com/json-c/json-c/tar.gz/json-c-0.11-20130402 -O jsonc.tar.gz ## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi +if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi ## Unpack the source code. rm -Rf jsonc && mkdir jsonc && tar --strip-components=1 --directory=jsonc -xvzf jsonc.tar.gz diff --git a/scripts/026-ps3soundlib.sh b/scripts/026-ps3soundlib.sh new file mode 100755 index 00000000..09a77bd4 --- /dev/null +++ b/scripts/026-ps3soundlib.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e +# ps3soundlib.sh by CrystalCT (crystal@unict.it) +# PS3 SOUNDLIB Credits: Hermes, HACKERCHANNEL, Xiph.Org, mpg123 project and Wargio/deroad + +## Download the source code. +wget https://github.com/wargio/ps3soundlib/tarball/master -O ps3soundlib.tar.gz + +## Unpack the source code. +rm -Rf ps3soundlib && mkdir ps3soundlib && tar --strip-components=1 --directory=ps3soundlib -xvzf ps3soundlib.tar.gz && cd ps3soundlib + +## Compile and install. +${MAKE:-make} diff --git a/scripts/027-tiny3d_libfont.sh b/scripts/027-tiny3d_libfont.sh new file mode 100755 index 00000000..1163478d --- /dev/null +++ b/scripts/027-tiny3d_libfont.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e +# tini3d_libfont.sh by CrystalCT (crystal@unict.it) +# Tiny3D 2.0 + libfont Credits: +# Hermes - Author +# ElSemi - Vertex Program Compiler and other useful sample code +# HACKERCHANNEL - PSL1GHT +# Oopo - ps3libraries +# xerpi - porting the lib to v2 +# deroad/Wargio - check code +# Bucanero, CrystalCT, Miigotu, Shagkur, Wargio and Zeldin to update Tiny3D for GCC 7.2.0 + +## Download the source code. +wget https://github.com/wargio/tiny3d/tarball/master -O tiny3d.tar.gz + +## Unpack the source code. +rm -Rf tiny3d && mkdir tiny3d && tar --strip-components=1 --directory=tiny3d -xvzf tiny3d.tar.gz && cd tiny3d + +## Compile and install. +${MAKE:-make} install -C lib --no-print-directory +${MAKE:-make} install -C libfont --no-print-directory diff --git a/scripts/028-mbedTLS-2.16.6.sh b/scripts/028-mbedTLS-2.16.6.sh new file mode 100755 index 00000000..72f80fa9 --- /dev/null +++ b/scripts/028-mbedTLS-2.16.6.sh @@ -0,0 +1,105 @@ +#!/bin/sh -e + +# Update by Damian Parrino (2020-07-29) +# Automatic build script for mbedTLS +# for PSL1GHT, PlayStation 3 open source SDK. +# +# Originally Created by Felix Schulze on 08.04.11. +# Ported to PS3Libraries to compile with psl1ght. +# Copyright 2010 Felix Schulze. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +########################################################################### +# Change values here +# +VERSION="2.16.6" +# +########################################################################### +# +# Don't change anything here + +CURRENTPATH=`pwd` +ARCH="powerpc64" +PLATFORM="PS3" + +## Download the source code. +wget -O mbedtls-${VERSION}.gpl.tgz http://downloads.arednmesh.org/sources/mbedtls-${VERSION}-gpl.tgz + +## Unpack the source code. +rm -Rf mbedtls-${VERSION} && tar xfvz mbedtls-${VERSION}.gpl.tgz && cd mbedtls-${VERSION} + +echo "Building mbedTLS ${VERSION} for ${PLATFORM} ${ARCH}" + +echo "Patching Makefile..." +sed -i.bak '4d' ${CURRENTPATH}/mbedtls-${VERSION}/library/Makefile + +echo "Please stand by..." + +TOOLCHAIN_PATH=$PS3DEV/ppu/bin/powerpc64-ps3-elf- +export CC=${TOOLCHAIN_PATH}gcc +export LD=${TOOLCHAIN_PATH}ld +export CPP=${TOOLCHAIN_PATH}cpp +export CXX=${TOOLCHAIN_PATH}g++ +export AR=${TOOLCHAIN_PATH}ar +export AS=${TOOLCHAIN_PATH}as +export NM=${TOOLCHAIN_PATH}nm +export CXXCPP=${TOOLCHAIN_PATH}cpp +export RANLIB=${TOOLCHAIN_PATH}ranlib +export LDFLAGS="-L$PS3DEV/ppu/powerpc64-ps3-elf/lib -L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" +export CFLAGS="-I${CURRENTPATH}/mbedtls-${VERSION}/include -I$PS3DEV/ppu/powerpc64-ps3-elf/include -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include -mcpu=cell" +export MBEDTLS_NO_PLATFORM_ENTROPY=1 + +## Create config.h file +cd library +sed -i.bak '94d' ../configs/config-no-entropy.h +sed -i.bak '92d' ../configs/config-no-entropy.h +cp ../configs/config-no-entropy.h ../include/mbedtls/config.h +echo "#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED +#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED +#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED +#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED +#define MBEDTLS_SSL_PROTO_DTLS +#define MBEDTLS_SSL_PROTO_SSL3 +#define MBEDTLS_SSL_PROTO_TLS1 +#define MBEDTLS_SSL_PROTO_TLS1_1 +#define MBEDTLS_SSL_PROTO_TLS1_2 +#define MBEDTLS_SHA1_C +#define MBEDTLS_MD5_C +#define MBEDTLS_DHM_C +#define MBEDTLS_ECDH_C +#define MBEDTLS_ECJPAKE_C +#define MBEDTLS_SSL_CLI_C +#define MBEDTLS_SSL_SRV_C +#define MBEDTLS_SSL_TLS_C + +#include \"check_config.h\" + +#endif /* MBEDTLS_CONFIG_H */" >> ../include/mbedtls/config.h + +echo "Build library..." +## Compile and install. +${MAKE:-make} + +cp lib*.a $PS3DEV/portlibs/ppu/lib/ +cp -R ../include/mbedtls $PS3DEV/portlibs/ppu/include/ +cp ../LICENSE $PS3DEV/portlibs/ppu/include/mbedtls/LICENSE + +echo "Building done." diff --git a/scripts/029-libunrar.sh b/scripts/029-libunrar.sh new file mode 100755 index 00000000..f2371126 --- /dev/null +++ b/scripts/029-libunrar.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e +# +# unRAR library ported to PS3 by Bucanero + +## Download the source code. +wget https://github.com/bucanero/libunrar-ps3/tarball/master -O libunrar.tar.gz + +## Unpack the source code. +rm -Rf libunrar && mkdir libunrar && tar --strip-components=1 --directory=libunrar -xvzf libunrar.tar.gz && cd libunrar + +## Compile and install. +${MAKE:-make} install diff --git a/scripts/030-libnfs.sh b/scripts/030-libnfs.sh new file mode 100755 index 00000000..f8bddc1d --- /dev/null +++ b/scripts/030-libnfs.sh @@ -0,0 +1,16 @@ +#!/bin/sh -e +# +# libnfs by sahlberg +# ported to PS3 by Bucanero + +## Download the source code. +owner=sahlberg +repo=libnfs +tag_latest=`wget -qO- "https://api.github.com/repos/${owner}/${repo}/tags" | grep -o '"name": "[^"]*' | cut -d'"' -f4 | head -n1` +wget https://github.com/${owner}/${repo}/archive/refs/tags/${tag_latest}.tar.gz -O libnfs.tar.gz + +## Unpack the source code. +rm -Rf libnfs && mkdir libnfs && tar --strip-components=1 --directory=libnfs -xvzf libnfs.tar.gz && cd libnfs + +## Compile and install. +${MAKE:-make} -f ps3_ppu/Makefile.PS3_PPU install \ No newline at end of file diff --git a/scripts/031-libsmb2.sh b/scripts/031-libsmb2.sh new file mode 100755 index 00000000..376fab66 --- /dev/null +++ b/scripts/031-libsmb2.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e +# +# libsmb2 by sahlberg +# ported to PS3 by Bucanero + +## Download the source code. +wget https://github.com/sahlberg/libsmb2/tarball/master -O libsmb2.tar.gz + +## Unpack the source code. +rm -Rf libsmb2 && mkdir libsmb2 && tar --strip-components=1 --directory=libsmb2 -xvzf libsmb2.tar.gz && cd libsmb2/lib + +## Compile and install. +${MAKE:-make} -f Makefile.PS3_PPU install diff --git a/scripts/032-libun7zip.sh b/scripts/032-libun7zip.sh new file mode 100755 index 00000000..a9602fd9 --- /dev/null +++ b/scripts/032-libun7zip.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e +# +# un7Zip library by Bucanero + +## Download the source code. +wget https://github.com/bucanero/libun7zip/tarball/master -O libun7zip.tar.gz + +## Unpack the source code. +rm -Rf libun7zip && mkdir libun7zip && tar --strip-components=1 --directory=libun7zip -xvzf libun7zip.tar.gz && cd libun7zip + +## Compile and install. +${MAKE:-make} install diff --git a/scripts/033-libtinytar.sh b/scripts/033-libtinytar.sh new file mode 100755 index 00000000..5d6a9b88 --- /dev/null +++ b/scripts/033-libtinytar.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e +# +# tar/tar.gz/tar.bz2 library by Bucanero + +## Download the source code. +wget https://github.com/bucanero/libtinytar/tarball/master -O libtinytar.tar.gz + +## Unpack the source code. +rm -Rf libtinytar && mkdir libtinytar && tar --strip-components=1 --directory=libtinytar -xvzf libtinytar.tar.gz && cd libtinytar + +## Compile and install. +${MAKE:-make} install diff --git a/scripts/034-libya2d.sh b/scripts/034-libya2d.sh new file mode 100755 index 00000000..8ea7d5b8 --- /dev/null +++ b/scripts/034-libya2d.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e +# ya2d_ps3 by xerpi +# fork by Bucanero + +## Download the source code. +wget https://github.com/bucanero/ya2d_ps3/tarball/master -O ya2d.tar.gz + +## Unpack the source code. +rm -Rf ya2d && mkdir ya2d && tar --strip-components=1 --directory=ya2d -xvzf ya2d.tar.gz && cd ya2d/libya2d + +## Compile and install. +${MAKE:-make} install diff --git a/scripts/035-bzip2.sh b/scripts/035-bzip2.sh new file mode 100755 index 00000000..acadca11 --- /dev/null +++ b/scripts/035-bzip2.sh @@ -0,0 +1,11 @@ +#!/bin/sh -e +# bzip2 by cadcdev + +## Download the source code. +wget https://github.com/bucanero/psl1ght-libs/tarball/master -O psl1ght-libs.tar.gz + +## Unpack the source code. +rm -Rf psl1ght-libs && mkdir psl1ght-libs && tar --strip-components=1 --directory=psl1ght-libs -xvzf psl1ght-libs.tar.gz && cd psl1ght-libs + +## Compile and install. +${MAKE:-make} --directory=bzip2 install diff --git a/scripts/036-dbglogger.sh b/scripts/036-dbglogger.sh new file mode 100755 index 00000000..cd19a98d --- /dev/null +++ b/scripts/036-dbglogger.sh @@ -0,0 +1,11 @@ +#!/bin/sh -e +# dbglogger by Bucanero + +## Download the source code. +wget https://github.com/bucanero/dbglogger/tarball/master -O dbglogger.tar.gz + +## Unpack the source code. +rm -Rf dbglogger && mkdir dbglogger && tar --strip-components=1 --directory=dbglogger -xvzf dbglogger.tar.gz && cd dbglogger + +## Compile and install. +${MAKE:-make} install diff --git a/scripts/037-mini18n.sh b/scripts/037-mini18n.sh new file mode 100755 index 00000000..185d09a2 --- /dev/null +++ b/scripts/037-mini18n.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e +# mini18n by Yabause team +# ported to PS3 by Bucanero + +## Download the source code. +wget https://github.com/bucanero/mini18n/tarball/master -O mini18n.tar.gz + +## Unpack the source code. +rm -Rf mini18n && mkdir mini18n && tar --strip-components=1 --directory=mini18n -xvzf mini18n.tar.gz && cd mini18n + +## Compile and install. +${MAKE:-make} install diff --git a/scripts/038-libansilove.sh b/scripts/038-libansilove.sh new file mode 100755 index 00000000..898a5d39 --- /dev/null +++ b/scripts/038-libansilove.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e +# libansilove by Stefan Vogt, Brian Cassidy, and Frederic Cambus +# ported to PS3 by Bucanero + +## Download the source code. +wget https://github.com/bucanero/libansilove/tarball/master -O libansilove.tar.gz + +## Unpack the source code. +rm -Rf libansilove && mkdir libansilove && tar --strip-components=1 --directory=libansilove -xvzf libansilove.tar.gz && cd libansilove + +## Compile and install. +${MAKE:-make} install diff --git a/scripts/039-pthreads-emb.sh b/scripts/039-pthreads-emb.sh new file mode 100755 index 00000000..14278d60 --- /dev/null +++ b/scripts/039-pthreads-emb.sh @@ -0,0 +1,14 @@ +#!/bin/sh -e +# pthreads-emb.sh by Humberto Dias + +## Download the source code. +wget https://github.com/humbertodias/pthread-emb-ps3/tarball/master -O pthreads-emb.tar.gz + +## Unpack the source code. +rm -Rf pthreads-emb && mkdir pthreads-emb && tar --strip-components=1 --directory=pthreads-emb -xvzf pthreads-emb.tar.gz + +## Create the build directory. +cd pthreads-emb/src/platform/psl1ght + +## Compile and install. +${MAKE:-make} && ${MAKE:-make} install diff --git a/scripts/040-sdl2_psl1ght.sh b/scripts/040-sdl2_psl1ght.sh new file mode 100755 index 00000000..2118736e --- /dev/null +++ b/scripts/040-sdl2_psl1ght.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e +# sdl2_psl1ght.sh by Humberto Dias + +## Download the source code. +# SDL2 +wget https://github.com/humbertodias/SDL2_PSL1GHT/tarball/master -O sdl2_psl1ght.tar.gz + +## Unpack the source code. +rm -Rf sdl2_psl1ght && mkdir sdl2_psl1ght && tar --strip-components=1 --directory=sdl2_psl1ght -xvzf sdl2_psl1ght.tar.gz + +## Create the build directory. +cd sdl2_psl1ght + +## Compile and install. +./script.sh && ${MAKE:-make} && ${MAKE:-make} install From 8300b6ae2b43b0e220505ba17b47f7f713dcbed6 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sat, 2 Mar 2024 13:25:05 -0300 Subject: [PATCH 02/36] add github action for testing --- .github/workflows/test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..c0a8c721 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,14 @@ +name: Run Tests + +on: [push, pull_request, workflow_dispatch] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Run Tests + run: make test \ No newline at end of file From 14e68f986dd340e7e8832ca995fc5bbde6e175cc Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sun, 3 Mar 2024 09:43:54 -0300 Subject: [PATCH 03/36] readme markdown --- readme.txt | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 readme.txt diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 48f679ed..00000000 --- a/readme.txt +++ /dev/null @@ -1,19 +0,0 @@ - - ==================== - What does this do? - ==================== - - This program will automatically build and install libraries used in the creation - of homebrew software for the Sony Playstation 3 videogame system. - - ================== - How do I use it? - ================== - - 1) Set up your environment by installing the following software: - - autoconf, automake, libtool, make, pkg-config, ps3toolchain, psl1ght, wget - - 2) Run the library script: - - ./libraries.sh From b02d5ca82f8497ca02379ea6e8122d8e5688322f Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sun, 3 Mar 2024 09:45:44 -0300 Subject: [PATCH 04/36] badge ci/cd --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index a34d73a7..777101b6 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,4 @@ +[![Run Tests](https://github.com/humbertodias/ps3libraries/actions/workflows/test.yml/badge.svg)](https://github.com/humbertodias/ps3libraries/actions/workflows/test.yml) ### What does this do? From 470a06e0a2cfa831d86eb3f91918c521ee317621 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sun, 3 Mar 2024 09:51:25 -0300 Subject: [PATCH 05/36] define workdir --- makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index c1b30b5a..ab3318f6 100644 --- a/makefile +++ b/makefile @@ -1,10 +1,10 @@ IMAGE=hldtux/ps3dev test: - DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run -i --rm -v "`pwd`:/src" ${IMAGE} ./libraries.sh + DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run -i --rm -v "`pwd`:/src" -w /src ${IMAGE} ./libraries.sh run: - DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run -it --rm -v "`pwd`:/src" ${IMAGE} bash + DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run -it --rm -v "`pwd`:/src" -w /src ${IMAGE} bash clean: rm -rf build \ No newline at end of file From f04f5b048c4f1ac55efa20d1040026631aaa7c60 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sun, 3 Mar 2024 10:11:00 -0300 Subject: [PATCH 06/36] add sdl2_psl1ght_libs --- scripts/041-sdl2_psl1ght_libs.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/041-sdl2_psl1ght_libs.sh diff --git a/scripts/041-sdl2_psl1ght_libs.sh b/scripts/041-sdl2_psl1ght_libs.sh new file mode 100755 index 00000000..6f23253c --- /dev/null +++ b/scripts/041-sdl2_psl1ght_libs.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e +# sdl2_psl1ght_libs.sh by Humberto Dias + +## Download the source code. +# SDL2 +wget https://github.com/humbertodias/SDL2_PSL1GHT_Libs/tarball/master -O sdl2_psl1ght_libs.tar.gz + +## Unpack the source code. +rm -Rf sdl2_psl1ght_libs && mkdir sdl2_psl1ght_libs && tar --strip-components=1 --directory=sdl2_psl1ght_libs -xvzf sdl2_psl1ght_libs.tar.gz + +## Create the build directory. +cd sdl2_psl1ght_libs + +## Compile and install. +./make_SDL_Libs.sh From e9d3cc0491617ddbe0cb0b2a8f96f7c0b8aed314 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sun, 3 Mar 2024 11:32:26 -0300 Subject: [PATCH 07/36] Update 040-sdl2_psl1ght.sh --- scripts/040-sdl2_psl1ght.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/040-sdl2_psl1ght.sh b/scripts/040-sdl2_psl1ght.sh index 2118736e..004ad43e 100755 --- a/scripts/040-sdl2_psl1ght.sh +++ b/scripts/040-sdl2_psl1ght.sh @@ -13,3 +13,6 @@ cd sdl2_psl1ght ## Compile and install. ./script.sh && ${MAKE:-make} && ${MAKE:-make} install + +# Copy sdl2-config to PATH +cp sdl2-config $PS3DEV/portlibs/ppu/bin From 08dd324363f6907d7001021fa5fd8e8ed19f37cb Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sun, 3 Mar 2024 15:27:26 -0300 Subject: [PATCH 08/36] libxml2-2.9.12.sh --- scripts/{012-libxml2-2.8.0.sh => 012-libxml2-2.9.12.sh} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename scripts/{012-libxml2-2.8.0.sh => 012-libxml2-2.9.12.sh} (89%) diff --git a/scripts/012-libxml2-2.8.0.sh b/scripts/012-libxml2-2.9.12.sh similarity index 89% rename from scripts/012-libxml2-2.8.0.sh rename to scripts/012-libxml2-2.9.12.sh index ea85fe9d..ffc90c26 100755 --- a/scripts/012-libxml2-2.8.0.sh +++ b/scripts/012-libxml2-2.9.12.sh @@ -1,8 +1,8 @@ #!/bin/sh -e -# libxml2-2.8.0.sh by Naomi Peori (naomi@peori.ca) +# libxml2-2.9.12.sh by Naomi Peori (naomi@peori.ca) ## Download the source code. -wget http://xmlsoft.org/download/libxml2-2.8.0.tar.gz -O libxml2.tar.gz +wget http://xmlsoft.org/download/libxml2-2.9.12.tar.gz -O libxml2.tar.gz ## Download an up-to-date config.guess and config.sub if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi From aa5788ba86e6efa130136014e357594bffc3ea62 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sun, 3 Mar 2024 15:32:05 -0300 Subject: [PATCH 09/36] ignore .DS_Store --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 378eac25..751831ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +.DS_Store \ No newline at end of file From 58231308646700f967e14f8ce0d594b9354d0a6d Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Mon, 4 Mar 2024 00:03:58 -0300 Subject: [PATCH 10/36] add yaml-cpp-0.8.0 --- scripts/042-yaml-cpp-0.8.0.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/042-yaml-cpp-0.8.0.sh diff --git a/scripts/042-yaml-cpp-0.8.0.sh b/scripts/042-yaml-cpp-0.8.0.sh new file mode 100755 index 00000000..1c38b53f --- /dev/null +++ b/scripts/042-yaml-cpp-0.8.0.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e +# yaml-cpp-0.8.0.sh by Humberto Dias + +## Download the source code. +wget https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz -O yaml-cpp.tar.gz + +## Unpack the source code. +rm -Rf yaml-cpp && mkdir yaml-cpp && tar --strip-components=1 --directory=yaml-cpp -xvzf yaml-cpp.tar.gz + +## Create the build directory. +cd yaml-cpp + +## Compile and install. +mkdir -p build && cd build +cmake -Wno-dev \ + -DCMAKE_INSTALL_PREFIX=${PS3DEV}/portlibs/ppu \ + -DCMAKE_C_COMPILER=ppu-gcc \ + -DCMAKE_CXX_COMPILER=ppu-g++ \ + -DBUILD_SHARED_LIBS=OFF -DYAML_ENABLE_PIC=OFF -DYAML_CPP_INSTALL=ON .. || { exit 1; } +make && make install || { exit 1; } \ No newline at end of file From dd2355cf2d6d0c8d3c24af6a58adf68426d57337 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Mon, 4 Mar 2024 01:08:05 -0300 Subject: [PATCH 11/36] exit 1 when fail pthreads-emb --- scripts/039-pthreads-emb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/039-pthreads-emb.sh b/scripts/039-pthreads-emb.sh index 14278d60..24e63d28 100755 --- a/scripts/039-pthreads-emb.sh +++ b/scripts/039-pthreads-emb.sh @@ -11,4 +11,4 @@ rm -Rf pthreads-emb && mkdir pthreads-emb && tar --strip-components=1 --director cd pthreads-emb/src/platform/psl1ght ## Compile and install. -${MAKE:-make} && ${MAKE:-make} install +${MAKE:-make} && ${MAKE:-make} install || { exit 1; } From 147275d74cd32ec6e2ff25cfbd891d7ae8e2be88 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Mon, 4 Mar 2024 01:54:16 -0300 Subject: [PATCH 12/36] rename singular --- scripts/{039-pthreads-emb.sh => 039-pthread-emb.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{039-pthreads-emb.sh => 039-pthread-emb.sh} (100%) diff --git a/scripts/039-pthreads-emb.sh b/scripts/039-pthread-emb.sh similarity index 100% rename from scripts/039-pthreads-emb.sh rename to scripts/039-pthread-emb.sh From 7e67cb04d129b9cab5279191b619fbd5e86b1e68 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Mon, 11 Mar 2024 01:05:20 -0300 Subject: [PATCH 13/36] libxml2 --without-lzma --- scripts/012-libxml2-2.9.12.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/012-libxml2-2.9.12.sh b/scripts/012-libxml2-2.9.12.sh index ffc90c26..d8f24b52 100755 --- a/scripts/012-libxml2-2.9.12.sh +++ b/scripts/012-libxml2-2.9.12.sh @@ -24,7 +24,7 @@ mkdir build-ppu && cd build-ppu CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ -../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --enable-static --disable-shared --without-ftp --without-http --without-python +../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --enable-static --disable-shared --without-ftp --without-http --without-python --without-lzma ## Compile and install. ${MAKE:-make} -j4 && ${MAKE:-make} install From c930464725e4a7bcfef05dbe06389f4a3afc5f2d Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Tue, 12 Mar 2024 02:31:06 -0300 Subject: [PATCH 14/36] psl1ght-2.30.1 --- scripts/040-sdl2_psl1ght.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/040-sdl2_psl1ght.sh b/scripts/040-sdl2_psl1ght.sh index 004ad43e..1bb7b781 100755 --- a/scripts/040-sdl2_psl1ght.sh +++ b/scripts/040-sdl2_psl1ght.sh @@ -3,7 +3,9 @@ ## Download the source code. # SDL2 -wget https://github.com/humbertodias/SDL2_PSL1GHT/tarball/master -O sdl2_psl1ght.tar.gz +#wget https://github.com/humbertodias/SDL2_PSL1GHT/tarball/master -O sdl2_psl1ght.tar.gz +#wget https://github.com/humbertodias/psl1ght-2.0.3/tarball/psl1ght-2.0.3 -O sdl2_psl1ght.tar.gz +wget https://github.com/humbertodias/sdl2_psl1ght_/tarball/psl1ght-2.30.1 -O sdl2_psl1ght.tar.gz ## Unpack the source code. rm -Rf sdl2_psl1ght && mkdir sdl2_psl1ght && tar --strip-components=1 --directory=sdl2_psl1ght -xvzf sdl2_psl1ght.tar.gz From cc675f86232ae65605e97381afa8a6ca3095ed46 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Thu, 14 Mar 2024 15:17:18 -0300 Subject: [PATCH 15/36] Update check-wget.sh --- depends/check-wget.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/check-wget.sh b/depends/check-wget.sh index 6ef701a4..231e3a04 100755 --- a/depends/check-wget.sh +++ b/depends/check-wget.sh @@ -23,4 +23,4 @@ no_clobber = on continue = on # quiet (default is no) quiet = on -" > /etc/wgetrc +" > ~/.wgetrc From 9b6253484ea76cdd8f8cb88f0c986152921e93be Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Thu, 14 Mar 2024 19:32:32 -0300 Subject: [PATCH 16/36] Update 041-sdl2_psl1ght_libs.sh --- scripts/041-sdl2_psl1ght_libs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/041-sdl2_psl1ght_libs.sh b/scripts/041-sdl2_psl1ght_libs.sh index 6f23253c..b57c1915 100755 --- a/scripts/041-sdl2_psl1ght_libs.sh +++ b/scripts/041-sdl2_psl1ght_libs.sh @@ -3,7 +3,7 @@ ## Download the source code. # SDL2 -wget https://github.com/humbertodias/SDL2_PSL1GHT_Libs/tarball/master -O sdl2_psl1ght_libs.tar.gz +wget https://github.com/humbertodias/SDL2_PSL1GHT_Libs/tarball/psl1ght-2.0.3 -O sdl2_psl1ght_libs.tar.gz ## Unpack the source code. rm -Rf sdl2_psl1ght_libs && mkdir sdl2_psl1ght_libs && tar --strip-components=1 --directory=sdl2_psl1ght_libs -xvzf sdl2_psl1ght_libs.tar.gz From f924107630ed7617487807cc918f979d134041de Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Thu, 14 Mar 2024 19:35:03 -0300 Subject: [PATCH 17/36] Update 041-sdl2_psl1ght_libs.sh --- scripts/041-sdl2_psl1ght_libs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/041-sdl2_psl1ght_libs.sh b/scripts/041-sdl2_psl1ght_libs.sh index b57c1915..34f5b493 100755 --- a/scripts/041-sdl2_psl1ght_libs.sh +++ b/scripts/041-sdl2_psl1ght_libs.sh @@ -3,7 +3,7 @@ ## Download the source code. # SDL2 -wget https://github.com/humbertodias/SDL2_PSL1GHT_Libs/tarball/psl1ght-2.0.3 -O sdl2_psl1ght_libs.tar.gz +wget https://github.com/humbertodias/SDL2_PSL1GHT_Libs/tarball/psl1ght-2.30.1 -O sdl2_psl1ght_libs.tar.gz ## Unpack the source code. rm -Rf sdl2_psl1ght_libs && mkdir sdl2_psl1ght_libs && tar --strip-components=1 --directory=sdl2_psl1ght_libs -xvzf sdl2_psl1ght_libs.tar.gz From 5871f58034fe16438741812302c9d2cfa1be8ca2 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sat, 6 Apr 2024 15:29:40 -0300 Subject: [PATCH 18/36] check-cmake --- depends/check-cmake.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 depends/check-cmake.sh diff --git a/depends/check-cmake.sh b/depends/check-cmake.sh new file mode 100755 index 00000000..5c6a7c7c --- /dev/null +++ b/depends/check-cmake.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +## Check for cmake. +which cmake 1> /dev/null || { echo "ERROR: Install cmake before continuing."; exit 1; } From bc86d439f6afe8e808777ff4ca9b5485fc8b9489 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sat, 5 Sep 2026 17:27:20 -0300 Subject: [PATCH 19/36] merge master into psl1ght-2.30.1 --- .gitattributes | 2 + .github/workflows/build.yml | 261 ++ .gitignore | 6 +- archives/archives.txt | 41 + config/config.guess | 1823 +++++++++++++ config/config.sub | 2364 +++++++++++++++++ config/get-config-scripts.sh | 51 + depends/check-libtool.sh | 9 +- download.sh | 149 ++ patches/mbedtls-2.28.10.patch | 237 ++ patches/zlib-1.2.11-PPU.patch | 38 - patches/zlib-1.2.13-PPU.patch | 10 + readme.md | 31 +- scripts/001-zlib-1.2.11.sh | 18 - scripts/001-zlib-1.2.13.sh | 29 + scripts/002-libpng-1.4.4.sh | 25 +- scripts/003-jpeg-8b.sh | 27 +- scripts/004-freetype-2.4.3.sh | 25 +- scripts/005-pixman-0.20.0.sh | 25 +- scripts/006-cairo-1.10.0.sh | 27 +- scripts/007-libogg-1.2.1.sh | 27 - scripts/007-libogg-1.3.4.sh | 36 + scripts/008-libvorbis-1.3.2.sh | 27 - scripts/008-libvorbis-1.3.5.sh | 36 + scripts/009-libzip-0.9.3.sh | 25 +- scripts/010-tiff-3.9.4.sh | 27 +- scripts/011-libmikmod-3.1.11.sh | 21 +- scripts/012-libxml2-2.9.12.sh | 30 +- scripts/013-sdl_psl1ght.sh | 20 +- scripts/014-sdl2_psl1ght.sh | 21 + scripts/014-sdl_psl1ght_libs.sh | 15 - scripts/015-sdl_psl1ght_libs.sh | 26 + scripts/016-SDL2_mixer-2.0.4.sh | 45 + ...olarssl-1.3.9.sh => 017-polarssl-1.3.9.sh} | 22 +- ...edTLS-2.16.6.sh => 018-mbedTLS-2.28.10.sh} | 59 +- ...ibmad-0.15.1b.sh => 019-libmad-0.15.1b.sh} | 24 +- .../{018-flac-1.2.1.sh => 020-flac-1.2.1.sh} | 24 +- scripts/021-NoRSX.sh | 11 - .../{019-faad2-2.7.sh => 021-faad2-2.7.sh} | 24 +- ...theora-1.1.1.sh => 022-libtheora-1.1.1.sh} | 24 +- scripts/023-NoRSX.sh | 20 + scripts/{022-libjson.sh => 024-libjson.sh} | 26 +- scripts/025-debugnet.sh | 20 + scripts/026-ps3soundlib.sh | 15 +- scripts/027-tiny3d_libfont.sh | 18 +- ...ibcurl-7.64.1.sh => 028-libcurl-7.64.1.sh} | 30 +- scripts/029-libunrar.sh | 18 +- scripts/030-libnfs.sh | 21 +- scripts/031-libsmb2.sh | 19 +- scripts/032-libun7zip.sh | 12 - scripts/032-pthread-emb.sh | 20 + scripts/033-libtinytar.sh | 12 - scripts/033-libun7zip.sh | 20 + scripts/034-libtinytar.sh | 20 + scripts/034-libya2d.sh | 12 - scripts/035-bzip2.sh | 11 - scripts/035-libya2d.sh | 21 + scripts/036-dbglogger.sh | 17 +- scripts/037-mini18n.sh | 17 +- scripts/038-libansilove.sh | 17 +- scripts/039-pthread-emb.sh | 14 - scripts/039-yaml-cpp.sh | 37 + scripts/040-mbedTLS.sh | 78 + scripts/040-sdl2_psl1ght.sh | 20 - scripts/041-sdl2_psl1ght_libs.sh | 15 - scripts/042-yaml-cpp-0.8.0.sh | 20 - utils/gen-github-actions-tasks.sh | 23 + utils/utils.sh | 34 + 68 files changed, 5853 insertions(+), 496 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/build.yml create mode 100644 archives/archives.txt create mode 100644 config/config.guess create mode 100644 config/config.sub create mode 100755 config/get-config-scripts.sh create mode 100755 download.sh create mode 100644 patches/mbedtls-2.28.10.patch delete mode 100644 patches/zlib-1.2.11-PPU.patch create mode 100644 patches/zlib-1.2.13-PPU.patch delete mode 100755 scripts/001-zlib-1.2.11.sh create mode 100755 scripts/001-zlib-1.2.13.sh delete mode 100755 scripts/007-libogg-1.2.1.sh create mode 100755 scripts/007-libogg-1.3.4.sh delete mode 100755 scripts/008-libvorbis-1.3.2.sh create mode 100755 scripts/008-libvorbis-1.3.5.sh create mode 100755 scripts/014-sdl2_psl1ght.sh delete mode 100755 scripts/014-sdl_psl1ght_libs.sh create mode 100755 scripts/015-sdl_psl1ght_libs.sh create mode 100755 scripts/016-SDL2_mixer-2.0.4.sh rename scripts/{015-polarssl-1.3.9.sh => 017-polarssl-1.3.9.sh} (81%) rename scripts/{028-mbedTLS-2.16.6.sh => 018-mbedTLS-2.28.10.sh} (54%) rename scripts/{017-libmad-0.15.1b.sh => 019-libmad-0.15.1b.sh} (50%) rename scripts/{018-flac-1.2.1.sh => 020-flac-1.2.1.sh} (53%) delete mode 100755 scripts/021-NoRSX.sh rename scripts/{019-faad2-2.7.sh => 021-faad2-2.7.sh} (51%) rename scripts/{020-libtheora-1.1.1.sh => 022-libtheora-1.1.1.sh} (50%) create mode 100755 scripts/023-NoRSX.sh rename scripts/{022-libjson.sh => 024-libjson.sh} (52%) create mode 100755 scripts/025-debugnet.sh rename scripts/{016-libcurl-7.64.1.sh => 028-libcurl-7.64.1.sh} (50%) delete mode 100755 scripts/032-libun7zip.sh create mode 100755 scripts/032-pthread-emb.sh delete mode 100755 scripts/033-libtinytar.sh create mode 100755 scripts/033-libun7zip.sh create mode 100755 scripts/034-libtinytar.sh delete mode 100755 scripts/034-libya2d.sh delete mode 100755 scripts/035-bzip2.sh create mode 100755 scripts/035-libya2d.sh delete mode 100755 scripts/039-pthread-emb.sh create mode 100755 scripts/039-yaml-cpp.sh create mode 100755 scripts/040-mbedTLS.sh delete mode 100755 scripts/040-sdl2_psl1ght.sh delete mode 100755 scripts/041-sdl2_psl1ght_libs.sh delete mode 100755 scripts/042-yaml-cpp-0.8.0.sh create mode 100755 utils/gen-github-actions-tasks.sh create mode 100755 utils/utils.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..65824f72 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.sh text eol=lf linguist-language=Shell +*.txt eol=lf \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a8070f9f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,261 @@ +name: Build libraries package + +on: [ push, pull_request, workflow_dispatch ] + +jobs: + build: + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - runner: ubuntu-latest + os: linux + + - runner: macos-26-intel + os: macos + + - runner: macos-26 + os: macos + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set env vars + id: slug + run: | + echo "sha_name=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV + echo "NO_SAVANNAH=1" >> $GITHUB_ENV + + - name: Install Linux requirements + if: matrix.os == 'linux' + run: | + sudo apt-get -y install gcc libelf-dev autoconf automake bison flex make cmake texinfo patch wget zlib1g-dev libtool-bin bzip2 pkg-config libssl-dev + + - name: Install MacOS requirements + if: matrix.os == 'macos' + shell: bash + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + HOMEBREW_NO_ENV_HINTS: 1 + run: | + eval "$(brew shellenv)" + brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo cmake + + - name: Create build folder + run: | + mkdir build + + - name: Cache downloaded archives + uses: actions/cache@v5 + with: + path: archives + key: archives-${{ hashFiles('archives/archives.txt') }} + + - name: Purge unverifiable archives + run: | + while IFS= read -r line; do + set -- $line + [ "${1:-}" = "-" ] || continue + # 3rd field is URL, 5th field (if "->") is rename + url="$3" + rename="" + [ "${4:-}" = "->" ] && rename="${5:-}" + file="${rename:-$(basename "$url")}" + rm -f "archives/$file" + done < archives/archives.txt + + - name: Download PS3DEV Toolchain + env: + GH_TOKEN: ${{ github.token }} + run: | + TOOLCHAIN_URL=$(gh api repos/ps3dev/ps3toolchain/releases \ + --jq ' + map(select(.prerelease and (.draft | not))) + | sort_by(.published_at) + | reverse + | .[0].assets[] + | select(.name == "ps3dev-${{ matrix.os }}-${{ runner.arch }}.tar.gz") + | .browser_download_url + ') + + curl -sL "$TOOLCHAIN_URL" | tar xvz -C ./ + echo "PS3DEV=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV + echo "PSL1GHT=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV + echo "PATH=$PATH:$PWD/ps3dev/bin:$PWD/ps3dev/ppu/bin:$PWD/ps3dev/spu/bin" >> $GITHUB_ENV + + - name: Download files + working-directory: ./build + run: ../download.sh + + - name: Build PSL1GHT + run: | + git clone https://github.com/ps3dev/PSL1GHT.git + cd PSL1GHT + JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu) + make -j"$JOBS" install-ctrl + make -j"$JOBS" + make -j"$JOBS" install + + - name: Build Zlib 1.2.13 + run: ./libraries.sh 001 + + - name: Build Libpng 1.4.4 + run: ./libraries.sh 002 + + - name: Build Jpeg 8b + run: ./libraries.sh 003 + + - name: Build Freetype 2.4.3 + run: ./libraries.sh 004 + + - name: Build Pixman 0.20.0 + run: ./libraries.sh 005 + + - name: Build Cairo 1.10.0 + run: ./libraries.sh 006 + + - name: Build Libogg 1.3.4 + run: ./libraries.sh 007 + + - name: Build Libvorbis 1.3.5 + run: ./libraries.sh 008 + + - name: Build Libzip 0.9.3 + run: ./libraries.sh 009 + + - name: Build Tiff 3.9.4 + run: ./libraries.sh 010 + + - name: Build Libmikmod 3.1.11 + run: ./libraries.sh 011 + + - name: Build Libxml2 2.9.12 + run: ./libraries.sh 012 + + - name: Build Sdl_psl1ght + run: ./libraries.sh 013 + + - name: Build Sdl2_psl1ght + run: ./libraries.sh 014 + + - name: Build Sdl_psl1ght_libs + run: ./libraries.sh 015 + + - name: Build SDL2_mixer 2.0.4 + run: ./libraries.sh 016 + + - name: Build Polarssl 1.3.9 + run: ./libraries.sh 017 + + - name: Build MbedTLS 2.28.10 + run: ./libraries.sh 018 + + - name: Build Libmad 0.15.1b + run: ./libraries.sh 019 + + - name: Build Flac 1.2.1 + run: ./libraries.sh 020 + + - name: Build Faad2 2.7 + run: ./libraries.sh 021 + + - name: Build Libtheora 1.1.1 + run: ./libraries.sh 022 + + - name: Build NoRSX + run: ./libraries.sh 023 + + - name: Build Libjson + run: ./libraries.sh 024 + + - name: Build Debugnet + run: ./libraries.sh 025 + + - name: Build Ps3soundlib + run: ./libraries.sh 026 + + - name: Build Tiny3d_libfont + run: ./libraries.sh 027 + + - name: Build Libcurl 7.64.1 + run: ./libraries.sh 028 + + - name: Build Libunrar + run: ./libraries.sh 029 + + - name: Build Libnfs + run: ./libraries.sh 030 + + - name: Build Libsmb2 + run: ./libraries.sh 031 + + - name: Build Pthread-emb + run: ./libraries.sh 032 + + - name: Build Libun7zip + run: ./libraries.sh 033 + + - name: Build Libtinytar + run: ./libraries.sh 034 + + - name: Build Libya2d + run: ./libraries.sh 035 + + - name: Build Bzip2 + run: ./libraries.sh 036 + + - name: Build Dbglogger + run: ./libraries.sh 037 + + - name: Build Mini18n + run: ./libraries.sh 038 + + - name: Build Libansilove + run: ./libraries.sh 039 + + - name: Build Yaml-cpp 0.9.0 + run: ./libraries.sh 040 + + - name: Build MbedTLS 2.16.6 + run: ./libraries.sh 041 + + - name: Build Package + run: | + cd $PSL1GHT + tar -zcvf ../ps3libraries-${{ matrix.os }}-${{ runner.arch }}.tar.gz portlibs/ + + - name: Push package artifact + uses: actions/upload-artifact@v7 + with: + name: ps3libraries-${{ env.sha_name }}-${{ matrix.os }}-${{ runner.arch }} + path: ps3libraries-${{ matrix.os }}-${{ runner.arch }}.tar.gz + if-no-files-found: error + + push_release: + if: | + github.event_name == 'push' && + github.repository == 'ps3dev/ps3libraries' + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Download artifacts + uses: actions/download-artifact@v8 + with: + path: artifacts + merge-multiple: true + + - name: Create Pre-Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG="nightly-$(date -u +%Y-%m-%d)" + gh release delete "$TAG" --yes --cleanup-tag || true + gh release create "$TAG" artifacts/*.tar.gz --target ${{ GITHUB.SHA }} -t "$TAG" --prerelease diff --git a/.gitignore b/.gitignore index 751831ee..9d575249 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ build -.DS_Store \ No newline at end of file +.DS_Store +/build +/archives/* +!/archives/archives.txt +/ps3dev \ No newline at end of file diff --git a/archives/archives.txt b/archives/archives.txt new file mode 100644 index 00000000..d2c6d87a --- /dev/null +++ b/archives/archives.txt @@ -0,0 +1,41 @@ +b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30 1497445 https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz +d07616ba1e9c161017384feb3b576d70c160b970abfd9549ad39a622284b574a 829414 https://download.sourceforge.net/libpng/libpng-1.4.4.tar.gz +64be2429346b1aa84a014fc47264661ca2e6c786aea25afecb363d5973b4e6a9 935594 https://www.ijg.org/files/jpegsrc.v8b.tar.gz +33ec92273c2d809e51dece879c09d206e5dfa3d6deb7ce9e4c2bf0891b8111f9 1907043 https://downloads.sourceforge.net/project/freetype/freetype2/2.4.3/freetype-2.4.3.tar.gz +9c02c22c6cc3f28f3633d02ef6f0cac130518f621edb011ebbbf08cd1a81251a 537274 https://cairographics.org/releases/pixman-0.20.0.tar.gz +0f2ce4cc4615594088d74eb8b5360bad7c3cc3c3da9b61af9bfd979ed1ed94b2 24022822 https://cairographics.org/releases/cairo-1.10.0.tar.gz +fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e 589570 https://downloads.xiph.org/releases/ogg/libogg-1.3.4.tar.gz +6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce 1638779 https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz +e63f5dc1b33fd1c02a881d5a819620634a69d1e4ce8637261ca0cb0fbc9f9dca 304965 https://www.nih.at/libzip/libzip-0.9.3.tar.bz2 +67b76d075fb74f7cb32e7e4b217701674755fe6cee0f463b259a753fce691da6 1436968 https://download.osgeo.org/libtiff/old/tiff-3.9.4.tar.gz +2d7598cd2a8c61c023f27c9c7c1aca8bbfd92aadbee2f98b7a6d421eae35c929 611590 https://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz +c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92 5681632 http://xmlsoft.org/sources/libxml2-2.9.12.tar.gz +b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419 11125077 https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz +d3605afc28ed4b7d1d9e3142d72e42855e4a23c07c951bbb0299556b02d36755 1741396 https://mirror2.openwrt.org/sources/polarssl-1.3.9-gpl.tgz +432d3f466644b9416bc5b649d344116a753aeaa520c8beaf024a90cba9d3d35d 4008103 https://curl.haxx.se/download/curl-7.64.1.tar.gz +bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690 502379 https://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz +9635a44bceb478bbf2ee8a785cf6986fba525afb5fad1fd4bba73cf71f2d3edf 2009217 https://downloads.sourceforge.net/project/flac/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz +ee26ed1e177c0cd8fa8458a481b14a0b24ca0b51468c8b4c8b676fd3ceccd330 1137407 https://downloads.sourceforge.net/faac/faad2-2.7.tar.gz +b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc 1903175 https://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 +9988283408c71838d8d62e5418e5abb5eb5300bd84c385fdc96143b5e8f10ed5 455089 https://codeload.github.com/json-c/json-c/tar.gz/json-c-0.11-20130402 -> json-c-0.11-20130402.tar.gz +19e5b81fdac0fe22009b9e2bdcd52d7dcafbf62bc67fc59cf0a76b5b5540d149 3489179 https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-2.28.10/mbedtls-2.28.10.tar.bz2 +- - https://github.com/zeldin/SDL_PSL1GHT/tarball/master -> sdl_psl1ght.tar.gz +- - https://github.com/zeldin/SDL_PSL1GHT_Libs/tarball/master -> sdl_psl1ght_libs.tar.gz +- - https://github.com/shagkur/SDL_PSL1GHT/archive/refs/heads/sdl2_master.tar.gz -> sdl2_psl1ght.tar.gz +- - https://github.com/wargio/NoRSX/tarball/master -> NoRSX.tar.gz +- - https://github.com/sergiou87/ps3debugnet/tarball/master -> ps3debugnet.tar.gz +- - https://github.com/wargio/ps3soundlib/tarball/master -> ps3soundlib.tar.gz +- - https://github.com/wargio/tiny3d/tarball/master -> tiny3d.tar.gz +- - https://github.com/bucanero/libunrar-ps3/tarball/master -> libunrar.tar.gz +- - https://github.com/sahlberg/libnfs/tarball/master -> libnfs.tar.gz +- - https://github.com/sahlberg/libsmb2/tarball/master -> libsmb2.tar.gz +- - https://github.com/clienthax/psl1ght/tarball/master -> psl1ght.tar.gz +- - https://github.com/bucanero/pthread-emb-ps3/tarball/master -> pthread-emb-ps3.tar.gz +- - https://github.com/bucanero/libun7zip/tarball/master -> libun7zip.tar.gz +- - https://github.com/bucanero/libtinytar/tarball/master -> libtinytar.tar.gz +- - https://github.com/bucanero/ya2d_ps3/tarball/master -> ya2d.tar.gz +- - https://github.com/bucanero/psl1ght-libs/tarball/master -> psl1ght-libs.tar.gz +- - https://github.com/bucanero/dbglogger/tarball/master -> dbglogger.tar.gz +- - https://github.com/bucanero/mini18n/tarball/master -> mini18n.tar.gz +- - https://github.com/bucanero/libansilove/tarball/master -> libansilove.tar.gz +25cb043240f828a8c51beb830569634bc7ac603978e0f69d6b63558dadefd49a 1056093 https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.9.0.tar.gz -> yaml-cpp.tar.gz diff --git a/config/config.guess b/config/config.guess new file mode 100644 index 00000000..c7f4c329 --- /dev/null +++ b/config/config.guess @@ -0,0 +1,1823 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2026 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2026-05-17' + +# 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 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system '$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2026 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# Just in case it came from the environment. +GUESS= + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c17 c99 c89 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case $UNAME_SYSTEM in +Ironclad|Linux|GNU|GNU/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm + #elif defined(__mlibc__) + LIBC=mlibc + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif + #endif + EOF + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case $UNAME_VERSION in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + GUESS=$machine-${os}${release}${abi-} + ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; + *:ekkoBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; + *:SolidBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; + macppc:MirBSD:*:*) + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; + *:MirBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; + alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case $ALPHA_CPU_TYPE in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; + Amiga*:UNIX_System_V:4.0:*) + GUESS=m68k-unknown-sysv4 + ;; + *:[Aa]miga[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; + *:[Mm]orph[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-morphos + ;; + *:OS/390:*:*) + GUESS=i370-ibm-openedition + ;; + *:z/VM:*:*) + GUESS=s390-ibm-zvmoe + ;; + *:OS400:*:*) + GUESS=powerpc-ibm-os400 + ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + GUESS=arm-unknown-riscos + ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + GUESS=hppa1.1-hitachi-hiuxmpp + ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; + NILE*:*:*:dcosx) + GUESS=pyramid-pyramid-svr4 + ;; + DRS?6000:unix:4.0:6*) + GUESS=sparc-icl-nx6 + ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; + s390x:SunOS:*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; + sun4H:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; + sun4*:SunOS:*:*) + case `/usr/bin/arch -k` in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like '4.1.3-JL'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; + sun3*:SunOS:*:*) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in + sun3) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun4) + GUESS=sparc-sun-sunos$UNAME_RELEASE + ;; + esac + ;; + aushp:SunOS:*:*) + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; + m68k:machten:*:*) + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; + powerpc:machten:*:*) + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; + RISC*:Mach:*:*) + GUESS=mips-dec-mach_bsd4.3 + ;; + RISC*:ULTRIX:*:*) + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; + VAX*:ULTRIX*:*:*) + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; + Motorola:PowerMAX_OS:*:*) + GUESS=powerpc-motorola-powermax + ;; + Motorola:*:4.3:PL8-*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:Power_UNIX:*:*) + GUESS=powerpc-harris-powerunix + ;; + m88k:CX/UX:7*:*) + GUESS=m88k-harris-cxux7 + ;; + m88k:*:4*:R4*) + GUESS=m88k-motorola-sysv4 + ;; + m88k:*:3*:R3*) + GUESS=m88k-motorola-sysv3 + ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x + then + GUESS=m88k-dg-dgux$UNAME_RELEASE + else + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE + fi + else + GUESS=i586-dg-dgux$UNAME_RELEASE + fi + ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + GUESS=m88k-dolphin-sysv3 + ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + GUESS=m88k-motorola-sysv3 + ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + GUESS=m88k-tektronix-sysv3 + ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + GUESS=m68k-tektronix-bsd + ;; + *:IRIX*:*:*) + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + GUESS=i386-ibm-aix + ;; + ia64:AIX:*:*) + if test -x /usr/bin/oslevel ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + int + main () + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + GUESS=$SYSTEM_NAME + else + GUESS=rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + GUESS=rs6000-ibm-aix3.2.4 + else + GUESS=rs6000-ibm-aix3.2 + fi + ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; + *:AIX:*:*) + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + GUESS=rs6000-bull-bosx + ;; + DPX/2?00:B.O.S.:*:*) + GUESS=m68k-bull-sysv3 + ;; + 9000/[34]??:4.3bsd:1.*:*) + GUESS=m68k-hp-bsd + ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + GUESS=m68k-hp-bsd4.4 + ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if test -x /usr/bin/getconf; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case $sc_cpu_version in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case $sc_kernel_bits in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int + main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if test "$HP_ARCH" = hppa2.0w + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; + 9000/8??:4.3bsd:*:*) + GUESS=hppa1.0-hp-bsd + ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; + hp8??:OSF1:*:*) + GUESS=hppa1.0-hp-osf + ;; + i*86:OSF1:*:*) + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk + else + GUESS=$UNAME_MACHINE-unknown-osf1 + fi + ;; + parisc*:Lites*:*:*) + GUESS=hppa1.1-hp-lites + ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + GUESS=c1-convex-bsd + ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + GUESS=c34-convex-bsd + ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + GUESS=c38-convex-bsd + ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + GUESS=c4-convex-bsd + ;; + CRAY*Y-MP:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; + CRAY*T3E:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; + CRAY*SV1:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; + *:UNICOS/mp:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; + sparc*:BSD/OS:*:*) + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; + *:BSD/OS:*:*) + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; + i*:CYGWIN*:*) + GUESS=$UNAME_MACHINE-pc-cygwin + ;; + *:MINGW64*:*) + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; + *:MINGW*:*) + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; + *:MSYS*:*) + GUESS=$UNAME_MACHINE-pc-msys + ;; + i*:PW*:*) + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; + *:Interix*:*) + case $UNAME_MACHINE in + x86) + GUESS=i586-pc-interix$UNAME_RELEASE + ;; + authenticamd | genuineintel | EM64T) + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; + IA64) + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; + esac ;; + i*:UWIN*:*) + GUESS=$UNAME_MACHINE-pc-uwin + ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + GUESS=x86_64-pc-cygwin + ;; + prep*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; + *:GNU:*:*) + # the GNU system + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; + aarch64:Linux:*:*) + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI + ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi + else + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf + fi + fi + ;; + avr32*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + cris:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + crisv32:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + frv:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + hexagon:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:Linux:*:*) + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; + ia64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m32r*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m68*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + openrisc*:Linux:*:*) + GUESS=or1k-unknown-linux-$LIBC + ;; + or32:Linux:*:* | or1k*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + padre:Linux:*:*) + GUESS=sparc-unknown-linux-$LIBC + ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + GUESS=hppa64-unknown-linux-$LIBC + ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; + esac + ;; + ppc64:Linux:*:*) + GUESS=powerpc64-unknown-linux-$LIBC + ;; + ppc:Linux:*:*) + GUESS=powerpc-unknown-linux-$LIBC + ;; + ppc64le:Linux:*:*) + GUESS=powerpc64le-unknown-linux-$LIBC + ;; + ppcle:Linux:*:*) + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + s390:Linux:*:* | s390x:Linux:*:*) + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; + sh64*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sh*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sw_64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + tile*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + vax:Linux:*:*) + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; + x86_64:Linux:*:*) + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac + fi + GUESS=$CPU-pc-linux-$LIBCABI + ;; + xtensa*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + GUESS=i386-sequent-sysv4 + ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; + i*86:OS/2:*:*) + # If we were able to find 'uname', then EMX Unix compatibility + # is probably installed. + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; + i*86:XTS-300:*:STOP) + GUESS=$UNAME_MACHINE-unknown-stop + ;; + i*86:atheos:*:*) + GUESS=$UNAME_MACHINE-unknown-atheos + ;; + i*86:syllable:*:*) + GUESS=$UNAME_MACHINE-pc-syllable + ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; + i*86:*DOS:*:*) + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL + fi + ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv32 + fi + ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + GUESS=i586-pc-msdosdjgpp + ;; + Intel:Mach:3*:*) + GUESS=i386-pc-mach3 + ;; + paragon:*:*:*) + GUESS=i860-intel-osf1 + ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 + fi + ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + GUESS=m68010-convergent-sysv + ;; + mc68k:UNIX:SYSTEM5:3.51m) + GUESS=m68k-convergent-sysv + ;; + M680?0:D-NIX:5.3:*) + GUESS=m68k-diab-dnix + ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; + mc68030:UNIX_System_V:4.*:*) + GUESS=m68k-atari-sysv4 + ;; + TSUNAMI:LynxOS:2.*:*) + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; + rs6000:LynxOS:2.*:*) + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; + SM[BE]S:UNIX_SV:*:*) + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; + RM*:ReliantUNIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + RM*:SINIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 + else + GUESS=ns32k-sni-sysv + fi + ;; + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort + # says + GUESS=i586-unisys-sysv4 + ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + GUESS=hppa1.1-stratus-sysv4 + ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + GUESS=i860-stratus-sysv4 + ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=$UNAME_MACHINE-stratus-vos + ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=hppa1.1-stratus-vos + ;; + mc68*:A/UX:*:*) + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; + news*:NEWS-OS:6*:*) + GUESS=mips-sony-newsos6 + ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE + else + GUESS=mips-unknown-sysv$UNAME_RELEASE + fi + ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + GUESS=powerpc-be-beos + ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + GUESS=powerpc-apple-beos + ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + GUESS=i586-pc-beos + ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + GUESS=i586-pc-haiku + ;; + ppc:Haiku:*:*) # Haiku running on Apple PowerPC + GUESS=powerpc-apple-haiku + ;; + *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) + GUESS=$UNAME_MACHINE-unknown-haiku + ;; + SX-4:SUPER-UX:*:*) + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; + SX-5:SUPER-UX:*:*) + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; + SX-6:SUPER-UX:*:*) + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; + SX-7:SUPER-UX:*:*) + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; + SX-8:SUPER-UX:*:*) + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; + SX-8R:SUPER-UX:*:*) + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; + Power*:Rhapsody:*:*) + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; + *:Rhapsody:*:*) + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; + *:QNX:*:4*) + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; + NSE-*:NONSTOP_KERNEL:*:*) + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; + *:NonStop-UX:*:*) + GUESS=mips-compaq-nonstopux + ;; + BS2000:POSIX*:*:*) + GUESS=bs2000-siemens-sysv + ;; + DS/*:UNIX_System_V:*:*) + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "${cputype-}" = 386; then + UNAME_MACHINE=i386 + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype + fi + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; + *:TOPS-10:*:*) + GUESS=pdp10-unknown-tops10 + ;; + *:TENEX:*:*) + GUESS=pdp10-unknown-tenex + ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + GUESS=pdp10-dec-tops20 + ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + GUESS=pdp10-xkl-tops20 + ;; + *:TOPS-20:*:*) + GUESS=pdp10-unknown-tops20 + ;; + *:ITS:*:*) + GUESS=pdp10-unknown-its + ;; + SEI:*:*:SEIUX) + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; + *:DragonFly:*:*) + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; + esac ;; + *:XENIX:*:SysV) + GUESS=i386-pc-xenix + ;; + i*86:skyos:*:*) + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; + i*86:rdos:*:*) + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; + x86_64:VMkernel:*:*) + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; + x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*) + GUESS=$UNAME_MACHINE-pc-ironclad-$LIBC + ;; + *:[Ii]ronclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad-$LIBC + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +int +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp nil t) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%Y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config/config.sub b/config/config.sub new file mode 100644 index 00000000..6bcf42f9 --- /dev/null +++ b/config/config.sub @@ -0,0 +1,2364 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2025 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale + +timestamp='2025-07-10' + +# 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 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2025 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + cloudabi*-eabi* \ + | kfreebsd*-gnu* \ + | knetbsd*-gnu* \ + | kopensolaris*-gnu* \ + | ironclad-* \ + | linux-* \ + | managarm-* \ + | netbsd*-eabi* \ + | netbsd*-gnu* \ + | nto-qnx* \ + | os2-emx* \ + | rtmk-nova* \ + | storm-chaos* \ + | uclinux-gnu* \ + | uclinux-uclibc* \ + | windows-* ) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + case $field1-$field2 in + # Shorthands that happen to contain a single dash + convex-c[12] | convex-c3[248]) + basic_machine=$field2-convex + basic_os= + ;; + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Do not treat sunos as a manufacturer + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + # Manufacturers + 3100* \ + | 32* \ + | 3300* \ + | 3600* \ + | 7300* \ + | acorn \ + | altos* \ + | apollo \ + | apple \ + | atari \ + | att* \ + | axis \ + | be \ + | bull \ + | cbm \ + | ccur \ + | cisco \ + | commodore \ + | convergent* \ + | convex* \ + | cray \ + | crds \ + | dec* \ + | delta* \ + | dg \ + | digital \ + | dolphin \ + | encore* \ + | gould \ + | harris \ + | highlevel \ + | hitachi* \ + | hp \ + | ibm* \ + | intergraph \ + | isi* \ + | knuth \ + | masscomp \ + | microblaze* \ + | mips* \ + | motorola* \ + | ncr* \ + | news \ + | next \ + | ns \ + | oki \ + | omron* \ + | pc533* \ + | rebel \ + | rom68k \ + | rombug \ + | semi \ + | sequent* \ + | sgi* \ + | siemens \ + | sim \ + | sni \ + | sony* \ + | stratus \ + | sun \ + | sun[234]* \ + | tektronix \ + | tti* \ + | ultra \ + | unicom* \ + | wec \ + | winbond \ + | wrs) + basic_machine=$field1-$field2 + basic_os= + ;; + tock* | zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) + cpu=m68k + vendor=motorola + ;; + # This used to be dpx2*, but that gets the RS6000-based + # DPX/20 and the x86-based DPX/2-100 wrong. See + # https://oldskool.silicium.org/stations/bull_dpx20.htm + # https://www.feb-patrimoine.com/english/bull_dpx2.htm + # https://www.feb-patrimoine.com/english/unix_and_bull.htm + dpx2 | dpx2[23]00 | dpx2[23]xx) + cpu=m68k + vendor=bull + ;; + dpx2100 | dpx21xx) + cpu=i386 + vendor=bull + ;; + dpx20) + cpu=rs6000 + vendor=bull + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if test x"$basic_os" != x +then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +obj= +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + saved_IFS=$IFS + IFS="-" read kernel os <&2 + fi + ;; + *) + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) + ;; + uclinux-uclibc*- | uclinux-gnu*- ) + ;; + ironclad-mlibc*-) + ;; + managarm-mlibc*- | managarm-kernel*- ) + ;; + windows*-msvc*-) + ;; + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 + ;; + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 + ;; + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) + ;; + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) + ;; + nto-qnx*-) + ;; + os2-emx-) + ;; + rtmk-nova-) + ;; + *-eabi*- | *-gnueabi*-) + ;; + ios*-simulator- | tvos*-simulator- | watchos*-simulator- ) + ;; + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) + # Blank kernel with real OS is always fine. + ;; + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) + vendor=acorn + ;; + *-sunos* | *-solaris*) + vendor=sun + ;; + *-cnk* | *-aix*) + vendor=ibm + ;; + *-beos*) + vendor=be + ;; + *-hpux*) + vendor=hp + ;; + *-mpeix*) + vendor=hp + ;; + *-hiux*) + vendor=hitachi + ;; + *-unos*) + vendor=crds + ;; + *-dgux*) + vendor=dg + ;; + *-luna*) + vendor=omron + ;; + *-genix*) + vendor=ns + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) + vendor=sequent + ;; + *-tpf*) + vendor=ibm + ;; + *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; + *-aux*) + vendor=apple + ;; + *-hms*) + vendor=hitachi + ;; + *-mpw* | *-macos*) + vendor=apple + ;; + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; + *-vos*) + vendor=stratus + ;; + esac + ;; +esac + +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp nil t) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%Y-%02m-%02d" +# time-stamp-end: "'" +# End: \ No newline at end of file diff --git a/config/get-config-scripts.sh b/config/get-config-scripts.sh new file mode 100755 index 00000000..1b511980 --- /dev/null +++ b/config/get-config-scripts.sh @@ -0,0 +1,51 @@ +#!/bin/sh +set -e + +CONFIG_TIMEOUT="${CONFIG_TIMEOUT:-15}" +CONFIG_BASE_URL="https://git.savannah.gnu.org/cgit/config.git/plain" + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)" +CONFIG_DIR="${ROOT_DIR}/config" + +cd "${ROOT_DIR}/archives" + +fetch_config_file() { + file="$1" + url="${CONFIG_BASE_URL}/${file}" + tmp="${file}.tmp" + + if test -f "${file}"; then + return 0 + fi + + echo "Fetching ${file} from Savannah, timeout ${CONFIG_TIMEOUT}s..." + + if command -v curl >/dev/null 2>&1; then + if curl -fsSL --connect-timeout 5 --max-time "${CONFIG_TIMEOUT}" "${url}" -o "${tmp}"; then + mv "${tmp}" "${file}" + chmod +x "${file}" + return 0 + fi + elif command -v wget >/dev/null 2>&1; then + if wget --timeout="${CONFIG_TIMEOUT}" --tries=1 -O "${tmp}" "${url}"; then + mv "${tmp}" "${file}" + chmod +x "${file}" + return 0 + fi + fi + + echo "Falling back to safe ${file}." + rm -f "${tmp}" + cp "${CONFIG_DIR}/${file}" "${file}" + chmod +x "${file}" +} + +if [ -z "${NO_SAVANNAH}" ]; then + fetch_config_file config.guess + fetch_config_file config.sub +else + echo "NO_SAVANNAH is set, skipping Savannah downloads." + cp "${CONFIG_DIR}/config.guess" "config.guess" + cp "${CONFIG_DIR}/config.sub" "config.sub" +fi \ No newline at end of file diff --git a/depends/check-libtool.sh b/depends/check-libtool.sh index b4c30874..f171f2a0 100755 --- a/depends/check-libtool.sh +++ b/depends/check-libtool.sh @@ -2,4 +2,11 @@ # check-libtool.sh by Naomi Peori (naomi@peori.ca) ## Check for libtool. -{ libtool --version || libtool -V; } 1> /dev/null || { echo "ERROR: Install libtool before continuing."; exit 1; } +case "$(uname -s)" in + Darwin*) + libtool -V >/dev/null 2>&1 || { echo "ERROR: Install libtool before continuing."; exit 1; } + ;; + *) + { libtool --version || libtool -V; } >/dev/null 2>&1 || { echo "ERROR: Install libtool before continuing."; exit 1; } + ;; +esac \ No newline at end of file diff --git a/download.sh b/download.sh new file mode 100755 index 00000000..3c2c5d6b --- /dev/null +++ b/download.sh @@ -0,0 +1,149 @@ +#!/bin/sh +set -eu +cd "$(dirname "$0")" +cd archives || exit 1 + +ARCHIVE="archives.txt" +WGET="wget --tries=5 --timeout=15 --quiet --show-progress" + +# ----------------------------------------------------------------------------- +# verify_sha256 +# Returns 0 on match, 1 on mismatch or error. +# ----------------------------------------------------------------------------- +verify_sha256() { + file="$1" + expected="$2" + out=$(sha256sum "$file" 2>/dev/null) || { + echo " !! sha256sum failed: $file" >&2 + return 1 + } + set -- $out + actual="$1" + if [ "$actual" != "$expected" ]; then + echo " !! SHA256 mismatch: $file" >&2 + echo " expected: $expected" >&2 + echo " got: $actual" >&2 + return 1 + fi + return 0 +} + +# ----------------------------------------------------------------------------- +# fetch +# ----------------------------------------------------------------------------- +fetch() { + url="$1" + dest="$2" + $WGET -O "$dest" "$url" || { + echo " !! Download failed: $url" >&2 + rm -f "$dest" + return 1 + } +} + +# ----------------------------------------------------------------------------- +# download [rename] +# ----------------------------------------------------------------------------- +download() { + sha="$1" + size="$2" + url="$3" + rename="${4:-}" + file="${rename:-$(basename "$url")}" + + printf '==> %s\n' "$file" + + # If already present, verify immediately — size alone is not enough. + if [ -f "$file" ]; then + if [ "$sha" = "-" ]; then + echo " -- no checksum, skipping re-download of existing file" + return 0 + fi + if verify_sha256 "$file" "$sha"; then + echo " -- already good" + return 0 + fi + echo " -- existing file failed verification, re-downloading..." + rm -f "$file" + fi + + # First attempt + fetch "$url" "$file" + + # Verify, with one retry on mismatch + if [ "$sha" != "-" ]; then + if ! verify_sha256 "$file" "$sha"; then + echo " -- retrying download..." + rm -f "$file" + fetch "$url" "$file" + verify_sha256 "$file" "$sha" || { + rm -f "$file" + echo " !! Giving up on $file" >&2 + return 1 + } + fi + fi + + echo " -- ok" +} + +# ----------------------------------------------------------------------------- +# parse_line -> prints "sha\tsize\turl\trename" or returns 1 +# ----------------------------------------------------------------------------- +parse_line() { + line="$1" + [ -z "$line" ] && return 1 + set -- $line + [ "$#" -lt 3 ] && return 1 + sha="$1"; size="$2"; url="$3" + rename="" + shift 3 + if [ "${1:-}" = "->" ]; then + rename="${2:-}" + fi + printf '%s\t%s\t%s\t%s\n' "$sha" "$size" "$url" "$rename" +} + +# ----------------------------------------------------------------------------- +# run_all / run_one +# ----------------------------------------------------------------------------- +run_all() { + ../config/get-config-scripts.sh + while IFS= read -r line; do + [ -z "$line" ] && continue + parsed=$(parse_line "$line") || continue + IFS="$(printf '\t')" read -r sha size url rename <&2 + exit 1 + } +} + +# ----------------------------------------------------------------------------- +if [ "$#" -eq 0 ]; then + run_all +else + run_one "$1" +fi \ No newline at end of file diff --git a/patches/mbedtls-2.28.10.patch b/patches/mbedtls-2.28.10.patch new file mode 100644 index 00000000..73f9f256 --- /dev/null +++ b/patches/mbedtls-2.28.10.patch @@ -0,0 +1,237 @@ +diff -Nru mbedtls-2.28.10-orig/library/entropy_poll.c mbedtls-2.28.10/library/entropy_poll.c +--- mbedtls-2.28.10-orig/library/entropy_poll.c 2025-03-24 08:49:00 ++++ mbedtls-2.28.10/library/entropy_poll.c 2026-04-25 20:09:41 +@@ -34,7 +34,7 @@ + + #if !defined(unix) && !defined(__unix__) && !defined(__unix) && \ + !defined(__APPLE__) && !defined(_WIN32) && !defined(__QNXNTO__) && \ +- !defined(__HAIKU__) && !defined(__midipix__) ++ !defined(__HAIKU__) && !defined(__midipix__) && !defined(__PPU__) + #error \ + "Platform entropy sources only work on Unix and Windows, see MBEDTLS_NO_PLATFORM_ENTROPY in config.h" + #endif +@@ -148,6 +148,10 @@ + + #include + ++#if defined(__PPU__) ++#include ++#endif ++ + int mbedtls_platform_entropy_poll(void *data, + unsigned char *output, size_t len, size_t *olen) + { +@@ -155,6 +159,15 @@ + size_t read_len; + int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; + ((void) data); ++ ++#if defined(__PPU__) ++ if (sysGetRandomNumber(output, len) == 0) { ++ *olen = len; ++ return 0; ++ } else { ++ return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED; ++ } ++#endif + + #if defined(HAVE_GETRANDOM) + ret = getrandom_wrapper(output, len, 0); +diff -Nru mbedtls-2.28.10-orig/library/net_sockets.c mbedtls-2.28.10/library/net_sockets.c +--- mbedtls-2.28.10-orig/library/net_sockets.c 2025-03-24 08:49:00 ++++ mbedtls-2.28.10/library/net_sockets.c 2026-04-25 19:37:20 +@@ -15,13 +15,16 @@ + #define _XOPEN_SOURCE 600 /* sockaddr_storage */ + #endif + ++#define sockaddr_storage sockaddr_in ++#include ++ + #include "common.h" + + #if defined(MBEDTLS_NET_C) + + #if !defined(unix) && !defined(__unix__) && !defined(__unix) && \ + !defined(__APPLE__) && !defined(_WIN32) && !defined(__QNXNTO__) && \ +- !defined(__HAIKU__) && !defined(__midipix__) ++ !defined(__HAIKU__) && !defined(__midipix__) && !defined(__PPU__) + #error "This module only works on Unix and Windows, see MBEDTLS_NET_C in config.h" + #endif + +@@ -30,6 +33,9 @@ + #include "mbedtls/net_sockets.h" + #include "mbedtls/error.h" + ++#include ++#include ++ + #include + + #if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(EFIX64) && \ +@@ -163,6 +169,7 @@ + int mbedtls_net_connect(mbedtls_net_context *ctx, const char *host, + const char *port, int proto) + { ++#if 0 + int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; + struct addrinfo hints, *addr_list, *cur; + +@@ -202,6 +209,37 @@ + freeaddrinfo(addr_list); + + return ret; ++#endif ++ /* Legacy IPv4-only version */ ++ ++ int ret; ++ struct sockaddr_in server_addr; ++ struct hostent *server_host; ++ ++ if( ( ret = net_prepare() ) != 0 ) ++ return( ret ); ++ ++ if( ( server_host = gethostbyname( host ) ) == NULL ) ++ return( MBEDTLS_ERR_NET_UNKNOWN_HOST ); ++ ++ if( ( ctx->fd = (int) socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 ) ++ return( MBEDTLS_ERR_NET_SOCKET_FAILED ); ++ ++ memcpy( (void *) &server_addr.sin_addr, ++ (void *) server_host->h_addr, ++ server_host->h_length ); ++ ++ server_addr.sin_family = AF_INET; ++ server_addr.sin_port = htons( atoi(port) ); ++ ++ if( connect( ctx->fd, (struct sockaddr *) &server_addr, ++ sizeof( server_addr ) ) < 0 ) ++ { ++ close( ctx->fd ); ++ return( MBEDTLS_ERR_NET_CONNECT_FAILED ); ++ } ++ ++ return( 0 ); + } + + /* +@@ -209,6 +247,7 @@ + */ + int mbedtls_net_bind(mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto) + { ++#if 0 + int n, ret; + struct addrinfo hints, *addr_list, *cur; + +@@ -270,7 +309,57 @@ + freeaddrinfo(addr_list); + + return ret; ++#endif ++ /* Legacy IPv4-only version */ ++ ++ int ret, n, c[4]; ++ struct sockaddr_in server_addr; + ++ if( ( ret = net_prepare() ) != 0 ) ++ return( ret ); ++ ++ if( ( ctx->fd = (int) socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 ) ++ return( MBEDTLS_ERR_NET_SOCKET_FAILED ); ++ ++ n = 1; ++ setsockopt( ctx->fd, SOL_SOCKET, SO_REUSEADDR, ++ (const char *) &n, sizeof( n ) ); ++ ++ server_addr.sin_addr.s_addr = htonl( INADDR_ANY ); ++ server_addr.sin_family = AF_INET; ++ server_addr.sin_port = htons( atoi(port) ); ++ ++ if( bind_ip != NULL ) ++ { ++ memset( c, 0, sizeof( c ) ); ++ sscanf( bind_ip, "%d.%d.%d.%d", &c[0], &c[1], &c[2], &c[3] ); ++ ++ for( n = 0; n < 4; n++ ) ++ if( c[n] < 0 || c[n] > 255 ) ++ break; ++ ++ if( n == 4 ) ++ server_addr.sin_addr.s_addr = htonl( ++ ( (uint32_t) c[0] << 24 ) | ++ ( (uint32_t) c[1] << 16 ) | ++ ( (uint32_t) c[2] << 8 ) | ++ ( (uint32_t) c[3] ) ); ++ } ++ ++ if( bind( ctx->fd, (struct sockaddr *) &server_addr, ++ sizeof( server_addr ) ) < 0 ) ++ { ++ close( ctx->fd ); ++ return( MBEDTLS_ERR_NET_BIND_FAILED ); ++ } ++ ++ if( listen( ctx->fd, MBEDTLS_NET_LISTEN_BACKLOG ) != 0 ) ++ { ++ close( ctx->fd ); ++ return( MBEDTLS_ERR_NET_LISTEN_FAILED ); ++ } ++ ++ return( 0 ); + } + + #if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(EFIX64) && \ +@@ -389,7 +478,7 @@ + n = sizeof(struct sockaddr_storage); + if (getsockname(client_ctx->fd, + (struct sockaddr *) &local_addr, &n) != 0 || +- (bind_ctx->fd = (int) socket(local_addr.ss_family, ++ (bind_ctx->fd = (int) socket(local_addr.sin_family, + SOCK_DGRAM, IPPROTO_UDP)) < 0 || + setsockopt(bind_ctx->fd, SOL_SOCKET, SO_REUSEADDR, + (const char *) &one, sizeof(one)) != 0) { +@@ -402,7 +491,7 @@ + } + + if (client_ip != NULL) { +- if (client_addr.ss_family == AF_INET) { ++ if (client_addr.sin_family == AF_INET) { + struct sockaddr_in *addr4 = (struct sockaddr_in *) &client_addr; + *cip_len = sizeof(addr4->sin_addr.s_addr); + +@@ -411,6 +500,7 @@ + } + + memcpy(client_ip, &addr4->sin_addr.s_addr, *cip_len); ++#if 0 + } else { + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *) &client_addr; + *cip_len = sizeof(addr6->sin6_addr.s6_addr); +@@ -420,6 +510,7 @@ + } + + memcpy(client_ip, &addr6->sin6_addr.s6_addr, *cip_len); ++#endif + } + } + +diff -Nru mbedtls-2.28.10-orig/library/timing.c mbedtls-2.28.10/library/timing.c +--- mbedtls-2.28.10-orig/library/timing.c 2025-03-24 08:49:00 ++++ mbedtls-2.28.10/library/timing.c 2026-04-25 20:02:39 +@@ -19,7 +19,7 @@ + + #if !defined(unix) && !defined(__unix__) && !defined(__unix) && \ + !defined(__APPLE__) && !defined(_WIN32) && !defined(__QNXNTO__) && \ +- !defined(__HAIKU__) && !defined(__midipix__) ++ !defined(__HAIKU__) && !defined(__midipix__) && !defined(__PPU__) + #error "This module only works on Unix and Windows, see MBEDTLS_TIMING_C in config.h" + #endif + +@@ -298,7 +298,7 @@ + { + mbedtls_timing_alarmed = 0; + signal(SIGALRM, sighandler); +- alarm(seconds); ++// alarm(seconds); + if (seconds == 0) { + /* alarm(0) cancelled any previous pending alarm, but the + handler won't fire, so raise the flag straight away. */ diff --git a/patches/zlib-1.2.11-PPU.patch b/patches/zlib-1.2.11-PPU.patch deleted file mode 100644 index f5b25b7b..00000000 --- a/patches/zlib-1.2.11-PPU.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- orig.zlib-1.2.11/Makefile.in 2017-01-15 18:29:40.000000000 +0100 -+++ zlib-1.2.11/Makefile.in 2017-02-15 12:02:49.221883981 +0100 -@@ -75,7 +75,7 @@ - - all: static shared - --static: example$(EXE) minigzip$(EXE) -+static: $(STATICLIB) # example$(EXE) minigzip$(EXE) - - shared: examplesh$(EXE) minigzipsh$(EXE) - ---- orig.zlib-1.2.11/configure 2016-12-31 19:06:40.000000000 +0100 -+++ zlib-1.2.11/configure 2017-02-15 12:02:49.244443762 +0100 -@@ -217,8 +217,8 @@ - MINGW* | mingw*) - # temporary bypass - rm -f $test.[co] $test $test$shared_ext -- echo "Please use win32/Makefile.gcc instead." | tee -a configure.log -- leave 1 -+ # echo "Please use win32/Makefile.gcc instead." | tee -a configure.log -+ # leave 1 - LDSHARED=${LDSHARED-"$cc -shared"} - LDSHAREDLIBC="" - EXE='.exe' ;; -@@ -241,12 +241,7 @@ - SHAREDLIBV=libz.$VER$shared_ext - SHAREDLIBM=libz.$VER1$shared_ext - LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} -- if libtool -V 2>&1 | grep Apple > /dev/null; then -- AR="libtool" -- else -- AR="/usr/bin/libtool" -- fi -- ARFLAGS="-o" ;; -+ ;; - *) LDSHARED=${LDSHARED-"$cc -shared"} ;; - esac - else diff --git a/patches/zlib-1.2.13-PPU.patch b/patches/zlib-1.2.13-PPU.patch new file mode 100644 index 00000000..2a7de0cf --- /dev/null +++ b/patches/zlib-1.2.13-PPU.patch @@ -0,0 +1,10 @@ +--- orig.zlib-1.2.13/Makefile.in ++++ zlib-1.2.13/Makefile.in +@@ -71,7 +71,7 @@ + + all: static shared + +-static: example$(EXE) minigzip$(EXE) ++static: $(STATICLIB) # example$(EXE) minigzip$(EXE) + + shared: examplesh$(EXE) minigzipsh$(EXE) \ No newline at end of file diff --git a/readme.md b/readme.md index 777101b6..2d672965 100644 --- a/readme.md +++ b/readme.md @@ -1,25 +1,24 @@ -[![Run Tests](https://github.com/humbertodias/ps3libraries/actions/workflows/test.yml/badge.svg)](https://github.com/humbertodias/ps3libraries/actions/workflows/test.yml) +[![CI](https://github.com/ps3dev/ps3libraries/actions/workflows/build.yml/badge.svg)](https://github.com/ps3dev/ps3libraries/actions/workflows/build.yml) -### What does this do? +# ps3libraries -This program will automatically build and install libraries used in the creation -of homebrew software for the Sony Playstation 3 videogame system. +A collection of libraries built in conjunction with the PS3 development environment. -### How do I use it? +# What does this do? -1. Set up your environment by installing the following software: + This program will automatically build and install libraries used in the creation + of homebrew software for the Sony Playstation 3 videogame system. -- autoconf -- automake -- libtool -- make -- pkg-config -- ps3toolchain -- psl1ght-sdl1 -- wget +# How do I use it? -2. Run the library script: + 1) Set up your environment by installing the following software: + +``` + autoconf, automake, libtool, make, pkg-config, ps3toolchain, psl1ght, wget +``` + + 2) Run the library script: ```sh -./libraries.sh + ./libraries.sh ``` diff --git a/scripts/001-zlib-1.2.11.sh b/scripts/001-zlib-1.2.11.sh deleted file mode 100755 index 47cf7fef..00000000 --- a/scripts/001-zlib-1.2.11.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -e -# zlib-1.2.11.sh by Naomi Peori (naomi@peori.ca) - -## Download the source code. -wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz - -## Unpack the source code. -rm -Rf zlib-1.2.11 && tar xfvz zlib-1.2.11.tar.gz && cd zlib-1.2.11 - -## Patch the source code. -cat ../../patches/zlib-1.2.11-PPU.patch | patch -p1 - -## Configure the build. -AR="powerpc64-ps3-elf-ar" CC="powerpc64-ps3-elf-gcc" RANLIB="powerpc64-ps3-elf-ranlib" \ -./configure --prefix="$PS3DEV/portlibs/ppu" --static - -## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install diff --git a/scripts/001-zlib-1.2.13.sh b/scripts/001-zlib-1.2.13.sh new file mode 100755 index 00000000..5b552f45 --- /dev/null +++ b/scripts/001-zlib-1.2.13.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -eo pipefail + +# zlib-1.2.13.sh by Naomi Peori (naomi@peori.ca) +ZLIB="zlib-1.2.13" + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh ${ZLIB}.tar.gz + +## Unpack the source code. +rm -Rf ${ZLIB} +echo "Unpacking ${ZLIB}" +extract ../archives/${ZLIB}.tar.gz +cd ${ZLIB} + +## Patch the source code. +cat ../../patches/${ZLIB}-PPU.patch | patch -p1 + +## Configure the build. +AR="powerpc64-ps3-elf-ar" CC="powerpc64-ps3-elf-gcc" RANLIB="powerpc64-ps3-elf-ranlib" \ +./configure --prefix="$PS3DEV/portlibs/ppu" --static + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" AR="powerpc64-ps3-elf-ar" ARFLAGS="rc" RANLIB="powerpc64-ps3-elf-ranlib" +${MAKE:-make} -j"$jobs" install AR="powerpc64-ps3-elf-ar" ARFLAGS="rc" RANLIB="powerpc64-ps3-elf-ranlib" diff --git a/scripts/002-libpng-1.4.4.sh b/scripts/002-libpng-1.4.4.sh index f55a64c8..8d19c3b8 100755 --- a/scripts/002-libpng-1.4.4.sh +++ b/scripts/002-libpng-1.4.4.sh @@ -1,18 +1,26 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # libpng-1.4.4.sh by Naomi Peori (naomi@peori.ca) +LIBPNG="libpng-1.4.4" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://phoenixnap.dl.sourceforge.net/project/libpng/libpng14/older-releases/1.4.4/libpng-1.4.4.tar.gz +../download.sh ${LIBPNG}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf libpng-1.4.4 && tar xfvz libpng-1.4.4.tar.gz && cd libpng-1.4.4 +rm -Rf ${LIBPNG} +echo "Unpacking ${LIBPNG}" +extract ../archives/${LIBPNG}.tar.gz +cd ${LIBPNG} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -25,4 +33,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --enable-static --disable-shared ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/003-jpeg-8b.sh b/scripts/003-jpeg-8b.sh index 3ff86353..374c623f 100755 --- a/scripts/003-jpeg-8b.sh +++ b/scripts/003-jpeg-8b.sh @@ -1,21 +1,25 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # jpeg-8b.sh by Naomi Peori (naomi@peori.ca) +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget http://www.ijg.org/files/jpegsrc.v8b.tar.gz +../download.sh jpegsrc.v8b.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf jpeg-8b && tar xfvz jpegsrc.v8b.tar.gz && cd jpeg-8b +rm -Rf jpeg-8b +echo "Unpacking jpegsrc.v8b" +extract ../archives/jpegsrc.v8b.tar.gz +cd jpeg-8b ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . - -## Patch the source code. -cat ../../patches/jpeg-8b-PPU.patch | patch -p1 +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -27,5 +31,6 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/004-freetype-2.4.3.sh b/scripts/004-freetype-2.4.3.sh index 01328860..2edd3dd2 100755 --- a/scripts/004-freetype-2.4.3.sh +++ b/scripts/004-freetype-2.4.3.sh @@ -1,18 +1,26 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # freetype-2.4.3.sh by Naomi Peori (naomi@peori.ca) +FREETYPE="freetype-2.4.3" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.4.3.tar.gz +../download.sh ${FREETYPE}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf freetype-2.4.3 && tar xfvz freetype-2.4.3.tar.gz && cd freetype-2.4.3 +rm -Rf ${FREETYPE} +echo "Unpacking ${FREETYPE}" +extract ../archives/${FREETYPE}.tar.gz +cd ${FREETYPE} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub builds/unix/ +cp ../../archives/config.guess ../../archives/config.sub builds/unix/ ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -27,4 +35,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ GNUMAKE=$MAKE ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/005-pixman-0.20.0.sh b/scripts/005-pixman-0.20.0.sh index fc61287e..0bdf0589 100755 --- a/scripts/005-pixman-0.20.0.sh +++ b/scripts/005-pixman-0.20.0.sh @@ -1,18 +1,26 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # pixman-0.20.0.sh by Naomi Peori (naomi@peori.ca) +PIXMAN="pixman-0.20.0" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://cairographics.org/releases/pixman-0.20.0.tar.gz +../download.sh ${PIXMAN}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf pixman-0.20.0 && tar xfvz pixman-0.20.0.tar.gz && cd pixman-0.20.0 +rm -Rf ${PIXMAN} +echo "Unpacking ${PIXMAN}" +extract ../archives/${PIXMAN}.tar.gz +cd ${PIXMAN} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -24,4 +32,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared --disable-vmx ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/006-cairo-1.10.0.sh b/scripts/006-cairo-1.10.0.sh index 0f5a7d1a..5a75a26c 100755 --- a/scripts/006-cairo-1.10.0.sh +++ b/scripts/006-cairo-1.10.0.sh @@ -1,21 +1,29 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # cairo-1.10.0.sh by Naomi Peori (naomi@peori.ca) +CAIRO="cairo-1.10.0" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://cairographics.org/releases/cairo-1.10.0.tar.gz +../download.sh ${CAIRO}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf cairo-1.10.0 && tar xfvz cairo-1.10.0.tar.gz && cd cairo-1.10.0 +rm -Rf ${CAIRO} +echo "Unpacking ${CAIRO}" +extract ../archives/${CAIRO}.tar.gz +cd ${CAIRO} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub build/ +cp ../../archives/config.guess ../../archives/config.sub build/ ## Patch the source code. -cat ../../patches/cairo-1.10.0.patch | patch -p1 +cat ../../patches/${CAIRO}.patch | patch -p1 ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -27,4 +35,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --enable-fc="no" --enable-xlib="no" --disable-shared --disable-valgrind --enable-gobject="no" ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/007-libogg-1.2.1.sh b/scripts/007-libogg-1.2.1.sh deleted file mode 100755 index 9d721586..00000000 --- a/scripts/007-libogg-1.2.1.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -e -# libogg-1.2.1.sh by Naomi Peori (naomi@peori.ca) - -## Download the source code. -wget http://downloads.xiph.org/releases/ogg/libogg-1.2.1.tar.gz - -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi - -## Unpack the source code. -rm -Rf libogg-1.2.1 && tar xfvz libogg-1.2.1.tar.gz && cd libogg-1.2.1 - -## Replace config.guess and config.sub -cp ../config.guess ../config.sub . - -## Create the build directory. -mkdir build-ppu && cd build-ppu - -## Configure the build. -CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ -LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ -PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ -../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared - -## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install diff --git a/scripts/007-libogg-1.3.4.sh b/scripts/007-libogg-1.3.4.sh new file mode 100755 index 00000000..2301421f --- /dev/null +++ b/scripts/007-libogg-1.3.4.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -eo pipefail + +# libogg-1.3.4.sh by Naomi Peori (naomi@peori.ca) +LIBOGG="libogg-1.3.4" + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh ${LIBOGG}.tar.gz + +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh + +## Unpack the source code. +rm -Rf ${LIBOGG} +echo "Unpacking ${LIBOGG}" +extract ../archives/${LIBOGG}.tar.gz +cd ${LIBOGG} + +## Replace config.guess and config.sub +cp ../../archives/config.guess ../../archives/config.sub . + +## Create the build directory. +mkdir build-ppu && cd build-ppu + +## Configure the build. +CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ +LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ +PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ +../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/008-libvorbis-1.3.2.sh b/scripts/008-libvorbis-1.3.2.sh deleted file mode 100755 index 1cb1686b..00000000 --- a/scripts/008-libvorbis-1.3.2.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -e -# libvorbis-1.3.2.sh by Naomi Peori (naomi@peori.ca) - -## Download the source code. -wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.gz - -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi - -## Unpack the source code. -rm -Rf libvorbis-1.3.2 && tar xfvz libvorbis-1.3.2.tar.gz && cd libvorbis-1.3.2 - -## Replace config.guess and config.sub -cp ../config.guess ../config.sub . - -## Create the build directory. -mkdir build-ppu && cd build-ppu - -## Configure the build. -CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ -LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ -PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ -../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared - -## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install diff --git a/scripts/008-libvorbis-1.3.5.sh b/scripts/008-libvorbis-1.3.5.sh new file mode 100755 index 00000000..e6592c75 --- /dev/null +++ b/scripts/008-libvorbis-1.3.5.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -eo pipefail + +# libvorbis-1.3.5.sh by Naomi Peori (naomi@peori.ca) +LIBVORBIS="libvorbis-1.3.5" + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh ${LIBVORBIS}.tar.gz + +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh + +## Unpack the source code. +rm -Rf ${LIBVORBIS} +echo "Unpacking ${LIBVORBIS}" +extract ../archives/${LIBVORBIS}.tar.gz +cd ${LIBVORBIS} + +## Replace config.guess and config.sub +cp ../../archives/config.guess ../../archives/config.sub . + +## Create the build directory. +mkdir build-ppu && cd build-ppu + +## Configure the build. +CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ +LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ +PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ +../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/009-libzip-0.9.3.sh b/scripts/009-libzip-0.9.3.sh index 806e2473..0a43b426 100755 --- a/scripts/009-libzip-0.9.3.sh +++ b/scripts/009-libzip-0.9.3.sh @@ -1,18 +1,26 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # libzip-0.9.3.sh by Naomi Peori (naomi@peori.ca) +LIBZIP="libzip-0.9.3" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget https://libzip.org/download/libzip-0.9.3.tar.bz2 +../download.sh ${LIBZIP}.tar.bz2 -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf libzip-0.9.3 && tar xfvj libzip-0.9.3.tar.bz2 && cd libzip-0.9.3 +rm -Rf ${LIBZIP} +echo "Unpacking ${LIBZIP}" +extract ../archives/${LIBZIP}.tar.bz2 +cd ${LIBZIP} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -24,4 +32,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/010-tiff-3.9.4.sh b/scripts/010-tiff-3.9.4.sh index 2781f4e8..fda78a80 100755 --- a/scripts/010-tiff-3.9.4.sh +++ b/scripts/010-tiff-3.9.4.sh @@ -1,21 +1,29 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # tiff-3.9.4.sh by Jon Limle +TIFF="tiff-3.9.4" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget --tries 5 --timeout 15 https://ftp.osuosl.org/pub/blfs/conglomeration/tiff/tiff-3.9.4.tar.gz +../download.sh ${TIFF}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf tiff-3.9.4 && tar xfvz ./tiff-3.9.4.tar.gz && cd tiff-3.9.4 +rm -Rf ${TIFF} +echo "Unpacking ${TIFF}" +extract ../archives/${TIFF}.tar.gz +cd ${TIFF} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub config/ +cp ../../archives/config.guess ../../archives/config.sub config/ ## Patch the source code. -cat ../../patches/tiff-3.9.4-PPU.patch | patch -p1 +cat ../../patches/${TIFF}-PPU.patch | patch -p1 ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -27,4 +35,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared ## Compile and install. -${MAKE:-make} && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/011-libmikmod-3.1.11.sh b/scripts/011-libmikmod-3.1.11.sh index 1f8bb83f..4ef3b786 100755 --- a/scripts/011-libmikmod-3.1.11.sh +++ b/scripts/011-libmikmod-3.1.11.sh @@ -1,14 +1,23 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # libmikmod-3.1.11.sh by Marcus Comstedt +LIBMIKMOD="libmikmod-3.1.11" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz +../download.sh ${LIBMIKMOD}.tar.gz ## Unpack the source code. -rm -Rf libmikmod-3.1.11 && tar xfvz ./libmikmod-3.1.11.tar.gz && cd libmikmod-3.1.11 +rm -Rf ${LIBMIKMOD} +echo "Unpacking ${LIBMIKMOD}" +extract ../archives/${LIBMIKMOD}.tar.gz +cd ${LIBMIKMOD} ## Patch the source code. -cat ../../patches/libmikmod-3.1.11-PPU.patch | patch -p1 +cat ../../patches/${LIBMIKMOD}-PPU.patch | patch -p1 ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -17,9 +26,11 @@ mkdir build-ppu && cd build-ppu CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ CC="powerpc64-ps3-elf-gcc" LD="powerpc64-ps3-elf-ld" NM="powerpc64-ps3-elf-nm" \ +AR="powerpc64-ps3-elf-ar" \ RANLIB="powerpc64-ps3-elf-ranlib" STRIP="powerpc64-ps3-elf-strip" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" \ --disable-esd --disable-dl --disable-shared ## Compile and install. -${MAKE:-make} && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/012-libxml2-2.9.12.sh b/scripts/012-libxml2-2.9.12.sh index d8f24b52..cd74b46e 100755 --- a/scripts/012-libxml2-2.9.12.sh +++ b/scripts/012-libxml2-2.9.12.sh @@ -1,21 +1,26 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # libxml2-2.9.12.sh by Naomi Peori (naomi@peori.ca) +LIBXML2="libxml2-2.9.12" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://xmlsoft.org/download/libxml2-2.9.12.tar.gz -O libxml2.tar.gz +../download.sh ${LIBXML2}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf libxml2 && mkdir libxml2 && tar --strip-components=1 --directory=libxml2 -xvzf libxml2.tar.gz - -## Create the build directory. -cd libxml2 +rm -Rf ${LIBXML2} +echo "Unpacking ${LIBXML2}" +extract ../archives/${LIBXML2}.tar.gz +cd ${LIBXML2} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -24,7 +29,8 @@ mkdir build-ppu && cd build-ppu CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ -../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --enable-static --disable-shared --without-ftp --without-http --without-python --without-lzma +../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --enable-static --disable-shared --without-ftp --without-http --without-python ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/013-sdl_psl1ght.sh b/scripts/013-sdl_psl1ght.sh index cacf209b..b06ad611 100755 --- a/scripts/013-sdl_psl1ght.sh +++ b/scripts/013-sdl_psl1ght.sh @@ -1,15 +1,21 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail + # sdl_psl1ght.sh by Naomi Peori (naomi@peori.ca) +## Source util functions +source ../utils/utils.sh + ## Download the source code. -# SDL1 -wget https://github.com/zeldin/SDL_PSL1GHT/tarball/master -O sdl_psl1ght.tar.gz +../download.sh sdl_psl1ght.tar.gz ## Unpack the source code. -rm -Rf sdl_psl1ght && mkdir sdl_psl1ght && tar --strip-components=1 --directory=sdl_psl1ght -xvzf sdl_psl1ght.tar.gz - -## Create the build directory. +rm -Rf sdl_psl1ght +mkdir sdl_psl1ght +echo "Unpacking sdl_psl1ght" +extract ../archives/sdl_psl1ght.tar.gz --strip-components=1 --directory=sdl_psl1ght cd sdl_psl1ght ## Compile and install. -./script.sh && ${MAKE:-make} && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +./script.sh && ${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/014-sdl2_psl1ght.sh b/scripts/014-sdl2_psl1ght.sh new file mode 100755 index 00000000..a8b03501 --- /dev/null +++ b/scripts/014-sdl2_psl1ght.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -eo pipefail + +# sdl_psl1ght.sh by Naomi Peori (naomi@peori.ca) + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh sdl2_psl1ght.tar.gz + +## Unpack the source code. +rm -Rf sdl2_psl1ght +mkdir sdl2_psl1ght +echo "Unpacking sdl2_psl1ght" +extract ../archives/sdl2_psl1ght.tar.gz --strip-components=1 --directory=sdl2_psl1ght +cd sdl2_psl1ght + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +./script.sh && ${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/014-sdl_psl1ght_libs.sh b/scripts/014-sdl_psl1ght_libs.sh deleted file mode 100755 index d3235abf..00000000 --- a/scripts/014-sdl_psl1ght_libs.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -e -# sdl_psl1ght_libs.sh by Naomi Peori (naomi@peori.ca) - -## Download the source code. -# SDL1 -wget https://github.com/zeldin/SDL_PSL1GHT_Libs/tarball/master -O sdl_psl1ght_libs.tar.gz - -## Unpack the source code. -rm -Rf sdl_psl1ght_libs && mkdir sdl_psl1ght_libs && tar --strip-components=1 --directory=sdl_psl1ght_libs -xvzf sdl_psl1ght_libs.tar.gz - -## Create the build directory. -cd sdl_psl1ght_libs - -## Compile and install. -./make_SDL_Libs.sh diff --git a/scripts/015-sdl_psl1ght_libs.sh b/scripts/015-sdl_psl1ght_libs.sh new file mode 100755 index 00000000..1cd1e60e --- /dev/null +++ b/scripts/015-sdl_psl1ght_libs.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -eo pipefail + +# sdl_psl1ght_libs.sh by Naomi Peori (naomi@peori.ca) + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh sdl_psl1ght_libs.tar.gz + +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh + +## Unpack the source code. +rm -Rf sdl_psl1ght_libs +mkdir sdl_psl1ght_libs +echo "Unpacking sdl_psl1ght_libs" +extract ../archives/sdl_psl1ght_libs.tar.gz --strip-components=1 --directory=sdl_psl1ght_libs +cd sdl_psl1ght_libs + +## Preload config.guess and config.sub +cp ../../archives/config.guess ../../archives/config.sub archives/ + +## Compile and install. +./make_SDL_Libs.sh diff --git a/scripts/016-SDL2_mixer-2.0.4.sh b/scripts/016-SDL2_mixer-2.0.4.sh new file mode 100755 index 00000000..8cd4ae0f --- /dev/null +++ b/scripts/016-SDL2_mixer-2.0.4.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -eo pipefail + +SDL2_MIXER="SDL2_mixer-2.0.4" + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh ${SDL2_MIXER}.tar.gz + +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh + +## Unpack the source code. +rm -Rf ${SDL2_MIXER} +echo "Unpacking ${SDL2_MIXER}" +extract ../archives/${SDL2_MIXER}.tar.gz +cd ${SDL2_MIXER} + +## Replace config.guess and config.sub +cp ../../archives/config.guess ../../archives/config.sub build-scripts/ + +## Create the build directory. +mkdir build-ppu && cd build-ppu + +## Configure the build. +CFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ +LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" \ +PKG_CONFIG_LIBDIR="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ +LIBMIKMOD_CONFIG="$PS3DEV/portlibs/ppu/bin/libmikmod-config" \ +../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" \ + --disable-sdltest \ + --with-sdl-exec-prefix="$PS3DEV/portlibs/ppu" \ + --disable-shared \ + --disable-music-cmd \ + --disable-music-ogg-shared \ + --disable-music-mp3 \ + --disable-music-flac \ + --disable-music-mod-modplug \ + --enable-music-mod-mikmod + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/015-polarssl-1.3.9.sh b/scripts/017-polarssl-1.3.9.sh similarity index 81% rename from scripts/015-polarssl-1.3.9.sh rename to scripts/017-polarssl-1.3.9.sh index cc69b94e..b5305687 100755 --- a/scripts/015-polarssl-1.3.9.sh +++ b/scripts/017-polarssl-1.3.9.sh @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # Automatic build script for polarssl # for psl1ght, playstaion 3 open source sdk. @@ -31,18 +32,24 @@ CURRENTPATH=`pwd` ARCH="powerpc64" PLATFORM="PS3" +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget -O polarssl-${VERSION}.gpl.tgz https://src.fedoraproject.org/repo/pkgs/polarssl/polarssl-1.3.9-gpl.tgz/48af7d1f0d5de512cbd6dacf5407884c/polarssl-${VERSION}-gpl.tgz +../download.sh polarssl-${VERSION}-gpl.tgz ## Unpack the source code. -rm -Rf polarssl-${VERSION} && tar xfvz polarssl-${VERSION}.gpl.tgz && cd polarssl-${VERSION} +rm -Rf polarssl-${VERSION} +echo "Unpacking polarssl-${VERSION}" +extract ../archives/polarssl-${VERSION}-gpl.tgz +cd polarssl-${VERSION} ## Patch the source code. echo "Patching net.c and timing.c for compatibility..." -cat ../../patches/polarssl-1.3.9-ipv6.patch | patch -p1 +cat ../../patches/polarssl-${VERSION}-ipv6.patch | patch -p1 cd library -cat ../../../patches/polarssl-1.3.9-net.patch | patch -p1 -cat ../../../patches/polarssl-1.3.9-timing.patch | patch -p1 +cat ../../../patches/polarssl-${VERSION}-net.patch | patch -p1 +cat ../../../patches/polarssl-${VERSION}-timing.patch | patch -p1 echo "Building polarssl for ${PLATFORM} ${SDKVERSION} ${ARCH}" @@ -65,7 +72,8 @@ export CFLAGS="-I${CURRENTPATH}/polarssl-${VERSION}/include -I$PS3DEV/ppu/powerp echo "Build library..." ## Compile and install. -${MAKE:-make} +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" cp libpolarssl.a $PS3DEV/portlibs/ppu/lib/libpolarssl.a cp -R ../include/polarssl $PS3DEV/portlibs/ppu/include/ diff --git a/scripts/028-mbedTLS-2.16.6.sh b/scripts/018-mbedTLS-2.28.10.sh similarity index 54% rename from scripts/028-mbedTLS-2.16.6.sh rename to scripts/018-mbedTLS-2.28.10.sh index 72f80fa9..6d86fb36 100755 --- a/scripts/028-mbedTLS-2.16.6.sh +++ b/scripts/018-mbedTLS-2.28.10.sh @@ -1,5 +1,5 @@ -#!/bin/sh -e - +#!/usr/bin/env bash +set -eo pipefail # Update by Damian Parrino (2020-07-29) # Automatic build script for mbedTLS # for PSL1GHT, PlayStation 3 open source SDK. @@ -23,7 +23,7 @@ ########################################################################### # Change values here # -VERSION="2.16.6" +VERSION="2.28.10" # ########################################################################### # @@ -33,16 +33,22 @@ CURRENTPATH=`pwd` ARCH="powerpc64" PLATFORM="PS3" +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget -O mbedtls-${VERSION}.gpl.tgz http://downloads.arednmesh.org/sources/mbedtls-${VERSION}-gpl.tgz +../download.sh mbedtls-${VERSION}.tar.bz2 ## Unpack the source code. -rm -Rf mbedtls-${VERSION} && tar xfvz mbedtls-${VERSION}.gpl.tgz && cd mbedtls-${VERSION} +rm -Rf mbedtls-${VERSION} +echo "Unpacking mbedtls-${VERSION}" +extract ../archives/mbedtls-${VERSION}.tar.bz2 +cd mbedtls-${VERSION} echo "Building mbedTLS ${VERSION} for ${PLATFORM} ${ARCH}" echo "Patching Makefile..." -sed -i.bak '4d' ${CURRENTPATH}/mbedtls-${VERSION}/library/Makefile +patch -p1 < ../../patches/mbedtls-${VERSION}.patch echo "Please stand by..." @@ -57,46 +63,13 @@ export NM=${TOOLCHAIN_PATH}nm export CXXCPP=${TOOLCHAIN_PATH}cpp export RANLIB=${TOOLCHAIN_PATH}ranlib export LDFLAGS="-L$PS3DEV/ppu/powerpc64-ps3-elf/lib -L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" -export CFLAGS="-I${CURRENTPATH}/mbedtls-${VERSION}/include -I$PS3DEV/ppu/powerpc64-ps3-elf/include -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include -mcpu=cell" -export MBEDTLS_NO_PLATFORM_ENTROPY=1 - -## Create config.h file -cd library -sed -i.bak '94d' ../configs/config-no-entropy.h -sed -i.bak '92d' ../configs/config-no-entropy.h -cp ../configs/config-no-entropy.h ../include/mbedtls/config.h -echo "#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED -#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED -#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED -#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED -#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED -#define MBEDTLS_SSL_PROTO_DTLS -#define MBEDTLS_SSL_PROTO_SSL3 -#define MBEDTLS_SSL_PROTO_TLS1 -#define MBEDTLS_SSL_PROTO_TLS1_1 -#define MBEDTLS_SSL_PROTO_TLS1_2 -#define MBEDTLS_SHA1_C -#define MBEDTLS_MD5_C -#define MBEDTLS_DHM_C -#define MBEDTLS_ECDH_C -#define MBEDTLS_ECJPAKE_C -#define MBEDTLS_SSL_CLI_C -#define MBEDTLS_SSL_SRV_C -#define MBEDTLS_SSL_TLS_C - -#include \"check_config.h\" - -#endif /* MBEDTLS_CONFIG_H */" >> ../include/mbedtls/config.h +export CFLAGS="-I../include -I$PS3DEV/ppu/powerpc64-ps3-elf/include -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include -mcpu=cell" echo "Build library..." ## Compile and install. -${MAKE:-make} +cd library +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" cp lib*.a $PS3DEV/portlibs/ppu/lib/ cp -R ../include/mbedtls $PS3DEV/portlibs/ppu/include/ diff --git a/scripts/017-libmad-0.15.1b.sh b/scripts/019-libmad-0.15.1b.sh similarity index 50% rename from scripts/017-libmad-0.15.1b.sh rename to scripts/019-libmad-0.15.1b.sh index 2d1b4249..2baef3d5 100755 --- a/scripts/017-libmad-0.15.1b.sh +++ b/scripts/019-libmad-0.15.1b.sh @@ -1,18 +1,25 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # libmad-0.15.1b.sh by dhewg (dhewg@wiibrew.org) +LIBMAD="libmad-0.15.1b" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget https://downloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz +../download.sh ${LIBMAD}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf libmad-0.15.1b && tar xfvz libmad-0.15.1b.tar.gz && cd libmad-0.15.1b +rm -Rf ${LIBMAD} +echo "Unpacking ${LIBMAD}" +extract ../archives/${LIBMAD}.tar.gz +cd ${LIBMAD} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -24,4 +31,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/018-flac-1.2.1.sh b/scripts/020-flac-1.2.1.sh similarity index 53% rename from scripts/018-flac-1.2.1.sh rename to scripts/020-flac-1.2.1.sh index 76d5fcbe..b0d53d72 100755 --- a/scripts/018-flac-1.2.1.sh +++ b/scripts/020-flac-1.2.1.sh @@ -1,18 +1,25 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # flac-1.2.1.sh by dhewg (dhewg@wiibrew.org) +FLAC="flac-1.2.1" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://downloads.sourceforge.net/project/flac/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz +../download.sh ${FLAC}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf flac-1.2.1 && tar xfvz flac-1.2.1.tar.gz && cd flac-1.2.1 +rm -Rf ${FLAC} +echo "Unpacking ${FLAC}" +extract ../archives/${FLAC}.tar.gz +cd ${FLAC} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -24,4 +31,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared --enable-altivec --disable-xmms-plugin --disable-ogg --disable-oggtest ## Compile (only parts to prevent failures in unrequired parts) and install. -${MAKE:-make} -C src/libFLAC -j4 && ${MAKE:-make} -C src/libFLAC install && ${MAKE:-make} -C include install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -C src/libFLAC -j"$jobs" && ${MAKE:-make} -j"$jobs" -C src/libFLAC install && ${MAKE:-make} -j"$jobs" -C include install diff --git a/scripts/021-NoRSX.sh b/scripts/021-NoRSX.sh deleted file mode 100755 index 00218ff1..00000000 --- a/scripts/021-NoRSX.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -e -# libNoRSX.sh by wargio (wargio@libero.it) - -## Download the source code. -wget https://github.com/wargio/NoRSX/tarball/master -O NoRSX.tar.gz - -## Unpack the source code. -rm -Rf NoRSX && mkdir NoRSX && tar --strip-components=1 --directory=NoRSX -xvzf NoRSX.tar.gz && cd NoRSX - -## Compile and install. -${MAKE:-make} diff --git a/scripts/019-faad2-2.7.sh b/scripts/021-faad2-2.7.sh similarity index 51% rename from scripts/019-faad2-2.7.sh rename to scripts/021-faad2-2.7.sh index 09793b96..c1726801 100755 --- a/scripts/019-faad2-2.7.sh +++ b/scripts/021-faad2-2.7.sh @@ -1,18 +1,25 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # faad2-2.7.sh by dhewg (dhewg@wiibrew.org) +FAAD2="faad2-2.7" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz +../download.sh ${FAAD2}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf faad2-2.7 && tar xfvz faad2-2.7.tar.gz && cd faad2-2.7 +rm -Rf ${FAAD2} +echo "Unpacking ${FAAD2}" +extract ../archives/${FAAD2}.tar.gz +cd ${FAAD2} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -24,4 +31,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/020-libtheora-1.1.1.sh b/scripts/022-libtheora-1.1.1.sh similarity index 50% rename from scripts/020-libtheora-1.1.1.sh rename to scripts/022-libtheora-1.1.1.sh index 6a1ebab2..f17eff35 100755 --- a/scripts/020-libtheora-1.1.1.sh +++ b/scripts/022-libtheora-1.1.1.sh @@ -1,18 +1,25 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # libtheora-1.1.1.sh by dhewg (dhewg@wiibrew.org) +LIBTHEORA="libtheora-1.1.1" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 +../download.sh ${LIBTHEORA}.tar.bz2 -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf libtheora-1.1.1 && tar xfvj libtheora-1.1.1.tar.bz2 && cd libtheora-1.1.1 +rm -Rf ${LIBTHEORA} +echo "Unpacking ${LIBTHEORA}" +extract ../archives/${LIBTHEORA}.tar.bz2 +cd ${LIBTHEORA} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -24,4 +31,5 @@ PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --disable-shared --disable-examples ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/023-NoRSX.sh b/scripts/023-NoRSX.sh new file mode 100755 index 00000000..ac92adda --- /dev/null +++ b/scripts/023-NoRSX.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eo pipefail +# libNoRSX.sh by wargio (wargio@libero.it) + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh NoRSX.tar.gz + +## Unpack the source code. +rm -Rf NoRSX +mkdir NoRSX +echo "Unpacking NoRSX" +extract ../archives/NoRSX.tar.gz --strip-components=1 --directory=NoRSX +cd NoRSX + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" diff --git a/scripts/022-libjson.sh b/scripts/024-libjson.sh similarity index 52% rename from scripts/022-libjson.sh rename to scripts/024-libjson.sh index 6adcea81..624a75bf 100755 --- a/scripts/022-libjson.sh +++ b/scripts/024-libjson.sh @@ -1,20 +1,25 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # libjson-c.sh by Mohammad Haseeb (mmhaqs@gmail.com) -wget https://codeload.github.com/json-c/json-c/tar.gz/json-c-0.11-20130402 -O jsonc.tar.gz +## Source util functions +source ../utils/utils.sh -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Download the source code. +../download.sh json-c-0.11-20130402.tar.gz -## Unpack the source code. -rm -Rf jsonc && mkdir jsonc && tar --strip-components=1 --directory=jsonc -xvzf jsonc.tar.gz +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh -## Create the build directory. +## Unpack the source code. +rm -Rf jsonc +mkdir jsonc +echo "Unpacking jsonc" +extract ../archives/json-c-0.11-20130402.tar.gz --strip-components=1 --directory=jsonc cd jsonc ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Configure the build. CFLAGS="-Wno-error -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \ @@ -25,4 +30,5 @@ ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes \ ./configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" --enable-static --disable-shared ## Compile and install. -${MAKE:-make} && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/025-debugnet.sh b/scripts/025-debugnet.sh new file mode 100755 index 00000000..b6fda714 --- /dev/null +++ b/scripts/025-debugnet.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eo pipefail +# debugnet.sh by Sergio Padrino (@sergiou87) + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh ps3debugnet.tar.gz + +## Unpack the source code. +rm -Rf ps3debugnet +mkdir ps3debugnet +echo "Unpacking ps3debugnet" +extract ../archives/ps3debugnet.tar.gz --strip-components=1 --directory=ps3debugnet +cd ps3debugnet/libdebugnet + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/026-ps3soundlib.sh b/scripts/026-ps3soundlib.sh index 09a77bd4..ed0a4714 100755 --- a/scripts/026-ps3soundlib.sh +++ b/scripts/026-ps3soundlib.sh @@ -1,12 +1,21 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # ps3soundlib.sh by CrystalCT (crystal@unict.it) # PS3 SOUNDLIB Credits: Hermes, HACKERCHANNEL, Xiph.Org, mpg123 project and Wargio/deroad +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget https://github.com/wargio/ps3soundlib/tarball/master -O ps3soundlib.tar.gz +../download.sh ps3soundlib.tar.gz ## Unpack the source code. -rm -Rf ps3soundlib && mkdir ps3soundlib && tar --strip-components=1 --directory=ps3soundlib -xvzf ps3soundlib.tar.gz && cd ps3soundlib +rm -Rf ps3soundlib +mkdir ps3soundlib +echo "Unpacking ps3soundlib" +extract ../archives/ps3soundlib.tar.gz --strip-components=1 --directory=ps3soundlib +cd ps3soundlib ## Compile and install. +## Explodes if you use -j.. ${MAKE:-make} diff --git a/scripts/027-tiny3d_libfont.sh b/scripts/027-tiny3d_libfont.sh index 1163478d..141f6971 100755 --- a/scripts/027-tiny3d_libfont.sh +++ b/scripts/027-tiny3d_libfont.sh @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # tini3d_libfont.sh by CrystalCT (crystal@unict.it) # Tiny3D 2.0 + libfont Credits: # Hermes - Author @@ -9,12 +10,19 @@ # deroad/Wargio - check code # Bucanero, CrystalCT, Miigotu, Shagkur, Wargio and Zeldin to update Tiny3D for GCC 7.2.0 +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget https://github.com/wargio/tiny3d/tarball/master -O tiny3d.tar.gz +../download.sh tiny3d.tar.gz ## Unpack the source code. -rm -Rf tiny3d && mkdir tiny3d && tar --strip-components=1 --directory=tiny3d -xvzf tiny3d.tar.gz && cd tiny3d +rm -Rf tiny3d +mkdir tiny3d +echo "Unpacking tiny3d" +extract ../archives/tiny3d.tar.gz --strip-components=1 --directory=tiny3d +cd tiny3d ## Compile and install. -${MAKE:-make} install -C lib --no-print-directory -${MAKE:-make} install -C libfont --no-print-directory +${MAKE:-make} -j"$jobs" install -C lib --no-print-directory +${MAKE:-make} -j"$jobs" install -C libfont --no-print-directory diff --git a/scripts/016-libcurl-7.64.1.sh b/scripts/028-libcurl-7.64.1.sh similarity index 50% rename from scripts/016-libcurl-7.64.1.sh rename to scripts/028-libcurl-7.64.1.sh index 42c81c93..098f8fdd 100755 --- a/scripts/016-libcurl-7.64.1.sh +++ b/scripts/028-libcurl-7.64.1.sh @@ -1,20 +1,27 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # libcurl-7.31.0 by KaKaRoTo # modified by mhaqs for 7.31.0 release and cpp compatibility -VERSION=7.64.1 +VERSION="7.64.1" + +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget http://curl.haxx.se/download/curl-${VERSION}.tar.gz +../download.sh curl-${VERSION}.tar.gz -## Download an up-to-date config.guess and config.sub -if [ ! -f config.guess ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi -if [ ! -f config.sub ]; then wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh ## Unpack the source code. -rm -Rf curl-${VERSION} && tar xfvz curl-${VERSION}.tar.gz && cd curl-${VERSION} +rm -Rf curl-${VERSION} +echo "Unpacking curl-${VERSION}" +extract ../archives/curl-${VERSION}.tar.gz +cd curl-${VERSION} ## Replace config.guess and config.sub -cp ../config.guess ../config.sub . +cp ../../archives/config.guess ../../archives/config.sub . ## Create the build directory. mkdir build-ppu && cd build-ppu @@ -27,8 +34,9 @@ AR="ppu-ar" CC="ppu-gcc" RANLIB="ppu-ranlib" \ LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib" LIBS="-lnet -lsysutil -lsysmodule -lm " \ PKG_CONFIG_LIBDIR="$PSL1GHT/ppu/lib/pkgconfig" PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \ ../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" \ - --disable-threaded-resolver --disable-ipv6 \ - --includedir="$PS3DEV/portlibs/ppu/include" --libdir="$PS3DEV/portlibs/ppu/lib" --without-ssl --with-polarssl="$PS3DEV/portlibs/ppu/include/polarssl" --with-ca-bundle="/usr/ssl/certs/ca-bundle.crt" + --disable-threaded-resolver --disable-ipv6 --disable-ntlm-wb \ + --includedir="$PS3DEV/portlibs/ppu/include" --libdir="$PS3DEV/portlibs/ppu/lib" --with-mbedtls="$PS3DEV/portlibs/ppu/include/mbedtls" --with-ca-bundle="/usr/ssl/certs/ca-bundle.crt" ## Compile and install. -${MAKE:-make} -j4 && ${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" && ${MAKE:-make} -j"$jobs" install diff --git a/scripts/029-libunrar.sh b/scripts/029-libunrar.sh index f2371126..eb3b1da5 100755 --- a/scripts/029-libunrar.sh +++ b/scripts/029-libunrar.sh @@ -1,12 +1,20 @@ -#!/bin/sh -e -# +#!/usr/bin/env bash +set -eo pipefail # unRAR library ported to PS3 by Bucanero +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget https://github.com/bucanero/libunrar-ps3/tarball/master -O libunrar.tar.gz +../download.sh libunrar.tar.gz ## Unpack the source code. -rm -Rf libunrar && mkdir libunrar && tar --strip-components=1 --directory=libunrar -xvzf libunrar.tar.gz && cd libunrar +rm -Rf libunrar +mkdir libunrar +echo "Unpacking libunrar" +extract ../archives/libunrar.tar.gz --strip-components=1 --directory=libunrar +cd libunrar ## Compile and install. -${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" install diff --git a/scripts/030-libnfs.sh b/scripts/030-libnfs.sh index f8bddc1d..4691550e 100755 --- a/scripts/030-libnfs.sh +++ b/scripts/030-libnfs.sh @@ -1,16 +1,21 @@ -#!/bin/sh -e -# +#!/usr/bin/env bash +set -eo pipefail # libnfs by sahlberg # ported to PS3 by Bucanero +## Source util functions +source ../utils/utils.sh + ## Download the source code. -owner=sahlberg -repo=libnfs -tag_latest=`wget -qO- "https://api.github.com/repos/${owner}/${repo}/tags" | grep -o '"name": "[^"]*' | cut -d'"' -f4 | head -n1` -wget https://github.com/${owner}/${repo}/archive/refs/tags/${tag_latest}.tar.gz -O libnfs.tar.gz +../download.sh libnfs.tar.gz ## Unpack the source code. -rm -Rf libnfs && mkdir libnfs && tar --strip-components=1 --directory=libnfs -xvzf libnfs.tar.gz && cd libnfs +rm -Rf libnfs +mkdir libnfs +echo "Unpacking libnfs" +extract ../archives/libnfs.tar.gz --strip-components=1 --directory=libnfs +cd libnfs ## Compile and install. -${MAKE:-make} -f ps3_ppu/Makefile.PS3_PPU install \ No newline at end of file +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" -f ps3_ppu/Makefile.PS3_PPU install diff --git a/scripts/031-libsmb2.sh b/scripts/031-libsmb2.sh index 376fab66..259772df 100755 --- a/scripts/031-libsmb2.sh +++ b/scripts/031-libsmb2.sh @@ -1,13 +1,22 @@ -#!/bin/sh -e -# +#!/usr/bin/env bash +set -eo pipefail # libsmb2 by sahlberg # ported to PS3 by Bucanero +SMB2="libsmb2" + +## Source util functions +source ../utils/utils.sh ## Download the source code. -wget https://github.com/sahlberg/libsmb2/tarball/master -O libsmb2.tar.gz +../download.sh ${SMB2}.tar.gz ## Unpack the source code. -rm -Rf libsmb2 && mkdir libsmb2 && tar --strip-components=1 --directory=libsmb2 -xvzf libsmb2.tar.gz && cd libsmb2/lib +rm -Rf ${SMB2} +mkdir ${SMB2} +echo "Unpacking ${SMB2}" +extract ../archives/${SMB2}.tar.gz --strip-components=1 --directory=${SMB2} +cd ${SMB2}/lib ## Compile and install. -${MAKE:-make} -f Makefile.PS3_PPU install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" -f Makefile.PS3_PPU install diff --git a/scripts/032-libun7zip.sh b/scripts/032-libun7zip.sh deleted file mode 100755 index a9602fd9..00000000 --- a/scripts/032-libun7zip.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -e -# -# un7Zip library by Bucanero - -## Download the source code. -wget https://github.com/bucanero/libun7zip/tarball/master -O libun7zip.tar.gz - -## Unpack the source code. -rm -Rf libun7zip && mkdir libun7zip && tar --strip-components=1 --directory=libun7zip -xvzf libun7zip.tar.gz && cd libun7zip - -## Compile and install. -${MAKE:-make} install diff --git a/scripts/032-pthread-emb.sh b/scripts/032-pthread-emb.sh new file mode 100755 index 00000000..e800ef4f --- /dev/null +++ b/scripts/032-pthread-emb.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eo pipefail +# pthread-emb ps3 library + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh pthread-emb-ps3.tar.gz + +## Unpack the source code. +rm -Rf pthread-emb-ps3 +mkdir pthread-emb-ps3 +echo "Unpacking pthread-emb" +extract ../archives/pthread-emb-ps3.tar.gz --strip-components=1 --directory=pthread-emb-ps3 +cd pthread-emb-ps3/platform/psl1ght + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" install diff --git a/scripts/033-libtinytar.sh b/scripts/033-libtinytar.sh deleted file mode 100755 index 5d6a9b88..00000000 --- a/scripts/033-libtinytar.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -e -# -# tar/tar.gz/tar.bz2 library by Bucanero - -## Download the source code. -wget https://github.com/bucanero/libtinytar/tarball/master -O libtinytar.tar.gz - -## Unpack the source code. -rm -Rf libtinytar && mkdir libtinytar && tar --strip-components=1 --directory=libtinytar -xvzf libtinytar.tar.gz && cd libtinytar - -## Compile and install. -${MAKE:-make} install diff --git a/scripts/033-libun7zip.sh b/scripts/033-libun7zip.sh new file mode 100755 index 00000000..85a118b7 --- /dev/null +++ b/scripts/033-libun7zip.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eo pipefail +# un7Zip library by Bucanero + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh libun7zip.tar.gz + +## Unpack the source code. +rm -Rf libun7zip +mkdir libun7zip +echo "Unpacking libun7zip" +extract ../archives/libun7zip.tar.gz --strip-components=1 --directory=libun7zip +cd libun7zip + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" install diff --git a/scripts/034-libtinytar.sh b/scripts/034-libtinytar.sh new file mode 100755 index 00000000..2f9782da --- /dev/null +++ b/scripts/034-libtinytar.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eo pipefail +# tar/tar.gz/tar.bz2 library by Bucanero + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh libtinytar.tar.gz + +## Unpack the source code. +rm -Rf libtinytar +mkdir libtinytar +echo "Unpacking libtinytar" +extract ../archives/libtinytar.tar.gz --strip-components=1 --directory=libtinytar +cd libtinytar + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" install diff --git a/scripts/034-libya2d.sh b/scripts/034-libya2d.sh deleted file mode 100755 index 8ea7d5b8..00000000 --- a/scripts/034-libya2d.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -e -# ya2d_ps3 by xerpi -# fork by Bucanero - -## Download the source code. -wget https://github.com/bucanero/ya2d_ps3/tarball/master -O ya2d.tar.gz - -## Unpack the source code. -rm -Rf ya2d && mkdir ya2d && tar --strip-components=1 --directory=ya2d -xvzf ya2d.tar.gz && cd ya2d/libya2d - -## Compile and install. -${MAKE:-make} install diff --git a/scripts/035-bzip2.sh b/scripts/035-bzip2.sh deleted file mode 100755 index acadca11..00000000 --- a/scripts/035-bzip2.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -e -# bzip2 by cadcdev - -## Download the source code. -wget https://github.com/bucanero/psl1ght-libs/tarball/master -O psl1ght-libs.tar.gz - -## Unpack the source code. -rm -Rf psl1ght-libs && mkdir psl1ght-libs && tar --strip-components=1 --directory=psl1ght-libs -xvzf psl1ght-libs.tar.gz && cd psl1ght-libs - -## Compile and install. -${MAKE:-make} --directory=bzip2 install diff --git a/scripts/035-libya2d.sh b/scripts/035-libya2d.sh new file mode 100755 index 00000000..fa1786f7 --- /dev/null +++ b/scripts/035-libya2d.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -eo pipefail +# ya2d_ps3 by xerpi +# fork by Bucanero + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh ya2d.tar.gz + +## Unpack the source code. +rm -Rf ya2d +mkdir ya2d +echo "Unpacking ya2d" +extract ../archives/ya2d.tar.gz --strip-components=1 --directory=ya2d +cd ya2d/libya2d + +## Compile and install. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" install diff --git a/scripts/036-dbglogger.sh b/scripts/036-dbglogger.sh index cd19a98d..a033c72c 100755 --- a/scripts/036-dbglogger.sh +++ b/scripts/036-dbglogger.sh @@ -1,11 +1,20 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # dbglogger by Bucanero +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget https://github.com/bucanero/dbglogger/tarball/master -O dbglogger.tar.gz +../download.sh dbglogger.tar.gz ## Unpack the source code. -rm -Rf dbglogger && mkdir dbglogger && tar --strip-components=1 --directory=dbglogger -xvzf dbglogger.tar.gz && cd dbglogger +rm -Rf dbglogger +mkdir dbglogger +echo "Unpacking dbglogger" +extract ../archives/dbglogger.tar.gz --strip-components=1 --directory=dbglogger +cd dbglogger ## Compile and install. -${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" install diff --git a/scripts/037-mini18n.sh b/scripts/037-mini18n.sh index 185d09a2..43a6e567 100755 --- a/scripts/037-mini18n.sh +++ b/scripts/037-mini18n.sh @@ -1,12 +1,21 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # mini18n by Yabause team # ported to PS3 by Bucanero +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget https://github.com/bucanero/mini18n/tarball/master -O mini18n.tar.gz +../download.sh mini18n.tar.gz ## Unpack the source code. -rm -Rf mini18n && mkdir mini18n && tar --strip-components=1 --directory=mini18n -xvzf mini18n.tar.gz && cd mini18n +rm -Rf mini18n +mkdir mini18n +echo "Unpacking mini18n" +extract ../archives/mini18n.tar.gz --strip-components=1 --directory=mini18n +cd mini18n ## Compile and install. -${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" install diff --git a/scripts/038-libansilove.sh b/scripts/038-libansilove.sh index 898a5d39..50fe3d3d 100755 --- a/scripts/038-libansilove.sh +++ b/scripts/038-libansilove.sh @@ -1,12 +1,21 @@ -#!/bin/sh -e +#!/usr/bin/env bash +set -eo pipefail # libansilove by Stefan Vogt, Brian Cassidy, and Frederic Cambus # ported to PS3 by Bucanero +## Source util functions +source ../utils/utils.sh + ## Download the source code. -wget https://github.com/bucanero/libansilove/tarball/master -O libansilove.tar.gz +../download.sh libansilove.tar.gz ## Unpack the source code. -rm -Rf libansilove && mkdir libansilove && tar --strip-components=1 --directory=libansilove -xvzf libansilove.tar.gz && cd libansilove +rm -Rf libansilove +mkdir libansilove +echo "Unpacking libansilove" +extract ../archives/libansilove.tar.gz --strip-components=1 --directory=libansilove +cd libansilove ## Compile and install. -${MAKE:-make} install +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" install diff --git a/scripts/039-pthread-emb.sh b/scripts/039-pthread-emb.sh deleted file mode 100755 index 24e63d28..00000000 --- a/scripts/039-pthread-emb.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -e -# pthreads-emb.sh by Humberto Dias - -## Download the source code. -wget https://github.com/humbertodias/pthread-emb-ps3/tarball/master -O pthreads-emb.tar.gz - -## Unpack the source code. -rm -Rf pthreads-emb && mkdir pthreads-emb && tar --strip-components=1 --directory=pthreads-emb -xvzf pthreads-emb.tar.gz - -## Create the build directory. -cd pthreads-emb/src/platform/psl1ght - -## Compile and install. -${MAKE:-make} && ${MAKE:-make} install || { exit 1; } diff --git a/scripts/039-yaml-cpp.sh b/scripts/039-yaml-cpp.sh new file mode 100755 index 00000000..76a5f5ef --- /dev/null +++ b/scripts/039-yaml-cpp.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -eo pipefail +# yaml-cpp-0.9.0.sh by Humberto Dias + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh yaml-cpp.tar.gz + +## Unpack the source code. +rm -Rf yaml-cpp +mkdir yaml-cpp +echo "Unpacking yaml-cpp" +extract ../archives/yaml-cpp.tar.gz --strip-components=1 --directory=yaml-cpp +cd yaml-cpp + +## Compile and install. +mkdir -p build +cd build +cmake -Wno-dev \ + -DCMAKE_SYSTEM_NAME=Generic \ + -DCMAKE_SYSTEM_PROCESSOR=powerpc64 \ + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \ + -DCMAKE_INSTALL_PREFIX="${PS3DEV}/portlibs/ppu" \ + -DCMAKE_C_COMPILER=ppu-gcc \ + -DCMAKE_CXX_COMPILER=ppu-g++ \ + -DBUILD_SHARED_LIBS=OFF \ + -DYAML_BUILD_SHARED_LIBS=OFF \ + -DYAML_ENABLE_PIC=OFF \ + -DYAML_CPP_BUILD_TOOLS=OFF \ + -DYAML_CPP_BUILD_TESTS=OFF \ + -DYAML_CPP_INSTALL=ON \ + .. +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" yaml-cpp +${MAKE:-make} -j"$jobs" install diff --git a/scripts/040-mbedTLS.sh b/scripts/040-mbedTLS.sh new file mode 100755 index 00000000..6d86fb36 --- /dev/null +++ b/scripts/040-mbedTLS.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +set -eo pipefail +# Update by Damian Parrino (2020-07-29) +# Automatic build script for mbedTLS +# for PSL1GHT, PlayStation 3 open source SDK. +# +# Originally Created by Felix Schulze on 08.04.11. +# Ported to PS3Libraries to compile with psl1ght. +# Copyright 2010 Felix Schulze. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +########################################################################### +# Change values here +# +VERSION="2.28.10" +# +########################################################################### +# +# Don't change anything here + +CURRENTPATH=`pwd` +ARCH="powerpc64" +PLATFORM="PS3" + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh mbedtls-${VERSION}.tar.bz2 + +## Unpack the source code. +rm -Rf mbedtls-${VERSION} +echo "Unpacking mbedtls-${VERSION}" +extract ../archives/mbedtls-${VERSION}.tar.bz2 +cd mbedtls-${VERSION} + +echo "Building mbedTLS ${VERSION} for ${PLATFORM} ${ARCH}" + +echo "Patching Makefile..." +patch -p1 < ../../patches/mbedtls-${VERSION}.patch + +echo "Please stand by..." + +TOOLCHAIN_PATH=$PS3DEV/ppu/bin/powerpc64-ps3-elf- +export CC=${TOOLCHAIN_PATH}gcc +export LD=${TOOLCHAIN_PATH}ld +export CPP=${TOOLCHAIN_PATH}cpp +export CXX=${TOOLCHAIN_PATH}g++ +export AR=${TOOLCHAIN_PATH}ar +export AS=${TOOLCHAIN_PATH}as +export NM=${TOOLCHAIN_PATH}nm +export CXXCPP=${TOOLCHAIN_PATH}cpp +export RANLIB=${TOOLCHAIN_PATH}ranlib +export LDFLAGS="-L$PS3DEV/ppu/powerpc64-ps3-elf/lib -L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2" +export CFLAGS="-I../include -I$PS3DEV/ppu/powerpc64-ps3-elf/include -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include -mcpu=cell" + +echo "Build library..." +## Compile and install. +cd library +jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu) +${MAKE:-make} -j"$jobs" + +cp lib*.a $PS3DEV/portlibs/ppu/lib/ +cp -R ../include/mbedtls $PS3DEV/portlibs/ppu/include/ +cp ../LICENSE $PS3DEV/portlibs/ppu/include/mbedtls/LICENSE + +echo "Building done." diff --git a/scripts/040-sdl2_psl1ght.sh b/scripts/040-sdl2_psl1ght.sh deleted file mode 100755 index 1bb7b781..00000000 --- a/scripts/040-sdl2_psl1ght.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -e -# sdl2_psl1ght.sh by Humberto Dias - -## Download the source code. -# SDL2 -#wget https://github.com/humbertodias/SDL2_PSL1GHT/tarball/master -O sdl2_psl1ght.tar.gz -#wget https://github.com/humbertodias/psl1ght-2.0.3/tarball/psl1ght-2.0.3 -O sdl2_psl1ght.tar.gz -wget https://github.com/humbertodias/sdl2_psl1ght_/tarball/psl1ght-2.30.1 -O sdl2_psl1ght.tar.gz - -## Unpack the source code. -rm -Rf sdl2_psl1ght && mkdir sdl2_psl1ght && tar --strip-components=1 --directory=sdl2_psl1ght -xvzf sdl2_psl1ght.tar.gz - -## Create the build directory. -cd sdl2_psl1ght - -## Compile and install. -./script.sh && ${MAKE:-make} && ${MAKE:-make} install - -# Copy sdl2-config to PATH -cp sdl2-config $PS3DEV/portlibs/ppu/bin diff --git a/scripts/041-sdl2_psl1ght_libs.sh b/scripts/041-sdl2_psl1ght_libs.sh deleted file mode 100755 index 34f5b493..00000000 --- a/scripts/041-sdl2_psl1ght_libs.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -e -# sdl2_psl1ght_libs.sh by Humberto Dias - -## Download the source code. -# SDL2 -wget https://github.com/humbertodias/SDL2_PSL1GHT_Libs/tarball/psl1ght-2.30.1 -O sdl2_psl1ght_libs.tar.gz - -## Unpack the source code. -rm -Rf sdl2_psl1ght_libs && mkdir sdl2_psl1ght_libs && tar --strip-components=1 --directory=sdl2_psl1ght_libs -xvzf sdl2_psl1ght_libs.tar.gz - -## Create the build directory. -cd sdl2_psl1ght_libs - -## Compile and install. -./make_SDL_Libs.sh diff --git a/scripts/042-yaml-cpp-0.8.0.sh b/scripts/042-yaml-cpp-0.8.0.sh deleted file mode 100755 index 1c38b53f..00000000 --- a/scripts/042-yaml-cpp-0.8.0.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -e -# yaml-cpp-0.8.0.sh by Humberto Dias - -## Download the source code. -wget https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz -O yaml-cpp.tar.gz - -## Unpack the source code. -rm -Rf yaml-cpp && mkdir yaml-cpp && tar --strip-components=1 --directory=yaml-cpp -xvzf yaml-cpp.tar.gz - -## Create the build directory. -cd yaml-cpp - -## Compile and install. -mkdir -p build && cd build -cmake -Wno-dev \ - -DCMAKE_INSTALL_PREFIX=${PS3DEV}/portlibs/ppu \ - -DCMAKE_C_COMPILER=ppu-gcc \ - -DCMAKE_CXX_COMPILER=ppu-g++ \ - -DBUILD_SHARED_LIBS=OFF -DYAML_ENABLE_PIC=OFF -DYAML_CPP_INSTALL=ON .. || { exit 1; } -make && make install || { exit 1; } \ No newline at end of file diff --git a/utils/gen-github-actions-tasks.sh b/utils/gen-github-actions-tasks.sh new file mode 100755 index 00000000..64c07749 --- /dev/null +++ b/utils/gen-github-actions-tasks.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="../scripts" + +echo " # ------------------------" +echo " # Build steps" +echo " # ------------------------" + +for script in "$SCRIPT_DIR"/*.sh; do + filename="$(basename "$script" .sh)" + + # Remove numeric prefix and convert dashes to spaces + name="${filename#[0-9][0-9][0-9]-}" + name="${name//-/ }" + + # Capitalize first letter of each word + name="$(echo "$name" | sed -E 's/(^| )([a-z])/\1\u\2/g')" + + echo " - name: Build $name" + echo " working-directory: ./build" + echo " run: ../scripts/$(basename "$script")" + echo +done \ No newline at end of file diff --git a/utils/utils.sh b/utils/utils.sh new file mode 100755 index 00000000..ea1011a9 --- /dev/null +++ b/utils/utils.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -eo pipefail + +# Extract an archive, with pv progress if available. +# Usage: extract [extra tar args...] +extract() { + local archive="$1" + shift + + if [ ! -f "$archive" ]; then + echo "extract: not a file: $archive" >&2 + return 1 + fi + + local -a flag=() + case "$archive" in + *.tar.xz|*.txz) flag=(-J) ;; + *.tar.gz|*.tgz) flag=(-z) ;; + *.tar.bz2|*.tbz2) flag=(-j) ;; + *.tar.zst) flag=(--zstd) ;; + *.tar) flag=() ;; + *) + echo "extract: unknown archive type: $archive" >&2 + return 1 + ;; + esac + + if command -v pv >/dev/null 2>&1; then + pv -pterab "$archive" | tar "${flag[@]}" -xf - "$@" + else + echo " (pv not found, extracting without progress)" + tar "${flag[@]}" -xf "$archive" "$@" + fi +} \ No newline at end of file From 3b7de88adea68bc24d0df737804d96397fa8650e Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sat, 5 Sep 2026 17:49:37 -0300 Subject: [PATCH 20/36] add 041-sdl2_psl1ght_libs.sh --- .github/workflows/build.yml | 14 +++++++------- archives/archives.txt | 1 + scripts/041-sdl2_psl1ght_libs.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100755 scripts/041-sdl2_psl1ght_libs.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8070f9f..67668a3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -204,22 +204,22 @@ jobs: - name: Build Libya2d run: ./libraries.sh 035 - - name: Build Bzip2 - run: ./libraries.sh 036 - - name: Build Dbglogger - run: ./libraries.sh 037 + run: ./libraries.sh 036 - name: Build Mini18n - run: ./libraries.sh 038 + run: ./libraries.sh 037 - name: Build Libansilove - run: ./libraries.sh 039 + run: ./libraries.sh 037 - name: Build Yaml-cpp 0.9.0 - run: ./libraries.sh 040 + run: ./libraries.sh 039 - name: Build MbedTLS 2.16.6 + run: ./libraries.sh 040 + + - name: Build SDL2 Libs run: ./libraries.sh 041 - name: Build Package diff --git a/archives/archives.txt b/archives/archives.txt index d2c6d87a..7a865364 100644 --- a/archives/archives.txt +++ b/archives/archives.txt @@ -39,3 +39,4 @@ b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc 1903175 https: - - https://github.com/bucanero/mini18n/tarball/master -> mini18n.tar.gz - - https://github.com/bucanero/libansilove/tarball/master -> libansilove.tar.gz 25cb043240f828a8c51beb830569634bc7ac603978e0f69d6b63558dadefd49a 1056093 https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.9.0.tar.gz -> yaml-cpp.tar.gz +- - https://github.com/humbertodias/SDL2_PSL1GHT_Libs/tarball/psl1ght-2.30.1 -> sdl2_psl1ght_libs.tar.gz diff --git a/scripts/041-sdl2_psl1ght_libs.sh b/scripts/041-sdl2_psl1ght_libs.sh new file mode 100755 index 00000000..38bd9ccf --- /dev/null +++ b/scripts/041-sdl2_psl1ght_libs.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -eo pipefail + +# sdl2_psl1ght_libs.sh by Humberto Dias + +## Source util functions +source ../utils/utils.sh + +## Download the source code. +../download.sh sdl2_psl1ght_libs.tar.gz + +## Fetch config.guess and config.sub, falling back to copies if Savannah is unavailable +../config/get-config-scripts.sh + +## Unpack the source code. +rm -Rf sdl2_psl1ght_libs +mkdir sdl2_psl1ght_libs +echo "Unpacking sdl2_psl1ght_libs" +extract ../archives/sdl2_psl1ght_libs.tar.gz --strip-components=1 --directory=sdl2_psl1ght_libs +cd sdl2_psl1ght_libs + +## Preload config.guess and config.sub +cp ../../archives/config.guess ../../archives/config.sub archives/ + +## Compile and install. +./make_SDL_Libs.sh From 37bb0051bbf7521ac75e7b879c70c29196496cea Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Sat, 5 Sep 2026 18:39:30 -0300 Subject: [PATCH 21/36] Build SDL 1.3/2.31 and add-on libraries from upstream tarballs with PPU patches --- .github/workflows/build.yml | 30 +- archives/archives.txt | 16 +- patches/SDL-1.3.0-PPU.patch | 5428 +++++++++++++++++ patches/SDL2-2.30.1-PPU.patch | 4476 ++++++++++++++ patches/SDL_image-1.2.10.patch | 12 + patches/SDL_mixer-1.2.11.patch | 105 + patches/SDL_net-1.2.7.patch | 27 + patches/SDL_ttf-2.0.10.patch | 12 + scripts/013-SDL-1.3.0.sh | 41 + scripts/013-sdl_psl1ght.sh | 21 - scripts/014-SDL2-2.31.0.sh | 40 + scripts/014-sdl2_psl1ght.sh | 21 - scripts/015-SDL_gfx-2.0.27.sh | 41 + scripts/015-sdl_psl1ght_libs.sh | 26 - scripts/016-SDL_image-1.2.10.sh | 42 + scripts/041-SDL_mixer-1.2.11.sh | 46 + scripts/041-sdl2_psl1ght_libs.sh | 26 - scripts/042-SDL_net-1.2.7.sh | 40 + scripts/043-SDL_ttf-2.0.10.sh | 41 + scripts/044-SDL2_image-2.8.2.sh | 43 + ...mixer-2.0.4.sh => 045-SDL2_mixer-2.8.0.sh} | 16 +- scripts/046-SDL2_ttf-2.22.0.sh | 41 + scripts/047-SDL2_gfx-1.0.4.sh | 40 + 23 files changed, 10517 insertions(+), 114 deletions(-) create mode 100644 patches/SDL-1.3.0-PPU.patch create mode 100644 patches/SDL2-2.30.1-PPU.patch create mode 100644 patches/SDL_image-1.2.10.patch create mode 100644 patches/SDL_mixer-1.2.11.patch create mode 100644 patches/SDL_net-1.2.7.patch create mode 100644 patches/SDL_ttf-2.0.10.patch create mode 100755 scripts/013-SDL-1.3.0.sh delete mode 100755 scripts/013-sdl_psl1ght.sh create mode 100755 scripts/014-SDL2-2.31.0.sh delete mode 100755 scripts/014-sdl2_psl1ght.sh create mode 100755 scripts/015-SDL_gfx-2.0.27.sh delete mode 100755 scripts/015-sdl_psl1ght_libs.sh create mode 100755 scripts/016-SDL_image-1.2.10.sh create mode 100755 scripts/041-SDL_mixer-1.2.11.sh delete mode 100755 scripts/041-sdl2_psl1ght_libs.sh create mode 100755 scripts/042-SDL_net-1.2.7.sh create mode 100755 scripts/043-SDL_ttf-2.0.10.sh create mode 100755 scripts/044-SDL2_image-2.8.2.sh rename scripts/{016-SDL2_mixer-2.0.4.sh => 045-SDL2_mixer-2.8.0.sh} (73%) create mode 100755 scripts/046-SDL2_ttf-2.22.0.sh create mode 100755 scripts/047-SDL2_gfx-1.0.4.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67668a3a..04a254a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,16 +135,16 @@ jobs: - name: Build Libxml2 2.9.12 run: ./libraries.sh 012 - - name: Build Sdl_psl1ght + - name: Build SDL 1.3.0 run: ./libraries.sh 013 - - name: Build Sdl2_psl1ght + - name: Build SDL2 2.31.0 run: ./libraries.sh 014 - - name: Build Sdl_psl1ght_libs + - name: Build SDL_gfx 2.0.27 run: ./libraries.sh 015 - - name: Build SDL2_mixer 2.0.4 + - name: Build SDL_image 1.2.10 run: ./libraries.sh 016 - name: Build Polarssl 1.3.9 @@ -211,7 +211,7 @@ jobs: run: ./libraries.sh 037 - name: Build Libansilove - run: ./libraries.sh 037 + run: ./libraries.sh 038 - name: Build Yaml-cpp 0.9.0 run: ./libraries.sh 039 @@ -219,9 +219,27 @@ jobs: - name: Build MbedTLS 2.16.6 run: ./libraries.sh 040 - - name: Build SDL2 Libs + - name: Build SDL_mixer 1.2.11 run: ./libraries.sh 041 + - name: Build SDL_net 1.2.7 + run: ./libraries.sh 042 + + - name: Build SDL_ttf 2.0.10 + run: ./libraries.sh 043 + + - name: Build SDL2_image 2.8.2 + run: ./libraries.sh 044 + + - name: Build SDL2_mixer 2.8.0 + run: ./libraries.sh 045 + + - name: Build SDL2_ttf 2.22.0 + run: ./libraries.sh 046 + + - name: Build SDL2_gfx 1.0.4 + run: ./libraries.sh 047 + - name: Build Package run: | cd $PSL1GHT diff --git a/archives/archives.txt b/archives/archives.txt index 7a865364..b05fff69 100644 --- a/archives/archives.txt +++ b/archives/archives.txt @@ -10,7 +10,17 @@ e63f5dc1b33fd1c02a881d5a819620634a69d1e4ce8637261ca0cb0fbc9f9dca 304965 https: 67b76d075fb74f7cb32e7e4b217701674755fe6cee0f463b259a753fce691da6 1436968 https://download.osgeo.org/libtiff/old/tiff-3.9.4.tar.gz 2d7598cd2a8c61c023f27c9c7c1aca8bbfd92aadbee2f98b7a6d421eae35c929 611590 https://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92 5681632 http://xmlsoft.org/sources/libxml2-2.9.12.tar.gz -b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419 11125077 https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz +dfb15ac5f8ce7a4952dc12d2aed9747518c5e6b335c0e31636d23f93c630f419 1693451 http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-2.0.27.tar.gz +75e05d1e95f6277b44797157d9e25a908ba8d08a393216ffb019b0d74de11876 1332906 https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.tar.gz +86145ac39cac6d2c6169c226f937648dca5e89dcd828751763dd174fa9af9cf9 2690654 https://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11.tar.gz +2ce7c84e62ff8117b9f205758bcce68ea603e08bc9d6936ded343735b8b77c53 373866 https://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.7.tar.gz +7d38704bcc7c34029c2dcb73b2d4857e8ad76341c6e0faed279eb9f743c66c6a 1326737 https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.10.tar.gz +8f486bbfbcf8464dd58c9e5d93394ab0255ce68b51c5a966a918244820a76ddc 11362515 https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.2/SDL2_image-2.8.2.tar.gz +1cfb34c87b26dbdbc7afd68c4f545c0116ab5f90bbfecc5aebe2a9cb4bb31549 10874471 https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.tar.gz +d48cbd1ce475b9e178206bf3b72d56b66d84d44f64ac05803328396234d67723 14314901 https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-2.22.0.tar.gz +63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262 1230588 http://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.4.tar.gz +0ac2ccd1449d9126b021428473137cc8255c60e624b955fef21ee5313db084f2 4526286 https://web.archive.org/web/20110715000000id_/http://www.libsdl.org/tmp/SDL-1.3.tar.gz -> SDL-1.3.0.tar.gz +01215ffbc8cfc4ad165ba7573750f15ddda1f971d5a66e9dcaffd37c587f473a 7428023 https://github.com/libsdl-org/SDL/releases/download/release-2.30.1/SDL2-2.30.1.tar.gz d3605afc28ed4b7d1d9e3142d72e42855e4a23c07c951bbb0299556b02d36755 1741396 https://mirror2.openwrt.org/sources/polarssl-1.3.9-gpl.tgz 432d3f466644b9416bc5b649d344116a753aeaa520c8beaf024a90cba9d3d35d 4008103 https://curl.haxx.se/download/curl-7.64.1.tar.gz bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690 502379 https://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz @@ -19,9 +29,6 @@ ee26ed1e177c0cd8fa8458a481b14a0b24ca0b51468c8b4c8b676fd3ceccd330 1137407 https: b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc 1903175 https://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 9988283408c71838d8d62e5418e5abb5eb5300bd84c385fdc96143b5e8f10ed5 455089 https://codeload.github.com/json-c/json-c/tar.gz/json-c-0.11-20130402 -> json-c-0.11-20130402.tar.gz 19e5b81fdac0fe22009b9e2bdcd52d7dcafbf62bc67fc59cf0a76b5b5540d149 3489179 https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-2.28.10/mbedtls-2.28.10.tar.bz2 -- - https://github.com/zeldin/SDL_PSL1GHT/tarball/master -> sdl_psl1ght.tar.gz -- - https://github.com/zeldin/SDL_PSL1GHT_Libs/tarball/master -> sdl_psl1ght_libs.tar.gz -- - https://github.com/shagkur/SDL_PSL1GHT/archive/refs/heads/sdl2_master.tar.gz -> sdl2_psl1ght.tar.gz - - https://github.com/wargio/NoRSX/tarball/master -> NoRSX.tar.gz - - https://github.com/sergiou87/ps3debugnet/tarball/master -> ps3debugnet.tar.gz - - https://github.com/wargio/ps3soundlib/tarball/master -> ps3soundlib.tar.gz @@ -39,4 +46,3 @@ b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc 1903175 https: - - https://github.com/bucanero/mini18n/tarball/master -> mini18n.tar.gz - - https://github.com/bucanero/libansilove/tarball/master -> libansilove.tar.gz 25cb043240f828a8c51beb830569634bc7ac603978e0f69d6b63558dadefd49a 1056093 https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.9.0.tar.gz -> yaml-cpp.tar.gz -- - https://github.com/humbertodias/SDL2_PSL1GHT_Libs/tarball/psl1ght-2.30.1 -> sdl2_psl1ght_libs.tar.gz diff --git a/patches/SDL-1.3.0-PPU.patch b/patches/SDL-1.3.0-PPU.patch new file mode 100644 index 00000000..789e563d --- /dev/null +++ b/patches/SDL-1.3.0-PPU.patch @@ -0,0 +1,5428 @@ +diff -Nru SDL-1.3.0/build-scripts/showrev.sh SDL-1.3.0/build-scripts/showrev.sh +--- SDL-1.3.0/build-scripts/showrev.sh 2011-02-20 15:45:10 ++++ SDL-1.3.0/build-scripts/showrev.sh 2026-09-05 18:29:53 +@@ -4,4 +4,4 @@ + + # FIXME: this prints the tip, which isn't useful if you're on a different + # branch, or just not sync'd to the tip. +-hg tip --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1) ++hg tip --template 'hg-{rev}:{node|short}' || git describe --tags --match=BEGIN --always | sed -e 's/^BEGIN-/git-/' || (echo "hg-0:baadf00d"; exit 1) +diff -Nru SDL-1.3.0/build-scripts/updaterev.sh SDL-1.3.0/build-scripts/updaterev.sh +--- SDL-1.3.0/build-scripts/updaterev.sh 2011-02-20 15:45:10 ++++ SDL-1.3.0/build-scripts/updaterev.sh 2026-09-05 18:29:53 +@@ -7,9 +7,15 @@ + srcdir=.. + header=$outdir/include/SDL_revision.h + ++if [ -f $header ]; then :; else ++ cat >$header </dev/null` + if [ "$rev" != "" -a "$rev" != "hg-0:baadf00d" ]; then +- revnum=`echo $rev | sed 's,hg-\([0-9]*\).*,\1,'` ++ revnum=`echo $rev | sed 's,\(hg\|git\)-\([0-9]*\).*,\2,'` + echo "#define SDL_REVISION \"$rev\"" >$header.new + echo "#define SDL_REVISION_NUMBER $revnum" >>$header.new + if diff $header $header.new >/dev/null 2>&1; then +diff -Nru SDL-1.3.0/configure.in SDL-1.3.0/configure.in +--- SDL-1.3.0/configure.in 2011-06-26 00:32:34 ++++ SDL-1.3.0/configure.in 2026-09-05 18:29:53 +@@ -280,25 +280,6 @@ + fi + fi + +-# Check for pthread implementation +-AC_MSG_CHECKING(for pthread spinlock) +-have_pthread_spinlock=no +- +-AC_TRY_LINK([ +-#include +-],[ +-pthread_spinlock_t a; +-pthread_spin_trylock(&a); +-pthread_spin_unlock(&a); +-],[ +-have_pthread_spinlock=yes +-]) +-AC_MSG_RESULT($have_pthread_spinlock) +-if test x$have_pthread_spinlock = xyes; then +- AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ]) +-fi +- +- + # Standard C sources + SOURCES="$SOURCES $srcdir/src/*.c" + SOURCES="$SOURCES $srcdir/src/atomic/*.c" +@@ -1398,6 +1379,21 @@ + fi + } + ++ ++dnl Set up the Null video driver. ++CheckPSL1GHTVideo() ++{ ++ AC_ARG_ENABLE(video-psl1ght, ++AC_HELP_STRING([--enable-video-psl1ght], [use PSL1GHT video driver [[default=yes]]]), ++ , enable_video_psl1ght=yes) ++ if test x$enable_video_psl1ght = xyes; then ++ AC_DEFINE(SDL_VIDEO_DRIVER_PSL1GHT, 1, [ ]) ++ AC_DEFINE(SDL_VIDEO_RENDER_PSL1GHT, 1, [ ]) ++ SOURCES="$SOURCES $srcdir/src/video/psl1ght/*.c" ++ have_video=yes ++ fi ++} ++ + dnl rcg04172001 Set up the Null video driver. + CheckDummyVideo() + { +@@ -2339,6 +2335,42 @@ + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" + fi + ;; ++ powerpc64-ps3-elf) ++ ARCH=psl1ght ++ EXTRA_CFLAGS="$EXTRA_CFLAGS -D__PSL1GHT__ -DHAVE_POW -DHAVE_MMAP=0 -DDEBUG_ERROR" ++ EXTRA_CFLAGS="$EXTRA_CFLAGS -I\"$PSL1GHT/ppu/include\" -mcpu=cell " ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgcm_sys -lrsx -lsysutil -lio -laudio -lrt -llv2" ++ CheckPSL1GHTVideo ++ #CheckDummyAudio ++ # Set up files for the thread library ++ if test x$enable_threads = xyes; then ++ AC_DEFINE(SDL_THREAD_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/thread/psl1ght/*.c" ++ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" ++ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" ++ have_threads=yes ++ fi ++ # Set up files for the joystick library ++ if test x$enable_joystick = xyes; then ++ AC_DEFINE(SDL_JOYSTICK_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/joystick/psl1ght/*.c" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lio" ++ have_joystick=yes ++ fi ++ # Set up files for the timer library ++ if test x$enable_timers = xyes; then ++ AC_DEFINE(SDL_TIMER_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/timer/psl1ght/*.c" ++ have_timers=yes ++ fi ++ # Set up files for the audio library ++ if test x$enable_audio = xyes; then ++ AC_DEFINE(SDL_AUDIO_DRIVER_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/audio/psl1ght/*.c" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio" ++ have_audio=yes ++ fi ++ ;; + *) + AC_MSG_ERROR([ + *** Unsupported host: Please add to configure.in +diff -Nru SDL-1.3.0/include/SDL_assert.h SDL-1.3.0/include/SDL_assert.h +--- SDL-1.3.0/include/SDL_assert.h 2011-06-26 00:32:34 ++++ SDL-1.3.0/include/SDL_assert.h 2026-09-05 18:29:53 +@@ -99,7 +99,7 @@ + SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ + SDL_ASSERTION_ABORT, /**< Terminate the program. */ + SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ +- SDL_ASSERTION_ALWAYS_IGNORE, /**< Ignore the assert from now on. */ ++ SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ + } SDL_assert_state; + + typedef struct SDL_assert_data +diff -Nru SDL-1.3.0/include/SDL_config.h SDL-1.3.0/include/SDL_config.h +--- SDL-1.3.0/include/SDL_config.h 2011-04-08 17:07:03 ++++ SDL-1.3.0/include/SDL_config.h 2026-09-05 18:29:53 +@@ -1,3 +1,4 @@ ++/* include/SDL_config.h. Generated from SDL_config.h.in by configure. */ + /* + Simple DirectMedia Layer + Copyright (C) 1997-2011 Sam Lantinga +@@ -22,27 +23,281 @@ + #ifndef _SDL_config_h + #define _SDL_config_h + +-#include "SDL_platform.h" +- + /** +- * \file SDL_config.h ++ * \file SDL_config.h.in + * +- * SDL_config.h for any platform that doesn't build using the configure system. ++ * This is a set of defines to configure the SDL features + */ +- +-/* Add any platform that doesn't build using the configure system. */ +-#if defined(__WIN32__) +-#include "SDL_config_windows.h" +-#elif defined(__MACOSX__) +-#include "SDL_config_macosx.h" +-#elif defined(__IPHONEOS__) +-#include "SDL_config_iphoneos.h" +-#elif defined(__ANDROID__) +-#include "SDL_config_android.h" +-#elif defined(__NINTENDODS__) +-#include "SDL_config_nintendods.h" ++ ++/* General platform specific identifiers */ ++#include "SDL_platform.h" ++ ++/* Make sure that this isn't included by Visual C++ */ ++#ifdef _MSC_VER ++#error You should run hg revert SDL_config.h ++#endif ++ ++/* C language features */ ++/* #undef const */ ++/* #undef inline */ ++/* #undef volatile */ ++ ++/* C datatypes */ ++#define SIZEOF_VOIDP 8 ++#define HAVE_GCC_ATOMICS 1 ++/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */ ++ ++/* Comment this if you want to build without any C library requirements */ ++#define HAVE_LIBC 1 ++#if HAVE_LIBC ++ ++/* Useful headers */ ++#define HAVE_ALLOCA_H 1 ++#define HAVE_SYS_TYPES_H 1 ++#define HAVE_STDIO_H 1 ++#define STDC_HEADERS 1 ++#define HAVE_STDLIB_H 1 ++#define HAVE_STDARG_H 1 ++#define HAVE_MALLOC_H 1 ++/* #undef HAVE_MEMORY_H */ ++#define HAVE_STRING_H 1 ++#define HAVE_STRINGS_H 1 ++#define HAVE_INTTYPES_H 1 ++#define HAVE_STDINT_H 1 ++#define HAVE_CTYPE_H 1 ++#define HAVE_MATH_H 1 ++#define HAVE_ICONV_H 1 ++#define HAVE_SIGNAL_H 1 ++#define HAVE_ALTIVEC_H 1 ++ ++/* C library functions */ ++#define HAVE_MALLOC 1 ++#define HAVE_CALLOC 1 ++#define HAVE_REALLOC 1 ++#define HAVE_FREE 1 ++#define HAVE_ALLOCA 1 ++#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ ++#define HAVE_GETENV 1 ++#define HAVE_SETENV 1 ++#define HAVE_PUTENV 1 ++#define HAVE_UNSETENV 1 ++#endif ++#define HAVE_QSORT 1 ++#define HAVE_ABS 1 ++#define HAVE_BCOPY 1 ++#define HAVE_MEMSET 1 ++#define HAVE_MEMCPY 1 ++#define HAVE_MEMMOVE 1 ++/* #undef HAVE_MEMCMP */ ++#define HAVE_STRLEN 1 ++#define HAVE_STRLCPY 1 ++#define HAVE_STRLCAT 1 ++#define HAVE_STRDUP 1 ++/* #undef HAVE__STRREV */ ++/* #undef HAVE__STRUPR */ ++/* #undef HAVE__STRLWR */ ++/* #undef HAVE_INDEX */ ++/* #undef HAVE_RINDEX */ ++#define HAVE_STRCHR 1 ++#define HAVE_STRRCHR 1 ++#define HAVE_STRSTR 1 ++/* #undef HAVE_ITOA */ ++/* #undef HAVE__LTOA */ ++/* #undef HAVE__UITOA */ ++/* #undef HAVE__ULTOA */ ++#define HAVE_STRTOL 1 ++#define HAVE_STRTOUL 1 ++/* #undef HAVE__I64TOA */ ++/* #undef HAVE__UI64TOA */ ++#define HAVE_STRTOLL 1 ++#define HAVE_STRTOULL 1 ++/* #undef HAVE_STRTOD */ ++#define HAVE_ATOI 1 ++#define HAVE_ATOF 1 ++#define HAVE_STRCMP 1 ++#define HAVE_STRNCMP 1 ++/* #undef HAVE__STRICMP */ ++#define HAVE_STRCASECMP 1 ++/* #undef HAVE__STRNICMP */ ++#define HAVE_STRNCASECMP 1 ++#define HAVE_SSCANF 1 ++#define HAVE_SNPRINTF 1 ++#define HAVE_VSNPRINTF 1 ++#define HAVE_M_PI /**/ ++#define HAVE_ATAN 1 ++#define HAVE_ATAN2 1 ++#define HAVE_CEIL 1 ++#define HAVE_COPYSIGN 1 ++#define HAVE_COS 1 ++#define HAVE_COSF 1 ++#define HAVE_FABS 1 ++#define HAVE_FLOOR 1 ++#define HAVE_LOG 1 ++/* #undef HAVE_POW */ ++#define HAVE_SCALBN 1 ++#define HAVE_SIN 1 ++#define HAVE_SINF 1 ++#define HAVE_SQRT 1 ++/* #undef HAVE_SIGACTION */ ++#define HAVE_SETJMP 1 ++/* #undef HAVE_NANOSLEEP */ ++#ifndef __PSL1GHT__ // Yeah PSL1GHT hasn't sysconf ++/* #undef HAVE_SYSCONF */ ++#endif ++/* #undef HAVE_SYSCTLBYNAME */ ++/* #undef HAVE_CLOCK_GETTIME */ ++/* #undef HAVE_GETPAGESIZE */ ++/* #undef HAVE_MPROTECT */ ++/* #undef HAVE_ICONV */ ++ + #else +-#include "SDL_config_minimal.h" +-#endif /* platform config */ ++/* We may need some replacement for stdarg.h here */ ++#include ++#endif /* HAVE_LIBC */ ++ ++/* SDL internal assertion support */ ++/* #undef SDL_DEFAULT_ASSERT_LEVEL */ ++ ++/* Allow disabling of core subsystems */ ++/* #undef SDL_ATOMIC_DISABLED */ ++/* #undef SDL_AUDIO_DISABLED */ ++/* #undef SDL_CPUINFO_DISABLED */ ++/* #undef SDL_EVENTS_DISABLED */ ++/* #undef SDL_FILE_DISABLED */ ++/* #undef SDL_JOYSTICK_DISABLED */ ++#define SDL_HAPTIC_DISABLED 1 ++#define SDL_LOADSO_DISABLED 1 ++/* #undef SDL_RENDER_DISABLED */ ++/* #undef SDL_THREADS_DISABLED */ ++/* #undef SDL_TIMERS_DISABLED */ ++/* #undef SDL_VIDEO_DISABLED */ ++/* #undef SDL_POWER_DISABLED */ ++ ++/* Enable various audio drivers */ ++/* #undef SDL_AUDIO_DRIVER_ALSA */ ++/* #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC */ ++/* #undef SDL_AUDIO_DRIVER_ARTS */ ++/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */ ++/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO */ ++/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */ ++/* #undef SDL_AUDIO_DRIVER_BEOSAUDIO */ ++/* #undef SDL_AUDIO_DRIVER_BSD */ ++/* #undef SDL_AUDIO_DRIVER_COREAUDIO */ ++/* #undef SDL_AUDIO_DRIVER_DISK */ ++/* #undef SDL_AUDIO_DRIVER_DUMMY */ ++/* #undef SDL_AUDIO_DRIVER_DSOUND */ ++/* #undef SDL_AUDIO_DRIVER_ESD */ ++/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */ ++/* #undef SDL_AUDIO_DRIVER_NAS */ ++/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */ ++/* #undef SDL_AUDIO_DRIVER_NDS */ ++/* #undef SDL_AUDIO_DRIVER_OSS */ ++/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */ ++/* #undef SDL_AUDIO_DRIVER_PAUDIO */ ++#define SDL_AUDIO_DRIVER_PSL1GHT 1 ++/* #undef SDL_AUDIO_DRIVER_QSA */ ++/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */ ++/* #undef SDL_AUDIO_DRIVER_WINWAVEOUT */ ++/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND */ ++/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */ ++ ++/* Enable various input drivers */ ++/* #undef SDL_INPUT_LINUXEV */ ++/* #undef SDL_INPUT_TSLIB */ ++/* #undef SDL_JOYSTICK_BEOS */ ++/* #undef SDL_JOYSTICK_DINPUT */ ++/* #undef SDL_JOYSTICK_DUMMY */ ++/* #undef SDL_JOYSTICK_IOKIT */ ++/* #undef SDL_JOYSTICK_LINUX */ ++/* #undef SDL_JOYSTICK_NDS */ ++/* #undef SDL_JOYSTICK_WINMM */ ++/* #undef SDL_JOYSTICK_USBHID */ ++/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */ ++#define SDL_JOYSTICK_PSL1GHT 1 ++/* #undef SDL_HAPTIC_DUMMY */ ++/* #undef SDL_HAPTIC_LINUX */ ++/* #undef SDL_HAPTIC_IOKIT */ ++/* #undef SDL_HAPTIC_DINPUT */ ++ ++/* Enable various shared object loading systems */ ++/* #undef SDL_LOADSO_BEOS */ ++/* #undef SDL_LOADSO_DLCOMPAT */ ++/* #undef SDL_LOADSO_DLOPEN */ ++/* #undef SDL_LOADSO_DUMMY */ ++/* #undef SDL_LOADSO_LDG */ ++/* #undef SDL_LOADSO_WINDOWS */ ++ ++/* Enable various threading systems */ ++/* #undef SDL_THREAD_BEOS */ ++/* #undef SDL_THREAD_NDS */ ++#define SDL_THREAD_PSL1GHT 1 ++/* #undef SDL_THREAD_PTHREAD */ ++/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX */ ++/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */ ++/* #undef SDL_THREAD_SPROC */ ++/* #undef SDL_THREAD_WINDOWS */ ++ ++/* Enable various timer systems */ ++/* #undef SDL_TIMER_BEOS */ ++/* #undef SDL_TIMER_DUMMY */ ++/* #undef SDL_TIMER_NDS */ ++#define SDL_TIMER_PSL1GHT 1 ++/* #undef SDL_TIMER_UNIX */ ++/* #undef SDL_TIMER_WINDOWS */ ++/* #undef SDL_TIMER_WINCE */ ++ ++/* Enable various video drivers */ ++/* #undef SDL_VIDEO_DRIVER_BWINDOW */ ++/* #undef SDL_VIDEO_DRIVER_COCOA */ ++/* #undef SDL_VIDEO_DRIVER_DIRECTFB */ ++/* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */ ++/* #undef SDL_VIDEO_DRIVER_DUMMY */ ++/* #undef SDL_VIDEO_DRIVER_NDS */ ++#define SDL_VIDEO_DRIVER_PSL1GHT 1 ++/* #undef SDL_VIDEO_DRIVER_WINDOWS */ ++/* #undef SDL_VIDEO_DRIVER_X11 */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE */ ++/* #undef SDL_VIDEO_DRIVER_X11_XCURSOR */ ++/* #undef SDL_VIDEO_DRIVER_X11_XINERAMA */ ++/* #undef SDL_VIDEO_DRIVER_X11_XINPUT */ ++/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */ ++/* #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER */ ++/* #undef SDL_VIDEO_DRIVER_X11_XSHAPE */ ++/* #undef SDL_VIDEO_DRIVER_X11_XVIDMODE */ ++ ++/* #undef SDL_VIDEO_RENDER_D3D */ ++/* #undef SDL_VIDEO_RENDER_OGL */ ++/* #undef SDL_VIDEO_RENDER_OGL_ES */ ++/* #undef SDL_VIDEO_RENDER_DIRECTFB */ ++#define SDL_VIDEO_RENDER_PSL1GHT 1 ++ ++/* Enable OpenGL support */ ++/* #undef SDL_VIDEO_OPENGL */ ++/* #undef SDL_VIDEO_OPENGL_ES */ ++/* #undef SDL_VIDEO_OPENGL_BGL */ ++/* #undef SDL_VIDEO_OPENGL_CGL */ ++/* #undef SDL_VIDEO_OPENGL_GLX */ ++/* #undef SDL_VIDEO_OPENGL_WGL */ ++/* #undef SDL_VIDEO_OPENGL_OSMESA */ ++/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */ ++ ++/* Enable system power support */ ++/* #undef SDL_POWER_LINUX */ ++/* #undef SDL_POWER_WINDOWS */ ++/* #undef SDL_POWER_MACOSX */ ++/* #undef SDL_POWER_BEOS */ ++/* #undef SDL_POWER_NINTENDODS */ ++/* #undef SDL_POWER_HARDWIRED */ ++ ++/* Enable assembly routines */ ++#define SDL_ASSEMBLY_ROUTINES 1 ++#define SDL_ALTIVEC_BLITTERS 1 + + #endif /* _SDL_config_h */ +diff -Nru SDL-1.3.0/include/SDL_config.h.in SDL-1.3.0/include/SDL_config.h.in +--- SDL-1.3.0/include/SDL_config.h.in 2011-06-26 00:32:34 ++++ SDL-1.3.0/include/SDL_config.h.in 2026-09-05 18:29:53 +@@ -45,7 +45,6 @@ + #undef SIZEOF_VOIDP + #undef HAVE_GCC_ATOMICS + #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET +-#undef HAVE_PTHREAD_SPINLOCK + + /* Comment this if you want to build without any C library requirements */ + #undef HAVE_LIBC +@@ -141,7 +140,9 @@ + #undef HAVE_SIGACTION + #undef HAVE_SETJMP + #undef HAVE_NANOSLEEP ++#ifndef __PSL1GHT__ // Yeah PSL1GHT hasn't sysconf + #undef HAVE_SYSCONF ++#endif + #undef HAVE_SYSCTLBYNAME + #undef HAVE_CLOCK_GETTIME + #undef HAVE_GETPAGESIZE +@@ -192,6 +193,7 @@ + #undef SDL_AUDIO_DRIVER_OSS + #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H + #undef SDL_AUDIO_DRIVER_PAUDIO ++#undef SDL_AUDIO_DRIVER_PSL1GHT + #undef SDL_AUDIO_DRIVER_QSA + #undef SDL_AUDIO_DRIVER_SUNAUDIO + #undef SDL_AUDIO_DRIVER_WINWAVEOUT +@@ -210,6 +212,7 @@ + #undef SDL_JOYSTICK_WINMM + #undef SDL_JOYSTICK_USBHID + #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H ++#undef SDL_JOYSTICK_PSL1GHT + #undef SDL_HAPTIC_DUMMY + #undef SDL_HAPTIC_LINUX + #undef SDL_HAPTIC_IOKIT +@@ -226,6 +229,7 @@ + /* Enable various threading systems */ + #undef SDL_THREAD_BEOS + #undef SDL_THREAD_NDS ++#undef SDL_THREAD_PSL1GHT + #undef SDL_THREAD_PTHREAD + #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX + #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +@@ -236,6 +240,7 @@ + #undef SDL_TIMER_BEOS + #undef SDL_TIMER_DUMMY + #undef SDL_TIMER_NDS ++#undef SDL_TIMER_PSL1GHT + #undef SDL_TIMER_UNIX + #undef SDL_TIMER_WINDOWS + #undef SDL_TIMER_WINCE +@@ -247,6 +252,7 @@ + #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC + #undef SDL_VIDEO_DRIVER_DUMMY + #undef SDL_VIDEO_DRIVER_NDS ++#undef SDL_VIDEO_DRIVER_PSL1GHT + #undef SDL_VIDEO_DRIVER_WINDOWS + #undef SDL_VIDEO_DRIVER_X11 + #undef SDL_VIDEO_DRIVER_X11_DYNAMIC +@@ -269,6 +275,7 @@ + #undef SDL_VIDEO_RENDER_OGL + #undef SDL_VIDEO_RENDER_OGL_ES + #undef SDL_VIDEO_RENDER_DIRECTFB ++#undef SDL_VIDEO_RENDER_PSL1GHT + + /* Enable OpenGL support */ + #undef SDL_VIDEO_OPENGL +diff -Nru SDL-1.3.0/include/SDL_endian.h SDL-1.3.0/include/SDL_endian.h +--- SDL-1.3.0/include/SDL_endian.h 2011-04-08 17:07:03 ++++ SDL-1.3.0/include/SDL_endian.h 2026-09-05 18:29:53 +@@ -47,7 +47,7 @@ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ +- defined(__sparc__) ++ defined(__PPC__) || defined(__powerpc__) || defined(__sparc__) + #define SDL_BYTEORDER SDL_BIG_ENDIAN + #else + #define SDL_BYTEORDER SDL_LIL_ENDIAN +diff -Nru SDL-1.3.0/include/SDL_hints.h SDL-1.3.0/include/SDL_hints.h +--- SDL-1.3.0/include/SDL_hints.h 2011-06-26 00:32:34 ++++ SDL-1.3.0/include/SDL_hints.h 2026-09-05 18:29:53 +@@ -118,31 +118,6 @@ + * By default SDL does not sync screen surface updates with vertical refresh. + */ + #define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" +- +-/** +- * \brief A variable controlling whether the idle timer is disabled on iOS. +- * +- * When an iOS app does not receive touches for some time, the screen is +- * dimmed automatically. For games where the accelerometer is the only input +- * this is problematic. This functionality can be disabled by setting this +- * hint. +- * +- * This variable can be set to the following values: +- * "0" - Enable idle timer +- * "1" - Disable idle timer +- */ +-#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" +- +-/** +- * \brief A variable controlling which orientations are allowed on iOS. +- * +- * In some circumstances it is necessary to be able to explicitly control +- * which UI orientations are allowed. +- * +- * This variable is a space delimited list of the following values: +- * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" +- */ +-#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" + + + /** +diff -Nru SDL-1.3.0/include/SDL_platform.h SDL-1.3.0/include/SDL_platform.h +--- SDL-1.3.0/include/SDL_platform.h 2011-04-08 17:07:03 ++++ SDL-1.3.0/include/SDL_platform.h 2026-09-05 18:29:53 +@@ -133,6 +133,11 @@ + #define __NINTENDODS__ 1 + #endif + ++#if defined(__PSL1GHT__) ++#undef __PSL1GHT__ ++#define __PSL1GHT__ 1 ++#endif ++ + + #include "begin_code.h" + /* Set up for C function definitions, even when using C++ */ +diff -Nru SDL-1.3.0/include/SDL_quit.h SDL-1.3.0/include/SDL_quit.h +--- SDL-1.3.0/include/SDL_quit.h 2011-06-26 00:32:34 ++++ SDL-1.3.0/include/SDL_quit.h 2026-09-05 18:29:53 +@@ -53,6 +53,6 @@ + /* There are no functions directly affecting the quit event */ + + #define SDL_QuitRequested() \ +- (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) ++ (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT)) + + #endif /* _SDL_quit_h */ +diff -Nru SDL-1.3.0/include/SDL_revision.h SDL-1.3.0/include/SDL_revision.h +--- SDL-1.3.0/include/SDL_revision.h 2011-06-26 00:32:34 ++++ SDL-1.3.0/include/SDL_revision.h 1969-12-31 21:00:00 +@@ -1,2 +0,0 @@ +-#define SDL_REVISION "hg-5557:c1ed57cbfd66" +-#define SDL_REVISION_NUMBER 5557 +diff -Nru SDL-1.3.0/src/SDL.c SDL-1.3.0/src/SDL.c +--- SDL-1.3.0/src/SDL.c 2011-04-08 17:07:03 ++++ SDL-1.3.0/src/SDL.c 2026-09-05 18:29:53 +@@ -239,7 +239,7 @@ + int + SDL_GetRevisionNumber(void) + { +- return SDL_REVISION_NUMBER; ++ return 0; + } + + /* Get the name of the platform */ +diff -Nru SDL-1.3.0/src/SDL_compat.c SDL-1.3.0/src/SDL_compat.c +--- SDL-1.3.0/src/SDL_compat.c 2011-04-08 17:07:03 ++++ SDL-1.3.0/src/SDL_compat.c 2026-09-05 18:29:53 +@@ -636,6 +636,31 @@ + return SDL_PublicSurface; + } + ++void ++SDL_VideoQuitCompat(void) ++{ ++ /* Destroy existing window */ ++ SDL_PublicSurface = NULL; ++ if (SDL_ShadowSurface) { ++ SDL_ShadowSurface->flags &= ~SDL_DONTFREE; ++ SDL_FreeSurface(SDL_ShadowSurface); ++ SDL_ShadowSurface = NULL; ++ } ++ if (SDL_VideoSurface) { ++ SDL_VideoSurface->flags &= ~SDL_DONTFREE; ++ SDL_FreeSurface(SDL_VideoSurface); ++ SDL_VideoSurface = NULL; ++ } ++ if (SDL_VideoContext) { ++ /* SDL_GL_MakeCurrent(0, NULL); *//* Doesn't do anything */ ++ SDL_GL_DeleteContext(SDL_VideoContext); ++ SDL_VideoContext = NULL; ++ } ++ if (SDL_VideoWindow) { ++ SDL_DestroyWindow(SDL_VideoWindow); ++ } ++} ++ + SDL_Surface * + SDL_GetVideoSurface(void) + { +@@ -962,7 +987,7 @@ + void + SDL_WarpMouse(Uint16 x, Uint16 y) + { +- SDL_WarpMouseInWindow(SDL_VideoWindow, x, y); ++ SDL_WarpMouseInWindow(SDL_VideoWindow, x + SDL_VideoViewport.x, y + SDL_VideoViewport.y); + } + + Uint8 +diff -Nru SDL-1.3.0/src/SDL_hints.c SDL-1.3.0/src/SDL_hints.c +--- SDL-1.3.0/src/SDL_hints.c 2011-06-26 00:32:34 ++++ SDL-1.3.0/src/SDL_hints.c 2026-09-05 18:29:53 +@@ -21,7 +21,6 @@ + #include "SDL_config.h" + + #include "SDL_hints.h" +-#include "SDL_hints_c.h" + + + /* Assuming there aren't many hints set and they aren't being queried in +@@ -31,26 +30,11 @@ + char *name; + char *value; + SDL_HintPriority priority; +- SDL_HintChangedCb callback; + struct SDL_Hint *next; + } SDL_Hint; + + static SDL_Hint *SDL_hints; + +-SDL_bool +-SDL_RegisterHintChangedCb(const char *name, SDL_HintChangedCb hintCb) +-{ +- SDL_Hint *hint; +- +- for (hint = SDL_hints; hint; hint = hint->next) { +- if (SDL_strcmp(name, hint->name) == 0) { +- hint->callback = hintCb; +- return SDL_TRUE; +- } +- } +- +- return SDL_FALSE; +-} + + SDL_bool + SDL_SetHintWithPriority(const char *name, const char *value, +@@ -75,9 +59,6 @@ + return SDL_FALSE; + } + if (SDL_strcmp(hint->value, value) != 0) { +- if (hint->callback != NULL) { +- (*hint->callback)(name, hint->value, value); +- } + SDL_free(hint->value); + hint->value = SDL_strdup(value); + } +@@ -94,7 +75,6 @@ + hint->name = SDL_strdup(name); + hint->value = SDL_strdup(value); + hint->priority = priority; +- hint->callback = NULL; + hint->next = SDL_hints; + SDL_hints = hint; + return SDL_TRUE; +diff -Nru SDL-1.3.0/src/SDL_hints_c.h SDL-1.3.0/src/SDL_hints_c.h +--- SDL-1.3.0/src/SDL_hints_c.h 2011-06-26 00:32:34 ++++ SDL-1.3.0/src/SDL_hints_c.h 1969-12-31 21:00:00 +@@ -1,34 +0,0 @@ +-/* +- Simple DirectMedia Layer +- Copyright (C) 1997-2011 Sam Lantinga +- +- 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. +- */ +- +-#ifndef _SDL_hints_c_h +-#define _SDL_hints_c_h +- +-/** +- * \brief A callback function that is optionally called when a hint changes +- */ +-typedef void (*SDL_HintChangedCb)(const char *name, const char *oldValue, const char *newValue); +- +-extern SDL_bool SDL_RegisterHintChangedCb(const char *name, SDL_HintChangedCb hintCb); +- +-#endif /* _SDL_hints_c_h */ +- +-/* vi: set ts=4 sw=4 expandtab: */ +\ No newline at end of file +diff -Nru SDL-1.3.0/src/atomic/SDL_spinlock.c SDL-1.3.0/src/atomic/SDL_spinlock.c +--- SDL-1.3.0/src/atomic/SDL_spinlock.c 2011-06-26 00:32:34 ++++ SDL-1.3.0/src/atomic/SDL_spinlock.c 2026-09-05 18:29:53 +@@ -77,13 +77,9 @@ + : "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory"); + return (result == 0); + +-#elif HAVE_PTHREAD_SPINLOCK +- /* pthread instructions */ +- return (pthread_spin_trylock(lock) == 0); +-#else ++#else + /* Need CPU instructions for spinlock here! */ + __need_spinlock_implementation__ +- + #endif + } + +@@ -105,10 +101,7 @@ + + #elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET + __sync_lock_release(lock); +- +-#elif HAVE_PTHREAD_SPINLOCK +- pthread_spin_unlock(lock); +- ++ + #else + *lock = 0; + #endif +diff -Nru SDL-1.3.0/src/audio/SDL_audio.c SDL-1.3.0/src/audio/SDL_audio.c +--- SDL-1.3.0/src/audio/SDL_audio.c 2011-04-08 17:07:03 ++++ SDL-1.3.0/src/audio/SDL_audio.c 2026-09-05 18:29:53 +@@ -67,6 +67,7 @@ + extern AudioBootStrap NDSAUD_bootstrap; + extern AudioBootStrap FUSIONSOUND_bootstrap; + extern AudioBootStrap ANDROIDAUD_bootstrap; ++extern AudioBootStrap PSL1GHT_AUD_bootstrap; + + + /* Available audio drivers */ +@@ -132,6 +133,9 @@ + #if SDL_AUDIO_DRIVER_ANDROID + &ANDROIDAUD_bootstrap, + #endif ++#if SDL_AUDIO_DRIVER_PSL1GHT ++ &PSL1GHT_AUD_bootstrap, ++#endif + NULL + }; + +@@ -375,8 +379,7 @@ + } + #endif + +- /* stream_len = device->convert.len; */ +- stream_len = device->spec.size; ++ stream_len = device->convert.len; + } else { + silence = device->spec.silence; + stream_len = device->spec.size; +@@ -932,7 +935,7 @@ + return 0; + } + if (device->convert.needed) { +- device->convert.len = (int) (((double) obtained->size) / ++ device->convert.len = (int) (((double) device->spec.size) / + device->convert.len_ratio); + + device->convert.buf = +diff -Nru SDL-1.3.0/src/audio/SDL_audiocvt.c SDL-1.3.0/src/audio/SDL_audiocvt.c +--- SDL-1.3.0/src/audio/SDL_audiocvt.c 2011-04-08 17:07:03 ++++ SDL-1.3.0/src/audio/SDL_audiocvt.c 2026-09-05 18:29:53 +@@ -295,8 +295,8 @@ + { \ + const type *src = (const type *) (cvt->buf + cvt->len_cvt); \ + type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \ +- for (i = cvt->len_cvt / 2; i; --i, --src) { \ +- const type val = *src; \ ++ for (i = cvt->len_cvt / sizeof(type); i; --i) { \ ++ const type val = *--src; \ + dst -= 2; \ + dst[0] = dst[1] = val; \ + } \ +diff -Nru SDL-1.3.0/src/audio/SDL_audiotypecvt.c SDL-1.3.0/src/audio/SDL_audiotypecvt.c +--- SDL-1.3.0/src/audio/SDL_audiotypecvt.c 2011-04-08 17:07:03 ++++ SDL-1.3.0/src/audio/SDL_audiotypecvt.c 2026-09-05 18:29:53 +@@ -2364,7 +2364,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -2401,7 +2401,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; +@@ -2438,7 +2438,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -2485,7 +2485,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; +@@ -2532,7 +2532,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 96; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 6 * 6; + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -2589,7 +2589,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 96; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 6 * 6; + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; +@@ -2646,7 +2646,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -2713,7 +2713,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; +@@ -2844,7 +2844,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -2881,7 +2881,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; +@@ -2918,7 +2918,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -2965,7 +2965,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; +@@ -3012,7 +3012,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 96; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 6 * 6; + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -3069,7 +3069,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 96; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 6 * 6; + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; +@@ -3126,7 +3126,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -3193,7 +3193,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; +@@ -3260,7 +3260,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; +@@ -3292,7 +3292,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -3324,7 +3324,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -3361,7 +3361,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -3398,7 +3398,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -3445,7 +3445,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -3492,7 +3492,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 192; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 12 * 12; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -3549,7 +3549,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 192; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 12 * 12; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -3606,7 +3606,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -3673,7 +3673,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -3740,7 +3740,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; +@@ -3772,7 +3772,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -3804,7 +3804,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -3841,7 +3841,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -3878,7 +3878,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -3925,7 +3925,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -3972,7 +3972,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 192; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 12 * 12; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -4029,7 +4029,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 192; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 12 * 12; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -4086,7 +4086,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -4153,7 +4153,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -4220,7 +4220,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; +@@ -4252,7 +4252,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -4284,7 +4284,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -4321,7 +4321,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -4358,7 +4358,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -4405,7 +4405,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -4452,7 +4452,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 192; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 12 * 12; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -4509,7 +4509,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 192; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 12 * 12; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -4566,7 +4566,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -4633,7 +4633,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; +@@ -4700,7 +4700,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; +@@ -4732,7 +4732,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 32; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~1; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -4764,7 +4764,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -4801,7 +4801,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -4838,7 +4838,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -4885,7 +4885,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -4932,7 +4932,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 192; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 12 * 12; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -4989,7 +4989,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 192; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 12 * 12; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -5046,7 +5046,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -5113,7 +5113,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; +@@ -5180,7 +5180,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; +@@ -5212,7 +5212,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -5244,7 +5244,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -5281,7 +5281,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -5318,7 +5318,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -5365,7 +5365,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -5412,7 +5412,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 384; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 24 * 24; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -5469,7 +5469,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 384; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 24 * 24; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -5526,7 +5526,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 512; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~31; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -5593,7 +5593,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 512; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~31; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -5660,7 +5660,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; +@@ -5692,7 +5692,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -5724,7 +5724,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -5761,7 +5761,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -5798,7 +5798,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -5845,7 +5845,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -5892,7 +5892,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 384; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 24 * 24; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -5949,7 +5949,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 384; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 24 * 24; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -6006,7 +6006,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 512; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~31; + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -6073,7 +6073,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 512; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~31; + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; +@@ -6140,7 +6140,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; +@@ -6172,7 +6172,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6204,7 +6204,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -6241,7 +6241,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6278,7 +6278,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -6325,7 +6325,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6372,7 +6372,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 384; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 24 * 24; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -6429,7 +6429,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 384; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 24 * 24; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6486,7 +6486,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 512; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~31; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -6553,7 +6553,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 512; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~31; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6620,7 +6620,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; +@@ -6652,7 +6652,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 64; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6684,7 +6684,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; +@@ -6721,7 +6721,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 128; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~7; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6758,7 +6758,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; +@@ -6805,7 +6805,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 256; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~15; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6852,7 +6852,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 384; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 24 * 24; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; +@@ -6909,7 +6909,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 384; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) / 24 * 24; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -6966,7 +6966,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 512; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~31; + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; +@@ -7033,7 +7033,7 @@ + #endif + + const int srcsize = cvt->len_cvt - 512; +- const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ++ const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~31; + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; +@@ -7248,7 +7248,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~1; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); +@@ -7316,7 +7316,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~1; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); +@@ -7390,7 +7390,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); +@@ -7480,7 +7480,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); +@@ -7572,7 +7572,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 6 * 6; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); +@@ -7684,7 +7684,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 6 * 6; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); +@@ -7794,7 +7794,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); +@@ -7928,7 +7928,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); +@@ -8128,7 +8128,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~1; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); +@@ -8196,7 +8196,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~1; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); +@@ -8270,7 +8270,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); +@@ -8360,7 +8360,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); +@@ -8452,7 +8452,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 6 * 6; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); +@@ -8564,7 +8564,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 6 * 6; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); +@@ -8674,7 +8674,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); +@@ -8808,7 +8808,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); +@@ -8891,7 +8891,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~1; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -8948,7 +8948,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~1; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9008,7 +9008,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9076,7 +9076,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9150,7 +9150,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9240,7 +9240,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9332,7 +9332,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 12 * 12; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9444,7 +9444,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 12 * 12; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9554,7 +9554,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~15; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9688,7 +9688,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~15; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -9771,7 +9771,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~1; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -9828,7 +9828,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~1; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -9888,7 +9888,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -9956,7 +9956,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -10030,7 +10030,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -10120,7 +10120,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -10212,7 +10212,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 12 * 12; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -10324,7 +10324,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 12 * 12; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -10434,7 +10434,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~15; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -10568,7 +10568,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~15; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -10651,7 +10651,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~1; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -10708,7 +10708,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~1; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -10768,7 +10768,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -10836,7 +10836,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -10910,7 +10910,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -11000,7 +11000,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -11092,7 +11092,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 12 * 12; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -11204,7 +11204,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 12 * 12; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -11314,7 +11314,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~15; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -11448,7 +11448,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~15; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); +@@ -11531,7 +11531,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~1; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -11588,7 +11588,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~1; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -11648,7 +11648,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -11716,7 +11716,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -11790,7 +11790,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -11880,7 +11880,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -11972,7 +11972,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 12 * 12; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -12084,7 +12084,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 12 * 12; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -12194,7 +12194,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~15; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -12328,7 +12328,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~15; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); +@@ -12411,7 +12411,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -12468,7 +12468,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -12528,7 +12528,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -12596,7 +12596,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -12670,7 +12670,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~15; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -12760,7 +12760,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~15; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -12852,7 +12852,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 24 * 24; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -12964,7 +12964,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 24 * 24; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13074,7 +13074,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~31; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13208,7 +13208,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~31; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13291,7 +13291,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13348,7 +13348,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13408,7 +13408,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13476,7 +13476,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13550,7 +13550,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~15; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13640,7 +13640,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~15; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13732,7 +13732,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 24 * 24; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13844,7 +13844,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 24 * 24; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -13954,7 +13954,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~31; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -14088,7 +14088,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~31; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); +@@ -14171,7 +14171,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14228,7 +14228,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14288,7 +14288,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14356,7 +14356,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14430,7 +14430,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~15; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14520,7 +14520,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~15; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14612,7 +14612,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 24 * 24; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14724,7 +14724,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 24 * 24; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14834,7 +14834,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~31; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -14968,7 +14968,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~31; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15051,7 +15051,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~3; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15108,7 +15108,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~3; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15168,7 +15168,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~7; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15236,7 +15236,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~7; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15310,7 +15310,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~15; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15400,7 +15400,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~15; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15492,7 +15492,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) / 24 * 24; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15604,7 +15604,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) / 24 * 24; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15714,7 +15714,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 2; ++ const int dstsize = (cvt->len_cvt / 2) & ~31; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +@@ -15848,7 +15848,7 @@ + #endif + + const int srcsize = cvt->len_cvt; +- const int dstsize = cvt->len_cvt / 4; ++ const int dstsize = (cvt->len_cvt / 4) & ~31; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); +diff -Nru SDL-1.3.0/src/audio/psl1ght/SDL_psl1ghtaudio.c SDL-1.3.0/src/audio/psl1ght/SDL_psl1ghtaudio.c +--- SDL-1.3.0/src/audio/psl1ght/SDL_psl1ghtaudio.c 1969-12-31 21:00:00 ++++ SDL-1.3.0/src/audio/psl1ght/SDL_psl1ghtaudio.c 2026-09-05 18:29:53 +@@ -0,0 +1,214 @@ ++/* ++ SDL - Simple DirectMedia Layer ++ Copyright (C) 1997-2010 Sam Lantinga ++ ++ 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 St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++ Sam Lantinga ++ slouken@libsdl.org ++ ++ This file written by Ryan C. Gordon (icculus@icculus.org) ++*/ ++#include "SDL_config.h" ++ ++/* Output audio to PSL1GHT */ ++ ++#include "SDL.h" ++ ++ ++#include "SDL_audio.h" ++#include "../SDL_audio_c.h" ++#include "SDL_psl1ghtaudio.h" ++ ++#define SHW64(X) (u32)(((u64)X)>>32), (u32)(((u64)X)&0xFFFFFFFF) ++ ++#define AUDIO_DEBUG ++ ++#ifdef AUDIO_DEBUG ++#define deprintf(...) printf(__VA_ARGS__) ++#else ++#define deprintf(...) ++#endif ++ ++static int ++PSL1GHT_AUD_OpenDevice(_THIS, const char *devname, int iscapture) ++{ ++ deprintf( "PSL1GHT_AUD_OpenDevice(%08X.%08X, %s, %d)\n", SHW64(this), devname, iscapture); ++ SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); ++ int valid_datatype = 0; ++ ++ this->hidden = SDL_malloc(sizeof(*(this->hidden))); ++ if (!this->hidden) { ++ SDL_OutOfMemory(); ++ return 0; ++ } ++ SDL_memset(this->hidden, 0, (sizeof *this->hidden)); ++ ++ ++ // PS3 Libaudio only handles floats ++ while ((!valid_datatype) && (test_format)) { ++ this->spec.format = test_format; ++ switch (test_format) { ++ case AUDIO_F32MSB: ++ valid_datatype = 1; ++ break; ++ default: ++ test_format = SDL_NextAudioFormat(); ++ break; ++ } ++ } ++ ++ int ret=audioInit(); ++ ++ //set some parameters we want ++ //either 2 or 8 channel ++ _params.numChannels = AUDIO_PORT_2CH; ++ //8 16 or 32 block buffer ++ _params.numBlocks = AUDIO_BLOCK_8; ++ //extended attributes ++ _params.attrib = 0; ++ //sound level (1 is default) ++ _params.level = 1; ++ ++ ret=audioPortOpen(&_params, &_portNum); ++ deprintf("audioPortOpen: %d\n",ret); ++ deprintf(" portNum: %d\n",_portNum); ++ ++ ret=audioGetPortConfig(_portNum, &_config); ++ deprintf("audioGetPortConfig: %d\n",ret); ++ deprintf(" readIndex: 0x%8X\n",_config.readIndex); ++ deprintf(" status: %d\n",_config.status); ++ deprintf(" channelCount: %ld\n",_config.channelCount); ++ deprintf(" numBlocks: %ld\n",_config.numBlocks); ++ deprintf(" portSize: %d\n",_config.portSize); ++ deprintf(" audioDataStart: 0x%8X\n",_config.audioDataStart); ++ ++ // create an event queue that will tell when a block is read ++ ret=audioCreateNotifyEventQueue( &_snd_queue, &_snd_queue_key); ++ printf("audioCreateNotifyEventQueue: %d\n",ret); ++ ++ // Set it to the sprx ++ ret = audioSetNotifyEventQueue(_snd_queue_key); ++ printf("audioSetNotifyEventQueue: %d\n",ret); ++ ++ // clears the event queue ++ ret = sysEventQueueDrain(_snd_queue); ++ printf("sysEentQueueDrain: %d\n",ret); ++ ++ ret=audioPortStart(_portNum); ++ deprintf("audioPortStart: %d\n",ret); ++ ++ _last_filled_buf = _config.numBlocks - 1; ++ ++ this->spec.format = test_format; ++ this->spec.size = sizeof(float) * AUDIO_BLOCK_SAMPLES * _config.channelCount; ++ this->spec.freq = 48000; ++ this->spec.samples = AUDIO_BLOCK_SAMPLES; ++ this->spec.channels = _config.channelCount; ++ ++ return ret == 0; ++} ++ ++static void ++PSL1GHT_AUD_PlayDevice(_THIS) ++{ ++ deprintf( "PSL1GHT_AUD_PlayDevice(%08X.%08X)\n", SHW64(this)); ++ ++ /* ++ while( _config.readIndex == _last_filled_buf) // FIXME this is a mess to remove when queued event will me integrated ++ { ++ deprintf( "\tplaying too fast... waiting a ms\n"); ++ //sleep(1); ++ }*/ ++ /*TransferSoundData *sound = SDL_malloc(sizeof(TransferSoundData)); ++ if (!sound) { ++ SDL_OutOfMemory(); ++ } ++ ++ playGenericSound(this->hidden->mixbuf, this->hidden->mixlen);*/ ++} ++ ++ ++static void ++PSL1GHT_AUD_CloseDevice(_THIS) ++{ ++ deprintf( "PSL1GHT_AUD_CloseDevice(%08X.%08X)\n", SHW64(this)); ++ int ret = 0; ++ ret=audioPortStop(_portNum); ++ deprintf("audioPortStop: %d\n",ret); ++ ret=audioRemoveNotifyEventQueue(_snd_queue_key); ++ deprintf("audioRemoveNotifyEventQueue: %d\n",ret); ++ ret=audioPortClose(_portNum); ++ deprintf("audioPortClose: %d\n",ret); ++ ret=sysEventQueueDestroy(_snd_queue, 0); ++ deprintf("sysEventQueueDestroy: %d\n",ret); ++ ret=audioQuit(); ++ deprintf("audioQuit: %d\n",ret); ++ ++ SDL_free(this->hidden); ++} ++ ++static Uint8 * ++PSL1GHT_AUD_GetDeviceBuf(_THIS) ++{ ++ ++ //deprintf( "PSL1GHT_AUD_GetDeviceBuf(%08X.%08X) at %d ms\n", SHW64(this), SDL_GetTicks()); ++ ++ //int playing = _config.readIndex; ++ int playing = *((u64*)(u64)_config.readIndex); ++ int filling = (_last_filled_buf + 1) % _config.numBlocks; ++ Uint8 * dma_buf = (Uint8 *)(u64)_config.audioDataStart; ++ //deprintf( "\tWriting to buffer %d \n", filling); ++ // deprintf( "\tbuffer address (%08X.%08X => %08X.%08X)\n", SHW64(_config.audioDataStart), SHW64(dma_buf)); ++ ++ _last_filled_buf = filling; ++ return (dma_buf + (filling * this->spec.size)); ++} ++ ++/* This function waits until it is possible to write a full sound buffer */ ++static void ++ALSA_WaitDevice(_THIS) ++{ ++ /* We're in blocking mode, so there's nothing to do here */ ++ //deprintf( "ALSA_WaitDevice(%08X.%08X)\n", SHW64(this)); ++ ++ sys_event_t event; ++ s32 ret = sysEventQueueReceive( _snd_queue, &event, 20 * 1000); ++ //deprintf( "sysEventQueueReceive: %08X\n", ret); ++} ++ ++ ++ static int ++PSL1GHT_AUD_Init(SDL_AudioDriverImpl * impl) ++{ ++ deprintf( "PSL1GHT_AUD_Init(%08X.%08X)\n", SHW64(impl)); ++ /* Set the function pointers */ ++ impl->OpenDevice = PSL1GHT_AUD_OpenDevice; ++ //impl->PlayDevice = PSL1GHT_AUD_PlayDevice; ++ impl->WaitDevice = ALSA_WaitDevice; ++ impl->CloseDevice = PSL1GHT_AUD_CloseDevice; ++ impl->GetDeviceBuf = PSL1GHT_AUD_GetDeviceBuf; ++ ++ /* and the capabilities */ ++ impl->OnlyHasDefaultOutputDevice = 1; ++ ++ return 1; /* this audio target is available. */ ++} ++ ++AudioBootStrap PSL1GHT_AUD_bootstrap = { ++ "psl1ght", "SDL PSL1GHT audio driver", PSL1GHT_AUD_Init, 0 /*1? */ ++}; ++ ++/* vi: set ts=4 sw=4 expandtab: */ +diff -Nru SDL-1.3.0/src/audio/psl1ght/SDL_psl1ghtaudio.h SDL-1.3.0/src/audio/psl1ght/SDL_psl1ghtaudio.h +--- SDL-1.3.0/src/audio/psl1ght/SDL_psl1ghtaudio.h 1969-12-31 21:00:00 ++++ SDL-1.3.0/src/audio/psl1ght/SDL_psl1ghtaudio.h 2026-09-05 18:29:53 +@@ -0,0 +1,52 @@ ++/* ++ SDL - Simple DirectMedia Layer ++ Copyright (C) 1997-2010 Sam Lantinga ++ ++ 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 St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++ Sam Lantinga ++ slouken@libsdl.org ++*/ ++#include "SDL_config.h" ++ ++#pragma once ++ ++#include "../SDL_sysaudio.h" ++ ++#include