The demos of
http://sourceforge.net/projects/jsdosbox/ aren't working
for me (it recommends Chrome :-( ) and its Java -> GWT -> JS approach
seems dubious, so I'm attempting to build Dosbox with emscripten.
(Has anyone succeeded after @Hee Hoo's messages to the mailing list
back in June?)
The emscripten tutorial works great, next
https://github.com/kripken/emscripten/wiki/Building-Projects suggests
I run
% emconfigure ./configure
for Dosbox, but it fails with
checking for sdl-config... /usr/bin/sdl-config
checking for SDL - version >= 1.2.0... no
*** Could not run SDL test program, checking why...
*** The test program failed to compile or link. ...
config.log shows it's trying to compile and link a test program with
emcc, but failing to find a libSDL it likes (linker output below). At
first that seems obvious as emscripten will be using its JavaScript
SDL implementation not a system library, but emconfigure says "What
happens is that all compilations done during this command are to
native code, not JS, so that configure tests will work properly."
Fine, so I tried
% emconfigure ./configure --disable-sdltest
but that fails with
checking for sdl-config... /usr/bin/sdl-config
checking for SDL - version >= 1.2.0... yes
checking SDL version only being 1.2.X... no
configure: error: Only libSDL 1.2.X supported
I think that fails because emscripten's ./system/include/SDL/
SDL_version.h has:
#define SDL_MINOR_VERSION 3
but my system (Kubuntu 11.10) has libsdl1.2debian-alsa and libsdl1.2-
dev installed and so sdl_version reports 1.2.14.
I wonder what the best fix is: specify a different sdl-config binary
just for enscriptem (maybe enscriptem could include one and
emconfigure could set SDL_CONFIG to it?), get configure to trust the
enscriptem headers, disable this part of configure altogether and hand-
merge settings with a native ./configure run, or ?
Thanks for suggestions, and an amazing tool!
- - - - - Output from % emconfigure ./configure follows - - - - -
configure:4472: result: /usr/bin/sdl-config
configure:4481: checking for SDL - version >= 1.2.0
configure:4576: /opt/download/emscripten/emcc -o conftest -m32 -
U__i386__ -U__x86_64__ -U__i386 -U__x86_64 -U__SSE__ -U__SSE2__ -
U__MMX__ -UX87_DOUBLE_ROUNDING -UHAVE_GCC_ASM_FOR_X87 -DEMSCRIPTEN -
U__STRICT_ANSI__ -U__CYGWIN__ -D__STDC__ -nostdinc -I/opt/download/
emscripten/system/include -I/opt/download/emscripten/system/include/
bsd -I/opt/download/emscripten/system/include/libc -I/opt/download/
emscripten/system/include/libcxx -I/opt/download/emscripten/system/
include/gfx -I/opt/download/emscripten/system/include/net -I/opt/
download/emscripten/system/include/SDL -U__APPLE__ -I/usr/include/SDL -
D_GNU_SOURCE=1 -D_REENTRANT conftest.c -L/usr/lib -lSDL >&5
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching
for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching
for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/
4.6/../../../libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/
4.6/../../../libSDL.a when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching
for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching
for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching
for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching
for -lSDL
/usr/bin/ld: cannot find -lSDL
clang: error: linker command failed with exit code 1 (use -v to see
invocation)