-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-emscripten-sdl2
executable file
·43 lines (33 loc) · 1.46 KB
/
build-emscripten-sdl2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
# make sure you use ". ./emsdk_env.sh"
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# for sdl2-config and sdl-config
export PATH=${EMSDK}/upstream/emscripten/system/bin:${PATH}
CC="emcc"
CXX="em++"
LD="emcc"
LD_CXX="em++"
AR="emar"
RANLIB="emranlib"
CFLAGS="-DEMTERPRETER_SYNC"
CXXFLAGS="-DEMSCRIPTEN=1 -DEMTERPRETER_SYNC -s USE_ZLIB=1 -s USE_SDL=2"
LDFLAGS="-DEMSCRIPTEN=1 -DEMTERPRETER_SYNC -s USE_ZLIB=1 -s USE_SDL=2 -s FORCE_FILESYSTEM=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=100663296 -s ASYNCIFY -s ERROR_ON_UNDEFINED_SYMBOLS=0"
export CC CXX LD LD_CXX AR RANLIB CFLAGS CXXFLAGS LDFLAGS
# where are we?
top=$(pwd)
if test -z "${top}" ; then exit 1; fi
# fix
chmod +x vs/sdl/build-scripts/strip_fPIC.sh
echo "Compiling DOSBox-X"
chmod +x configure
# build command borrowed from Yksoft1 vanilla DOSBox-X port with modifications
./configure \
--host=x86_64-linux --disable-dynrec --disable-dynamic-x86 --disable-fpu-x86 --disable-dynamic-core \
--enable-sdl2 --with-sdl-prefix="${EMSDK}/upstream/emscripten/system" --disable-screenshots \
--disable-opengl --disable-mt32 --enable-emscripten --enable-force-menu-sdldraw --disable-x11 \
--disable-avcodec --disable-libslirp --disable-libfluidsynth --disable-freetype "${@}"
make -j6 || exit 1
# the resulting files are src/dosbox-x (JS) and src/dosbox-x.wasm