Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten ( http://emscripten.org/ ), and make your SDL-based C/C++ program into a web app. This port was due to the efforts of several people, including: Charlie Birks, Sathyanarayanan Gunasekaran, Jukka Jyl?nki, Alon Zakai, Edward Rudd, Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
This commit is contained in:
parent
a228b67d88
commit
fe40a17224
61 changed files with 4047 additions and 600 deletions
133
configure
vendored
133
configure
vendored
|
@ -21385,6 +21385,78 @@ $as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h
|
|||
fi
|
||||
}
|
||||
|
||||
CheckEmscriptenGLES()
|
||||
{
|
||||
if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGL support" >&5
|
||||
$as_echo_n "checking for EGL support... " >&6; }
|
||||
video_opengl_egl=no
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <EGL/egl.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
video_opengl_egl=yes
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengl_egl" >&5
|
||||
$as_echo "$video_opengl_egl" >&6; }
|
||||
if test x$video_opengl_egl = xyes; then
|
||||
|
||||
$as_echo "#define SDL_VIDEO_OPENGL_EGL 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v2 headers" >&5
|
||||
$as_echo_n "checking for OpenGL ES v2 headers... " >&6; }
|
||||
video_opengles_v2=no
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
video_opengles_v2=yes
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengles_v2" >&5
|
||||
$as_echo "$video_opengles_v2" >&6; }
|
||||
if test x$video_opengles_v2 = xyes; then
|
||||
|
||||
$as_echo "#define SDL_VIDEO_OPENGL_ES2 1" >>confdefs.h
|
||||
|
||||
|
||||
$as_echo "#define SDL_VIDEO_RENDER_OGL_ES2 1" >>confdefs.h
|
||||
|
||||
SUMMARY_video="${SUMMARY_video} opengl_es2"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
CheckInputEvents()
|
||||
{
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux 2.4 unified input interface" >&5
|
||||
|
@ -23483,7 +23555,68 @@ $as_echo "#define SDL_FILESYSTEM_NACL 1" >>confdefs.h
|
|||
SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c"
|
||||
have_filesystem=yes
|
||||
fi
|
||||
;;
|
||||
*-*-emscripten* )
|
||||
if test x$enable_video = xyes; then
|
||||
|
||||
$as_echo "#define SDL_VIDEO_DRIVER_EMSCRIPTEN 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c"
|
||||
have_video=yes
|
||||
SUMMARY_video="${SUMMARY_video} emscripten"
|
||||
fi
|
||||
|
||||
if test x$enable_audio = xyes; then
|
||||
|
||||
$as_echo "#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c"
|
||||
have_audio=yes
|
||||
SUMMARY_audio="${SUMMARY_audio} emscripten"
|
||||
fi
|
||||
|
||||
CheckVisibilityHidden
|
||||
CheckDummyVideo
|
||||
CheckDiskAudio
|
||||
CheckDummyAudio
|
||||
CheckDLOPEN
|
||||
CheckClockGettime
|
||||
CheckEmscriptenGLES
|
||||
|
||||
# Set up files for the power library
|
||||
if test x$enable_power = xyes; then
|
||||
|
||||
$as_echo "#define SDL_POWER_EMSCRIPTEN 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c"
|
||||
have_power=yes
|
||||
fi
|
||||
|
||||
# Set up files for the power library
|
||||
if test x$enable_joystick = xyes; then
|
||||
|
||||
$as_echo "#define SDL_JOYSTICK_EMSCRIPTEN 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c"
|
||||
have_joystick=yes
|
||||
fi
|
||||
|
||||
# Set up files for the filesystem library
|
||||
if test x$enable_filesystem = xyes; then
|
||||
|
||||
$as_echo "#define SDL_FILESYSTEM_EMSCRIPTEN 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c"
|
||||
have_filesystem=yes
|
||||
fi
|
||||
# Set up files for the timer library
|
||||
if test x$enable_timers = xyes; then
|
||||
|
||||
$as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
|
||||
have_timers=yes
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
as_fn_error $? "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue