├── .cargo └── config ├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE.md ├── README.md ├── packages ├── arch │ ├── autoconf │ │ ├── .gitignore │ │ └── PKGBUILD │ ├── binutils │ │ ├── .gitignore │ │ └── PKGBUILD │ ├── gcc-freestanding │ │ ├── .gitignore │ │ └── PKGBUILD │ ├── gcc │ │ ├── .gitignore │ │ └── PKGBUILD │ └── newlib │ │ ├── .gitignore │ │ └── PKGBUILD └── debian │ ├── .gitignore │ ├── binutils │ ├── .gitignore │ └── debian │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── rules │ │ └── source │ │ └── format │ ├── gcc-freestanding │ ├── .gitignore │ └── debian │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── rules │ │ ├── source │ │ └── format │ │ └── x86-64-unknown-redox-gcc-freestanding.install │ ├── gcc │ ├── .gitignore │ └── debian │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── rules │ │ └── source │ │ └── format │ ├── newlib │ ├── .gitignore │ └── debian │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── rules │ │ └── source │ │ └── format │ └── relibc │ ├── .gitignore │ └── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── rules │ └── source │ └── format ├── ports ├── 2H4U.patch ├── 2H4U.sh ├── airstrike.patch ├── airstrike.sh ├── binutils.sh ├── curl.patch ├── curl.sh ├── dash.patch ├── dash.sh ├── dosbox.patch ├── dosbox.sh ├── environ.sh ├── expat.patch ├── expat.sh ├── freeciv.patch ├── freeciv.sh ├── freetype.patch ├── freetype.sh ├── gcc.sh ├── gettext.patch ├── gettext.sh ├── glib2.patch ├── glib2.sh ├── gtk+.patch ├── gtk+.sh ├── jemalloc.patch ├── jemalloc.sh ├── libffi.patch ├── libffi.sh ├── libgit2.patch ├── libgit2.sh ├── libiconv.patch ├── libiconv.sh ├── libpng.patch ├── libpng.sh ├── libxml2.patch ├── libxml2.sh ├── llvm.sh ├── lua.patch ├── lua.sh ├── make.patch ├── make.sh ├── mame.sh ├── mesa.patch ├── mesa.sh ├── mio.sh ├── nasm.sh ├── net2.sh ├── netsurf.patch ├── netsurf.sh ├── netutils.sh ├── openssl.patch ├── openssl.sh ├── pacman.sh ├── pcc.patch ├── pcc.sh ├── pixelcannon.sh ├── qt.patch ├── qt.sh ├── ring.sh ├── rust.sh ├── rust │ ├── config.toml │ └── llvm-config ├── rustls.sh ├── sdl.patch ├── sdl.sh ├── sdl2.sh ├── sdl_gfx.patch ├── sdl_gfx.sh ├── sdl_image.patch ├── sdl_image.sh ├── sdl_mixer.patch ├── sdl_mixer.sh ├── sdl_ttf.patch ├── sdl_ttf.sh ├── sdldoom.patch ├── sdldoom.sh ├── tar.patch ├── tar.sh ├── tcc.patch ├── tcc.sh ├── time.sh ├── warmux.patch ├── warmux.sh ├── webpki.sh └── zlib.sh ├── setup.sh ├── shell.nix ├── tests ├── c-test.c ├── ed.c ├── sdl-test.c ├── sdl2-test.c └── thread-test.c └── ubuntu.sh /.cargo/config: -------------------------------------------------------------------------------- 1 | [target.x86_64-unknown-redox] 2 | linker = "x86_64-elf-redox-gcc" 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "binutils-gdb"] 2 | path = binutils-gdb 3 | url = https://gitlab.redox-os.org/redox-os/binutils-gdb.git 4 | branch = master 5 | [submodule "newlib"] 6 | path = newlib 7 | url = https://gitlab.redox-os.org/redox-os/newlib.git 8 | branch = redox 9 | [submodule "gcc"] 10 | path = gcc 11 | url = https://gitlab.redox-os.org/redox-os/gcc.git 12 | branch = redox 13 | [submodule "relibc"] 14 | path = relibc 15 | url = https://gitlab.redox-os.org/redox-os/relibc.git 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | os: 3 | - linux 4 | dist: trusty 5 | install: 6 | - sudo apt-get update -qq 7 | - sudo apt-get install -qq autoconf2.64 automake1.11 gcc-multilib libtool texinfo gperf bison flex 8 | script: 9 | - ./setup.sh all >/dev/null 10 | notifications: 11 | email: false 12 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Jeremy Soller 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Redox Libc and Ports 2 | 3 | Newlib, ported to Redox, and a number of shell files for compiling other programs. 4 | 5 | [![Travis Build Status](https://travis-ci.org/redox-os/libc.svg?branch=master)](https://travis-ci.org/redox-os/libc) 6 | [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md) 7 | 8 | ## Building the toolchain and libc 9 | 10 | Run `./setup.sh all` to build the gcc toolchain and newlib libc implementation. 11 | 12 | Arch Linux and .deb packages can be built from the files in `packages/`. A prebuild .deb toolchain is available at https://static.redox-os.org/toolchain/. 13 | 14 | ## Building ports 15 | 16 | To build a port, enter the ports directory with `cd ports`. Choose a port to build, such as lua, keeping in mind the fact that many of the ports due not work yet. You can then run `./lua.sh add` to build the port. You can then copy the binary `../build/sysroot/usr/bin/lua` to Redox's filesystem. 17 | -------------------------------------------------------------------------------- /packages/arch/autoconf/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !PKGBUILD 4 | -------------------------------------------------------------------------------- /packages/arch/autoconf/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=autoconf-2.64 2 | pkgver=2.64 3 | pkgrel=1 4 | epoch=0 5 | pkgdesc="A GNU tool for automatically configuring source code" 6 | arch=('any') 7 | url="https://www.gnu.org/software/autoconf" 8 | license=('GPL2' 'GPL3') 9 | groups=() 10 | depends=('coreutils' 'awk' 'm4' 'diffutils' 'bash') 11 | makedepends=() 12 | checkdepends=() 13 | optdepends=() 14 | provides=() 15 | conflicts=() 16 | replaces=() 17 | backup=() 18 | options=() 19 | install= 20 | changelog= 21 | source=("https://ftp.gnu.org/gnu/autoconf/autoconf-${pkgver}.tar.gz") 22 | noextract=() 23 | md5sums=('30a198cef839471dd4926e92ab485361') 24 | sha1sums=('4341f861dac1ec79aecd36ff14df618b55b4e52b') 25 | sha256sums=('a84471733f86ac2c1240a6d28b705b05a6b79c3cca8835c3712efbdf813c5eb6') 26 | sha512sums=('96c4d8ae04c4b3488da0ea5ac67f2450c9ec97363fcc4b2ee288daed885be0e4e3db9e89112245ba7707e3e326d391406c3b194d7ee79882a9044b2d6c27bf55') 27 | validpgpkeys=() 28 | 29 | prepare() { 30 | cd ${pkgname} 31 | } 32 | 33 | build() { 34 | cd ${pkgname} 35 | ./configure --prefix=/opt/autoconf/${pkgver} 36 | make 37 | } 38 | 39 | check() { 40 | cd "${srcdir}/${pkgname}" 41 | } 42 | 43 | package() { 44 | cd "${srcdir}/${pkgname}" 45 | make DESTDIR=${pkgdir} install 46 | } 47 | -------------------------------------------------------------------------------- /packages/arch/binutils/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !PKGBUILD 4 | -------------------------------------------------------------------------------- /packages/arch/binutils/PKGBUILD: -------------------------------------------------------------------------------- 1 | _target=x86_64-unknown-redox 2 | pkgname=$_target-binutils-git 3 | pkgver=r89563.fca55db437 4 | pkgrel=1 5 | arch=(i686 x86_64) 6 | license=(GPL) 7 | source=(git+https://github.com/redox-os/binutils-gdb) 8 | makedepends=('git') 9 | md5sums=('SKIP') 10 | 11 | prepare() { 12 | cd "$srcdir/binutils-gdb" 13 | sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure 14 | } 15 | 16 | build() { 17 | cd "$srcdir/binutils-gdb" 18 | 19 | ./configure \ 20 | --target=$_target \ 21 | --prefix=/usr \ 22 | --with-sysroot=/usr/$_target \ 23 | --disable-gdb \ 24 | --disable-nls \ 25 | --disable-werror 26 | 27 | make 28 | } 29 | 30 | package() { 31 | cd "$srcdir/binutils-gdb" 32 | make DESTDIR="$pkgdir" install 33 | rm -rf "$pkgdir"/usr/share/info 34 | } 35 | 36 | pkgver() { 37 | cd "$srcdir/binutils-gdb" 38 | printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" 39 | } 40 | -------------------------------------------------------------------------------- /packages/arch/gcc-freestanding/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !PKGBUILD 4 | -------------------------------------------------------------------------------- /packages/arch/gcc-freestanding/PKGBUILD: -------------------------------------------------------------------------------- 1 | _target=x86_64-unknown-redox 2 | pkgname=$_target-gcc-freestanding-git 3 | pkgver=r152183.98e77b0b0d2 4 | pkgrel=1 5 | arch=(i686 x86_64) 6 | license=(GPL) 7 | source=("git+https://github.com/redox-os/gcc#branch=redox") 8 | md5sums=('SKIP') 9 | makedepends=('autoconf-2.64' 'git') 10 | depends=($_target-binutils-git libmpc zlib) 11 | 12 | prepare() { 13 | cd "$srcdir/gcc" 14 | sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure 15 | rm -rf $srcdir/gcc-build 16 | mkdir $srcdir/gcc-build 17 | } 18 | 19 | build() { 20 | cd "$srcdir/gcc" 21 | 22 | cd libstdc++-v3 23 | /opt/autoconf/2.64/bin/autoconf 24 | cd .. 25 | 26 | cd $srcdir/gcc-build 27 | $srcdir/gcc/configure --target=$_target --prefix=/usr --disable-nls --enable-languages=c,c++ --without-headers 28 | make all-gcc all-target-libgcc 29 | } 30 | 31 | package() { 32 | cd $srcdir/gcc-build 33 | 34 | make DESTDIR="$pkgdir" install-gcc install-target-libgcc 35 | 36 | rm -r "$pkgdir"/usr/share/man/man7 37 | rm -r "$pkgdir"/usr/share/info 38 | } 39 | 40 | pkgver() { 41 | cd "$srcdir/gcc" 42 | printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" 43 | } 44 | -------------------------------------------------------------------------------- /packages/arch/gcc/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !PKGBUILD 4 | -------------------------------------------------------------------------------- /packages/arch/gcc/PKGBUILD: -------------------------------------------------------------------------------- 1 | _target=x86_64-unknown-redox 2 | pkgname=$_target-gcc-git 3 | pkgver=r152183.98e77b0b0d2 4 | pkgrel=1 5 | arch=(i686 x86_64) 6 | license=(GPL) 7 | source=("git+https://github.com/redox-os/gcc#branch=redox") 8 | md5sums=('SKIP') 9 | makedepends=('git' 'autoconf-2.64') 10 | depends=($_target-binutils-git $_target-newlib-git libmpc zlib) 11 | conflicts=($_target-gcc-freestanding-git) 12 | provides=($_target-gcc-freestanding-git) 13 | 14 | prepare() { 15 | cd "$srcdir/gcc" 16 | 17 | cd libstdc++-v3 18 | /opt/autoconf/2.64/bin/autoconf 19 | cd .. 20 | 21 | sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure 22 | 23 | rm -rf $srcdir/gcc-build 24 | mkdir $srcdir/gcc-build 25 | } 26 | 27 | build() { 28 | cd "$srcdir/gcc" 29 | 30 | cd $srcdir/gcc-build 31 | $srcdir/gcc/configure --target=$_target --prefix=/usr --with-local-prefix=/usr/$_target --with-sysroot=/usr/$_target --with-native-system-header-dir=/include --disable-nls --enable-languages=c,c++ 32 | make all-gcc all-target-libgcc all-target-libstdc++-v3 33 | } 34 | 35 | package() { 36 | cd $srcdir/gcc-build 37 | 38 | make DESTDIR="$pkgdir" install-gcc install-target-libgcc install-target-libstdc++-v3 39 | 40 | rm -r "$pkgdir"/usr/share/man 41 | rm -r "$pkgdir"/usr/share/info 42 | } 43 | 44 | pkgver() { 45 | cd "$srcdir/gcc" 46 | printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" 47 | } 48 | -------------------------------------------------------------------------------- /packages/arch/newlib/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !PKGBUILD 4 | -------------------------------------------------------------------------------- /packages/arch/newlib/PKGBUILD: -------------------------------------------------------------------------------- 1 | _target=x86_64-unknown-redox 2 | pkgname=$_target-newlib-git 3 | pkgver=r17774.d5ac42a49 4 | pkgrel=1 5 | arch=(i686 x86_64) 6 | license=(GPL) 7 | source=("git+https://github.com/redox-os/newlib#branch=redox") 8 | md5sums=('SKIP') 9 | makedepends=('git' 'rustup' $_target-binutils-git $_target-gcc-freestanding-git) 10 | 11 | prepare() { 12 | cd "$srcdir/newlib" 13 | 14 | rustup override set nightly-2018-04-27 15 | rustup component add rust-src 16 | 17 | rm -rf $srcdir/xargo 18 | cargo install --root $srcdir/xargo xargo 19 | 20 | rm -rf $srcdir/newlib-build 21 | mkdir $srcdir/newlib-build 22 | } 23 | 24 | build() { 25 | cd "$srcdir/newlib-build" 26 | $srcdir/newlib/configure --target=$_target --prefix=/usr --enable-newlib-iconv 27 | PATH=$srcdir/xargo/bin:$PATH make all 28 | } 29 | 30 | package() { 31 | cd "$srcdir/newlib-build" 32 | make DESTDIR="$pkgdir" install 33 | } 34 | 35 | pkgver() { 36 | cd "$srcdir/newlib" 37 | printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" 38 | } 39 | -------------------------------------------------------------------------------- /packages/debian/.gitignore: -------------------------------------------------------------------------------- 1 | *.build 2 | *.buildinfo 3 | *.changes 4 | *.deb 5 | *.dsc 6 | *.tar.xz 7 | *.upload 8 | -------------------------------------------------------------------------------- /packages/debian/binutils/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /packages/debian/binutils/debian/changelog: -------------------------------------------------------------------------------- 1 | x86-64-unknown-redox-binutils (0.0.2) zesty; urgency=medium 2 | 3 | * Remove share directory from package 4 | 5 | -- Jeremy Soller Sat, 23 Sep 2017 17:31:49 -0600 6 | 7 | x86-64-unknown-redox-binutils (0.0.1) zesty; urgency=medium 8 | 9 | * Initial release. 10 | 11 | -- Jeremy Soller Sun, 04 Jun 2017 06:17:52 -0600 12 | -------------------------------------------------------------------------------- /packages/debian/binutils/debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /packages/debian/binutils/debian/control: -------------------------------------------------------------------------------- 1 | Source: x86-64-unknown-redox-binutils 2 | Maintainer: Jeremy Soller 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 10) 7 | 8 | Package: x86-64-unknown-redox-binutils 9 | Architecture: amd64 10 | Depends: ${misc:Depends} 11 | Description: Binutils for Redox cross compilation on x86_64 12 | -------------------------------------------------------------------------------- /packages/debian/binutils/debian/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Jeremy Soller 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/debian/binutils/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | TARGET=x86_64-unknown-redox 3 | 4 | %: 5 | mkdir -p build 6 | dh $@ --builddirectory=build 7 | 8 | override_dh_auto_configure: 9 | mkdir -p build 10 | cd build && ../../../../binutils-gdb/configure \ 11 | --target="$(TARGET)" \ 12 | --prefix=/usr \ 13 | --with-sysroot="/usr/$(TARGET)" \ 14 | --disable-gdb \ 15 | --disable-nls \ 16 | --disable-werror 17 | 18 | override_dh_auto_install: 19 | dh_auto_install 20 | rm -rf "debian/x86-64-unknown-redox-binutils/usr/share/info" 21 | -------------------------------------------------------------------------------- /packages/debian/binutils/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /packages/debian/gcc-freestanding/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /packages/debian/gcc-freestanding/debian/changelog: -------------------------------------------------------------------------------- 1 | x86-64-unknown-redox-gcc-freestanding (0.0.1) zesty; urgency=medium 2 | 3 | * Initial release. 4 | 5 | -- Jeremy Soller Sun, 04 Jun 2017 06:17:52 -0600 6 | -------------------------------------------------------------------------------- /packages/debian/gcc-freestanding/debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /packages/debian/gcc-freestanding/debian/control: -------------------------------------------------------------------------------- 1 | Source: x86-64-unknown-redox-gcc-freestanding 2 | Maintainer: Jeremy Soller 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 10), autogen, x86-64-unknown-redox-binutils 7 | 8 | Package: x86-64-unknown-redox-gcc-freestanding 9 | Architecture: amd64 10 | Depends: ${misc:Depends}, x86-64-unknown-redox-binutils 11 | Conflicts: x86-64-unknown-redox-gcc 12 | Description: GCC without libc for Redox cross compilation on x86_64 13 | -------------------------------------------------------------------------------- /packages/debian/gcc-freestanding/debian/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Jeremy Soller 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/debian/gcc-freestanding/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | TARGET=x86_64-unknown-redox 3 | 4 | export DEB_BUILD_OPTIONS=nocheck 5 | export DEB_BUILD_MAINT_OPTIONS=hardening=-format 6 | 7 | %: 8 | mkdir -p build 9 | dh $@ --builddirectory=build 10 | 11 | override_dh_auto_configure: 12 | mkdir -p build 13 | cd build && ../../../../gcc/configure \ 14 | --target="$(TARGET)" \ 15 | --prefix=/usr \ 16 | --disable-nls \ 17 | --enable-languages=c,c++ \ 18 | --without-headers 19 | 20 | override_dh_auto_build: 21 | mkdir -p build 22 | cd build && make all-gcc all-target-libgcc 23 | 24 | override_dh_auto_install: 25 | mkdir -p build 26 | cd build && make DESTDIR="$$(realpath ../debian/x86-64-unknown-redox-gcc-freestanding)" install-gcc install-target-libgcc 27 | -------------------------------------------------------------------------------- /packages/debian/gcc-freestanding/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /packages/debian/gcc-freestanding/debian/x86-64-unknown-redox-gcc-freestanding.install: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/lib/gcc/x86_64-unknown-redox 3 | usr/libexec/gcc/x86_64-unknown-redox 4 | usr/x86_64-unknown-redox 5 | -------------------------------------------------------------------------------- /packages/debian/gcc/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /packages/debian/gcc/debian/changelog: -------------------------------------------------------------------------------- 1 | x86-64-unknown-redox-gcc (0.0.2) zesty; urgency=medium 2 | 3 | * Remove share directory from package 4 | 5 | -- Jeremy Soller Sat, 23 Sep 2017 17:32:04 -0600 6 | 7 | x86-64-unknown-redox-gcc (0.0.1) zesty; urgency=medium 8 | 9 | * Initial release. 10 | 11 | -- Jeremy Soller Sun, 04 Jun 2017 06:17:52 -0600 12 | -------------------------------------------------------------------------------- /packages/debian/gcc/debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /packages/debian/gcc/debian/control: -------------------------------------------------------------------------------- 1 | Source: x86-64-unknown-redox-gcc 2 | Maintainer: Jeremy Soller 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 10), autogen, x86-64-unknown-redox-binutils, x86-64-unknown-redox-relibc | x86-64-unknown-redox-newlib 7 | 8 | Package: x86-64-unknown-redox-gcc 9 | Architecture: amd64 10 | Depends: ${misc:Depends}, x86-64-unknown-redox-binutils, x86-64-unknown-redox-newlib | x86-64-unknown-redox-relibc 11 | Conflicts: x86-64-unknown-redox-gcc-freestanding 12 | Provides: x86-64-unknown-redox-gcc-freestanding 13 | Description: GCC for Redox cross compilation on x86_64 14 | -------------------------------------------------------------------------------- /packages/debian/gcc/debian/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Jeremy Soller 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/debian/gcc/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | TARGET=x86_64-unknown-redox 3 | 4 | export DEB_BUILD_OPTIONS=nocheck 5 | export DEB_BUILD_MAINT_OPTIONS=hardening=-format 6 | 7 | %: 8 | mkdir -p build 9 | dh $@ --builddirectory=build 10 | 11 | override_dh_auto_configure: 12 | mkdir -p build 13 | cd build && ../../../../gcc/configure \ 14 | --target="$(TARGET)" \ 15 | --prefix=/usr \ 16 | --with-local-prefix="/usr/$(TARGET)" \ 17 | --with-sysroot="/usr/$(TARGET)" \ 18 | --with-native-system-header-dir=/include \ 19 | --disable-nls \ 20 | --enable-languages=c,c++ 21 | 22 | override_dh_auto_build: 23 | mkdir -p build 24 | cd build && make all-gcc all-target-libgcc all-target-libstdc++-v3 25 | 26 | override_dh_auto_install: 27 | mkdir -p build 28 | cd build && make DESTDIR="$$(realpath ../debian/x86-64-unknown-redox-gcc)" install-gcc install-target-libgcc install-target-libstdc++-v3 29 | rm -rf "debian/x86-64-unknown-redox-gcc/usr/share/info" 30 | -------------------------------------------------------------------------------- /packages/debian/gcc/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /packages/debian/newlib/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /packages/debian/newlib/debian/changelog: -------------------------------------------------------------------------------- 1 | x86-64-unknown-redox-newlib (0.0.3) zesty; urgency=medium 2 | 3 | * Remove share directory from package 4 | 5 | -- Jeremy Soller Sat, 23 Sep 2017 17:32:07 -0600 6 | 7 | x86-64-unknown-redox-newlib (0.0.2) zesty; urgency=medium 8 | 9 | * Update to fix init bug 10 | 11 | -- Jeremy Soller Sun, 18 Jun 2017 17:29:34 -0600 12 | 13 | x86-64-unknown-redox-newlib (0.0.1) zesty; urgency=medium 14 | 15 | * Initial release. 16 | 17 | -- Jeremy Soller Sun, 04 Jun 2017 06:17:52 -0600 18 | -------------------------------------------------------------------------------- /packages/debian/newlib/debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /packages/debian/newlib/debian/control: -------------------------------------------------------------------------------- 1 | Source: x86-64-unknown-redox-newlib 2 | Maintainer: Jeremy Soller 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 10), x86-64-unknown-redox-binutils, x86-64-unknown-redox-gcc-freestanding 7 | 8 | Package: x86-64-unknown-redox-newlib 9 | Architecture: amd64 10 | Depends: ${misc:Depends} 11 | Conflicts: x86-64-unknown-redox-relibc 12 | Description: Newlib libc for Redox cross compilation on x86_64 13 | -------------------------------------------------------------------------------- /packages/debian/newlib/debian/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Jeremy Soller 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/debian/newlib/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | TARGET=x86_64-unknown-redox 3 | 4 | %: 5 | mkdir -p build 6 | dh $@ --builddirectory=build 7 | 8 | override_dh_auto_configure: 9 | mkdir -p build 10 | cd build && ../../../../newlib/configure \ 11 | --target="$(TARGET)" \ 12 | --prefix=/usr \ 13 | --enable-newlib-iconv 14 | 15 | override_dh_auto_build: 16 | PATH="$$HOME/.cargo/bin:$$PATH" dh_auto_build 17 | -------------------------------------------------------------------------------- /packages/debian/newlib/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /packages/debian/relibc/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /packages/debian/relibc/debian/changelog: -------------------------------------------------------------------------------- 1 | x86-64-unknown-redox-relibc (0.0.1) zesty; urgency=medium 2 | 3 | * Initial release. 4 | 5 | -- Jeremy Soller Sun, 04 Jun 2017 06:17:52 -0600 6 | -------------------------------------------------------------------------------- /packages/debian/relibc/debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /packages/debian/relibc/debian/control: -------------------------------------------------------------------------------- 1 | Source: x86-64-unknown-redox-relibc 2 | Maintainer: Jeremy Soller 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 10), x86-64-unknown-redox-binutils, x86-64-unknown-redox-gcc-freestanding 7 | 8 | Package: x86-64-unknown-redox-relibc 9 | Architecture: amd64 10 | Depends: ${misc:Depends} 11 | Conflicts: x86-64-unknown-redox-newlib 12 | Description: Relibc libc for Redox cross compilation on x86_64 13 | -------------------------------------------------------------------------------- /packages/debian/relibc/debian/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Jeremy Soller 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/debian/relibc/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | export TARGET=x86_64-unknown-redox 3 | 4 | %: 5 | dh $@ --builddirectory=build 6 | 7 | override_dh_auto_configure: 8 | rm -rf build 9 | cp -r ../../../relibc build 10 | 11 | override_dh_auto_build: 12 | PATH="$$HOME/.cargo/bin:$$PATH" dh_auto_build 13 | 14 | override_dh_auto_install: 15 | PATH="$$HOME/.cargo/bin:$$PATH" dh_auto_install --destdir=debian/x86-64-unknown-redox-relibc/usr/$(TARGET) 16 | 17 | override_dh_auto_test: 18 | true 19 | -------------------------------------------------------------------------------- /packages/debian/relibc/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /ports/2H4U.patch: -------------------------------------------------------------------------------- 1 | diff -rupN 2H4U/scripts/Makefile 2H4U-redox/scripts/Makefile 2 | --- 2H4U/scripts/Makefile 2006-06-30 03:57:46.000000000 -0700 3 | +++ 2H4U-redox/scripts/Makefile 2016-07-27 18:01:44.337133422 -0700 4 | @@ -2,62 +2,62 @@ 5 | 6 | OBJECTS = ../objs/Engine.o ../objs/bonus.o ../objs/highscore.o ../objs/launcher.o ../objs/son.o ../objs/Param.o ../objs/brick.o ../objs/intro.o ../objs/main.o ../objs/terrain.o ../objs/balle.o ../objs/figure.o ../objs/jeu.o ../objs/menu.o 7 | TARGET = ../2H4U 8 | -LIBS = $(shell sdl-config --libs) -lSDL_image -lSDL_mixer -lSDL_ttf 9 | +LIBS = -lSDL_image -lSDL_mixer -lSDL_ttf -lSDL -lfreetype -lpng -lz 10 | 11 | all: dirs $(OBJECTS) 12 | - g++ $(LIBS) -o $(TARGET) $(OBJECTS) 13 | + $(CXX) -o $(TARGET) $(OBJECTS) $(LIBS) 14 | 15 | dirs: 16 | mkdir -p ../objs 17 | 18 | ../objs/Engine.o: ../sources/Engine.cpp 19 | - g++ -o $@ -c $< 20 | + $(CXX) -o $@ -c $< 21 | 22 | ../objs/bonus.o: ../sources/bonus.cpp 23 | - g++ -o $@ -c $< 24 | + $(CXX) -o $@ -c $< 25 | 26 | ../objs/highscore.o: ../sources/highscore.cpp 27 | - g++ -o $@ -c $< 28 | + $(CXX) -o $@ -c $< 29 | 30 | ../objs/launcher.o: ../sources/launcher.cpp 31 | - g++ -o $@ -c $< 32 | + $(CXX) -o $@ -c $< 33 | 34 | ../objs/son.o: ../sources/son.cpp 35 | - g++ -o $@ -c $< 36 | + $(CXX) -o $@ -c $< 37 | 38 | ../objs/Param.o: ../sources/Param.cpp 39 | - g++ -o $@ -c $< 40 | + $(CXX) -o $@ -c $< 41 | 42 | ../objs/brick.o: ../sources/brick.cpp 43 | - g++ -o $@ -c $< 44 | + $(CXX) -o $@ -c $< 45 | 46 | ../objs/intro.o: ../sources/intro.cpp 47 | - g++ -o $@ -c $< 48 | + $(CXX) -o $@ -c $< 49 | 50 | ../objs/main.o: ../sources/main.cpp 51 | - g++ -o $@ -c $< 52 | + $(CXX) -o $@ -c $< 53 | 54 | ../objs/terrain.o: ../sources/terrain.cpp 55 | - g++ -o $@ -c $< 56 | + $(CXX) -o $@ -c $< 57 | 58 | ../objs/balle.o: ../sources/balle.cpp 59 | - g++ -o $@ -c $< 60 | + $(CXX) -o $@ -c $< 61 | 62 | ../objs/figure.o: ../sources/figure.cpp 63 | - g++ -o $@ -c $< 64 | + $(CXX) -o $@ -c $< 65 | 66 | ../objs/jeu.o: ../sources/jeu.cpp 67 | - g++ -o $@ -c $< 68 | + $(CXX) -o $@ -c $< 69 | 70 | ../objs/menu.o: ../sources/menu.cpp 71 | - g++ -o $@ -c $< 72 | + $(CXX) -o $@ -c $< 73 | 74 | rebuild: 75 | - superclean 76 | + distclean 77 | all 78 | 79 | clean: 80 | rm -rf $(OBJECTS) 81 | 82 | -superclean : clean 83 | +distclean : clean 84 | rm -rf $(TARGET) 85 | diff -rupN 2H4U/sources/sdl_includes.h 2H4U-redox/sources/sdl_includes.h 86 | --- 2H4U/sources/sdl_includes.h 2006-10-02 10:14:50.000000000 -0700 87 | +++ 2H4U-redox/sources/sdl_includes.h 2016-07-27 18:01:44.337133422 -0700 88 | @@ -20,7 +20,7 @@ 89 | //Fichier qui contient tous les includes de SDL. 90 | 91 | //Uncomment the following line to disables sounds in 2H4U. 92 | -//#define NO_SOUND_2H4U 93 | +#define NO_SOUND_2H4U 94 | 95 | //IF compiling with MAC 96 | #ifdef MAC_OS 97 | -------------------------------------------------------------------------------- /ports/2H4U.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | SRC=http://sourceforge.net/projects/toohardforyou/files/2H4U/2H4U%20v1.3/2H4U-1.3_SOURCES.tar.gz 7 | DIR=2H4U 8 | 9 | MAKE_DIR=scripts 10 | make_template $* 11 | -------------------------------------------------------------------------------- /ports/airstrike.patch: -------------------------------------------------------------------------------- 1 | diff -rupN airstrike/src/Makefile airstrike-redox/src/Makefile 2 | --- airstrike/src/Makefile 2003-01-18 12:02:32.000000000 -0800 3 | +++ airstrike-redox/src/Makefile 2016-07-27 18:03:53.961313537 -0700 4 | @@ -5,7 +5,7 @@ CFILES:= $(shell find . -name '*.c') 5 | OBJECTS:= $(CFILES:.c=.o) 6 | 7 | airstrike: $(OBJECTS) 8 | - $(CC) -o $@ $(CFLAGS) $(OBJECTS) `sdl-config --libs` -lSDL_image 9 | + $(CC) -o $@ $(CFLAGS) $(OBJECTS) `sdl-config --libs` -lSDL_image -lpng -lz 10 | 11 | airstrike-sound: $(OBJECTS) 12 | $(CC) -o $@ $(CFLAGS) $(OBJECTS) `sdl-config --libs` -lSDL_image -lSDL_mixer 13 | -------------------------------------------------------------------------------- /ports/airstrike.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | DEPENDS sdl 6 | DEPENDS sdl_image 7 | 8 | SRC=http://icculus.org/airstrike/airstrike-pre6a-src.tar.gz 9 | DIR=airstrike-pre6a-src 10 | 11 | export OPTIONS="-Os -static" 12 | make_template $* 13 | -------------------------------------------------------------------------------- /ports/binutils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | GIT=https://github.com/redox-os/binutils-gdb.git 7 | DIR=binutils-gdb 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}" "--target=${HOST}" "--prefix=/" "--with-sysroot=${SYSROOT}" "--disable-gdb" "--disable-nls" "--disable-werror") 10 | 11 | function binutils_template { 12 | case $1 in 13 | install) 14 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" DESTDIR="${BUILD}/sysroot" -j `nproc` install 15 | ;; 16 | add) 17 | fetch_template add 18 | configure_template configure 19 | make_template build 20 | binutils_template install 21 | ;; 22 | uninstall) 23 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" DESTDIR="${BUILD}/sysroot" -j `nproc` uninstal 24 | ;; 25 | *) 26 | configure_template $* 27 | ;; 28 | esac 29 | } 30 | 31 | binutils_template $* 32 | -------------------------------------------------------------------------------- /ports/curl.patch: -------------------------------------------------------------------------------- 1 | diff -rupN curl/config.sub curl-redox/config.sub 2 | --- curl/config.sub 2015-09-22 07:11:42.000000000 -0700 3 | +++ curl-redox/config.sub 2016-07-27 18:04:23.608268450 -0700 4 | @@ -1377,7 +1377,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* | -cloudabi* | -sortix* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/curl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | SRC=http://curl.haxx.se/download/curl-7.45.0.tar.gz 7 | DIR=curl-7.45.0 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-tftp" "--disable-ftp") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/dash.patch: -------------------------------------------------------------------------------- 1 | diff -ru dash-0.5.7/src/bltin/test.c dash-0.5.7-new/src/bltin/test.c 2 | --- dash-0.5.7/src/bltin/test.c 2011-03-15 00:18:06.000000000 -0700 3 | +++ dash-0.5.7-new/src/bltin/test.c 2017-06-06 12:57:18.211291543 -0700 4 | @@ -528,9 +528,9 @@ 5 | if (gid == getgid() || gid == getegid()) 6 | return (1); 7 | 8 | - ngroups = getgroups(0, NULL); 9 | - group_array = stalloc(ngroups * sizeof(gid_t)); 10 | - if ((getgroups(ngroups, group_array)) != ngroups) 11 | + //ngroups = getgroups(0, NULL); 12 | + //group_array = stalloc(ngroups * sizeof(gid_t)); 13 | + //if ((getgroups(ngroups, group_array)) != ngroups) 14 | return (0); 15 | 16 | /* Search through the list looking for GID. */ 17 | diff -ru dash-0.5.7/src/builtins.def.in dash-0.5.7-new/src/builtins.def.in 18 | --- dash-0.5.7/src/builtins.def.in 2010-05-26 20:45:23.000000000 -0700 19 | +++ dash-0.5.7-new/src/builtins.def.in 2017-06-06 12:58:52.892326015 -0700 20 | @@ -46,7 +46,7 @@ 21 | */ 22 | 23 | #ifndef JOBS 24 | -#define JOBS 1 25 | +#define JOBS 0 26 | #endif 27 | 28 | #if JOBS 29 | diff -ru dash-0.5.7/src/jobs.c dash-0.5.7-new/src/jobs.c 30 | --- dash-0.5.7/src/jobs.c 2011-03-15 00:45:32.000000000 -0700 31 | +++ dash-0.5.7-new/src/jobs.c 2017-06-06 13:03:15.904978131 -0700 32 | @@ -46,7 +46,7 @@ 33 | #include 34 | #include 35 | #endif 36 | -#include 37 | +//#include 38 | 39 | #include "shell.h" 40 | #if JOBS 41 | @@ -1136,17 +1136,17 @@ 42 | 43 | do { 44 | gotsigchld = 0; 45 | - err = wait3(status, flags, NULL); 46 | + err = waitpid(-1, status, flags); 47 | if (err || !block) 48 | break; 49 | 50 | block = 0; 51 | 52 | sigfillset(&mask); 53 | - sigprocmask(SIG_SETMASK, &mask, &oldmask); 54 | + //sigprocmask(SIG_SETMASK, &mask, &oldmask); 55 | 56 | - while (!gotsigchld && !pendingsigs) 57 | - sigsuspend(&oldmask); 58 | + //while (!gotsigchld && !pendingsigs) 59 | + // sigsuspend(&oldmask); 60 | 61 | sigclearmask(); 62 | } while (gotsigchld); 63 | diff -ru dash-0.5.7/src/mkinit.c dash-0.5.7-new/src/mkinit.c 64 | --- dash-0.5.7/src/mkinit.c 2008-05-01 23:09:44.000000000 -0700 65 | +++ dash-0.5.7-new/src/mkinit.c 2017-06-06 12:51:08.200809714 -0700 66 | @@ -47,7 +47,7 @@ 67 | #include 68 | #include 69 | #include 70 | -#include 71 | +//#include 72 | #include 73 | 74 | 75 | diff -ru dash-0.5.7/src/output.c dash-0.5.7-new/src/output.c 76 | --- dash-0.5.7/src/output.c 2011-03-15 00:18:06.000000000 -0700 77 | +++ dash-0.5.7-new/src/output.c 2017-06-06 12:18:38.123364338 -0700 78 | @@ -45,7 +45,7 @@ 79 | 80 | #include /* quad_t */ 81 | #include /* BSD4_4 */ 82 | -#include 83 | +//#include 84 | 85 | #include /* defines BUFSIZ */ 86 | #include 87 | diff -ru dash-0.5.7/src/shell.h dash-0.5.7-new/src/shell.h 88 | --- dash-0.5.7/src/shell.h 2008-05-01 23:09:44.000000000 -0700 89 | +++ dash-0.5.7-new/src/shell.h 2017-06-06 12:33:14.200424324 -0700 90 | @@ -52,7 +52,7 @@ 91 | #include 92 | 93 | #ifndef JOBS 94 | -#define JOBS 1 95 | +#define JOBS 0 96 | #endif 97 | #ifndef BSD 98 | #define BSD 1 99 | diff -ru dash-0.5.7/src/system.h dash-0.5.7-new/src/system.h 100 | --- dash-0.5.7/src/system.h 2011-03-15 00:34:53.000000000 -0700 101 | +++ dash-0.5.7-new/src/system.h 2017-06-06 12:54:36.082716644 -0700 102 | @@ -36,9 +36,8 @@ 103 | 104 | static inline void sigclearmask(void) 105 | { 106 | -#ifdef HAVE_SIGSETMASK 107 | +#if 0 108 | sigsetmask(0); 109 | -#else 110 | sigset_t set; 111 | sigemptyset(&set); 112 | sigprocmask(SIG_SETMASK, &set, 0); 113 | @@ -82,7 +81,7 @@ 114 | int (*)(const void *, const void *)); 115 | #endif 116 | 117 | -#ifndef HAVE_KILLPG 118 | +#if 0 119 | static inline int killpg(pid_t pid, int signal) 120 | { 121 | #ifdef DEBUG 122 | diff -ru dash-0.5.7/src/trap.c dash-0.5.7-new/src/trap.c 123 | --- dash-0.5.7/src/trap.c 2010-11-28 04:54:10.000000000 -0800 124 | +++ dash-0.5.7-new/src/trap.c 2017-06-06 12:55:47.773584397 -0700 125 | @@ -183,6 +183,7 @@ 126 | void 127 | setsignal(int signo) 128 | { 129 | +#if 0 130 | int action; 131 | char *t, tsig; 132 | struct sigaction act; 133 | @@ -262,6 +263,7 @@ 134 | act.sa_flags = 0; 135 | sigfillset(&act.sa_mask); 136 | sigaction(signo, &act, 0); 137 | +#endif 138 | } 139 | 140 | /* 141 | diff -ru dash-0.5.7/src/var.c dash-0.5.7-new/src/var.c 142 | --- dash-0.5.7/src/var.c 2011-03-15 00:45:32.000000000 -0700 143 | +++ dash-0.5.7-new/src/var.c 2017-06-06 13:04:12.695518184 -0700 144 | @@ -139,7 +139,7 @@ 145 | } 146 | } 147 | 148 | - fmtstr(ppid + 5, sizeof(ppid) - 5, "%ld", (long) getppid()); 149 | + fmtstr(ppid + 5, sizeof(ppid) - 5, "%ld", 1); 150 | setvareq(ppid, VTEXTFIXED); 151 | 152 | p = lookupvar("PWD"); 153 | -------------------------------------------------------------------------------- /ports/dash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://http.debian.net/debian/pool/main/d/dash/dash_0.5.8.orig.tar.gz 7 | DIR=dash-0.5.8 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}") 10 | autoconf_template $* 11 | -------------------------------------------------------------------------------- /ports/dosbox.patch: -------------------------------------------------------------------------------- 1 | diff -rupN dosbox/config.sub dosbox-redox/config.sub 2 | --- dosbox/config.sub 2010-05-10 10:43:54.000000000 -0700 3 | +++ dosbox-redox/config.sub 2016-07-27 18:05:56.382451841 -0700 4 | @@ -1288,7 +1288,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* \ 9 | + | -sym* | -kopensolaris* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | diff -rupN dosbox/include/cross.h dosbox-redox/include/cross.h 14 | --- dosbox/include/cross.h 2010-05-10 10:43:54.000000000 -0700 15 | +++ dosbox-redox/include/cross.h 2016-07-27 18:05:56.382451841 -0700 16 | @@ -61,6 +61,7 @@ 17 | #define ftruncate(blah,blah2) chsize(blah,blah2) 18 | #endif 19 | 20 | +#undef DB_HAVE_NO_POWF 21 | //Solaris maybe others 22 | #if defined (DB_HAVE_NO_POWF) 23 | #include 24 | diff -rupN dosbox/src/cpu/cpu.cpp dosbox-redox/src/cpu/cpu.cpp 25 | --- dosbox/src/cpu/cpu.cpp 2010-05-12 02:57:31.000000000 -0700 26 | +++ dosbox-redox/src/cpu/cpu.cpp 2016-07-27 18:05:56.382451841 -0700 27 | @@ -22,7 +22,7 @@ 28 | #include 29 | #include "dosbox.h" 30 | #include "cpu.h" 31 | -#include "memory.h" 32 | +//#include "memory.h" 33 | #include "debug.h" 34 | #include "mapper.h" 35 | #include "setup.h" 36 | diff -rupN dosbox/src/dos/cdrom_image.cpp dosbox-redox/src/dos/cdrom_image.cpp 37 | --- dosbox/src/dos/cdrom_image.cpp 2010-05-10 10:43:54.000000000 -0700 38 | +++ dosbox-redox/src/dos/cdrom_image.cpp 2016-07-27 18:05:56.382451841 -0700 39 | @@ -418,6 +418,8 @@ static string dirname(char * file) { 40 | 41 | bool CDROM_Interface_Image::LoadCueSheet(char *cuefile) 42 | { 43 | + return false; 44 | + /* 45 | Track track = {0, 0, 0, 0, 0, 0, false, NULL}; 46 | tracks.clear(); 47 | int shift = 0; 48 | @@ -549,6 +551,7 @@ bool CDROM_Interface_Image::LoadCueSheet 49 | if(!AddTrack(track, shift, 0, totalPregap, 0)) return false; 50 | 51 | return true; 52 | + */ 53 | } 54 | 55 | bool CDROM_Interface_Image::AddTrack(Track &curr, int &shift, int prestart, int &totalPregap, int currPregap) 56 | diff -rupN dosbox/src/misc/cross.cpp dosbox-redox/src/misc/cross.cpp 57 | --- dosbox/src/misc/cross.cpp 2010-05-10 10:43:54.000000000 -0700 58 | +++ dosbox-redox/src/misc/cross.cpp 2016-07-27 18:05:56.382451841 -0700 59 | @@ -103,6 +103,7 @@ void Cross::ResolveHomedir(std::string & 60 | if(temp_line.size() == 1 || temp_line[1] == CROSS_FILESPLIT) { //The ~ and ~/ variant 61 | char * home = getenv("HOME"); 62 | if(home) temp_line.replace(0,1,std::string(home)); 63 | +/* 64 | #if defined HAVE_SYS_TYPES_H && defined HAVE_PWD_H 65 | } else { // The ~username variant 66 | std::string::size_type namelen = temp_line.find(CROSS_FILESPLIT); 67 | @@ -111,6 +112,7 @@ void Cross::ResolveHomedir(std::string & 68 | struct passwd* pass = getpwnam(username.c_str()); 69 | if(pass) temp_line.replace(0,namelen,pass->pw_dir); //namelen -1 +1(for the ~) 70 | #endif // USERNAME lookup code 71 | +*/ 72 | } 73 | } 74 | 75 | -------------------------------------------------------------------------------- /ports/dosbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | SRC=http://downloads.sourceforge.net/project/dosbox/dosbox/0.74/dosbox-0.74.tar.gz 7 | DIR=dosbox-0.74 8 | 9 | export CXXFLAGS="-Os -static" 10 | CONFIGURE_ARGS=("--host=${HOST}" "--with-sdl-prefix=${PREFIX}" "--disable-opengl" "--disable-sdltest") 11 | configure_template $* 12 | -------------------------------------------------------------------------------- /ports/environ.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | name="$(basename "$0" .sh)" 5 | 6 | ARCH="x86_64" 7 | HOST="${ARCH}-unknown-redox" 8 | RUST_HOST="${ARCH}-unknown-redox" 9 | BUILD="$(dirname "${PWD}")/build" 10 | PREFIX="${BUILD}/sysroot/usr" 11 | export PATH="${BUILD}/prefix/bin:$PATH" 12 | export PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig/" 13 | export AR="${HOST}-ar" 14 | export AS="${HOST}-as" 15 | export CC="${HOST}-gcc" 16 | export CXX="${HOST}-g++" 17 | export CONFIGURE=./configure 18 | export LD="${HOST}-ld" 19 | export NM="${HOST}-nm" 20 | export OBJCOPY="${HOST}-objcopy" 21 | export OBJDUMP="${HOST}-objdump" 22 | export RANLIB="${HOST}-ranlib" 23 | export READELF="${HOST}-readelf" 24 | export STRIP="${HOST}-strip" 25 | 26 | function BROKEN { 27 | printf "%-16s \e[1m\e[31mBROKEN\e[39m\e[0m\n" "$name" 28 | } 29 | 30 | function UNSTABLE { 31 | printf "%-16s \e[1m\e[33mUNSTABLE\e[39m\e[0m\n" "$name" 32 | } 33 | 34 | function STABLE { 35 | printf "%-16s \e[1m\e[32mSTABLE\e[39m\e[0m\n" "$name" 36 | } 37 | 38 | function DEPENDS { 39 | for depend in $* 40 | do 41 | printf "%-16s \e[1m%s\e[0m\n" "$name" "$depend" 42 | done 43 | } 44 | 45 | function fetch_template { 46 | case $1 in 47 | add) 48 | fetch_template fetch 49 | if [ -f "$name.patch" ] 50 | then 51 | patch -p1 -d "${BUILD}/${DIR}" < "$name.patch" 52 | fi 53 | ;; 54 | remove) 55 | if [ -d "${BUILD}/${DIR}" ] 56 | then 57 | rm -rfv "${BUILD}/${DIR}" 58 | fi 59 | ;; 60 | fetch) 61 | if [ -n "${SRC}" ] 62 | then 63 | if [ ! -f "${BUILD}/$(basename "${SRC}")" ] 64 | then 65 | wget "${SRC}" -O "${BUILD}/$(basename "${SRC}")" 66 | fi 67 | rm -rf "${BUILD}/${DIR}" 68 | pushd "${BUILD}" 69 | tar xvf "$(basename "${SRC}")" 70 | popd 71 | elif [ -n "${GIT}" ] 72 | then 73 | if [ ! -d "${BUILD}/${DIR}" ] 74 | then 75 | pushd "${BUILD}" 76 | if [ -n "${GIT_BRANCH}" ] 77 | then 78 | git clone --recursive "${GIT}" --branch "${GIT_BRANCH}" 79 | else 80 | git clone --recursive "${GIT}" 81 | fi 82 | popd 83 | else 84 | pushd "${BUILD}/${DIR}" 85 | git clean -fd 86 | git reset --hard 87 | git pull 88 | popd 89 | fi 90 | fi 91 | ;; 92 | unfetch) 93 | if [ -n "${SRC}" ] 94 | then 95 | if [ -f "${BUILD}/$(basename "${SRC}")" ] 96 | then 97 | rm -fv "${BUILD}/$(basename "${SRC}")" 98 | fi 99 | elif [ -n "${GIT}" ] 100 | then 101 | if [ -d "${BUILD}/${DIR}" ] 102 | then 103 | rm -rfv "${BUILD}/${DIR}" 104 | fi 105 | fi 106 | ;; 107 | patch) 108 | if [ -f "${BUILD}/${DIR}/$2" ] 109 | then 110 | mkdir -pv "$(dirname "${DIR}/$2")" 111 | cp -v "${BUILD}/${DIR}/$2" "${DIR}/$2" 112 | fi 113 | ;; 114 | esac 115 | } 116 | 117 | function make_template { 118 | case $1 in 119 | build) 120 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" -j `nproc` "${BUILD_ARGS[@]}" 121 | ;; 122 | install) 123 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" -j `nproc` install "${INSTALL_ARGS[@]}" 124 | ;; 125 | add) 126 | fetch_template add 127 | make_template build 128 | make_template install 129 | ;; 130 | clean) 131 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" -j `nproc` clean "${CLEAN_ARGS[@]}" 132 | ;; 133 | uninstall) 134 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" -j `nproc` uninstall "${UNINSTALL_ARGS[@]}" 135 | ;; 136 | remove) 137 | make_template uninstall || true 138 | make_template clean || true 139 | fetch_template remove 140 | ;; 141 | *) 142 | fetch_template $* 143 | ;; 144 | esac 145 | } 146 | 147 | function cargo_template { 148 | case $1 in 149 | update) 150 | pushd "${BUILD}/${DIR}/${MAKE_DIR}" 151 | cargo update 152 | popd 153 | ;; 154 | build) 155 | pushd "${BUILD}/${DIR}/${MAKE_DIR}" 156 | cargo build --target="${RUST_HOST}" --release --verbose $CARGO_ARGS 157 | popd 158 | ;; 159 | install) 160 | if [ -n "${CARGO_BINS}" ] 161 | then 162 | for bin in ${CARGO_BINS} 163 | do 164 | cp -v "${BUILD}/${DIR}/${MAKE_DIR}/target/${RUST_HOST}/release/$bin" "${PREFIX}/bin" 165 | done 166 | fi 167 | ;; 168 | add) 169 | fetch_template add 170 | cargo_template build 171 | cargo_template install 172 | ;; 173 | clean) 174 | pushd "${BUILD}/${DIR}/${MAKE_DIR}" 175 | cargo clean 176 | popd 177 | ;; 178 | uninstall) 179 | if [ -n "${CARGO_BINS}" ] 180 | then 181 | for bin in ${CARGO_BINS} 182 | do 183 | rm -v "${PREFIX}/bin/$bin" 184 | done 185 | fi 186 | ;; 187 | remove) 188 | cargo_template uninstall || true 189 | cargo_template clean || true 190 | fetch_template remove 191 | ;; 192 | *) 193 | fetch_template $* 194 | ;; 195 | esac 196 | } 197 | 198 | function configure_template { 199 | case $1 in 200 | configure) 201 | mkdir -p "${BUILD}/${DIR}/${MAKE_DIR}" 202 | pushd "${BUILD}/${DIR}/${MAKE_DIR}" 203 | ${CONFIGURE} --prefix="${PREFIX}" "${CONFIGURE_ARGS[@]}" 204 | popd 205 | ;; 206 | add) 207 | fetch_template add 208 | configure_template configure 209 | make_template build 210 | make_template install 211 | ;; 212 | distclean) 213 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" -j `nproc` distclean "${DISTCLEAN_ARGS[@]}" 214 | ;; 215 | remove) 216 | make_template uninstall || true 217 | configure_template distclean || true 218 | fetch_template remove 219 | ;; 220 | *) 221 | make_template $* 222 | ;; 223 | esac 224 | } 225 | 226 | function autoconf_template { 227 | case $1 in 228 | autoconf) 229 | mkdir -p "${BUILD}/${DIR}/${MAKE_DIR}" 230 | pushd "${BUILD}/${DIR}/${MAKE_DIR}" 231 | autoconf $AUTOCONF_ARGS 232 | popd 233 | ;; 234 | add) 235 | fetch_template add 236 | autoconf_template autoconf 237 | configure_template configure 238 | make_template build 239 | make_template install 240 | ;; 241 | *) 242 | configure_template $* 243 | ;; 244 | esac 245 | } 246 | 247 | function autogen_template { 248 | case $1 in 249 | autogen) 250 | pushd "${BUILD}/${DIR}" 251 | ./autogen.sh $AUTOGEN_ARGS 252 | popd 253 | ;; 254 | add) 255 | fetch_template add 256 | autogen_template autogen 257 | configure_template configure 258 | make_template build 259 | make_template install 260 | ;; 261 | *) 262 | configure_template $* 263 | ;; 264 | esac 265 | } 266 | 267 | function cmake_template { 268 | case $1 in 269 | cmake) 270 | mkdir -p "${BUILD}/${DIR}/${MAKE_DIR}" 271 | pushd "${BUILD}/${DIR}/${MAKE_DIR}" 272 | cmake "${CMAKE_ARGS[@]}" ${BUILD}/${DIR} 273 | popd 274 | ;; 275 | add) 276 | fetch_template add 277 | cmake_template cmake 278 | make_template build 279 | make_template install 280 | ;; 281 | *) 282 | configure_template $* 283 | ;; 284 | esac 285 | } 286 | -------------------------------------------------------------------------------- /ports/expat.patch: -------------------------------------------------------------------------------- 1 | diff -rupN expat/conftools/config.sub expat-redox/conftools/config.sub 2 | --- expat/conftools/config.sub 2012-03-24 12:12:39.000000000 -0700 3 | +++ expat-redox/conftools/config.sub 2016-07-27 18:06:35.556122814 -0700 4 | @@ -1324,7 +1324,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* \ 9 | + | -sym* | -kopensolaris* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/expat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | STABLE 5 | 6 | SRC=http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz 7 | DIR=expat-2.1.0 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/freeciv.patch: -------------------------------------------------------------------------------- 1 | diff -rupN freeciv/bootstrap/config.sub freeciv-redox/bootstrap/config.sub 2 | --- freeciv/bootstrap/config.sub 2004-09-20 17:58:58.000000000 -0700 3 | +++ freeciv-redox/bootstrap/config.sub 2016-07-27 18:06:44.842867836 -0700 4 | @@ -1023,7 +1023,7 @@ case $os in 5 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ 6 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ 7 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 8 | - | -aos* \ 9 | + | -aos* | -redox* \ 10 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 11 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 12 | | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ 13 | -------------------------------------------------------------------------------- /ports/freeciv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://sourceforge.net/projects/freeciv/files/Freeciv%202.0/2.0.4/freeciv-2.0.4.tar.bz2 7 | DIR=freeciv-2.0.4 8 | 9 | AUTOGEN_ARGS="--host=${HOST} --prefix=${PREFIX} --with-libiconv-prefix=${PREFIX} --with-sdl-prefix=${PREFIX} --enable-client=sdl" 10 | autogen_template $* 11 | -------------------------------------------------------------------------------- /ports/freetype.patch: -------------------------------------------------------------------------------- 1 | diff -rupN freetype/builds/unix/config.sub freetype-redox/builds/unix/config.sub 2 | --- freetype/builds/unix/config.sub 2015-10-03 23:21:09.000000000 -0700 3 | +++ freetype-redox/builds/unix/config.sub 2016-07-27 18:06:47.346222182 -0700 4 | @@ -1377,7 +1377,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* | -cloudabi* | -sortix* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/freetype.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | STABLE 5 | 6 | SRC=http://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.bz2 7 | DIR=freetype-2.6.1 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-shared" "--with-harfbuzz=no") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | GIT=https://github.com/redox-os/gcc.git 7 | GIT_BRANCH=redox 8 | DIR=gcc 9 | 10 | CONFIGURE_ARGS=("--host=${HOST}" "--target=${HOST}" "--prefix=/" "--enable-static" "--disable-shared" "--disable-dlopen" "--disable-nls" "--enable-languages=c" "--without-headers") 11 | BUILD_ARGS=("all-gcc" "all-target-libgcc") 12 | 13 | case $1 in 14 | add) 15 | fetch_template add 16 | pushd "${BUILD}/${DIR}" 17 | ./contrib/download_prerequisites 18 | cp config.sub gmp/config.sub 19 | cp config.sub isl/config.sub 20 | cp config.sub mpfr/config.sub 21 | cp -f config.sub mpc/config.sub 22 | pushd libstdc++-v3 23 | autoconf2.64 24 | popd 25 | popd 26 | configure_template configure 27 | make_template build 28 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" DESTDIR="${BUILD}/sysroot" -j `nproc` install-gcc install-target-libgcc 29 | ;; 30 | install) 31 | make -C "${BUILD}/${DIR}/${MAKE_DIR}" DESTDIR="${BUILD}/sysroot" -j `nproc` install-gcc install-target-libgcc 32 | ;; 33 | *) 34 | configure_template $* 35 | ;; 36 | esac 37 | -------------------------------------------------------------------------------- /ports/gettext.patch: -------------------------------------------------------------------------------- 1 | diff -rupN gettext/builds/unix/config.sub gettext-redox/builds/unix/config.sub 2 | --- gettext/builds/unix/config.sub 2015-10-03 23:21:09.000000000 -0700 3 | +++ gettext-redox/builds/unix/config.sub 2016-07-27 17:50:35.887740393 -0700 4 | @@ -1377,7 +1377,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* | -cloudabi* | -sortix* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/gettext.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.6.tar.xz 7 | DIR=gettext-0.19.6 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-java" "--disable-threads") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/glib2.patch: -------------------------------------------------------------------------------- 1 | diff -rupN glib2/config.sub glib2-redox/config.sub 2 | --- glib2/config.sub 2015-10-14 06:10:57.000000000 -0700 3 | +++ glib2-redox/config.sub 2016-07-27 18:07:20.603163831 -0700 4 | @@ -1377,7 +1377,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* | -cloudabi* | -sortix* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/glib2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://ftp.gnome.org/pub/gnome/sources/glib/2.46/glib-2.46.1.tar.xz 7 | DIR=glib-2.46.1 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/gtk+.patch: -------------------------------------------------------------------------------- 1 | diff -rupN gtk+/build-aux/config.sub gtk+-redox/build-aux/config.sub 2 | --- gtk+/build-aux/config.sub 2015-10-21 12:35:42.000000000 -0700 3 | +++ gtk+-redox/build-aux/config.sub 2016-07-27 18:08:32.743735322 -0700 4 | @@ -1371,7 +1371,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/gtk+.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://ftp.gnome.org/pub/gnome/sources/gtk+/3.19/gtk+-3.19.1.tar.xz 7 | DIR=gtk+-3.19.1 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/jemalloc.patch: -------------------------------------------------------------------------------- 1 | diff -rupN jemalloc/build-aux/config.sub jemalloc-redox/build-aux/config.sub 2 | --- jemalloc/build-aux/config.sub 2015-10-21 12:35:42.000000000 -0700 3 | +++ jemalloc-redox/build-aux/config.sub 2016-07-27 17:52:05.564777775 -0700 4 | @@ -1371,7 +1371,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/jemalloc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=https://github.com/jemalloc/jemalloc/releases/download/4.1.0/jemalloc-4.1.0.tar.bz2 7 | DIR=jemalloc-4.1.0 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/libffi.patch: -------------------------------------------------------------------------------- 1 | diff -rupN libffi/config.sub libffi-redox/config.sub 2 | --- libffi/config.sub 2014-11-12 03:59:58.000000000 -0800 3 | +++ libffi-redox/config.sub 2016-07-27 18:08:34.673750173 -0700 4 | @@ -1352,7 +1352,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/libffi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | STABLE 5 | 6 | SRC=ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz 7 | DIR=libffi-3.2.1 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/libgit2.patch: -------------------------------------------------------------------------------- 1 | diff -ru libgit2-0.25.1/CMakeLists.txt libgit2-0.25.1-new/CMakeLists.txt 2 | --- libgit2-0.25.1/CMakeLists.txt 2017-01-09 12:26:45.000000000 -0800 3 | +++ libgit2-0.25.1-new/CMakeLists.txt 2017-06-16 17:09:35.624607611 -0700 4 | @@ -577,6 +577,7 @@ 5 | FILE(GLOB SRC_H include/git2.h include/git2/*.h include/git2/sys/*.h) 6 | 7 | # On Windows use specific platform sources 8 | +ADD_DEFINITIONS(-DNO_ADDRINFO) 9 | IF (WIN32 AND NOT CYGWIN) 10 | ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0501) 11 | FILE(GLOB SRC_OS src/win32/*.c src/win32/*.h) 12 | diff -ru libgit2-0.25.1/src/index.c libgit2-0.25.1-new/src/index.c 13 | --- libgit2-0.25.1/src/index.c 2017-01-09 12:26:45.000000000 -0800 14 | +++ libgit2-0.25.1-new/src/index.c 2017-06-16 17:06:12.780557883 -0700 15 | @@ -860,7 +860,7 @@ 16 | entry->mtime.nanoseconds = st->st_mtime_nsec; 17 | entry->ctime.nanoseconds = st->st_ctime_nsec; 18 | #endif 19 | - entry->dev = st->st_rdev; 20 | + entry->dev = 0; 21 | entry->ino = st->st_ino; 22 | entry->mode = (!trust_mode && S_ISREG(st->st_mode)) ? 23 | git_index__create_mode(0666) : git_index__create_mode(st->st_mode); 24 | diff -ru libgit2-0.25.1/src/posix.c libgit2-0.25.1-new/src/posix.c 25 | --- libgit2-0.25.1/src/posix.c 2017-01-09 12:26:45.000000000 -0800 26 | +++ libgit2-0.25.1-new/src/posix.c 2017-06-16 18:05:19.710672149 -0700 27 | @@ -33,11 +33,11 @@ 28 | return -2; 29 | } 30 | 31 | - ainfo->ai_servent = getservbyname(port, 0); 32 | + ainfo->ai_servent = NULL; 33 | 34 | - if (ainfo->ai_servent) 35 | - ainfo->ai_port = ainfo->ai_servent->s_port; 36 | - else 37 | +// if (ainfo->ai_servent) 38 | +// ainfo->ai_port = ainfo->ai_servent->s_port; 39 | +// else 40 | ainfo->ai_port = atol(port); 41 | 42 | memcpy(&ainfo->ai_addr_in.sin_addr, 43 | diff -ru libgit2-0.25.1/src/unix/map.c libgit2-0.25.1-new/src/unix/map.c 44 | --- libgit2-0.25.1/src/unix/map.c 2017-01-09 12:26:45.000000000 -0800 45 | +++ libgit2-0.25.1-new/src/unix/map.c 2017-06-16 18:07:35.726322986 -0700 46 | @@ -6,7 +6,7 @@ 47 | */ 48 | #include 49 | 50 | -#if !defined(GIT_WIN32) && !defined(NO_MMAP) 51 | +#if 0 52 | 53 | #include "map.h" 54 | #include 55 | -------------------------------------------------------------------------------- /ports/libgit2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | SRC=https://github.com/libgit2/libgit2/archive/v0.25.1.tar.gz 7 | DIR=libgit2-0.25.1 8 | CMAKE_ARGS=(-DCMAKE_CROSSCOMPILING=True -DCMAKE_SYSTEM_NAME=Generic -target=$HOST -DTHREADSAFE=Off -DCURL=Off -DUSE_SSH=Off -DBUILD_CLAR=Off -DCMAKE_INSTALL_PREFIX="$PREFIX") 9 | 10 | cmake_template $* 11 | -------------------------------------------------------------------------------- /ports/libiconv.patch: -------------------------------------------------------------------------------- 1 | diff -rupN libiconv/build-aux/config.sub libiconv-redox/build-aux/config.sub 2 | --- libiconv/build-aux/config.sub 2009-06-21 04:17:33.000000000 -0700 3 | +++ libiconv-redox/build-aux/config.sub 2016-07-27 18:08:40.323793525 -0700 4 | @@ -1261,7 +1261,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ 8 | - | -kopensolaris* \ 9 | + | -kopensolaris* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | diff -rupN libiconv/libcharset/build-aux/config.sub libiconv-redox/libcharset/build-aux/config.sub 14 | --- libiconv/libcharset/build-aux/config.sub 2009-06-21 04:17:33.000000000 -0700 15 | +++ libiconv-redox/libcharset/build-aux/config.sub 2016-07-27 18:08:40.327126884 -0700 16 | @@ -1,9 +1,10 @@ 17 | #! /bin/sh 18 | # Configuration validation subroutine script. 19 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 20 | -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 21 | +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 22 | +# Free Software Foundation, Inc. 23 | 24 | -timestamp='2005-12-23' 25 | +timestamp='2009-02-03' 26 | 27 | # This file is (in principle) common to ALL GNU software. 28 | # The presence of a machine in this file suggests that SOME GNU software 29 | @@ -71,8 +72,8 @@ Report bugs and patches to ".so", 6 | }, 7 | 8 | + 9 | +### Redox 10 | + "redox-x86_64" => { 11 | + inherit_from => [ "BASE_common", asm("x86_elf_asm") ], 12 | + cc => "gcc", 13 | + cflags => "-DL_ENDIAN -DOPENSSL_NO_SOCK -DOPENSSL_NO_DGRAM -DOSSL_SSIZE_MAX=INT_MAX -DNO_SYSLOG -O3 -Wall", 14 | + bn_ops => "BN_LLONG", 15 | + thread_scheme => "(unknown)", 16 | + }, 17 | + 18 | #### Solaris configurations 19 | "solaris-common" => { 20 | inherit_from => [ "BASE_unix" ], 21 | @@ -1867,5 +1882,4 @@ sub vms_info { 22 | ex_libs => add(sub { return vms_info(64)->{zlib} || (); }), 23 | pointer_size => sub { return vms_info(64)->{pointer_size} }, 24 | }, 25 | - 26 | ); 27 | -------------------------------------------------------------------------------- /ports/openssl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | SRC=https://www.openssl.org/source/openssl-1.1.0c.tar.gz 7 | DIR=openssl-1.1.0c 8 | 9 | CONFIGURE="./Configure" 10 | CONFIGURE_ARGS=("no-shared" "redox-x86_64") 11 | configure_template $* 12 | -------------------------------------------------------------------------------- /ports/pacman.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | GIT=https://github.com/ebuc99/pacman.git 7 | DIR=pacman 8 | 9 | AUTOGEN_ARGS="--host=${HOST} --prefix=$PREFIX --with-sdl-prefix=$PREFIX --disable-sdltest" 10 | autogen_template $* 11 | -------------------------------------------------------------------------------- /ports/pcc.patch: -------------------------------------------------------------------------------- 1 | diff -rupN pcc/config.sub pcc-redox/config.sub 2 | --- pcc/config.sub 2015-12-31 08:21:57.000000000 -0800 3 | +++ pcc-redox/config.sub 2016-07-27 18:09:14.374050963 -0700 4 | @@ -1377,7 +1377,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* | -cloudabi* | -sortix* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | diff -rupN pcc/configure pcc-redox/configure 14 | --- pcc/configure 2016-05-15 01:13:53.000000000 -0700 15 | +++ pcc-redox/configure 2016-07-27 18:09:14.374050963 -0700 16 | @@ -2785,6 +2785,20 @@ case "$target_os" in 17 | esac 18 | ;; 19 | 20 | + redox*) 21 | + targos=redox 22 | + abi=elf 23 | + stabs=yes 24 | + case "$target_cpu" in 25 | + arm*) targmach=arm ;; 26 | + i?86) targmach=i386 ;; 27 | + powerpc*) targmach=powerpc endian=big ;; 28 | + x86_64) targmach=amd64 ;; 29 | + mipseb) targmach=mips endian=big ;; 30 | + mips*) targmach=mips ;; 31 | + esac 32 | + ;; 33 | + 34 | sysv4*) 35 | targos=sysv4 36 | abi=elf 37 | diff -rupN pcc/os/redox/ccconfig.h pcc-redox/os/redox/ccconfig.h 38 | --- pcc/os/redox/ccconfig.h 1969-12-31 16:00:00.000000000 -0800 39 | +++ pcc-redox/os/redox/ccconfig.h 2016-07-27 18:09:14.377384322 -0700 40 | @@ -0,0 +1,49 @@ 41 | +/* $Id: ccconfig.h,v 1.4 2014/12/26 11:05:27 ragge Exp $ */ 42 | + 43 | +/* 44 | + * Copyright (c) 2004 Anders Magnusson (ragge@ludd.luth.se). 45 | + * All rights reserved. 46 | + * 47 | + * Redistribution and use in source and binary forms, with or without 48 | + * modification, are permitted provided that the following conditions 49 | + * are met: 50 | + * 1. Redistributions of source code must retain the above copyright 51 | + * notice, this list of conditions and the following disclaimer. 52 | + * 2. Redistributions in binary form must reproduce the above copyright 53 | + * notice, this list of conditions and the following disclaimer in the 54 | + * documentation and/or other materials provided with the distribution. 55 | + * 3. The name of the author may not be used to endorse or promote products 56 | + * derived from this software without specific prior written permission 57 | + * 58 | + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 59 | + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 60 | + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 61 | + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 62 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 63 | + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 64 | + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 65 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 66 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 67 | + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 68 | + */ 69 | + 70 | +/* 71 | + * Various settings that controls how the C compiler works. 72 | + */ 73 | + 74 | +/* 75 | + * This file is for targets where there is no OS 76 | + */ 77 | + 78 | +/* common cpp predefines */ 79 | +#define CPPADD { NULL, } 80 | +#define CRT0FILE "" 81 | +#define STARTFILES { NULL } 82 | +#define ENDFILES { NULL } 83 | + 84 | +#if defined(mach_i386) 85 | +#define CPPMDADD { "-D__i386__", NULL, } 86 | +#else 87 | +#error defines for arch missing 88 | +#endif 89 | + 90 | -------------------------------------------------------------------------------- /ports/pcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-20160603.tgz 7 | DIR=pcc-20160603 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/pixelcannon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | GIT=https://github.com/jackpot51/pixelcannon.git 7 | DIR=pixelcannon 8 | 9 | CARGO_BINS="pixelcannon" 10 | cargo_template $* 11 | -------------------------------------------------------------------------------- /ports/qt.patch: -------------------------------------------------------------------------------- 1 | diff -rupN qt/qtbase/mkspecs/common/redox.conf qt-redox/qtbase/mkspecs/common/redox.conf 2 | --- qt/qtbase/mkspecs/common/redox.conf 1969-12-31 16:00:00.000000000 -0800 3 | +++ qt-redox/qtbase/mkspecs/common/redox.conf 2016-07-27 18:14:03.299353480 -0700 4 | @@ -0,0 +1,55 @@ 5 | +# 6 | +# qmake configuration for common redox 7 | +# 8 | + 9 | +QMAKE_PLATFORM += redox 10 | + 11 | +QMAKE_CFLAGS_THREAD += -D_REENTRANT 12 | +QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD 13 | +QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections 14 | + 15 | +QMAKE_INCDIR = 16 | +QMAKE_LIBDIR = 17 | +QMAKE_INCDIR_X11 = 18 | +QMAKE_LIBDIR_X11 = 19 | +QMAKE_INCDIR_OPENGL = 20 | +QMAKE_LIBDIR_OPENGL = 21 | +QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL 22 | +QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL 23 | +QMAKE_INCDIR_EGL = 24 | +QMAKE_LIBDIR_EGL = 25 | +QMAKE_INCDIR_OPENVG = 26 | +QMAKE_LIBDIR_OPENVG = 27 | + 28 | +QMAKE_LIBS = 29 | +QMAKE_LIBS_DYNLOAD = -ldl 30 | +QMAKE_LIBS_X11 = -lXext -lX11 -lm 31 | +QMAKE_LIBS_NIS = -lnsl 32 | +QMAKE_LIBS_EGL = -lEGL 33 | +QMAKE_LIBS_OPENGL = -lGL 34 | +QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 35 | +QMAKE_LIBS_OPENVG = -lOpenVG 36 | +QMAKE_LIBS_THREAD = -lpthread 37 | +QMAKE_LIBS_LIBUDEV = -ludev 38 | + 39 | +QMAKE_CFLAGS_WAYLAND = 40 | +QMAKE_INCDIR_WAYLAND = 41 | +QMAKE_LIBS_WAYLAND_CLIENT = -lwayland-client 42 | +QMAKE_LIBS_WAYLAND_SERVER = -lwayland-server 43 | +QMAKE_LIBDIR_WAYLAND = 44 | +QMAKE_DEFINES_WAYLAND = 45 | +QMAKE_WAYLAND_SCANNER = wayland-scanner 46 | + 47 | +QMAKE_CFLAGS_XCB = 48 | +QMAKE_LIBS_XCB = 49 | +QMAKE_DEFINES_XCB = 50 | + 51 | +QMAKE_AR = ar cqs 52 | +QMAKE_OBJCOPY = objcopy 53 | +QMAKE_NM = nm -P 54 | +QMAKE_RANLIB = 55 | + 56 | +QMAKE_STRIP = strip 57 | +QMAKE_STRIPFLAGS_LIB += --strip-unneeded 58 | + 59 | +include(unix.conf) 60 | diff -rupN qt/qtbase/mkspecs/redox-g++/qmake.conf qt-redox/qtbase/mkspecs/redox-g++/qmake.conf 61 | --- qt/qtbase/mkspecs/redox-g++/qmake.conf 1969-12-31 16:00:00.000000000 -0800 62 | +++ qt-redox/qtbase/mkspecs/redox-g++/qmake.conf 2016-07-27 18:14:03.299353480 -0700 63 | @@ -0,0 +1,12 @@ 64 | +# 65 | +# qmake configuration for redox-g++ 66 | +# 67 | + 68 | +MAKEFILE_GENERATOR = UNIX 69 | +CONFIG += incremental 70 | +QMAKE_INCREMENTAL_STYLE = sublib 71 | + 72 | +include(../common/redox.conf) 73 | +include(../common/gcc-base-unix.conf) 74 | +include(../common/g++-unix.conf) 75 | +load(qt_config) 76 | diff -rupN qt/qtbase/mkspecs/redox-g++/qplatformdefs.h qt-redox/qtbase/mkspecs/redox-g++/qplatformdefs.h 77 | --- qt/qtbase/mkspecs/redox-g++/qplatformdefs.h 1969-12-31 16:00:00.000000000 -0800 78 | +++ qt-redox/qtbase/mkspecs/redox-g++/qplatformdefs.h 2016-07-27 18:14:03.299353480 -0700 79 | @@ -0,0 +1,92 @@ 80 | +/**************************************************************************** 81 | +** 82 | +** Copyright (C) 2015 The Qt Company Ltd. 83 | +** Contact: http://www.qt.io/licensing/ 84 | +** 85 | +** This file is part of the qmake spec of the Qt Toolkit. 86 | +** 87 | +** $QT_BEGIN_LICENSE:LGPL21$ 88 | +** Commercial License Usage 89 | +** Licensees holding valid commercial Qt licenses may use this file in 90 | +** accordance with the commercial license agreement provided with the 91 | +** Software or, alternatively, in accordance with the terms contained in 92 | +** a written agreement between you and The Qt Company. For licensing terms 93 | +** and conditions see http://www.qt.io/terms-conditions. For further 94 | +** information use the contact form at http://www.qt.io/contact-us. 95 | +** 96 | +** GNU Lesser General Public License Usage 97 | +** Alternatively, this file may be used under the terms of the GNU Lesser 98 | +** General Public License version 2.1 or version 3 as published by the Free 99 | +** Software Foundation and appearing in the file LICENSE.LGPLv21 and 100 | +** LICENSE.LGPLv3 included in the packaging of this file. Please review the 101 | +** following information to ensure the GNU Lesser General Public License 102 | +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 103 | +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 104 | +** 105 | +** As a special exception, The Qt Company gives you certain additional 106 | +** rights. These rights are described in The Qt Company LGPL Exception 107 | +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 108 | +** 109 | +** $QT_END_LICENSE$ 110 | +** 111 | +****************************************************************************/ 112 | + 113 | +#ifndef QPLATFORMDEFS_H 114 | +#define QPLATFORMDEFS_H 115 | + 116 | +// Get Qt defines/settings 117 | + 118 | +#include "qglobal.h" 119 | + 120 | +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs 121 | + 122 | +// 1) need to reset default environment if _BSD_SOURCE is defined 123 | +// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 124 | +// 3) it seems older glibc need this to include the X/Open stuff 125 | +#ifndef _GNU_SOURCE 126 | +# define _GNU_SOURCE 127 | +#endif 128 | + 129 | +#include 130 | + 131 | + 132 | +// We are hot - unistd.h should have turned on the specific APIs we requested 133 | + 134 | +#include 135 | +#include 136 | +#include 137 | +#include 138 | +#include 139 | +#include 140 | +#include 141 | + 142 | +#include 143 | +#include 144 | +#include 145 | +#include 146 | +#include 147 | +#include 148 | +#include 149 | +#include 150 | +#include 151 | +#ifndef QT_NO_IPV6IFNAME 152 | +#include 153 | +#endif 154 | + 155 | +#define QT_USE_XOPEN_LFS_EXTENSIONS 156 | +#include "../common/posix/qplatformdefs.h" 157 | + 158 | +#undef QT_SOCKLEN_T 159 | + 160 | +#if defined(__GLIBC__) && (__GLIBC__ >= 2) 161 | +#define QT_SOCKLEN_T socklen_t 162 | +#else 163 | +#define QT_SOCKLEN_T int 164 | +#endif 165 | + 166 | +#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) 167 | +#define QT_SNPRINTF ::snprintf 168 | +#define QT_VSNPRINTF ::vsnprintf 169 | +#endif 170 | + 171 | +#endif // QPLATFORMDEFS_H 172 | -------------------------------------------------------------------------------- /ports/qt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://download.qt.io/official_releases/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.gz 7 | DIR=qt-everywhere-opensource-src-5.5.1 8 | 9 | CONFIGURE_ARGS=("-xplatform" "redox-g++" "-prefix" "$PREFIX" "-arch" "x86" "-opensource" "-confirm-license" "-static" "-no-largefile" "-no-accessibility" "-no-xcb") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/ring.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | GIT=https://github.com/redox-os/ring.git 7 | DIR=ring 8 | 9 | CARGO_ARGS="--no-default-features --features use_heap --example checkdigest" 10 | CARGO_BINS="" 11 | cargo_template $* 12 | -------------------------------------------------------------------------------- /ports/rust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | DEPENDS llvm 6 | 7 | GIT=https://github.com/ids1024/rust.git 8 | GIT_BRANCH=compile-redox 9 | DIR=rust 10 | 11 | unset AR AS CC CXX LD NM OBJCOPY OBJDUMP RANLIB READELF STRIP 12 | 13 | function rustbuild_template { 14 | case $1 in 15 | build) 16 | cp ${BUILD}/../ports/rust/* "${BUILD}/${DIR}" 17 | pushd "${BUILD}/${DIR}" 18 | python x.py build 19 | popd 20 | ;; 21 | add) 22 | fetch_template add 23 | rustbuild_template build 24 | rustbuild_template install 25 | ;; 26 | install) 27 | pushd "${BUILD}/${DIR}" 28 | binpath="${BUILD}/sysroot/bin" 29 | libpath="${BUILD}/sysroot/lib/rustlib/${RUST_HOST}/lib" 30 | mkdir -p "$binpath" "$libpath" 31 | cp -fv "build/${RUST_HOST}/stage2/bin/rustc" "$binpath" 32 | ${HOST}-strip "$binpath/rustc" 33 | cp -fv $(find build/${RUST_HOST}/stage2/lib/rustlib/${RUST_HOST}/lib/ -type f | grep -v librustc) "$libpath" 34 | popd 35 | ;; 36 | *) 37 | configure_template $* 38 | ;; 39 | esac 40 | } 41 | 42 | rustbuild_template $* 43 | -------------------------------------------------------------------------------- /ports/rust/config.toml: -------------------------------------------------------------------------------- 1 | [rust] 2 | backtrace = false 3 | 4 | [target.x86_64-unknown-redox] 5 | cc = "x86_64-elf-redox-gcc" 6 | cxx = "x86_64-elf-redox-g++" 7 | llvm-config = "./llvm-config" 8 | 9 | [build] 10 | host = ["x86_64-unknown-redox"] 11 | target = ["x86_64-unknown-redox"] 12 | -------------------------------------------------------------------------------- /ports/rust/llvm-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import os 5 | 6 | args = sys.argv[1:] 7 | prefix = os.path.realpath(os.path.dirname(os.path.abspath(sys.argv[0])) + "/../sysroot/usr") 8 | 9 | # The values here are copied from the output of llvm-config running under Redox. 10 | # This is a hack, and should be replaced if possible. 11 | 12 | if args == ["--version"]: 13 | print("4.0.1") 14 | elif args == ["--cxxflags"]: 15 | print("-I" + prefix + "/include --std=gnu++11 -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=gnu++11 -g -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS") 16 | elif args == ["--components"]: 17 | print("all all-targets analysis asmparser asmprinter bitreader bitwriter codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfomsf debuginfopdb demangle engine executionengine globalisel instcombine instrumentation interpreter ipo irreader libdriver lineeditor linker lto mc mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcjit passes profiledata runtimedyld scalaropts selectiondag support symbolize tablegen target transformutils vectorize x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info x86utils") 18 | elif args == ['--libs', '--link-static', 'asmparser', 'bitreader', 'bitwriter', 'instrumentation', 'interpreter', 'ipo', 'linker', 'mcjit', 'x86']: 19 | print("-lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMipo -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMInstrumentation -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMProfileData -lLLVMBitReader -lLLVMAsmParser -lLLVMCore -lLLVMSupport -lLLVMDemangle -lgcc") 20 | # FIXME -lgcc should probably not need to be here 21 | elif args == ["--link-static", "--ldflags"]: 22 | print("-L" + prefix + "/lib") 23 | else: 24 | sys.exit(1) 25 | -------------------------------------------------------------------------------- /ports/rustls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | GIT=https://github.com/redox-os/rustls.git 7 | DIR=rustls 8 | 9 | CARGO_ARGS="--no-default-features" 10 | CARGO_BINS="" 11 | cargo_template $* 12 | -------------------------------------------------------------------------------- /ports/sdl.patch: -------------------------------------------------------------------------------- 1 | diff -rupN sdl/build-scripts/config.sub sdl-redox/build-scripts/config.sub 2 | --- sdl/build-scripts/config.sub 2012-01-18 22:30:05.000000000 -0800 3 | +++ sdl-redox/build-scripts/config.sub 2016-07-27 18:17:26.683907466 -0700 4 | @@ -1276,7 +1276,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ 8 | - | -kopensolaris* \ 9 | + | -kopensolaris* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | diff -rupN sdl/configure.in sdl-redox/configure.in 14 | --- sdl/configure.in 2012-01-18 22:30:05.000000000 -0800 15 | +++ sdl-redox/configure.in 2016-07-27 18:17:26.683907466 -0700 16 | @@ -1646,6 +1646,19 @@ AC_HELP_STRING([--enable-video-dummy], [ 17 | fi 18 | } 19 | 20 | +dnl Set up the Orbital video driver. 21 | +CheckOrbitalVideo() 22 | +{ 23 | + AC_ARG_ENABLE(video-orbital, 24 | +AC_HELP_STRING([--enable-video-orbital], [use orbital video driver [[default=yes]]]), 25 | + , enable_video_orbital=yes) 26 | + if test x$enable_video_orbital = xyes; then 27 | + AC_DEFINE(SDL_VIDEO_DRIVER_ORBITAL) 28 | + SOURCES="$SOURCES $srcdir/src/video/orbital/*.c" 29 | + have_video=yes 30 | + fi 31 | +} 32 | + 33 | dnl Check to see if OpenGL support is desired 34 | AC_ARG_ENABLE(video-opengl, 35 | AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [[default=yes]]]), 36 | @@ -2325,10 +2338,11 @@ case "$host" in 37 | have_timers=yes 38 | fi 39 | ;; 40 | - *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*) 41 | + *-*-linux*|*-*-uclinux*|*-*-redox*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*) 42 | case "$host" in 43 | *-*-linux*) ARCH=linux ;; 44 | *-*-uclinux*) ARCH=linux ;; 45 | + *-*-redox*) ARCH=redox ;; 46 | *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;; 47 | *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;; 48 | *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;; 49 | @@ -2347,6 +2361,7 @@ case "$host" in 50 | esac 51 | CheckVisibilityHidden 52 | CheckDummyVideo 53 | + CheckOrbitalVideo 54 | CheckDiskAudio 55 | CheckDummyAudio 56 | CheckDLOPEN 57 | diff -rupN sdl/include/SDL_config.h.in sdl-redox/include/SDL_config.h.in 58 | --- sdl/include/SDL_config.h.in 2012-01-18 22:30:05.000000000 -0800 59 | +++ sdl-redox/include/SDL_config.h.in 2016-07-27 18:17:26.683907466 -0700 60 | @@ -268,6 +268,7 @@ 61 | #undef SDL_VIDEO_DRIVER_GGI 62 | #undef SDL_VIDEO_DRIVER_IPOD 63 | #undef SDL_VIDEO_DRIVER_NANOX 64 | +#undef SDL_VIDEO_DRIVER_ORBITAL 65 | #undef SDL_VIDEO_DRIVER_OS2FS 66 | #undef SDL_VIDEO_DRIVER_PHOTON 67 | #undef SDL_VIDEO_DRIVER_PICOGUI 68 | diff -rupN sdl/src/video/orbital/SDL_orbitalevents.c sdl-redox/src/video/orbital/SDL_orbitalevents.c 69 | --- sdl/src/video/orbital/SDL_orbitalevents.c 1969-12-31 16:00:00.000000000 -0800 70 | +++ sdl-redox/src/video/orbital/SDL_orbitalevents.c 2016-07-27 18:17:26.683907466 -0700 71 | @@ -0,0 +1,159 @@ 72 | +/* 73 | + SDL - Simple DirectMedia Layer 74 | + Copyright (C) 1997-2012 Sam Lantinga 75 | + 76 | + This library is free software; you can redistribute it and/or 77 | + modify it under the terms of the GNU Lesser General Public 78 | + License as published by the Free Software Foundation; either 79 | + version 2.1 of the License, or (at your option) any later version. 80 | + 81 | + This library is distributed in the hope that it will be useful, 82 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 83 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 84 | + Lesser General Public License for more details. 85 | + 86 | + You should have received a copy of the GNU Lesser General Public 87 | + License along with this library; if not, write to the Free Software 88 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 89 | + 90 | + Sam Lantinga 91 | + slouken@libsdl.org 92 | +*/ 93 | +#include "SDL_config.h" 94 | + 95 | +#include "SDL.h" 96 | +#include "../../events/SDL_sysevents.h" 97 | +#include "../../events/SDL_events_c.h" 98 | + 99 | +#include "SDL_orbitalvideo.h" 100 | +#include "SDL_orbitalevents_c.h" 101 | +#include "SDL_orbitalscancode.h" 102 | + 103 | +#include 104 | + 105 | +static SDLKey keymap[128]; 106 | + 107 | +#define EVENT_NONE 0 108 | +#define EVENT_MOUSE 1 109 | +#define EVENT_KEY 2 110 | +#define EVENT_QUIT 3 111 | + 112 | +struct Event { 113 | + int64_t code; 114 | + int64_t a; 115 | + int64_t b; 116 | + int64_t c; 117 | +} __attribute__((packed)); 118 | + 119 | +void ORBITAL_PumpEvents(_THIS) 120 | +{ 121 | + struct Event event; 122 | + while(read(this->hidden->fd, &event, sizeof(event)) > 0){ 123 | + if ( event.code == EVENT_KEY ) { 124 | + SDL_keysym keysym; 125 | + keysym.unicode = event.a; 126 | + keysym.scancode = event.b; 127 | + keysym.sym = keymap[event.b]; 128 | + keysym.mod = KMOD_NONE; 129 | + if ( event.c > 0 ) { 130 | + SDL_PrivateKeyboard(SDL_PRESSED, &keysym); 131 | + } else { 132 | + SDL_PrivateKeyboard(SDL_RELEASED, &keysym); 133 | + } 134 | + } else if( event.code == EVENT_MOUSE ) { 135 | + SDL_PrivateMouseMotion(event.c, 0, event.a, event.b); 136 | + //SDL_PrivateMouseButton(Uint8 state, Uint8 button, Sint16 x, Sint16 y); 137 | + } else if ( event.code == EVENT_QUIT ) { 138 | + SDL_PrivateQuit(); 139 | + } 140 | + } 141 | +} 142 | + 143 | +void ORBITAL_InitOSKeymap(_THIS) 144 | +{ 145 | + int i; 146 | + for ( i = 0; i < SDL_arraysize(keymap); ++i ) 147 | + keymap[i] = SDLK_UNKNOWN; 148 | + 149 | + keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE; 150 | + keymap[SCANCODE_1] = SDLK_1; 151 | + keymap[SCANCODE_2] = SDLK_2; 152 | + keymap[SCANCODE_3] = SDLK_3; 153 | + keymap[SCANCODE_4] = SDLK_4; 154 | + keymap[SCANCODE_5] = SDLK_5; 155 | + keymap[SCANCODE_6] = SDLK_6; 156 | + keymap[SCANCODE_7] = SDLK_7; 157 | + keymap[SCANCODE_8] = SDLK_8; 158 | + keymap[SCANCODE_9] = SDLK_9; 159 | + keymap[SCANCODE_0] = SDLK_0; 160 | + keymap[SCANCODE_MINUS] = SDLK_MINUS; 161 | + keymap[SCANCODE_EQUAL] = SDLK_EQUALS; 162 | + keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE; 163 | + keymap[SCANCODE_TAB] = SDLK_TAB; 164 | + keymap[SCANCODE_Q] = SDLK_q; 165 | + keymap[SCANCODE_W] = SDLK_w; 166 | + keymap[SCANCODE_E] = SDLK_e; 167 | + keymap[SCANCODE_R] = SDLK_r; 168 | + keymap[SCANCODE_T] = SDLK_t; 169 | + keymap[SCANCODE_Y] = SDLK_y; 170 | + keymap[SCANCODE_U] = SDLK_u; 171 | + keymap[SCANCODE_I] = SDLK_i; 172 | + keymap[SCANCODE_O] = SDLK_o; 173 | + keymap[SCANCODE_P] = SDLK_p; 174 | + keymap[SCANCODE_BRACKET_LEFT] = SDLK_LEFTBRACKET; 175 | + keymap[SCANCODE_BRACKET_RIGHT] = SDLK_RIGHTBRACKET; 176 | + keymap[SCANCODE_ENTER] = SDLK_RETURN; 177 | + keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL; 178 | + keymap[SCANCODE_A] = SDLK_a; 179 | + keymap[SCANCODE_S] = SDLK_s; 180 | + keymap[SCANCODE_D] = SDLK_d; 181 | + keymap[SCANCODE_F] = SDLK_f; 182 | + keymap[SCANCODE_G] = SDLK_g; 183 | + keymap[SCANCODE_H] = SDLK_h; 184 | + keymap[SCANCODE_J] = SDLK_j; 185 | + keymap[SCANCODE_K] = SDLK_k; 186 | + keymap[SCANCODE_L] = SDLK_l; 187 | + keymap[SCANCODE_SEMICOLON] = SDLK_SEMICOLON; 188 | + keymap[SCANCODE_APOSTROPHE] = SDLK_QUOTE; 189 | + keymap[SCANCODE_TICK] = SDLK_BACKQUOTE; 190 | + keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT; 191 | + keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT; 192 | + keymap[SCANCODE_BACKSLASH] = SDLK_BACKSLASH; 193 | + keymap[SCANCODE_Z] = SDLK_z; 194 | + keymap[SCANCODE_X] = SDLK_x; 195 | + keymap[SCANCODE_C] = SDLK_c; 196 | + keymap[SCANCODE_V] = SDLK_v; 197 | + keymap[SCANCODE_B] = SDLK_b; 198 | + keymap[SCANCODE_N] = SDLK_n; 199 | + keymap[SCANCODE_M] = SDLK_m; 200 | + keymap[SCANCODE_COMMA] = SDLK_COMMA; 201 | + keymap[SCANCODE_PERIOD] = SDLK_PERIOD; 202 | + keymap[SCANCODE_SLASH] = SDLK_SLASH; 203 | + keymap[SCANCODE_LEFTALT] = SDLK_LALT; 204 | + keymap[SCANCODE_SPACE] = SDLK_SPACE; 205 | + keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK; 206 | + keymap[SCANCODE_F1] = SDLK_F1; 207 | + keymap[SCANCODE_F2] = SDLK_F2; 208 | + keymap[SCANCODE_F3] = SDLK_F3; 209 | + keymap[SCANCODE_F4] = SDLK_F4; 210 | + keymap[SCANCODE_F5] = SDLK_F5; 211 | + keymap[SCANCODE_F6] = SDLK_F6; 212 | + keymap[SCANCODE_F7] = SDLK_F7; 213 | + keymap[SCANCODE_F8] = SDLK_F8; 214 | + keymap[SCANCODE_F9] = SDLK_F9; 215 | + keymap[SCANCODE_F10] = SDLK_F10; 216 | + keymap[SCANCODE_F11] = SDLK_F11; 217 | + keymap[SCANCODE_F12] = SDLK_F12; 218 | + keymap[SCANCODE_HOME] = SDLK_HOME; 219 | + keymap[SCANCODE_CURSORBLOCKUP] = SDLK_UP; 220 | + keymap[SCANCODE_PAGEUP] = SDLK_PAGEUP; 221 | + keymap[SCANCODE_CURSORBLOCKLEFT] = SDLK_LEFT; 222 | + keymap[SCANCODE_CURSORBLOCKRIGHT] = SDLK_RIGHT; 223 | + keymap[SCANCODE_END] = SDLK_END; 224 | + keymap[SCANCODE_CURSORBLOCKDOWN] = SDLK_DOWN; 225 | + keymap[SCANCODE_PAGEDOWN] = SDLK_PAGEDOWN; 226 | + keymap[SCANCODE_INSERT] = SDLK_INSERT; 227 | + keymap[SCANCODE_DELETE] = SDLK_DELETE; 228 | +} 229 | + 230 | +/* end of SDL_orbitalevents.c ... */ 231 | diff -rupN sdl/src/video/orbital/SDL_orbitalevents_c.h sdl-redox/src/video/orbital/SDL_orbitalevents_c.h 232 | --- sdl/src/video/orbital/SDL_orbitalevents_c.h 1969-12-31 16:00:00.000000000 -0800 233 | +++ sdl-redox/src/video/orbital/SDL_orbitalevents_c.h 2016-07-27 18:17:26.683907466 -0700 234 | @@ -0,0 +1,32 @@ 235 | +/* 236 | + SDL - Simple DirectMedia Layer 237 | + Copyright (C) 1997-2012 Sam Lantinga 238 | + 239 | + This library is free software; you can redistribute it and/or 240 | + modify it under the terms of the GNU Lesser General Public 241 | + License as published by the Free Software Foundation; either 242 | + version 2.1 of the License, or (at your option) any later version. 243 | + 244 | + This library is distributed in the hope that it will be useful, 245 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 246 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 247 | + Lesser General Public License for more details. 248 | + 249 | + You should have received a copy of the GNU Lesser General Public 250 | + License along with this library; if not, write to the Free Software 251 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 252 | + 253 | + Sam Lantinga 254 | + slouken@libsdl.org 255 | +*/ 256 | +#include "SDL_config.h" 257 | + 258 | +#include "SDL_orbitalvideo.h" 259 | + 260 | +/* Variables and functions exported by SDL_sysevents.c to other parts 261 | + of the native video subsystem (SDL_sysvideo.c) 262 | +*/ 263 | +extern void ORBITAL_InitOSKeymap(_THIS); 264 | +extern void ORBITAL_PumpEvents(_THIS); 265 | + 266 | +/* end of SDL_orbitalevents_c.h ... */ 267 | diff -rupN sdl/src/video/orbital/SDL_orbitalmouse.c sdl-redox/src/video/orbital/SDL_orbitalmouse.c 268 | --- sdl/src/video/orbital/SDL_orbitalmouse.c 1969-12-31 16:00:00.000000000 -0800 269 | +++ sdl-redox/src/video/orbital/SDL_orbitalmouse.c 2016-07-27 18:17:26.683907466 -0700 270 | @@ -0,0 +1,33 @@ 271 | +/* 272 | + SDL - Simple DirectMedia Layer 273 | + Copyright (C) 1997-2012 Sam Lantinga 274 | + 275 | + This library is free software; you can redistribute it and/or 276 | + modify it under the terms of the GNU Lesser General Public 277 | + License as published by the Free Software Foundation; either 278 | + version 2.1 of the License, or (at your option) any later version. 279 | + 280 | + This library is distributed in the hope that it will be useful, 281 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 282 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 283 | + Lesser General Public License for more details. 284 | + 285 | + You should have received a copy of the GNU Lesser General Public 286 | + License along with this library; if not, write to the Free Software 287 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 288 | + 289 | + Sam Lantinga 290 | + slouken@libsdl.org 291 | +*/ 292 | +#include "SDL_config.h" 293 | + 294 | +#include "SDL_mouse.h" 295 | +#include "../../events/SDL_events_c.h" 296 | + 297 | +#include "SDL_orbitalmouse_c.h" 298 | + 299 | + 300 | +/* The implementation dependent data for the window manager cursor */ 301 | +struct WMcursor { 302 | + int unused; 303 | +}; 304 | diff -rupN sdl/src/video/orbital/SDL_orbitalmouse_c.h sdl-redox/src/video/orbital/SDL_orbitalmouse_c.h 305 | --- sdl/src/video/orbital/SDL_orbitalmouse_c.h 1969-12-31 16:00:00.000000000 -0800 306 | +++ sdl-redox/src/video/orbital/SDL_orbitalmouse_c.h 2016-07-27 18:17:26.683907466 -0700 307 | @@ -0,0 +1,26 @@ 308 | +/* 309 | + SDL - Simple DirectMedia Layer 310 | + Copyright (C) 1997-2012 Sam Lantinga 311 | + 312 | + This library is free software; you can redistribute it and/or 313 | + modify it under the terms of the GNU Lesser General Public 314 | + License as published by the Free Software Foundation; either 315 | + version 2.1 of the License, or (at your option) any later version. 316 | + 317 | + This library is distributed in the hope that it will be useful, 318 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 319 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 320 | + Lesser General Public License for more details. 321 | + 322 | + You should have received a copy of the GNU Lesser General Public 323 | + License along with this library; if not, write to the Free Software 324 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 325 | + 326 | + Sam Lantinga 327 | + slouken@libsdl.org 328 | +*/ 329 | +#include "SDL_config.h" 330 | + 331 | +#include "SDL_orbitalvideo.h" 332 | + 333 | +/* Functions to be exported */ 334 | diff -rupN sdl/src/video/orbital/SDL_orbitalscancode.h sdl-redox/src/video/orbital/SDL_orbitalscancode.h 335 | --- sdl/src/video/orbital/SDL_orbitalscancode.h 1969-12-31 16:00:00.000000000 -0800 336 | +++ sdl-redox/src/video/orbital/SDL_orbitalscancode.h 2016-07-27 18:17:26.687240818 -0700 337 | @@ -0,0 +1,80 @@ 338 | +#define SCANCODE_A 0x1E 339 | +#define SCANCODE_B 0x30 340 | +#define SCANCODE_C 0x2E 341 | +#define SCANCODE_D 0x20 342 | +#define SCANCODE_E 0x12 343 | +#define SCANCODE_F 0x21 344 | +#define SCANCODE_G 0x22 345 | +#define SCANCODE_H 0x23 346 | +#define SCANCODE_I 0x17 347 | +#define SCANCODE_J 0x24 348 | +#define SCANCODE_K 0x25 349 | +#define SCANCODE_L 0x26 350 | +#define SCANCODE_M 0x32 351 | +#define SCANCODE_N 0x31 352 | +#define SCANCODE_O 0x18 353 | +#define SCANCODE_P 0x19 354 | +#define SCANCODE_Q 0x10 355 | +#define SCANCODE_R 0x13 356 | +#define SCANCODE_S 0x1F 357 | +#define SCANCODE_T 0x14 358 | +#define SCANCODE_U 0x16 359 | +#define SCANCODE_V 0x2F 360 | +#define SCANCODE_W 0x11 361 | +#define SCANCODE_X 0x2D 362 | +#define SCANCODE_Y 0x15 363 | +#define SCANCODE_Z 0x2C 364 | +#define SCANCODE_0 0x0B 365 | +#define SCANCODE_1 0x2 366 | +#define SCANCODE_2 0x3 367 | +#define SCANCODE_3 0x4 368 | +#define SCANCODE_4 0x5 369 | +#define SCANCODE_5 0x6 370 | +#define SCANCODE_6 0x7 371 | +#define SCANCODE_7 0x8 372 | +#define SCANCODE_8 0x9 373 | +#define SCANCODE_9 0x0A 374 | +#define SCANCODE_TICK 0x29 375 | +#define SCANCODE_MINUS 0x0C 376 | +#define SCANCODE_EQUAL 0x0D 377 | +#define SCANCODE_BACKSLASH 0x2B 378 | +#define SCANCODE_BACKSPACE 0x0E 379 | +#define SCANCODE_SPACE 0x39 380 | +#define SCANCODE_TAB 0x0F 381 | +#define SCANCODE_CAPSLOCK 0x3A 382 | +#define SCANCODE_LEFTSHIFT 0x2A 383 | +#define SCANCODE_LEFTCONTROL 0x1D 384 | +#define SCANCODE_LEFTALT 0x38 385 | +#define SCANCODE_RIGHTSHIFT 0x36 386 | +#define SCANCODE_ENTER 0x1C 387 | +#define SCANCODE_ESCAPE 0x1 388 | +#define SCANCODE_F1 0x3B 389 | +#define SCANCODE_F2 0x3C 390 | +#define SCANCODE_F3 0x3D 391 | +#define SCANCODE_F4 0x3E 392 | +#define SCANCODE_F5 0x3F 393 | +#define SCANCODE_F6 0x40 394 | +#define SCANCODE_F7 0x41 395 | +#define SCANCODE_F8 0x42 396 | +#define SCANCODE_F9 0x43 397 | +#define SCANCODE_F10 0x44 398 | +#define SCANCODE_F11 0x57 399 | +#define SCANCODE_F12 0x58 400 | +#define SCANCODE_SCROLL 0x46 401 | +#define SCANCODE_BRACKET_LEFT 0x1A 402 | +#define SCANCODE_BRACKET_RIGHT 0x1B 403 | +#define SCANCODE_INSERT 0x52 404 | +#define SCANCODE_HOME 0x47 405 | +#define SCANCODE_PAGEUP 0x49 406 | +#define SCANCODE_DELETE 0x53 407 | +#define SCANCODE_END 0x4F 408 | +#define SCANCODE_PAGEDOWN 0x51 409 | +#define SCANCODE_CURSORBLOCKUP 0x48 410 | +#define SCANCODE_CURSORBLOCKLEFT 0x4B 411 | +#define SCANCODE_CURSORBLOCKDOWN 0x50 412 | +#define SCANCODE_CURSORBLOCKRIGHT 0x4D 413 | +#define SCANCODE_SEMICOLON 0x27 414 | +#define SCANCODE_APOSTROPHE 0x28 415 | +#define SCANCODE_COMMA 0x33 416 | +#define SCANCODE_PERIOD 0x34 417 | +#define SCANCODE_SLASH 0x35 418 | diff -rupN sdl/src/video/orbital/SDL_orbitalvideo.c sdl-redox/src/video/orbital/SDL_orbitalvideo.c 419 | --- sdl/src/video/orbital/SDL_orbitalvideo.c 1969-12-31 16:00:00.000000000 -0800 420 | +++ sdl-redox/src/video/orbital/SDL_orbitalvideo.c 2016-07-27 18:17:26.687240818 -0700 421 | @@ -0,0 +1,243 @@ 422 | +/* 423 | + SDL - Simple DirectMedia Layer 424 | + Copyright (C) 1997-2012 Sam Lantinga 425 | + 426 | + This library is free software; you can redistribute it and/or 427 | + modify it under the terms of the GNU Lesser General Public 428 | + License as published by the Free Software Foundation; either 429 | + version 2.1 of the License, or (at your option) any later version. 430 | + 431 | + This library is distributed in the hope that it will be useful, 432 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 433 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 434 | + Lesser General Public License for more details. 435 | + 436 | + You should have received a copy of the GNU Lesser General Public 437 | + License along with this library; if not, write to the Free Software 438 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 439 | + 440 | + Sam Lantinga 441 | + slouken@libsdl.org 442 | +*/ 443 | +#include "SDL_config.h" 444 | + 445 | +/* Orbital SDL video driver implementation 446 | + * 447 | + * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion 448 | + * of this was cut-and-pasted from Stephane Peter's work in the AAlib 449 | + * SDL video driver. Renamed to "DUMMY" by Sam Lantinga. 450 | + * Repurposed to ORBITAL by Jeremy Soller. 451 | + */ 452 | + 453 | +#include "SDL_video.h" 454 | +#include "SDL_mouse.h" 455 | +#include "../SDL_sysvideo.h" 456 | +#include "../SDL_pixels_c.h" 457 | +#include "../../events/SDL_events_c.h" 458 | + 459 | +#include "SDL_orbitalvideo.h" 460 | +#include "SDL_orbitalevents_c.h" 461 | +#include "SDL_orbitalmouse_c.h" 462 | + 463 | +#include 464 | +#include 465 | +#include 466 | + 467 | +#define ORBITALVID_DRIVER_NAME "orbital" 468 | + 469 | +/* Initialization/Query functions */ 470 | +static int ORBITAL_VideoInit(_THIS, SDL_PixelFormat *vformat); 471 | +static SDL_Rect **ORBITAL_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); 472 | +static SDL_Surface *ORBITAL_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags); 473 | +static int ORBITAL_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors); 474 | +static void ORBITAL_VideoQuit(_THIS); 475 | + 476 | +/* Hardware surface functions */ 477 | +static int ORBITAL_AllocHWSurface(_THIS, SDL_Surface *surface); 478 | +static int ORBITAL_LockHWSurface(_THIS, SDL_Surface *surface); 479 | +static void ORBITAL_UnlockHWSurface(_THIS, SDL_Surface *surface); 480 | +static void ORBITAL_FreeHWSurface(_THIS, SDL_Surface *surface); 481 | + 482 | +/* etc. */ 483 | +static void ORBITAL_UpdateRects(_THIS, int numrects, SDL_Rect *rects); 484 | + 485 | +/* ORBITAL driver bootstrap functions */ 486 | + 487 | +static int ORBITAL_Available(void) 488 | +{ 489 | + return(1); 490 | +} 491 | + 492 | +static void ORBITAL_DeleteDevice(SDL_VideoDevice *device) 493 | +{ 494 | + SDL_free(device->hidden); 495 | + SDL_free(device); 496 | +} 497 | + 498 | +static SDL_VideoDevice *ORBITAL_CreateDevice(int devindex) 499 | +{ 500 | + SDL_VideoDevice *device; 501 | + 502 | + /* Initialize all variables that we clean on shutdown */ 503 | + device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice)); 504 | + if ( device ) { 505 | + SDL_memset(device, 0, (sizeof *device)); 506 | + device->hidden = (struct SDL_PrivateVideoData *) 507 | + SDL_malloc((sizeof *device->hidden)); 508 | + } 509 | + if ( (device == NULL) || (device->hidden == NULL) ) { 510 | + SDL_OutOfMemory(); 511 | + if ( device ) { 512 | + SDL_free(device); 513 | + } 514 | + return(0); 515 | + } 516 | + SDL_memset(device->hidden, 0, (sizeof *device->hidden)); 517 | + 518 | + /* Set the function pointers */ 519 | + device->VideoInit = ORBITAL_VideoInit; 520 | + device->ListModes = ORBITAL_ListModes; 521 | + device->SetVideoMode = ORBITAL_SetVideoMode; 522 | + device->CreateYUVOverlay = NULL; 523 | + device->SetColors = ORBITAL_SetColors; 524 | + device->UpdateRects = ORBITAL_UpdateRects; 525 | + device->VideoQuit = ORBITAL_VideoQuit; 526 | + device->AllocHWSurface = ORBITAL_AllocHWSurface; 527 | + device->CheckHWBlit = NULL; 528 | + device->FillHWRect = NULL; 529 | + device->SetHWColorKey = NULL; 530 | + device->SetHWAlpha = NULL; 531 | + device->LockHWSurface = ORBITAL_LockHWSurface; 532 | + device->UnlockHWSurface = ORBITAL_UnlockHWSurface; 533 | + device->FlipHWSurface = NULL; 534 | + device->FreeHWSurface = ORBITAL_FreeHWSurface; 535 | + device->SetCaption = NULL; 536 | + device->SetIcon = NULL; 537 | + device->IconifyWindow = NULL; 538 | + device->GrabInput = NULL; 539 | + device->GetWMInfo = NULL; 540 | + device->InitOSKeymap = ORBITAL_InitOSKeymap; 541 | + device->PumpEvents = ORBITAL_PumpEvents; 542 | + 543 | + device->free = ORBITAL_DeleteDevice; 544 | + 545 | + return device; 546 | +} 547 | + 548 | +VideoBootStrap ORBITAL_bootstrap = { 549 | + ORBITALVID_DRIVER_NAME, "SDL orbital video driver", 550 | + ORBITAL_Available, ORBITAL_CreateDevice 551 | +}; 552 | + 553 | + 554 | +int ORBITAL_VideoInit(_THIS, SDL_PixelFormat *vformat) 555 | +{ 556 | + fprintf(stderr, "WARNING: You are using the SDL orbital video driver!\n"); 557 | + 558 | + /* Determine the screen depth (use default 32-bit depth) */ 559 | + /* we change this during the SDL_SetVideoMode implementation... */ 560 | + vformat->BitsPerPixel = 32; 561 | + vformat->BytesPerPixel = 4; 562 | + 563 | + /* We're done! */ 564 | + return(0); 565 | +} 566 | + 567 | +SDL_Rect **ORBITAL_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags) 568 | +{ 569 | + return (SDL_Rect **) -1; 570 | +} 571 | + 572 | +SDL_Surface *ORBITAL_SetVideoMode(_THIS, SDL_Surface *current, 573 | + int width, int height, int bpp, Uint32 flags) 574 | +{ 575 | + if ( this->hidden->fd ) { 576 | + close( this->hidden->fd ); 577 | + } 578 | + 579 | + if ( this->hidden->buffer ) { 580 | + SDL_free( this->hidden->buffer ); 581 | + } 582 | + 583 | + char path[4096]; 584 | + snprintf(path, 4096, "orbital:/-1/-1/%d/%d/SDL", width, height); 585 | + this->hidden->fd = open(path, O_RDONLY); 586 | + printf("%s at %d\n", path, this->hidden->fd); 587 | + 588 | + this->hidden->buffer = SDL_malloc(width * height * (bpp / 8)); 589 | + if ( ! this->hidden->buffer ) { 590 | + SDL_SetError("Couldn't allocate buffer for requested mode"); 591 | + return(NULL); 592 | + } 593 | + 594 | + printf("Setting mode %dx%d@%d\n", width, height, bpp); 595 | + 596 | + SDL_memset(this->hidden->buffer, 0, width * height * (bpp / 8)); 597 | + 598 | + /* Allocate the new pixel format for the screen */ 599 | + if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) { 600 | + SDL_free(this->hidden->buffer); 601 | + this->hidden->buffer = NULL; 602 | + SDL_SetError("Couldn't allocate new pixel format for requested mode"); 603 | + return(NULL); 604 | + } 605 | + 606 | + /* Set up the new mode framebuffer */ 607 | + current->flags = flags & SDL_FULLSCREEN; 608 | + this->hidden->w = current->w = width; 609 | + this->hidden->h = current->h = height; 610 | + current->pitch = current->w * (bpp / 8); 611 | + current->pixels = this->hidden->buffer; 612 | + 613 | + /* We're done */ 614 | + return(current); 615 | +} 616 | + 617 | +/* We don't actually allow hardware surfaces other than the main one */ 618 | +static int ORBITAL_AllocHWSurface(_THIS, SDL_Surface *surface) 619 | +{ 620 | + return(-1); 621 | +} 622 | +static void ORBITAL_FreeHWSurface(_THIS, SDL_Surface *surface) 623 | +{ 624 | + return; 625 | +} 626 | + 627 | +/* We need to wait for vertical retrace on page flipped displays */ 628 | +static int ORBITAL_LockHWSurface(_THIS, SDL_Surface *surface) 629 | +{ 630 | + return(0); 631 | +} 632 | + 633 | +static void ORBITAL_UnlockHWSurface(_THIS, SDL_Surface *surface) 634 | +{ 635 | + return; 636 | +} 637 | + 638 | +static void ORBITAL_UpdateRects(_THIS, int numrects, SDL_Rect *rects) 639 | +{ 640 | + write(this->hidden->fd, this->hidden->buffer, this->hidden->w * this->hidden->h * 4); 641 | +} 642 | + 643 | +int ORBITAL_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) 644 | +{ 645 | + /* do nothing of note. */ 646 | + return(1); 647 | +} 648 | + 649 | +/* Note: If we are terminated, this could be called in the middle of 650 | + another SDL video routine -- notably UpdateRects. 651 | +*/ 652 | +void ORBITAL_VideoQuit(_THIS) 653 | +{ 654 | + if ( this->hidden->fd ) { 655 | + close( this->hidden->fd ); 656 | + this->hidden->fd = 0; 657 | + } 658 | + 659 | + if (this->screen->pixels != NULL) 660 | + { 661 | + SDL_free(this->screen->pixels); 662 | + this->screen->pixels = NULL; 663 | + } 664 | +} 665 | diff -rupN sdl/src/video/orbital/SDL_orbitalvideo.h sdl-redox/src/video/orbital/SDL_orbitalvideo.h 666 | --- sdl/src/video/orbital/SDL_orbitalvideo.h 1969-12-31 16:00:00.000000000 -0800 667 | +++ sdl-redox/src/video/orbital/SDL_orbitalvideo.h 2016-07-27 18:17:26.687240818 -0700 668 | @@ -0,0 +1,41 @@ 669 | +/* 670 | + SDL - Simple DirectMedia Layer 671 | + Copyright (C) 1997-2012 Sam Lantinga 672 | + 673 | + This library is free software; you can redistribute it and/or 674 | + modify it under the terms of the GNU Lesser General Public 675 | + License as published by the Free Software Foundation; either 676 | + version 2.1 of the License, or (at your option) any later version. 677 | + 678 | + This library is distributed in the hope that it will be useful, 679 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 680 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 681 | + Lesser General Public License for more details. 682 | + 683 | + You should have received a copy of the GNU Lesser General Public 684 | + License along with this library; if not, write to the Free Software 685 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 686 | + 687 | + Sam Lantinga 688 | + slouken@libsdl.org 689 | +*/ 690 | +#include "SDL_config.h" 691 | + 692 | +#ifndef _SDL_orbitalvideo_h 693 | +#define _SDL_orbitalvideo_h 694 | + 695 | +#include "../SDL_sysvideo.h" 696 | + 697 | +/* Hidden "this" pointer for the video functions */ 698 | +#define _THIS SDL_VideoDevice *this 699 | + 700 | + 701 | +/* Private display data */ 702 | + 703 | +struct SDL_PrivateVideoData { 704 | + int w, h; 705 | + int fd; 706 | + void *buffer; 707 | +}; 708 | + 709 | +#endif /* _SDL_orbitalvideo_h */ 710 | diff -rupN sdl/src/video/SDL_sysvideo.h sdl-redox/src/video/SDL_sysvideo.h 711 | --- sdl/src/video/SDL_sysvideo.h 2012-01-18 22:30:06.000000000 -0800 712 | +++ sdl-redox/src/video/SDL_sysvideo.h 2016-07-27 18:17:26.683907466 -0700 713 | @@ -410,6 +410,9 @@ extern VideoBootStrap AALIB_bootstrap; 714 | #if SDL_VIDEO_DRIVER_CACA 715 | extern VideoBootStrap CACA_bootstrap; 716 | #endif 717 | +#if SDL_VIDEO_DRIVER_ORBITAL 718 | +extern VideoBootStrap ORBITAL_bootstrap; 719 | +#endif 720 | #if SDL_VIDEO_DRIVER_DUMMY 721 | extern VideoBootStrap DUMMY_bootstrap; 722 | #endif 723 | diff -rupN sdl/src/video/SDL_video.c sdl-redox/src/video/SDL_video.c 724 | --- sdl/src/video/SDL_video.c 2012-01-18 22:30:06.000000000 -0800 725 | +++ sdl-redox/src/video/SDL_video.c 2016-07-27 18:17:26.683907466 -0700 726 | @@ -126,6 +126,9 @@ static VideoBootStrap *bootstrap[] = { 727 | #if SDL_VIDEO_DRIVER_CACA 728 | &CACA_bootstrap, 729 | #endif 730 | +#if SDL_VIDEO_DRIVER_ORBITAL 731 | + &ORBITAL_bootstrap, 732 | +#endif 733 | #if SDL_VIDEO_DRIVER_DUMMY 734 | &DUMMY_bootstrap, 735 | #endif 736 | -------------------------------------------------------------------------------- /ports/sdl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | SRC=https://www.libsdl.org/release/SDL-1.2.15.tar.gz 5 | DIR=SDL-1.2.15 6 | 7 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-shared" "--disable-pulseaudio" "--disable-video-x11" "--disable-cdrom" "--disable-loadso" "--disable-threads" "--disable-timers" "--enable-audio" "--enable-dummyaudio" "--enable-video-orbital") 8 | autogen_template $* 9 | -------------------------------------------------------------------------------- /ports/sdl2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | GIT=https://github.com/redox-os/SDL-mirror.git 5 | GIT_BRANCH=redox 6 | DIR=SDL-mirror 7 | 8 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-shared" "--disable-pulseaudio" "--disable-video-x11" "--disable-ime" "--disable-loadso" "--disable-sdl-dlopen" "--disable-threads" "--disable-timers" "--enable-audio" "--enable-dummyaudio" "--enable-video" "--enable-video-orbital") 9 | autogen_template $* 10 | -------------------------------------------------------------------------------- /ports/sdl_gfx.patch: -------------------------------------------------------------------------------- 1 | diff -rupN sdl_gfx/config.sub sdl_gfx-redox/config.sub 2 | --- sdl_gfx/config.sub 2013-10-27 15:04:13.000000000 -0700 3 | +++ sdl_gfx-redox/config.sub 2016-07-27 18:17:21.113875342 -0700 4 | @@ -1346,7 +1346,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* \ 9 | + | -sym* | -kopensolaris* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/sdl_gfx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | STABLE 5 | 6 | SRC=http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-2.0.25.tar.gz 7 | DIR=SDL_gfx-2.0.25 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-shared" "--disable-sdltest") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/sdl_image.patch: -------------------------------------------------------------------------------- 1 | diff -rupN sdl_image/config.sub sdl_image-redox/config.sub 2 | --- sdl_image/config.sub 2012-01-20 17:51:33.000000000 -0800 3 | +++ sdl_image-redox/config.sub 2016-07-27 18:17:22.457216428 -0700 4 | @@ -1276,7 +1276,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ 8 | - | -kopensolaris* \ 9 | + | -kopensolaris* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/sdl_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | STABLE 5 | DEPENDS libpng 6 | 7 | SRC=https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.tar.gz 8 | DIR=SDL_image-1.2.12 9 | 10 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-shared") 11 | configure_template $* 12 | -------------------------------------------------------------------------------- /ports/sdl_mixer.patch: -------------------------------------------------------------------------------- 1 | diff -rupN sdl_mixer/build-scripts/config.sub sdl_mixer-redox/build-scripts/config.sub 2 | --- sdl_mixer/build-scripts/config.sub 2012-01-15 14:01:05.000000000 -0800 3 | +++ sdl_mixer-redox/build-scripts/config.sub 2016-07-27 18:17:24.513894959 -0700 4 | @@ -1276,7 +1276,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ 8 | - | -kopensolaris* \ 9 | + | -kopensolaris* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/sdl_mixer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | SRC=https://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12.tar.gz 7 | DIR=SDL_mixer-1.2.12 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-shared" "--disable-sdltest" "--disable-music-cmd" "--disable-smpegtest") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/sdl_ttf.patch: -------------------------------------------------------------------------------- 1 | diff -rupN sdl_ttf/config.sub sdl_ttf-redox/config.sub 2 | --- sdl_ttf/config.sub 2012-01-14 20:44:08.000000000 -0800 3 | +++ sdl_ttf-redox/config.sub 2016-07-27 18:17:30.113927216 -0700 4 | @@ -1276,7 +1276,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ 8 | - | -kopensolaris* \ 9 | + | -kopensolaris* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | -------------------------------------------------------------------------------- /ports/sdl_ttf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | STABLE 5 | DEPENDS freetype 6 | 7 | SRC=https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.tar.gz 8 | DIR=SDL_ttf-2.0.11 9 | 10 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-shared" "--with-freetype-prefix=${PREFIX}" "--with-sdl-prefix=${PREFIX}" "--disable-sdltest" "--without-harfbuzz") 11 | configure_template $* 12 | -------------------------------------------------------------------------------- /ports/sdldoom.patch: -------------------------------------------------------------------------------- 1 | diff -rupN sdldoom/d_main.c sdldoom-redox/d_main.c 2 | --- sdldoom/d_main.c 1999-12-20 21:16:15.000000000 -0800 3 | +++ sdldoom-redox/d_main.c 2016-07-27 18:17:16.173846798 -0700 4 | @@ -34,10 +34,7 @@ static const char rcsid[] = "$Id: d_main 5 | #include 6 | #include 7 | 8 | -extern int access(char *file, int mode); 9 | - 10 | #define R_OK 4 11 | -#if 0 12 | static int access(char *file, int mode) 13 | { 14 | FILE *test_fp; 15 | @@ -49,7 +46,6 @@ static int access(char *file, int mode) 16 | } 17 | return(-1); 18 | } 19 | -#endif 20 | 21 | 22 | #include "doomdef.h" 23 | diff -rupN sdldoom/i_net.c sdldoom-redox/i_net.c 24 | --- sdldoom/i_net.c 1999-12-20 21:16:16.000000000 -0800 25 | +++ sdldoom-redox/i_net.c 2016-07-27 18:17:16.177180151 -0700 26 | @@ -51,7 +51,7 @@ rcsid[] = "$Id: m_bbox.c,v 1.1 1997/02/0 27 | #define Win32_Winsock 28 | #include 29 | #else 30 | -#error You should hack this file for your BSD sockets layer 31 | +//#error You should hack this file for your BSD sockets layer 32 | #endif 33 | #endif 34 | #endif 35 | @@ -107,13 +107,9 @@ boolean NetListen (void); 36 | // NETWORKING 37 | // 38 | 39 | -int DOOMPORT = (IPPORT_USERRESERVED +0x1d ); 40 | - 41 | int sendsocket; 42 | int insocket; 43 | 44 | -struct sockaddr_in sendaddress[MAXNETNODES]; 45 | - 46 | void (*netget) (void); 47 | void (*netsend) (void); 48 | 49 | @@ -123,14 +119,9 @@ void (*netsend) (void); 50 | // 51 | int UDPsocket (void) 52 | { 53 | - int s; 54 | - 55 | - // allocate a socket 56 | - s = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); 57 | - if (s<0) 58 | - I_Error ("can't create socket: %s",strerror(errno)); 59 | - 60 | - return s; 61 | + I_Error ("no sockets on redox"); 62 | + 63 | + return -1; 64 | } 65 | 66 | // 67 | @@ -141,17 +132,7 @@ BindToLocalPort 68 | ( int s, 69 | int port ) 70 | { 71 | - int v; 72 | - struct sockaddr_in address; 73 | - 74 | - memset (&address, 0, sizeof(address)); 75 | - address.sin_family = AF_INET; 76 | - address.sin_addr.s_addr = INADDR_ANY; 77 | - address.sin_port = port; 78 | - 79 | - v = bind (s, (void *)&address, sizeof(address)); 80 | - if (v == -1) 81 | - I_Error ("BindToPort: bind: %s", strerror(errno)); 82 | + I_Error ("no bind on redox"); 83 | } 84 | 85 | 86 | @@ -160,32 +141,7 @@ BindToLocalPort 87 | // 88 | void PacketSend (void) 89 | { 90 | - int c; 91 | - doomdata_t sw; 92 | - 93 | - // byte swap 94 | - sw.checksum = htonl(netbuffer->checksum); 95 | - sw.player = netbuffer->player; 96 | - sw.retransmitfrom = netbuffer->retransmitfrom; 97 | - sw.starttic = netbuffer->starttic; 98 | - sw.numtics = netbuffer->numtics; 99 | - for (c=0 ; c< netbuffer->numtics ; c++) 100 | - { 101 | - sw.cmds[c].forwardmove = netbuffer->cmds[c].forwardmove; 102 | - sw.cmds[c].sidemove = netbuffer->cmds[c].sidemove; 103 | - sw.cmds[c].angleturn = htons(netbuffer->cmds[c].angleturn); 104 | - sw.cmds[c].consistancy = htons(netbuffer->cmds[c].consistancy); 105 | - sw.cmds[c].chatchar = netbuffer->cmds[c].chatchar; 106 | - sw.cmds[c].buttons = netbuffer->cmds[c].buttons; 107 | - } 108 | - 109 | - //printf ("sending %i\n",gametic); 110 | - c = sendto (sendsocket , &sw, doomcom->datalength 111 | - ,0,(void *)&sendaddress[doomcom->remotenode] 112 | - ,sizeof(sendaddress[doomcom->remotenode])); 113 | - 114 | - // if (c == -1) 115 | - // I_Error ("SendPacket error: %s",strerror(errno)); 116 | + I_Error("no send on redox"); 117 | } 118 | 119 | 120 | @@ -194,83 +150,15 @@ void PacketSend (void) 121 | // 122 | void PacketGet (void) 123 | { 124 | - int i; 125 | - int c; 126 | - struct sockaddr_in fromaddress; 127 | - int fromlen; 128 | - doomdata_t sw; 129 | - 130 | - fromlen = sizeof(fromaddress); 131 | - c = recvfrom (insocket, &sw, sizeof(sw), 0 132 | - , (struct sockaddr *)&fromaddress, &fromlen ); 133 | - if (c == -1 ) 134 | - { 135 | -#ifdef EWOULDBLOCK 136 | - if (errno != EWOULDBLOCK) 137 | -#endif 138 | - I_Error ("GetPacket: %s",strerror(errno)); 139 | - doomcom->remotenode = -1; // no packet 140 | - return; 141 | - } 142 | - 143 | - { 144 | - static int first=1; 145 | - if (first) 146 | - printf("len=%d:p=[0x%x 0x%x] \n", c, *(int*)&sw, *((int*)&sw+1)); 147 | - first = 0; 148 | - } 149 | - 150 | - // find remote node number 151 | - for (i=0 ; inumnodes ; i++) 152 | - if ( fromaddress.sin_addr.s_addr == sendaddress[i].sin_addr.s_addr ) 153 | - break; 154 | - 155 | - if (i == doomcom->numnodes) 156 | - { 157 | - // packet is not from one of the players (new game broadcast) 158 | - doomcom->remotenode = -1; // no packet 159 | - return; 160 | - } 161 | - 162 | - doomcom->remotenode = i; // good packet from a game player 163 | - doomcom->datalength = c; 164 | - 165 | - // byte swap 166 | - netbuffer->checksum = ntohl(sw.checksum); 167 | - netbuffer->player = sw.player; 168 | - netbuffer->retransmitfrom = sw.retransmitfrom; 169 | - netbuffer->starttic = sw.starttic; 170 | - netbuffer->numtics = sw.numtics; 171 | - 172 | - for (c=0 ; c< netbuffer->numtics ; c++) 173 | - { 174 | - netbuffer->cmds[c].forwardmove = sw.cmds[c].forwardmove; 175 | - netbuffer->cmds[c].sidemove = sw.cmds[c].sidemove; 176 | - netbuffer->cmds[c].angleturn = ntohs(sw.cmds[c].angleturn); 177 | - netbuffer->cmds[c].consistancy = ntohs(sw.cmds[c].consistancy); 178 | - netbuffer->cmds[c].chatchar = sw.cmds[c].chatchar; 179 | - netbuffer->cmds[c].buttons = sw.cmds[c].buttons; 180 | - } 181 | + I_Error("no recv on redox"); 182 | } 183 | 184 | 185 | 186 | int GetLocalAddress (void) 187 | { 188 | - char hostname[1024]; 189 | - struct hostent* hostentry; // host information entry 190 | - int v; 191 | - 192 | - // get local address 193 | - v = gethostname (hostname, sizeof(hostname)); 194 | - if (v == -1) 195 | - I_Error ("GetLocalAddress : gethostname: errno %d",errno); 196 | - 197 | - hostentry = gethostbyname (hostname); 198 | - if (!hostentry) 199 | - I_Error ("GetLocalAddress : gethostbyname: couldn't get local host"); 200 | - 201 | - return *(int *)hostentry->h_addr_list[0]; 202 | + I_Error ("no gethostname on redox"); 203 | + return -1; 204 | } 205 | 206 | 207 | @@ -279,108 +167,11 @@ int GetLocalAddress (void) 208 | // 209 | void I_InitNetwork (void) 210 | { 211 | - boolean trueval = true; 212 | - int i; 213 | - int p; 214 | - struct hostent* hostentry; // host information entry 215 | - 216 | - doomcom = malloc (sizeof (*doomcom) ); 217 | - memset (doomcom, 0, sizeof(*doomcom) ); 218 | - 219 | - // set up for network 220 | - i = M_CheckParm ("-dup"); 221 | - if (i && i< myargc-1) 222 | - { 223 | - doomcom->ticdup = myargv[i+1][0]-'0'; 224 | - if (doomcom->ticdup < 1) 225 | - doomcom->ticdup = 1; 226 | - if (doomcom->ticdup > 9) 227 | - doomcom->ticdup = 9; 228 | - } 229 | - else 230 | - doomcom-> ticdup = 1; 231 | - 232 | - if (M_CheckParm ("-extratic")) 233 | - doomcom-> extratics = 1; 234 | - else 235 | - doomcom-> extratics = 0; 236 | - 237 | - p = M_CheckParm ("-port"); 238 | - if (p && p ... 246 | - i = M_CheckParm ("-net"); 247 | - if (!i) 248 | - { 249 | - // single player game 250 | - netgame = false; 251 | - doomcom->id = DOOMCOM_ID; 252 | - doomcom->numplayers = doomcom->numnodes = 1; 253 | - doomcom->deathmatch = false; 254 | - doomcom->consoleplayer = 0; 255 | - return; 256 | - } 257 | - 258 | - netsend = PacketSend; 259 | - netget = PacketGet; 260 | - netgame = true; 261 | - 262 | - // parse player number and host list 263 | - doomcom->consoleplayer = myargv[i+1][0]-'1'; 264 | - 265 | - doomcom->numnodes = 1; // this node for sure 266 | - 267 | - i++; 268 | - while (++i < myargc && myargv[i][0] != '-') 269 | - { 270 | - sendaddress[doomcom->numnodes].sin_family = AF_INET; 271 | - sendaddress[doomcom->numnodes].sin_port = htons(DOOMPORT); 272 | - if (myargv[i][0] == '.') 273 | - { 274 | - sendaddress[doomcom->numnodes].sin_addr.s_addr 275 | - = inet_addr (myargv[i]+1); 276 | - } 277 | - else 278 | - { 279 | - hostentry = gethostbyname (myargv[i]); 280 | - if (!hostentry) 281 | - I_Error ("gethostbyname: couldn't find %s", myargv[i]); 282 | - sendaddress[doomcom->numnodes].sin_addr.s_addr 283 | - = *(int *)hostentry->h_addr_list[0]; 284 | - } 285 | - doomcom->numnodes++; 286 | - } 287 | - 288 | - doomcom->id = DOOMCOM_ID; 289 | - doomcom->numplayers = doomcom->numnodes; 290 | - 291 | - // build message to receive 292 | - insocket = UDPsocket (); 293 | - BindToLocalPort (insocket,htons(DOOMPORT)); 294 | -#ifdef linux 295 | - ioctl (insocket, FIONBIO, &trueval); 296 | -#endif 297 | - 298 | - sendsocket = UDPsocket (); 299 | + I_Error("cannot use networking on redox"); 300 | } 301 | 302 | 303 | void I_NetCmd (void) 304 | { 305 | - if (doomcom->command == CMD_SEND) 306 | - { 307 | - netsend (); 308 | - } 309 | - else if (doomcom->command == CMD_GET) 310 | - { 311 | - netget (); 312 | - } 313 | - else 314 | - I_Error ("Bad net cmd: %i\n",doomcom->command); 315 | + I_Error("no netcmd on redox"); 316 | } 317 | - 318 | -------------------------------------------------------------------------------- /ports/sdldoom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | DEPENDS sdl 6 | 7 | SRC=https://www.libsdl.org/projects/doom/src/sdldoom-1.10.tar.gz 8 | DIR=sdldoom-1.10 9 | 10 | CONFIGURE_ARGS=("--host=${HOST}" "--disable-sdltest") 11 | configure_template $* 12 | -------------------------------------------------------------------------------- /ports/tar.patch: -------------------------------------------------------------------------------- 1 | diff -rupN tar/build-aux/config.sub tar-redox/build-aux/config.sub 2 | --- tar/build-aux/config.sub 2014-03-25 23:58:15.000000000 -0700 3 | +++ tar-redox/build-aux/config.sub 2016-07-27 18:17:33.217278397 -0700 4 | @@ -1354,7 +1354,7 @@ case $os in 5 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 6 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 7 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 8 | - | -sym* | -kopensolaris* | -plan9* \ 9 | + | -sym* | -kopensolaris* | -plan9* | -redox* \ 10 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 11 | | -aos* | -aros* \ 12 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 13 | diff -rupN tar/src/tar.c tar-redox/src/tar.c 14 | --- tar/src/tar.c 2014-07-27 13:30:40.000000000 -0700 15 | +++ tar-redox/src/tar.c 2016-07-27 18:17:33.220611749 -0700 16 | @@ -1341,14 +1341,14 @@ static char filename_terminator; 17 | static char const *const sort_mode_arg[] = { 18 | "none", 19 | "name", 20 | - "inode", 21 | + //"inode", 22 | NULL 23 | }; 24 | 25 | static int sort_mode_flag[] = { 26 | SAVEDIR_SORT_NONE, 27 | SAVEDIR_SORT_NAME, 28 | - SAVEDIR_SORT_INODE 29 | + //SAVEDIR_SORT_INODE 30 | }; 31 | 32 | ARGMATCH_VERIFY (sort_mode_arg, sort_mode_flag); 33 | -------------------------------------------------------------------------------- /ports/tar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://ftp.gnu.org/gnu/tar/tar-1.28.tar.xz 7 | DIR=tar-1.28 8 | 9 | CONFIGURE_ARGS=("--host=${HOST}") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/tcc.patch: -------------------------------------------------------------------------------- 1 | diff -rupN tcc/configure tcc-redox/configure 2 | --- tcc/configure 2013-02-15 06:24:00.000000000 -0800 3 | +++ tcc-redox/configure 2016-07-27 20:01:32.315469568 -0700 4 | @@ -46,7 +46,7 @@ tcc_elfinterp="" 5 | tcc_lddir= 6 | confvars= 7 | 8 | -cpu=`uname -m` 9 | +cpu="i686" 10 | 11 | # OS specific 12 | targetos=`uname -s` 13 | @@ -57,6 +57,8 @@ case $targetos in 14 | *) ;; 15 | esac 16 | 17 | +noldl="yes" 18 | + 19 | # find source path 20 | # XXX: we assume an absolute path is given when launching configure, 21 | # except in './configure' case. 22 | @@ -399,7 +401,7 @@ print_mak() { 23 | echo "/* Automatically generated by configure - do not modify */" > $TMPH 24 | 25 | print_inc CONFIG_SYSROOT "$sysroot" 26 | -print_inc CONFIG_TCCDIR "$tccdir" 27 | +print_inc CONFIG_TCCDIR "/lib/tcc" 28 | print_mak CONFIG_TCC_SYSINCLUDEPATHS "$tcc_sysincludepaths" 29 | print_mak CONFIG_TCC_LIBPATHS "$tcc_libpaths" 30 | print_mak CONFIG_TCC_CRTPREFIX "$tcc_crtprefix" 31 | diff -rupN tcc/lib/bcheck.c tcc-redox/lib/bcheck.c 32 | --- tcc/lib/bcheck.c 2013-02-15 06:24:00.000000000 -0800 33 | +++ tcc-redox/lib/bcheck.c 2016-07-27 20:10:24.721796978 -0700 34 | @@ -39,14 +39,14 @@ 35 | #define CONFIG_TCC_MALLOC_HOOKS 36 | #define HAVE_MEMALIGN 37 | 38 | -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \ 39 | - || defined(__DragonFly__) || defined(__dietlibc__) \ 40 | - || defined(__UCLIBC__) || defined(__OpenBSD__) \ 41 | - || defined(_WIN32) || defined(TCC_UCLIBC) 42 | +//#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \ 43 | +// || defined(__DragonFly__) || defined(__dietlibc__) \ 44 | +// || defined(__UCLIBC__) || defined(__OpenBSD__) \ 45 | +// || defined(_WIN32) || defined(TCC_UCLIBC) 46 | #warning Bound checking does not support malloc (etc.) in this environment. 47 | #undef CONFIG_TCC_MALLOC_HOOKS 48 | #undef HAVE_MEMALIGN 49 | -#endif 50 | +//#endif 51 | 52 | #define BOUND_T1_BITS 13 53 | #define BOUND_T2_BITS 11 54 | diff -rupN tcc/libtcc.c tcc-redox/libtcc.c 55 | --- tcc/libtcc.c 2013-02-15 06:24:00.000000000 -0800 56 | +++ tcc-redox/libtcc.c 2016-07-27 20:01:32.318802950 -0700 57 | @@ -1041,13 +1041,6 @@ LIBTCCAPI void tcc_delete(TCCState *s1) 58 | for(i = 0; i < s1->nb_priv_sections; i++) 59 | free_section(s1->priv_sections[i]); 60 | dynarray_reset(&s1->priv_sections, &s1->nb_priv_sections); 61 | - 62 | - /* free any loaded DLLs */ 63 | - for ( i = 0; i < s1->nb_loaded_dlls; i++) { 64 | - DLLReference *ref = s1->loaded_dlls[i]; 65 | - if ( ref->handle ) 66 | - dlclose(ref->handle); 67 | - } 68 | 69 | /* free loaded dlls array */ 70 | dynarray_reset(&s1->loaded_dlls, &s1->nb_loaded_dlls); 71 | @@ -1175,9 +1168,6 @@ ST_FUNC int tcc_add_file_internal(TCCSta 72 | if (ehdr.e_type == ET_DYN) { 73 | if (s1->output_type == TCC_OUTPUT_MEMORY) { 74 | #ifdef TCC_IS_NATIVE 75 | - void *h; 76 | - h = dlopen(filename, RTLD_GLOBAL | RTLD_LAZY); 77 | - if (h) 78 | #endif 79 | ret = 0; 80 | } else { 81 | @@ -1342,12 +1332,11 @@ LIBTCCAPI int tcc_set_output_type(TCCSta 82 | tcc_add_systemdir(s); 83 | # endif 84 | #else 85 | - /* add libc crt1/crti objects */ 86 | + /* add libc crt0/crti objects */ 87 | if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) && 88 | !s->nostdlib) { 89 | if (output_type != TCC_OUTPUT_DLL) 90 | - tcc_add_crt(s, "crt1.o"); 91 | - tcc_add_crt(s, "crti.o"); 92 | + tcc_add_crt(s, "crt0.o"); 93 | } 94 | #endif 95 | return 0; 96 | diff -rupN tcc/tcc.c tcc-redox/tcc.c 97 | --- tcc/tcc.c 2013-02-15 06:24:00.000000000 -0800 98 | +++ tcc-redox/tcc.c 2016-07-27 20:01:32.318802950 -0700 99 | @@ -326,12 +326,8 @@ int main(int argc, char **argv) 100 | tcc_print_stats(s, getclock_us() - start_time); 101 | 102 | if (s->output_type == TCC_OUTPUT_MEMORY) { 103 | -#ifdef TCC_IS_NATIVE 104 | - ret = tcc_run(s, argc - 1 - optind, argv + 1 + optind); 105 | -#else 106 | - tcc_error_noabort("-run is not available in a cross compiler"); 107 | + tcc_error_noabort("-run is not currently available on redox"); 108 | ret = 1; 109 | -#endif 110 | } else if (s->output_type == TCC_OUTPUT_PREPROCESS) { 111 | if (s->outfile) 112 | fclose(s->ppfp); 113 | diff -rupN tcc/tccelf.c tcc-redox/tccelf.c 114 | --- tcc/tccelf.c 2013-02-15 06:24:00.000000000 -0800 115 | +++ tcc-redox/tccelf.c 2016-07-27 20:01:32.318802950 -0700 116 | @@ -434,13 +434,6 @@ ST_FUNC void relocate_syms(TCCState *s1, 117 | name = strtab_section->data + sym->st_name; 118 | if (do_resolve) { 119 | #if defined TCC_IS_NATIVE && !defined _WIN32 120 | - void *addr; 121 | - name = symtab_section->link->data + sym->st_name; 122 | - addr = resolve_sym(s1, name); 123 | - if (addr) { 124 | - sym->st_value = (addr_t)addr; 125 | - goto found; 126 | - } 127 | #endif 128 | } else if (s1->dynsym) { 129 | /* if dynamic symbol exist, then use it */ 130 | @@ -1366,9 +1359,6 @@ ST_FUNC void tcc_add_runtime(TCCState *s 131 | #elif !defined WITHOUT_LIBTCC 132 | tcc_add_support(s1, "libtcc1.a"); 133 | #endif 134 | - /* add crt end if not memory output */ 135 | - if (s1->output_type != TCC_OUTPUT_MEMORY) 136 | - tcc_add_crt(s1, "crtn.o"); 137 | } 138 | } 139 | 140 | @@ -2205,6 +2195,7 @@ static int elf_output_file(TCCState *s1, 141 | unlink(filename); 142 | fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, mode); 143 | if (fd < 0) { 144 | + perror("Error"); 145 | tcc_error_noabort("could not write '%s'", filename); 146 | goto fail; 147 | } 148 | diff -rupN tcc/tcc.h tcc-redox/tcc.h 149 | --- tcc/tcc.h 2013-02-15 06:24:00.000000000 -0800 150 | +++ tcc-redox/tcc.h 2016-07-27 20:01:32.318802950 -0700 151 | @@ -43,10 +43,7 @@ 152 | #ifndef _WIN32 153 | # include 154 | # include 155 | -# include 156 | -# include 157 | # ifndef CONFIG_TCC_STATIC 158 | -# include 159 | # endif 160 | #else 161 | # include 162 | @@ -147,7 +144,6 @@ 163 | #endif 164 | 165 | #if defined TCC_IS_NATIVE && !defined CONFIG_TCCBOOT 166 | -# define CONFIG_TCC_BACKTRACE 167 | #endif 168 | 169 | /* ------------ path configuration ------------ */ 170 | diff -rupN tcc/tccrun.c tcc-redox/tccrun.c 171 | --- tcc/tccrun.c 2013-02-15 06:24:00.000000000 -0800 172 | +++ tcc-redox/tccrun.c 2016-07-27 20:01:32.318802950 -0700 173 | @@ -21,6 +21,7 @@ 174 | #include "tcc.h" 175 | 176 | /* only native compiler supports -run */ 177 | +#if 0 178 | #ifdef TCC_IS_NATIVE 179 | 180 | #ifdef CONFIG_TCC_BACKTRACE 181 | @@ -729,4 +730,5 @@ ST_FUNC void *resolve_sym(TCCState *s1, 182 | 183 | #endif /* CONFIG_TCC_STATIC */ 184 | #endif /* TCC_IS_NATIVE */ 185 | +#endif 186 | /* ------------------------------------------------------------- */ 187 | -------------------------------------------------------------------------------- /ports/tcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | 6 | SRC=http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.26.tar.bz2 7 | DIR=tcc-0.9.26 8 | 9 | CONFIGURE_ARGS=("--cross-prefix=${HOST}-" "--crtprefix=/lib") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /ports/time.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | GIT=https://github.com/redox-os/time.git 7 | DIR=time 8 | 9 | CARGO_BINS="" 10 | cargo_template $* 11 | -------------------------------------------------------------------------------- /ports/warmux.patch: -------------------------------------------------------------------------------- 1 | diff -rupN warmux/config.sub warmux-redox/config.sub 2 | --- warmux/config.sub 2011-04-28 12:04:39.000000000 -0700 3 | +++ warmux-redox/config.sub 2016-07-27 18:19:00.204437794 -0700 4 | @@ -1151,7 +1151,7 @@ case $os in 5 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ 6 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ 7 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 8 | - | -aos* \ 9 | + | -aos* | -redox* \ 10 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 11 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 12 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ 13 | -------------------------------------------------------------------------------- /ports/warmux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | BROKEN 5 | DEPENDS libxml2 6 | 7 | SRC=http://download.gna.org/warmux/warmux-11.04.1.tar.bz2 8 | DIR=warmux-11.04 9 | 10 | CONFIGURE_ARGS=("--host=${HOST}") 11 | configure_template $* 12 | -------------------------------------------------------------------------------- /ports/webpki.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | UNSTABLE 5 | 6 | GIT=https://github.com/redox-os/webpki.git 7 | DIR=webpki 8 | 9 | CARGO_BINS="" 10 | cargo_template $* 11 | -------------------------------------------------------------------------------- /ports/zlib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source environ.sh 3 | 4 | STABLE 5 | 6 | SRC=http://zlib.net/zlib-1.2.11.tar.gz 7 | DIR=zlib-1.2.11 8 | 9 | CONFIGURE_ARGS=("--static") 10 | configure_template $* 11 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | ARCH=x86_64 5 | export TARGET="${ARCH}-unknown-redox" 6 | RUST_VERSION=nightly-2018-06-19 7 | 8 | ROOT="${ROOT:-$PWD}" 9 | 10 | if [ `uname` = "Darwin" ]; then 11 | NPROC=`sysctl -n hw.ncpu` 12 | NO_VERIFY="--no-verify" 13 | AUTOCONF="autoconf264" 14 | AUTOMAKE="automake112" 15 | ACLOCAL="aclocal112" 16 | else 17 | NPROC=`nproc` 18 | AUTOCONF="autoconf2.64" 19 | # Autoconf is often autoconf or autoconf- 20 | if ! hash $AUTOCONF &> /dev/null; then 21 | AUTOCONF="autoconf-2.64" 22 | if ! hash $AUTOCONF &> /dev/null; then 23 | AUTOCONF="autoconf" 24 | fi 25 | fi 26 | AUTOMAKE="automake-1.11" 27 | if ! hash $AUTOMAKE &> /dev/null; then 28 | AUTOMAKE="automake" 29 | fi 30 | ACLOCAL="aclocal-1.11" 31 | if ! hash $ACLOCAL &> /dev/null; then 32 | ACLOCAL="aclocal" 33 | fi 34 | fi 35 | 36 | BUILD="${ROOT}/build" 37 | mkdir -p "${BUILD}" 38 | cd "${BUILD}" 39 | 40 | PREFIX=${PREFIX:-"${BUILD}/prefix"} 41 | mkdir -p "${PREFIX}" 42 | mkdir -p "${PREFIX}/bin" 43 | export PATH="${PREFIX}/bin:$PATH" 44 | 45 | SYSROOT="${BUILD}/sysroot" 46 | mkdir -p "${SYSROOT}" 47 | 48 | CROSS="${BUILD}/cross" 49 | mkdir -p "${CROSS}" 50 | cd "${CROSS}" 51 | 52 | ###################BINUTILS######################### 53 | function binutils { 54 | BINUTILS="${ROOT}/binutils-gdb" 55 | 56 | rm -rf "binutils" 57 | mkdir "binutils" 58 | pushd "binutils" 59 | "${BINUTILS}/configure" --target="${TARGET}" --prefix="${PREFIX}" --with-sysroot="${SYSROOT}" --disable-gdb --disable-nls --disable-werror 60 | make -j $NPROC 61 | make -j $NPROC install 62 | popd 63 | } 64 | 65 | ##################GCC FREESTANDING############################## 66 | function gcc_freestanding { 67 | GCC="${ROOT}/gcc" 68 | 69 | pushd "${GCC}" 70 | ./contrib/download_prerequisites $NO_VERIFY 71 | popd 72 | 73 | pushd "${GCC}/libstdc++-v3" 74 | $AUTOCONF 75 | popd 76 | 77 | rm -rf "gcc-freestanding" 78 | mkdir "gcc-freestanding" 79 | pushd "gcc-freestanding" 80 | "${GCC}/configure" --target="${TARGET}" --prefix="${PREFIX}" --disable-nls --enable-languages=c,c++ --without-headers 81 | make -j $NPROC all-gcc 82 | make -j $NPROC all-target-libgcc 83 | make -j $NPROC install-gcc 84 | make -j $NPROC install-target-libgcc 85 | popd 86 | } 87 | 88 | ##################NEWLIB########################### 89 | function newlib { 90 | NEWLIB="${ROOT}/newlib" 91 | 92 | echo "Setting Rust version to ${RUST_VERSION}" 93 | rustup override set "${RUST_VERSION}" 94 | echo "Downloading Rust source" 95 | rustup component add rust-src 96 | if [ -z "$(which xargo)" ] 97 | then 98 | echo "Installing xargo" 99 | cargo install -f xargo 100 | fi 101 | 102 | pushd "${NEWLIB}/newlib/libc/sys" 103 | $ACLOCAL -I ../.. 104 | autoconf 105 | $AUTOMAKE --cygnus Makefile 106 | popd 107 | 108 | pushd "${NEWLIB}/newlib/libc/sys/redox" 109 | $ACLOCAL -I ../../.. 110 | autoconf 111 | $AUTOMAKE --cygnus Makefile 112 | popd 113 | 114 | rm -rf "newlib" 115 | mkdir "newlib" 116 | pushd "newlib" 117 | "${NEWLIB}/configure" --target="${TARGET}" --prefix="${PREFIX}" --enable-newlib-iconv 118 | make -j $NPROC all 119 | make -j $NPROC install 120 | popd 121 | 122 | mkdir -p "${SYSROOT}/usr" 123 | cp -r "${PREFIX}/${TARGET}/lib" "${SYSROOT}/usr" 124 | cp -r "${PREFIX}/${TARGET}/include" "${SYSROOT}/usr" 125 | } 126 | 127 | ##################RELIBC########################### 128 | function relibc { 129 | RELIBC="${ROOT}/relibc" 130 | 131 | echo "Setting Rust version to ${RUST_VERSION}" 132 | rustup override set "${RUST_VERSION}" 133 | echo "Adding Redox OS target" 134 | rustup target add "${TARGET}" 135 | echo "Downloading Rust source" 136 | rustup component add rust-src 137 | 138 | rm -rf "relibc" 139 | cp -r "${RELIBC}" "relibc" 140 | pushd "relibc" 141 | make -j $NPROC all 142 | make -j $NPROC "DESTDIR=${PREFIX}/${TARGET}" install 143 | make -j $NPROC "DESTDIR=${SYSROOT}/usr" install 144 | popd 145 | } 146 | 147 | ######################GCC############################ 148 | function gcc_complete { 149 | GCC="${ROOT}/gcc" 150 | 151 | rm -rf "gcc" 152 | mkdir "gcc" 153 | pushd "gcc" 154 | "${GCC}/configure" --target="${TARGET}" --prefix="${PREFIX}" --with-sysroot="${SYSROOT}" --disable-nls --enable-languages=c,c++ 155 | make -j $NPROC all-gcc 156 | make -j $NPROC all-target-libgcc 157 | make -j $NPROC install-gcc 158 | make -j $NPROC install-target-libgcc 159 | make -j $NPROC all-target-libstdc++-v3 160 | make -j $NPROC install-target-libstdc++-v3 161 | popd 162 | } 163 | 164 | for pair in $AUTOCONF,2.64 $AUTOMAKE,1.11 $ACLOCAL,1.11 165 | do 166 | cmd="$(echo "$pair" | cut -d "," -f 1)" 167 | ver="$(echo "$pair" | cut -d "," -f 2)" 168 | if ! hash $cmd &> /dev/null; then 169 | echo "Must install $cmd version $ver before x86_64-unknown-redox may be built" 170 | exit 1 171 | fi 172 | if [[ "$(eval $cmd --version 2>/dev/null | head -n1 | cut -d' ' -f4)" != "$ver"* ]]; then 173 | echo "$cmd is installed, but version isn't $ver." 174 | echo "Make sure the correct version is in \$PATH" 175 | exit 1 176 | fi 177 | done 178 | 179 | case $1 in 180 | binutils) 181 | binutils 182 | ;; 183 | gcc_freestanding) 184 | gcc_freestanding 185 | ;; 186 | newlib) 187 | newlib 188 | ;; 189 | relibc) 190 | relibc 191 | ;; 192 | gcc_complete) 193 | gcc_complete 194 | ;; 195 | all) 196 | binutils 197 | gcc_freestanding 198 | newlib 199 | # TODO: relibc 200 | gcc_complete 201 | ;; 202 | *) 203 | echo "$0 [binutils, gcc_freestanding, newlib, relibc, gcc_complete, all]" 204 | ;; 205 | esac 206 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | with import {}; 2 | stdenv.mkDerivation rec { 3 | name = "libc"; 4 | 5 | nativeBuildInputs = [ autoconf264 automake111x flex bison ]; 6 | buildInputs = [ libtool ]; 7 | 8 | hardeningDisable = [ "all" ]; 9 | } 10 | -------------------------------------------------------------------------------- /tests/c-test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char ** argv){ 9 | printf("Test %d\n", argc); 10 | int i; 11 | for(i = 0; i < argc; i++){ 12 | printf("%d: %s\n", i, argv[i]); 13 | } 14 | struct timespec tp; 15 | if(clock_gettime(CLOCK_REALTIME, &tp) == 0){ 16 | printf("clock_gettime %d %d\n", (int)tp.tv_sec, (int)tp.tv_nsec); 17 | printf("ctime %s", ctime(&tp.tv_sec)); 18 | void* test = malloc(1024*1024); 19 | if(test > 0){ 20 | printf("Malloc %p\n", test); 21 | free(test); 22 | printf("Free\n"); 23 | 24 | DIR * dir = opendir("/home/"); 25 | if (dir != NULL) { 26 | printf("opendir %p\n", dir); 27 | struct dirent * ent; 28 | while ((ent = readdir(dir)) != NULL) { 29 | printf("%s\n", ent->d_name); 30 | } 31 | closedir(dir); 32 | 33 | pid_t pid = fork(); 34 | if(pid > 0){ 35 | printf("Fork Parent %d = %d\n", getpid(), pid); 36 | int status = 0; 37 | if(waitpid(pid, &status, 0) >= 0){ 38 | printf("waitpid status %d\n", status); 39 | }else{ 40 | perror("waitpid failed\n"); 41 | } 42 | }else if(pid == 0){ 43 | printf("Fork Child %d = %d\n", getpid(), pid); 44 | int result = system("echo test"); 45 | if(result == 0){ 46 | printf("System Success"); 47 | } else { 48 | printf("System Failed %d\n", result); 49 | } 50 | _exit(123); 51 | } else { 52 | printf("Fork Failed %d = %d\n", getpid(), pid); 53 | } 54 | }else{ 55 | perror("Opendir Failed\n"); 56 | } 57 | } else { 58 | perror("Malloc Failed\n"); 59 | } 60 | } else { 61 | perror("clock_gettime Failed\n"); 62 | } 63 | return 234; 64 | } 65 | -------------------------------------------------------------------------------- /tests/ed.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Editor 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | /* make BLKSIZE and LBSIZE 512 for smaller machines */ 9 | #define BLKSIZE 4096 10 | #define NBLK 2047 11 | 12 | #define NULL 0 13 | #define FNSIZE 128 14 | #define LBSIZE 4096 15 | #define ESIZE 256 16 | #define GBSIZE 256 17 | #define NBRA 5 18 | #define EOF -1 19 | #define KSIZE 9 20 | 21 | #define CBRA 1 22 | #define CCHR 2 23 | #define CDOT 4 24 | #define CCL 6 25 | #define NCCL 8 26 | #define CDOL 10 27 | #define CEOF 11 28 | #define CKET 12 29 | #define CBACK 14 30 | #define CCIRC 15 31 | 32 | #define STAR 01 33 | 34 | char Q[] = ""; 35 | char T[] = "TMP"; 36 | #define READ 0 37 | #define WRITE 1 38 | 39 | int peekc; 40 | int lastc; 41 | char savedfile[FNSIZE]; 42 | char file[FNSIZE]; 43 | char linebuf[LBSIZE]; 44 | char rhsbuf[LBSIZE/2]; 45 | char expbuf[ESIZE+4]; 46 | int given; 47 | unsigned int *addr1, *addr2; 48 | unsigned int *dot, *dol, *zero; 49 | char genbuf[LBSIZE]; 50 | long count; 51 | char *nextip; 52 | char *linebp; 53 | int ninbuf; 54 | int io; 55 | int pflag; 56 | long lseek(int, long, int); 57 | int open(char *, int); 58 | int creat(char *, int); 59 | int read(int, char*, int); 60 | int write(int, char*, int); 61 | int close(int); 62 | int fork(void); 63 | int execl(char *, ...); 64 | int exit(int); 65 | int wait(int *); 66 | int unlink(char *); 67 | 68 | 69 | 70 | int vflag = 1; 71 | int oflag; 72 | int listf; 73 | int listn; 74 | int col; 75 | char *globp; 76 | int tfile = -1; 77 | int tline; 78 | char *tfname; 79 | char *loc1; 80 | char *loc2; 81 | char ibuff[BLKSIZE]; 82 | int iblock = -1; 83 | char obuff[BLKSIZE]; 84 | int oblock = -1; 85 | int ichanged; 86 | int nleft; 87 | char WRERR[] = "WRITE ERROR"; 88 | int names[26]; 89 | int anymarks; 90 | char *braslist[NBRA]; 91 | char *braelist[NBRA]; 92 | int nbra; 93 | int subnewa; 94 | int subolda; 95 | int fchange; 96 | int wrapp; 97 | int bpagesize = 20; 98 | unsigned nlall = 128; 99 | 100 | char *mktemp(char *); 101 | char tmpXXXXX[50] = "/tmp/eXXXXX"; 102 | char *malloc(int); 103 | char *realloc(char *, int); 104 | 105 | char *getblock(unsigned int atl, int iof); 106 | char *getline(unsigned int tl); 107 | char *place(char *sp, char *l1, char *l2); 108 | void add(int i); 109 | int advance(char *lp, char *ep); 110 | int append(int (*f)(void), unsigned int *a); 111 | int backref(int i, char *lp); 112 | void blkio(int b, char *buf, int (*iofcn)(int, char*, int)); 113 | void callunix(void); 114 | int cclass(char *set, int c, int af); 115 | void commands(void); 116 | void compile(int eof); 117 | int compsub(void); 118 | void dosub(void); 119 | void error(char *s); 120 | int execute(unsigned int *addr); 121 | void exfile(void); 122 | void filename(int comm); 123 | void gdelete(void); 124 | int getchr(void); 125 | int getcopy(void); 126 | int getfile(void); 127 | int getnum(void); 128 | int getsub(void); 129 | int gettty(void); 130 | int gety(void); 131 | void global(int k); 132 | void init(void); 133 | unsigned int *address(void); 134 | void join(void); 135 | void move(int cflag); 136 | void newline(void); 137 | void nonzero(void); 138 | void onhup(int n); 139 | void onintr(int n); 140 | void print(void); 141 | void putchr(int ac); 142 | void putd(void); 143 | void putfile(void); 144 | int putline(void); 145 | void puts(char *sp); 146 | void quit(int n); 147 | void rdelete(unsigned int *ad1, unsigned int *ad2); 148 | void reverse(unsigned int *a1, unsigned int *a2); 149 | void setwide(void); 150 | void setnoaddr(void); 151 | void squeeze(int i); 152 | void substitute(int inglob); 153 | 154 | jmp_buf savej; 155 | 156 | typedef void (*SIG_TYP)(int); 157 | SIG_TYP oldhup; 158 | SIG_TYP oldquit; 159 | /* these two are not in ansi, but we need them */ 160 | #define SIGHUP 1 /* hangup */ 161 | #define SIGQUIT 3 /* quit (ASCII FS) */ 162 | 163 | int main(int argc, char *argv[]) 164 | { 165 | char *p1, *p2; 166 | SIG_TYP oldintr; 167 | 168 | oldquit = signal(SIGQUIT, SIG_IGN); 169 | oldhup = signal(SIGHUP, SIG_IGN); 170 | oldintr = signal(SIGINT, SIG_IGN); 171 | if (signal(SIGTERM, SIG_IGN) == SIG_DFL) 172 | signal(SIGTERM, quit); 173 | argv++; 174 | while (argc > 1 && **argv=='-') { 175 | switch((*argv)[1]) { 176 | 177 | case '\0': 178 | vflag = 0; 179 | break; 180 | 181 | case 'q': 182 | signal(SIGQUIT, SIG_DFL); 183 | vflag = 1; 184 | break; 185 | 186 | case 'o': 187 | oflag = 1; 188 | break; 189 | } 190 | argv++; 191 | argc--; 192 | } 193 | if (oflag) { 194 | p1 = "/dev/stdout"; 195 | p2 = savedfile; 196 | while (*p2++ = *p1++) 197 | ; 198 | } 199 | if (argc>1) { 200 | p1 = *argv; 201 | p2 = savedfile; 202 | while (*p2++ = *p1++) 203 | if (p2 >= &savedfile[sizeof(savedfile)]) 204 | p2--; 205 | globp = "r"; 206 | } 207 | zero = (unsigned *)malloc(nlall*sizeof(unsigned)); 208 | tfname = mktemp(tmpXXXXX); 209 | init(); 210 | if (oldintr!=SIG_IGN) 211 | signal(SIGINT, onintr); 212 | if (oldhup!=SIG_IGN) 213 | signal(SIGHUP, onhup); 214 | setjmp(savej); 215 | commands(); 216 | quit(0); 217 | return 0; 218 | } 219 | 220 | void commands(void) 221 | { 222 | unsigned int *a1; 223 | int c; 224 | int temp; 225 | char lastsep; 226 | 227 | for (;;) { 228 | if (pflag) { 229 | pflag = 0; 230 | addr1 = addr2 = dot; 231 | print(); 232 | } 233 | c = '\n'; 234 | for (addr1 = 0;;) { 235 | lastsep = c; 236 | a1 = address(); 237 | c = getchr(); 238 | if (c!=',' && c!=';') 239 | break; 240 | if (lastsep==',') 241 | error(Q); 242 | if (a1==0) { 243 | a1 = zero+1; 244 | if (a1>dol) 245 | a1--; 246 | } 247 | addr1 = a1; 248 | if (c==';') 249 | dot = a1; 250 | } 251 | if (lastsep!='\n' && a1==0) 252 | a1 = dol; 253 | if ((addr2=a1)==0) { 254 | given = 0; 255 | addr2 = dot; 256 | } 257 | else 258 | given = 1; 259 | if (addr1==0) 260 | addr1 = addr2; 261 | switch(c) { 262 | 263 | case 'a': 264 | add(0); 265 | continue; 266 | 267 | case 'c': 268 | nonzero(); 269 | newline(); 270 | rdelete(addr1, addr2); 271 | append(gettty, addr1-1); 272 | continue; 273 | 274 | case 'd': 275 | nonzero(); 276 | newline(); 277 | rdelete(addr1, addr2); 278 | continue; 279 | 280 | case 'E': 281 | fchange = 0; 282 | c = 'e'; 283 | case 'e': 284 | setnoaddr(); 285 | if (vflag && fchange) { 286 | fchange = 0; 287 | error(Q); 288 | } 289 | filename(c); 290 | init(); 291 | addr2 = zero; 292 | goto caseread; 293 | 294 | case 'f': 295 | setnoaddr(); 296 | filename(c); 297 | puts(savedfile); 298 | continue; 299 | 300 | case 'g': 301 | global(1); 302 | continue; 303 | 304 | case 'i': 305 | add(-1); 306 | continue; 307 | 308 | 309 | case 'j': 310 | if (!given) 311 | addr2++; 312 | newline(); 313 | join(); 314 | continue; 315 | 316 | case 'k': 317 | nonzero(); 318 | if ((c = getchr()) < 'a' || c > 'z') 319 | error(Q); 320 | newline(); 321 | names[c-'a'] = *addr2 & ~01; 322 | anymarks |= 01; 323 | continue; 324 | 325 | case 'm': 326 | move(0); 327 | continue; 328 | 329 | case 'n': 330 | listn++; 331 | newline(); 332 | print(); 333 | continue; 334 | 335 | case '\n': 336 | if (a1==0) { 337 | a1 = dot+1; 338 | addr2 = a1; 339 | addr1 = a1; 340 | } 341 | if (lastsep==';') 342 | addr1 = a1; 343 | print(); 344 | continue; 345 | 346 | case 'l': 347 | listf++; 348 | case 'p': 349 | case 'P': 350 | newline(); 351 | print(); 352 | continue; 353 | 354 | case 'Q': 355 | fchange = 0; 356 | case 'q': 357 | setnoaddr(); 358 | newline(); 359 | quit(0); 360 | 361 | case 'r': 362 | filename(c); 363 | caseread: 364 | if ((io = open(file, 0)) < 0) { 365 | lastc = '\n'; 366 | error(file); 367 | } 368 | setwide(); 369 | squeeze(0); 370 | ninbuf = 0; 371 | c = zero != dol; 372 | append(getfile, addr2); 373 | exfile(); 374 | fchange = c; 375 | continue; 376 | 377 | case 's': 378 | nonzero(); 379 | substitute(globp!=0); 380 | continue; 381 | 382 | case 't': 383 | move(1); 384 | continue; 385 | 386 | case 'u': 387 | nonzero(); 388 | newline(); 389 | if ((*addr2&~01) != subnewa) 390 | error(Q); 391 | *addr2 = subolda; 392 | dot = addr2; 393 | continue; 394 | 395 | case 'v': 396 | global(0); 397 | continue; 398 | 399 | case 'W': 400 | wrapp++; 401 | case 'w': 402 | setwide(); 403 | squeeze(dol>zero); 404 | if ((temp = getchr()) != 'q' && temp != 'Q') { 405 | peekc = temp; 406 | temp = 0; 407 | } 408 | filename(c); 409 | if(!wrapp || 410 | ((io = open(file,1)) == -1) || 411 | ((lseek(io, 0L, 2)) == -1)) 412 | if ((io = creat(file, 0666)) < 0) 413 | error(file); 414 | wrapp = 0; 415 | if (dol > zero) 416 | putfile(); 417 | exfile(); 418 | if (addr1<=zero+1 && addr2==dol) 419 | fchange = 0; 420 | if (temp == 'Q') 421 | fchange = 0; 422 | if (temp) 423 | quit(0); 424 | continue; 425 | 426 | case '=': 427 | setwide(); 428 | squeeze(0); 429 | newline(); 430 | count = addr2 - zero; 431 | putd(); 432 | putchr('\n'); 433 | continue; 434 | 435 | case '!': 436 | callunix(); 437 | continue; 438 | 439 | case EOF: 440 | return; 441 | 442 | } 443 | error(Q); 444 | } 445 | } 446 | 447 | void print(void) 448 | { 449 | unsigned int *a1; 450 | 451 | nonzero(); 452 | a1 = addr1; 453 | do { 454 | if (listn) { 455 | count = a1-zero; 456 | putd(); 457 | putchr('\t'); 458 | } 459 | puts(getline(*a1++)); 460 | } while (a1 <= addr2); 461 | dot = addr2; 462 | listf = 0; 463 | listn = 0; 464 | pflag = 0; 465 | } 466 | 467 | unsigned int * 468 | address(void) 469 | { 470 | int sign; 471 | unsigned int *a, *b; 472 | int opcnt, nextopand; 473 | int c; 474 | 475 | nextopand = -1; 476 | sign = 1; 477 | opcnt = 0; 478 | a = dot; 479 | do { 480 | do c = getchr(); while (c==' ' || c=='\t'); 481 | if ('0'<=c && c<='9') { 482 | peekc = c; 483 | if (!opcnt) 484 | a = zero; 485 | a += sign*getnum(); 486 | } else switch (c) { 487 | case '$': 488 | a = dol; 489 | /* fall through */ 490 | case '.': 491 | if (opcnt) 492 | error(Q); 493 | break; 494 | case '\'': 495 | c = getchr(); 496 | if (opcnt || c<'a' || 'z'dol) 512 | a = zero; 513 | if (execute(a)) 514 | break; 515 | if (a==b) 516 | error(Q); 517 | } 518 | break; 519 | default: 520 | if (nextopand == opcnt) { 521 | a += sign; 522 | if (a='0' && c<='9') 551 | r = r*10 + c - '0'; 552 | peekc = c; 553 | return (r); 554 | } 555 | 556 | void setwide(void) 557 | { 558 | if (!given) { 559 | addr1 = zero + (dol>zero); 560 | addr2 = dol; 561 | } 562 | } 563 | 564 | void setnoaddr(void) 565 | { 566 | if (given) 567 | error(Q); 568 | } 569 | 570 | void nonzero(void) 571 | { 572 | squeeze(1); 573 | } 574 | 575 | void squeeze(int i) 576 | { 577 | if (addr1dol || addr1>addr2) 578 | error(Q); 579 | } 580 | 581 | void newline(void) 582 | { 583 | int c; 584 | 585 | if ((c = getchr()) == '\n' || c == EOF) 586 | return; 587 | if (c=='p' || c=='l' || c=='n') { 588 | pflag++; 589 | if (c=='l') 590 | listf++; 591 | else if (c=='n') 592 | listn++; 593 | if ((c=getchr())=='\n') 594 | return; 595 | } 596 | error(Q); 597 | } 598 | 599 | void filename(int comm) 600 | { 601 | char *p1, *p2; 602 | int c; 603 | 604 | count = 0; 605 | c = getchr(); 606 | if (c=='\n' || c==EOF) { 607 | p1 = savedfile; 608 | if (*p1==0 && comm!='f') 609 | error(Q); 610 | p2 = file; 611 | while (*p2++ = *p1++) 612 | ; 613 | return; 614 | } 615 | if (c!=' ') 616 | error(Q); 617 | while ((c = getchr()) == ' ') 618 | ; 619 | if (c=='\n') 620 | error(Q); 621 | p1 = file; 622 | do { 623 | if (p1 >= &file[sizeof(file)-1] || c==' ' || c==EOF) 624 | error(Q); 625 | *p1++ = c; 626 | } while ((c = getchr()) != '\n'); 627 | *p1++ = 0; 628 | if (savedfile[0]==0 || comm=='e' || comm=='f') { 629 | p1 = savedfile; 630 | p2 = file; 631 | while (*p1++ = *p2++) 632 | ; 633 | } 634 | } 635 | 636 | void exfile(void) 637 | { 638 | close(io); 639 | io = -1; 640 | if (vflag) { 641 | putd(); 642 | putchr('\n'); 643 | } 644 | } 645 | 646 | void onintr(int n) 647 | { 648 | signal(SIGINT, onintr); 649 | putchr('\n'); 650 | lastc = '\n'; 651 | error(Q); 652 | } 653 | 654 | void onhup(int n) 655 | { 656 | signal(SIGINT, SIG_IGN); 657 | signal(SIGHUP, SIG_IGN); 658 | if (dol > zero) { 659 | addr1 = zero+1; 660 | addr2 = dol; 661 | io = creat("ed.hup", 0600); 662 | if (io > 0) 663 | putfile(); 664 | } 665 | fchange = 0; 666 | quit(0); 667 | } 668 | 669 | void error(char *s) 670 | { 671 | int c; 672 | 673 | wrapp = 0; 674 | listf = 0; 675 | listn = 0; 676 | putchr('?'); 677 | puts(s); 678 | count = 0; 679 | lseek(0, (long)0, 2); 680 | pflag = 0; 681 | if (globp) 682 | lastc = '\n'; 683 | globp = 0; 684 | peekc = lastc; 685 | if(lastc) 686 | while ((c = getchr()) != '\n' && c != EOF) 687 | ; 688 | if (io > 0) { 689 | close(io); 690 | io = -1; 691 | } 692 | longjmp(savej, 1); 693 | } 694 | 695 | int getchr(void) 696 | { 697 | char c; 698 | if (lastc=peekc) { 699 | peekc = 0; 700 | return(lastc); 701 | } 702 | if (globp) { 703 | if ((lastc = *globp++) != 0) 704 | return(lastc); 705 | globp = 0; 706 | return(EOF); 707 | } 708 | if (read(0, &c, 1) <= 0) 709 | return(lastc = EOF); 710 | lastc = c&0177; 711 | return(lastc); 712 | } 713 | 714 | int gettty(void) 715 | { 716 | int rc; 717 | 718 | if (rc = gety()) 719 | return(rc); 720 | if (linebuf[0]=='.' && linebuf[1]==0) 721 | return(EOF); 722 | return(0); 723 | } 724 | 725 | int gety(void) 726 | { 727 | int c; 728 | char *gf; 729 | char *p; 730 | 731 | p = linebuf; 732 | gf = globp; 733 | while ((c = getchr()) != '\n') { 734 | if (c==EOF) { 735 | if (gf) 736 | peekc = c; 737 | return(c); 738 | } 739 | if ((c &= 0177) == 0) 740 | continue; 741 | *p++ = c; 742 | if (p >= &linebuf[LBSIZE-2]) 743 | error(Q); 744 | } 745 | 746 | *p++ = 0; 747 | return(0); 748 | } 749 | 750 | int getfile(void) 751 | { 752 | int c; 753 | char *lp, *fp; 754 | 755 | lp = linebuf; 756 | fp = nextip; 757 | do { 758 | if (--ninbuf < 0) { 759 | if ((ninbuf = read(io, genbuf, LBSIZE)-1) < 0) 760 | if (lp>linebuf) { 761 | puts("'\\n' appended"); 762 | *genbuf = '\n'; 763 | } 764 | else return(EOF); 765 | fp = genbuf; 766 | while(fp < &genbuf[ninbuf]) { 767 | if (*fp++ & 0200) 768 | break; 769 | } 770 | fp = genbuf; 771 | } 772 | c = *fp++; 773 | if (c=='\0') 774 | continue; 775 | if (c&0200 || lp >= &linebuf[LBSIZE]) { 776 | lastc = '\n'; 777 | error(Q); 778 | } 779 | *lp++ = c; 780 | count++; 781 | } while (c != '\n'); 782 | *--lp = 0; 783 | nextip = fp; 784 | return(0); 785 | } 786 | 787 | void putfile(void) 788 | { 789 | unsigned int *a1; 790 | int n; 791 | char *fp, *lp; 792 | int nib; 793 | 794 | nib = BLKSIZE; 795 | fp = genbuf; 796 | a1 = addr1; 797 | do { 798 | lp = getline(*a1++); 799 | for (;;) { 800 | if (--nib < 0) { 801 | n = fp-genbuf; 802 | if(write(io, genbuf, n) != n) { 803 | puts(WRERR); 804 | error(Q); 805 | } 806 | nib = BLKSIZE-1; 807 | fp = genbuf; 808 | } 809 | count++; 810 | if ((*fp++ = *lp++) == 0) { 811 | fp[-1] = '\n'; 812 | break; 813 | } 814 | } 815 | } while (a1 <= addr2); 816 | n = fp-genbuf; 817 | if(write(io, genbuf, n) != n) { 818 | puts(WRERR); 819 | error(Q); 820 | } 821 | } 822 | 823 | int append(int (*f)(void), unsigned int *a) 824 | { 825 | unsigned int *a1, *a2, *rdot; 826 | int nline, tl; 827 | 828 | nline = 0; 829 | dot = a; 830 | while ((*f)() == 0) { 831 | if ((dol-zero)+1 >= nlall) { 832 | unsigned *ozero = zero; 833 | 834 | nlall += 1024; 835 | if ((zero = (unsigned *)realloc((char *)zero, nlall*sizeof(unsigned)))==NULL) { 836 | error("MEM?"); 837 | onhup(0); 838 | } 839 | dot += zero - ozero; 840 | dol += zero - ozero; 841 | } 842 | tl = putline(); 843 | nline++; 844 | a1 = ++dol; 845 | a2 = a1+1; 846 | rdot = ++dot; 847 | while (a1 > rdot) 848 | *--a2 = *--a1; 849 | *rdot = tl; 850 | } 851 | return(nline); 852 | } 853 | 854 | void add(int i) 855 | { 856 | if (i && (given || dol>zero)) { 857 | addr1--; 858 | addr2--; 859 | } 860 | squeeze(0); 861 | newline(); 862 | append(gettty, addr2); 863 | } 864 | 865 | void callunix(void) 866 | { 867 | SIG_TYP savint; 868 | int pid, rpid; 869 | int retcode; 870 | 871 | setnoaddr(); 872 | if ((pid = fork()) == 0) { 873 | signal(SIGHUP, oldhup); 874 | signal(SIGQUIT, oldquit); 875 | execl("/bin/sh", "sh", "-t", 0); 876 | exit(0100); 877 | } 878 | savint = signal(SIGINT, SIG_IGN); 879 | while ((rpid = wait(&retcode)) != pid && rpid != -1) 880 | ; 881 | signal(SIGINT, savint); 882 | if (vflag) { 883 | puts("!"); 884 | } 885 | } 886 | 887 | void quit(int n) 888 | { 889 | if (vflag && fchange && dol!=zero) { 890 | fchange = 0; 891 | error(Q); 892 | } 893 | unlink(tfname); 894 | exit(0); 895 | } 896 | 897 | void rdelete(unsigned int *ad1, unsigned int *ad2) 898 | { 899 | unsigned int *a1, *a2, *a3; 900 | 901 | a1 = ad1; 902 | a2 = ad2+1; 903 | a3 = dol; 904 | dol -= a2 - a1; 905 | do { 906 | *a1++ = *a2++; 907 | } while (a2 <= a3); 908 | a1 = ad1; 909 | if (a1 > dol) 910 | a1 = dol; 911 | dot = a1; 912 | fchange = 1; 913 | } 914 | 915 | void gdelete(void) 916 | { 917 | unsigned int *a1, *a2, *a3; 918 | 919 | a3 = dol; 920 | for (a1=zero; (*a1&01)==0; a1++) 921 | if (a1>=a3) 922 | return; 923 | for (a2=a1+1; a2<=a3;) { 924 | if (*a2&01) { 925 | a2++; 926 | dot = a1; 927 | } else 928 | *a1++ = *a2++; 929 | } 930 | dol = a1-1; 931 | if (dot>dol) 932 | dot = dol; 933 | fchange = 1; 934 | } 935 | 936 | char * 937 | getline(unsigned int tl) 938 | { 939 | char *bp, *lp; 940 | int nl; 941 | 942 | lp = linebuf; 943 | bp = getblock(tl, READ); 944 | nl = nleft; 945 | tl &= ~((BLKSIZE/2)-1); 946 | while (*lp++ = *bp++) 947 | if (--nl == 0) { 948 | bp = getblock(tl+=(BLKSIZE/2), READ); 949 | nl = nleft; 950 | } 951 | return(linebuf); 952 | } 953 | 954 | int putline(void) 955 | { 956 | char *bp, *lp; 957 | int nl; 958 | unsigned int tl; 959 | 960 | fchange = 1; 961 | lp = linebuf; 962 | tl = tline; 963 | bp = getblock(tl, WRITE); 964 | nl = nleft; 965 | tl &= ~((BLKSIZE/2)-1); 966 | while (*bp = *lp++) { 967 | if (*bp++ == '\n') { 968 | *--bp = 0; 969 | linebp = lp; 970 | break; 971 | } 972 | if (--nl == 0) { 973 | bp = getblock(tl+=(BLKSIZE/2), WRITE); 974 | nl = nleft; 975 | } 976 | } 977 | nl = tline; 978 | tline += (((lp-linebuf)+03)>>1)&077776; 979 | return(nl); 980 | } 981 | 982 | char * 983 | getblock(unsigned int atl, int iof) 984 | { 985 | int bno, off; 986 | 987 | bno = (atl/(BLKSIZE/2)); 988 | off = (atl<<1) & (BLKSIZE-1) & ~03; 989 | if (bno >= NBLK) { 990 | lastc = '\n'; 991 | error(T); 992 | } 993 | nleft = BLKSIZE - off; 994 | if (bno==iblock) { 995 | ichanged |= iof; 996 | return(ibuff+off); 997 | } 998 | if (bno==oblock) 999 | return(obuff+off); 1000 | if (iof==READ) { 1001 | if (ichanged) 1002 | blkio(iblock, ibuff, write); 1003 | ichanged = 0; 1004 | iblock = bno; 1005 | blkio(bno, ibuff, read); 1006 | return(ibuff+off); 1007 | } 1008 | if (oblock>=0) 1009 | blkio(oblock, obuff, write); 1010 | oblock = bno; 1011 | return(obuff+off); 1012 | } 1013 | 1014 | void blkio(int b, char *buf, int (*iofcn)(int, char*, int)) 1015 | { 1016 | lseek(tfile, (long)b*BLKSIZE, 0); 1017 | if ((*iofcn)(tfile, buf, BLKSIZE) != BLKSIZE) { 1018 | error(T); 1019 | } 1020 | } 1021 | 1022 | void init(void) 1023 | { 1024 | int *markp; 1025 | 1026 | close(tfile); 1027 | tline = 2; 1028 | for (markp = names; markp < &names[26]; ) 1029 | *markp++ = 0; 1030 | subnewa = 0; 1031 | anymarks = 0; 1032 | iblock = -1; 1033 | oblock = -1; 1034 | ichanged = 0; 1035 | close(creat(tfname, 0600)); 1036 | tfile = open(tfname, 2); 1037 | dot = dol = zero; 1038 | } 1039 | 1040 | void global(int k) 1041 | { 1042 | char *gp; 1043 | int c; 1044 | unsigned int *a1; 1045 | char globuf[GBSIZE]; 1046 | 1047 | if (globp) 1048 | error(Q); 1049 | setwide(); 1050 | squeeze(dol>zero); 1051 | if ((c=getchr())=='\n') 1052 | error(Q); 1053 | compile(c); 1054 | gp = globuf; 1055 | while ((c = getchr()) != '\n') { 1056 | if (c==EOF) 1057 | error(Q); 1058 | if (c=='\\') { 1059 | c = getchr(); 1060 | if (c!='\n') 1061 | *gp++ = '\\'; 1062 | } 1063 | *gp++ = c; 1064 | if (gp >= &globuf[GBSIZE-2]) 1065 | error(Q); 1066 | } 1067 | if (gp == globuf) 1068 | *gp++ = 'p'; 1069 | *gp++ = '\n'; 1070 | *gp++ = 0; 1071 | for (a1=zero; a1<=dol; a1++) { 1072 | *a1 &= ~01; 1073 | if (a1>=addr1 && a1<=addr2 && execute(a1)==k) 1074 | *a1 |= 01; 1075 | } 1076 | /* 1077 | * Special case: g/.../d (avoid n^2 algorithm) 1078 | */ 1079 | if (globuf[0]=='d' && globuf[1]=='\n' && globuf[2]=='\0') { 1080 | gdelete(); 1081 | return; 1082 | } 1083 | for (a1=zero; a1<=dol; a1++) { 1084 | if (*a1 & 01) { 1085 | *a1 &= ~01; 1086 | dot = a1; 1087 | globp = globuf; 1088 | commands(); 1089 | a1 = zero; 1090 | } 1091 | } 1092 | } 1093 | 1094 | void join(void) 1095 | { 1096 | char *gp, *lp; 1097 | unsigned int *a1; 1098 | 1099 | nonzero(); 1100 | gp = genbuf; 1101 | for (a1=addr1; a1<=addr2; a1++) { 1102 | lp = getline(*a1); 1103 | while (*gp = *lp++) 1104 | if (gp++ >= &genbuf[LBSIZE-2]) 1105 | error(Q); 1106 | } 1107 | lp = linebuf; 1108 | gp = genbuf; 1109 | while (*lp++ = *gp++) 1110 | ; 1111 | *addr1 = putline(); 1112 | if (addr1= &rhsbuf[LBSIZE/2]) 1192 | error(Q); 1193 | } 1194 | *p++ = 0; 1195 | if ((peekc = getchr()) == 'g') { 1196 | peekc = 0; 1197 | newline(); 1198 | return(1); 1199 | } 1200 | newline(); 1201 | return(0); 1202 | } 1203 | 1204 | int getsub(void) 1205 | { 1206 | char *p1, *p2; 1207 | 1208 | p1 = linebuf; 1209 | if ((p2 = linebp) == 0) 1210 | return(EOF); 1211 | while (*p1++ = *p2++) 1212 | ; 1213 | linebp = 0; 1214 | return(0); 1215 | } 1216 | 1217 | void dosub(void) 1218 | { 1219 | char *lp, *sp, *rp; 1220 | int c; 1221 | 1222 | lp = linebuf; 1223 | sp = genbuf; 1224 | rp = rhsbuf; 1225 | while (lp < loc1) 1226 | *sp++ = *lp++; 1227 | while (c = *rp++&0377) { 1228 | if (c=='&') { 1229 | sp = place(sp, loc1, loc2); 1230 | continue; 1231 | } else if (c&0200 && (c &= 0177) >='1' && c < nbra+'1') { 1232 | sp = place(sp, braslist[c-'1'], braelist[c-'1']); 1233 | continue; 1234 | } 1235 | *sp++ = c&0177; 1236 | if (sp >= &genbuf[LBSIZE]) 1237 | error(Q); 1238 | } 1239 | lp = loc2; 1240 | loc2 = sp - genbuf + linebuf; 1241 | while (*sp++ = *lp++) 1242 | if (sp >= &genbuf[LBSIZE]) 1243 | error(Q); 1244 | lp = linebuf; 1245 | sp = genbuf; 1246 | while (*lp++ = *sp++) 1247 | ; 1248 | } 1249 | 1250 | char * 1251 | place(char *sp, char *l1, char *l2) 1252 | { 1253 | 1254 | while (l1 < l2) { 1255 | *sp++ = *l1++; 1256 | if (sp >= &genbuf[LBSIZE]) 1257 | error(Q); 1258 | } 1259 | return(sp); 1260 | } 1261 | 1262 | void move(int cflag) 1263 | { 1264 | unsigned int *adt, *ad1, *ad2; 1265 | 1266 | nonzero(); 1267 | if ((adt = address())==0) /* address() guarantees addr is in range */ 1268 | error(Q); 1269 | newline(); 1270 | if (cflag) { 1271 | unsigned int *ozero; 1272 | int delta; 1273 | 1274 | ad1 = dol; 1275 | ozero = zero; 1276 | append(getcopy, ad1++); 1277 | ad2 = dol; 1278 | delta = zero - ozero; 1279 | ad1 += delta; 1280 | adt += delta; 1281 | } else { 1282 | ad2 = addr2; 1283 | for (ad1 = addr1; ad1 <= ad2;) 1284 | *ad1++ &= ~01; 1285 | ad1 = addr1; 1286 | } 1287 | ad2++; 1288 | if (adt= ad2) { 1296 | dot = adt++; 1297 | reverse(ad1, ad2); 1298 | reverse(ad2, adt); 1299 | reverse(ad1, adt); 1300 | } else 1301 | error(Q); 1302 | fchange = 1; 1303 | } 1304 | 1305 | void reverse(unsigned int *a1, unsigned int *a2) 1306 | { 1307 | int t; 1308 | 1309 | for (;;) { 1310 | t = *--a2; 1311 | if (a2 <= a1) 1312 | return; 1313 | *a2 = *a1; 1314 | *a1++ = t; 1315 | } 1316 | } 1317 | 1318 | int getcopy(void) 1319 | { 1320 | if (addr1 > addr2) 1321 | return(EOF); 1322 | getline(*addr1++); 1323 | return(0); 1324 | } 1325 | 1326 | void compile(int eof) 1327 | { 1328 | int c; 1329 | char *ep; 1330 | char *lastep; 1331 | char bracket[NBRA], *bracketp; 1332 | int cclcnt; 1333 | 1334 | ep = expbuf; 1335 | bracketp = bracket; 1336 | if ((c = getchr()) == '\n') { 1337 | peekc = c; 1338 | c = eof; 1339 | } 1340 | if (c == eof) { 1341 | if (*ep==0) 1342 | error(Q); 1343 | return; 1344 | } 1345 | nbra = 0; 1346 | if (c=='^') { 1347 | c = getchr(); 1348 | *ep++ = CCIRC; 1349 | } 1350 | peekc = c; 1351 | lastep = 0; 1352 | for (;;) { 1353 | if (ep >= &expbuf[ESIZE]) 1354 | goto cerror; 1355 | c = getchr(); 1356 | if (c == '\n') { 1357 | peekc = c; 1358 | c = eof; 1359 | } 1360 | if (c==eof) { 1361 | if (bracketp != bracket) 1362 | goto cerror; 1363 | *ep++ = CEOF; 1364 | return; 1365 | } 1366 | if (c!='*') 1367 | lastep = ep; 1368 | switch (c) { 1369 | 1370 | case '\\': 1371 | if ((c = getchr())=='(') { 1372 | if (nbra >= NBRA) 1373 | goto cerror; 1374 | *bracketp++ = nbra; 1375 | *ep++ = CBRA; 1376 | *ep++ = nbra++; 1377 | continue; 1378 | } 1379 | if (c == ')') { 1380 | if (bracketp <= bracket) 1381 | goto cerror; 1382 | *ep++ = CKET; 1383 | *ep++ = *--bracketp; 1384 | continue; 1385 | } 1386 | if (c>='1' && c<'1'+NBRA) { 1387 | *ep++ = CBACK; 1388 | *ep++ = c-'1'; 1389 | continue; 1390 | } 1391 | *ep++ = CCHR; 1392 | if (c=='\n') 1393 | goto cerror; 1394 | *ep++ = c; 1395 | continue; 1396 | 1397 | case '.': 1398 | *ep++ = CDOT; 1399 | continue; 1400 | 1401 | case '\n': 1402 | goto cerror; 1403 | 1404 | case '*': 1405 | if (lastep==0 || *lastep==CBRA || *lastep==CKET) 1406 | goto defchar; 1407 | *lastep |= STAR; 1408 | continue; 1409 | 1410 | case '$': 1411 | if ((peekc=getchr()) != eof && peekc!='\n') 1412 | goto defchar; 1413 | *ep++ = CDOL; 1414 | continue; 1415 | 1416 | case '[': 1417 | *ep++ = CCL; 1418 | *ep++ = 0; 1419 | cclcnt = 1; 1420 | if ((c=getchr()) == '^') { 1421 | c = getchr(); 1422 | ep[-2] = NCCL; 1423 | } 1424 | do { 1425 | if (c=='\n') 1426 | goto cerror; 1427 | if (c=='-' && ep[-1]!=0) { 1428 | if ((c=getchr())==']') { 1429 | *ep++ = '-'; 1430 | cclcnt++; 1431 | break; 1432 | } 1433 | while (ep[-1]=&expbuf[ESIZE]) 1438 | goto cerror; 1439 | } 1440 | } 1441 | *ep++ = c; 1442 | cclcnt++; 1443 | if (ep >= &expbuf[ESIZE]) 1444 | goto cerror; 1445 | } while ((c = getchr()) != ']'); 1446 | lastep[1] = cclcnt; 1447 | continue; 1448 | 1449 | defchar: 1450 | default: 1451 | *ep++ = CCHR; 1452 | *ep++ = c; 1453 | } 1454 | } 1455 | cerror: 1456 | expbuf[0] = 0; 1457 | nbra = 0; 1458 | error(Q); 1459 | } 1460 | 1461 | int execute(unsigned int *addr) 1462 | { 1463 | char *p1, *p2; 1464 | int c; 1465 | 1466 | for (c=0; c= curlp) { 1570 | if (advance(lp, ep)) 1571 | return(1); 1572 | lp -= braelist[i] - braslist[i]; 1573 | } 1574 | continue; 1575 | 1576 | case CDOT|STAR: 1577 | curlp = lp; 1578 | while (*lp++) 1579 | ; 1580 | goto star; 1581 | 1582 | case CCHR|STAR: 1583 | curlp = lp; 1584 | while (*lp++ == *ep) 1585 | ; 1586 | ep++; 1587 | goto star; 1588 | 1589 | case CCL|STAR: 1590 | case NCCL|STAR: 1591 | curlp = lp; 1592 | while (cclass(ep, *lp++, ep[-1]==(CCL|STAR))) 1593 | ; 1594 | ep += *ep; 1595 | goto star; 1596 | 1597 | star: 1598 | do { 1599 | lp--; 1600 | if (advance(lp, ep)) 1601 | return(1); 1602 | } while (lp > curlp); 1603 | return(0); 1604 | 1605 | default: 1606 | error(Q); 1607 | } 1608 | } 1609 | 1610 | int backref(int i, char *lp) 1611 | { 1612 | char *bp; 1613 | 1614 | bp = braslist[i]; 1615 | while (*bp++ == *lp++) 1616 | if (bp >= braelist[i]) 1617 | return(1); 1618 | return(0); 1619 | } 1620 | 1621 | int cclass(char *set, int c, int af) 1622 | { 1623 | int n; 1624 | 1625 | if (c==0) 1626 | return(0); 1627 | n = *set++; 1628 | while (--n) 1629 | if (*set++ == c) 1630 | return(af); 1631 | return(!af); 1632 | } 1633 | 1634 | void putd(void) 1635 | { 1636 | int r; 1637 | 1638 | r = count%10; 1639 | count /= 10; 1640 | if (count) 1641 | putd(); 1642 | putchr(r + '0'); 1643 | } 1644 | 1645 | void puts(char *sp) 1646 | { 1647 | col = 0; 1648 | while (*sp) 1649 | putchr(*sp++); 1650 | putchr('\n'); 1651 | } 1652 | 1653 | char line[70]; 1654 | char *linp = line; 1655 | 1656 | void putchr(int ac) 1657 | { 1658 | char *lp; 1659 | int c; 1660 | 1661 | lp = linp; 1662 | c = ac; 1663 | if (listf) { 1664 | if (c=='\n') { 1665 | if (linp!=line && linp[-1]==' ') { 1666 | *lp++ = '\\'; 1667 | *lp++ = 'n'; 1668 | } 1669 | } else { 1670 | if (col > (72-4-2)) { 1671 | col = 8; 1672 | *lp++ = '\\'; 1673 | *lp++ = '\n'; 1674 | *lp++ = '\t'; 1675 | } 1676 | col++; 1677 | if (c=='\b' || c=='\t' || c=='\\') { 1678 | *lp++ = '\\'; 1679 | if (c=='\b') 1680 | c = 'b'; 1681 | else if (c=='\t') 1682 | c = 't'; 1683 | col++; 1684 | } else if (c<' ' || c=='\177') { 1685 | *lp++ = '\\'; 1686 | *lp++ = (c>>6) +'0'; 1687 | *lp++ = ((c>>3)&07)+'0'; 1688 | c = ( c &07)+'0'; 1689 | col += 3; 1690 | } 1691 | } 1692 | } 1693 | *lp++ = c; 1694 | if(c == '\n' || lp >= &line[64]) { 1695 | linp = line; 1696 | write(oflag?2:1, line, lp-line); 1697 | return; 1698 | } 1699 | linp = lp; 1700 | } 1701 | -------------------------------------------------------------------------------- /tests/sdl-test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int log_events(){ 6 | SDL_Event event; 7 | if(SDL_PollEvent(&event)){ /* Loop until there are no events left on the queue */ 8 | switch(event.type){ /* Process the appropiate event type */ 9 | case SDL_KEYDOWN: /* Handle a KEYDOWN event */ 10 | printf("Key down %d\n", event.key.keysym.sym); 11 | if(event.key.keysym.sym == SDLK_ESCAPE){ 12 | return 0; 13 | } 14 | break; 15 | case SDL_KEYUP: 16 | printf("Key up: %d\n", event.key.keysym.sym); 17 | break; 18 | case SDL_MOUSEMOTION: 19 | printf("Mouse motion\n"); 20 | break; 21 | case SDL_QUIT: 22 | printf("Quit\n"); 23 | return 0; 24 | default: /* Report an unhandled event */ 25 | printf("Unknown Event: %d\n", event.type); 26 | break; 27 | } 28 | } 29 | return 1; 30 | } 31 | 32 | int main(int argc, char* argv[]) { 33 | SDL_Init(SDL_INIT_VIDEO); 34 | 35 | SDL_Surface * surface = SDL_SetVideoMode(640, 480, 32, 0); 36 | 37 | if (surface == NULL) { 38 | printf("Could not create surface: %s\n", SDL_GetError()); 39 | return 1; 40 | } 41 | 42 | time_t start = time(NULL); 43 | 44 | SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, 0, 0, 0)); 45 | SDL_Flip(surface); 46 | 47 | while(time(NULL) - start < 1){ 48 | log_events(); 49 | } 50 | 51 | SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, 255, 0, 0)); 52 | SDL_Flip(surface); 53 | 54 | while(time(NULL) - start < 2){ 55 | log_events(); 56 | } 57 | 58 | SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, 0, 255, 0)); 59 | SDL_Flip(surface); 60 | 61 | while(time(NULL) - start < 3){ 62 | log_events(); 63 | } 64 | 65 | SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, 0, 0, 255)); 66 | SDL_Flip(surface); 67 | 68 | while(time(NULL) - start < 4){ 69 | log_events(); 70 | } 71 | 72 | SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, 255, 255, 255)); 73 | SDL_Flip(surface); 74 | 75 | while(log_events()){} 76 | 77 | SDL_Quit(); 78 | 79 | return 0; 80 | } 81 | -------------------------------------------------------------------------------- /tests/sdl2-test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int log_events(){ 6 | SDL_Event event; 7 | if(SDL_PollEvent(&event)){ /* Loop until there are no events left on the queue */ 8 | switch(event.type){ /* Process the appropiate event type */ 9 | case SDL_KEYDOWN: /* Handle a KEYDOWN event */ 10 | printf("Key down %d\n", event.key.keysym.sym); 11 | if(event.key.keysym.sym == SDLK_ESCAPE){ 12 | return 0; 13 | } 14 | break; 15 | case SDL_KEYUP: 16 | printf("Key up: %d\n", event.key.keysym.sym); 17 | break; 18 | case SDL_MOUSEMOTION: 19 | printf("Mouse motion\n"); 20 | break; 21 | case SDL_QUIT: 22 | printf("Quit\n"); 23 | return 0; 24 | default: /* Report an unhandled event */ 25 | printf("Unknown Event: %d\n", event.type); 26 | break; 27 | } 28 | } 29 | return 1; 30 | } 31 | 32 | int main(int argc, char* argv[]) { 33 | SDL_Init(SDL_INIT_VIDEO); 34 | 35 | SDL_Window * win = SDL_CreateWindow("Hello World!", 640, 480, 32, 0, SDL_WINDOW_SHOWN); 36 | 37 | if (win == NULL) { 38 | printf("Could not create window: %s\n", SDL_GetError()); 39 | return 1; 40 | } 41 | 42 | SDL_Renderer *ren = SDL_CreateRenderer(win, -1, 0); 43 | if (ren == NULL) { 44 | printf("Could not create renderer: %s\n", SDL_GetError()); 45 | return 1; 46 | } 47 | 48 | time_t start = time(NULL); 49 | 50 | SDL_SetRenderDrawColor(ren, 0, 0, 0, 255); 51 | SDL_RenderFillRect(ren, NULL); 52 | SDL_RenderPresent(ren); 53 | 54 | while(time(NULL) - start < 1){ 55 | log_events(); 56 | } 57 | 58 | SDL_SetRenderDrawColor(ren, 255, 0, 0, 255); 59 | SDL_RenderFillRect(ren, NULL); 60 | SDL_RenderPresent(ren); 61 | 62 | while(time(NULL) - start < 2){ 63 | log_events(); 64 | } 65 | 66 | SDL_SetRenderDrawColor(ren, 0, 255, 0, 255); 67 | SDL_RenderFillRect(ren, NULL); 68 | SDL_RenderPresent(ren); 69 | 70 | while(time(NULL) - start < 3){ 71 | log_events(); 72 | } 73 | 74 | SDL_SetRenderDrawColor(ren, 0, 0, 255, 255); 75 | SDL_RenderFillRect(ren, NULL); 76 | SDL_RenderPresent(ren); 77 | 78 | while(time(NULL) - start < 4){ 79 | log_events(); 80 | } 81 | 82 | SDL_SetRenderDrawColor(ren, 255, 255, 255, 255); 83 | SDL_RenderFillRect(ren, NULL); 84 | SDL_RenderPresent(ren); 85 | 86 | while(log_events()){} 87 | 88 | SDL_Quit(); 89 | 90 | return 0; 91 | } 92 | -------------------------------------------------------------------------------- /tests/thread-test.c: -------------------------------------------------------------------------------- 1 | int regular_data = 1; 2 | int regular_bss = 0; 3 | 4 | __thread int test_tl_data = 1; 5 | __thread int test_tl_bss = 0; 6 | 7 | int main(int argc, char ** argv){ 8 | printf("REG DATA: %d, REG BSS: %d\n", regular_data, regular_bss); 9 | printf("TLS DATA: %d, TLS BSS: %d\n", test_tl_data, test_tl_bss); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt-get install build-essential autoconf2.64 automake1.11 gcc-multilib libtool texinfo gperf bison flex libssl-dev python-minimal cmake ccache 3 | --------------------------------------------------------------------------------