Skip to content

Commit

Permalink
Release v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mid-kid committed Aug 25, 2021
1 parent c721e8d commit 6e24c07
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/mobile
/mobile.exe
/config.bin
/releng/musl/
/releng/winxp-pthreads/
10 changes: 10 additions & 0 deletions releng/build-musl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
CC="x86_64-pc-linux-gnu-gcc -m32" \
AR="x86_64-pc-linux-gnu-ar" \
RANLIB="x86_64-pc-linux-gnu-ranlib" \
../musl-1.2.2/configure \
--prefix="$(realpath $PWD/../musl)" \
--disable-shared \
--host=i686-pc-linux-musl
make
make install
8 changes: 8 additions & 0 deletions releng/build-winxp-pthreads.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
CC="x86_64-w64-mingw32-gcc -m32 -D_WIN32_WINNT=0x0501" \
../mingw-w64-v9.0.0/mingw-w64-libraries/winpthreads/configure \
--prefix="$(realpath "$PWD/../winxp-pthreads")" \
--host=x86_64-w64-mingw32 \
--disable-shared
make
make install
21 changes: 21 additions & 0 deletions releng/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
set -e

make_mingw() {
CC="x86_64-w64-mingw32-gcc -m32" \
CFLAGS="-isystem '$PWD/winxp-pthreads/include'" \
LDFLAGS="-L '$PWD/winxp-pthreads/lib'" \
../make-mingw -C .. "$@"
}

make_musl() {
CC="$PWD/musl/bin/musl-gcc -m32" \
REALGCC="x86_64-pc-linux-gnu-gcc" \
LDFLAGS="-static -Wl,-melf_i386" \
make -C .. "$@"
}

make_musl clean
make_musl
make_mingw clean
make_mingw
3 changes: 2 additions & 1 deletion source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ int mobile_board_sock_recv(void *user, unsigned conn, void *data, unsigned size,
// zero-length datagrams.
int sock_type = 0;
socklen_t sock_type_len = sizeof(sock_type);
getsockopt(sock, SOL_SOCKET, SO_TYPE, &sock_type, &sock_type_len);
getsockopt(sock, SOL_SOCKET, SO_TYPE, (char *)&sock_type,
&sock_type_len);
if (sock_type == SOCK_STREAM) return -2;
}

Expand Down

0 comments on commit 6e24c07

Please sign in to comment.