diff options
author | Dan Sagunov <danilka.pro@gmail.com> | 2013-10-30 23:00:40 +0400 |
---|---|---|
committer | Dan Sagunov <danilka.pro@gmail.com> | 2013-10-30 23:00:40 +0400 |
commit | bb5d5bfd20c09952cfb3b9881b90177b0c34aac7 (patch) | |
tree | c4aedf31fb76782f3438869ef2dbe4aecb1b9fd1 | |
parent | 7f2484d82112851dbeba83afd18790a58b03599d (diff) | |
download | mv-bb5d5bfd20c09952cfb3b9881b90177b0c34aac7.tar.gz mv-bb5d5bfd20c09952cfb3b9881b90177b0c34aac7.tar.bz2 mv-bb5d5bfd20c09952cfb3b9881b90177b0c34aac7.tar.xz mv-bb5d5bfd20c09952cfb3b9881b90177b0c34aac7.zip |
Fix nacl building
-rwxr-xr-x | configure.ac | 48 | ||||
-rw-r--r-- | src/net/ea/network.h | 4 | ||||
-rw-r--r-- | src/net/nacltcpnet.cpp | 2 |
3 files changed, 37 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac index 74124d902..1aad56794 100755 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,6 @@ AC_CONFIG_HEADERS([config.h:config.h.in]) AC_LANG_CPLUSPLUS # Checks for android. -# Enable mac build AC_ARG_ENABLE(androidbuild, [ --enable-androidbuild Turn on android building], [case "${enableval}" in @@ -16,6 +15,17 @@ AC_ARG_ENABLE(androidbuild, *) AC_MSG_ERROR(bad value ${enableval} for --enable-androidbuild) ;; esac],[androidbuild_enabled=false]) +# Enable nacl build +AC_ARG_ENABLE(naclbuild, +[ --enable-naclbuild Turn on nacl building], +[case "${enableval}" in + yes) naclbuild_enabled=true + ;; + no) naclbuild_enabled=false + ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-naclbuild) ;; +esac],[anaclbuild_enabled=false]) + # Checks for programs. AC_PROG_CXX AM_PROG_CC_C_O @@ -28,8 +38,10 @@ AC_HEADER_TIME AC_FUNC_ERROR_AT_LINE if test "x$androidbuild_enabled" == "xfalse"; then - AC_FUNC_MALLOC - AC_FUNC_REALLOC + if test "x$naclbuild_enabled" == "xfalse"; then + AC_FUNC_MALLOC + AC_FUNC_REALLOC + fi fi AC_C_INLINE @@ -95,26 +107,30 @@ else LIBS="$LIBS `$SDL_CONFIG --libs`" CPPFLAGS="$CPPFLAGS `$SDL_CONFIG --cflags`" fi - AC_CHECK_LIB([SDL], [SDL_Init], , - AC_MSG_ERROR([ *** Unable to find SDL library (http://www.libsdl.org/)])) - AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, , - AC_MSG_ERROR([ *** Unable to find SDL_image library with PNG support + if test "x$naclbuild_enabled" == "xfalse"; then + AC_CHECK_LIB([SDL], [SDL_Init], , + AC_MSG_ERROR([ *** Unable to find SDL library (http://www.libsdl.org/)])) + + + AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, , + AC_MSG_ERROR([ *** Unable to find SDL_image library with PNG support (http://www.libsdl.org/projects/SDL_image/)])) - AC_CHECK_LIB(SDL_ttf, TTF_Quit, , - AC_MSG_ERROR([ *** Unable to find SDL_ttf library (http://www.libsdl.org/projects/SDL_ttf/)])) + AC_CHECK_LIB(SDL_ttf, TTF_Quit, , + AC_MSG_ERROR([ *** Unable to find SDL_ttf library (http://www.libsdl.org/projects/SDL_ttf/)])) - AC_CHECK_LIB([SDL_mixer], [Mix_OpenAudio], , - AC_MSG_ERROR([ *** Unable to find SDL_mixer library (http://www.libsdl.org/projects/SDL_mixer/)])) + AC_CHECK_LIB([SDL_mixer], [Mix_OpenAudio], , + AC_MSG_ERROR([ *** Unable to find SDL_mixer library (http://www.libsdl.org/projects/SDL_mixer/)])) - AC_CHECK_LIB(SDL_gfx, rotozoomSurfaceXY, , - AC_MSG_ERROR([ *** Unable to find SDL_gfx library (http://www.ferzkopp.net/joomla/software-mainmenu-14/4-ferzkopps-linux-software/19-sdlgfx)])) - AC_CHECK_HEADERS(SDL_rotozoom.h, ,) + AC_CHECK_LIB(SDL_gfx, rotozoomSurfaceXY, , + AC_MSG_ERROR([ *** Unable to find SDL_gfx library (http://www.ferzkopp.net/joomla/software-mainmenu-14/4-ferzkopps-linux-software/19-sdlgfx)])) + AC_CHECK_HEADERS(SDL_rotozoom.h, ,) - AC_CHECK_LIB(SDL_net, SDLNet_Init, , - AC_MSG_ERROR([ *** Unable to find SDL_net library])) + AC_CHECK_LIB(SDL_net, SDLNet_Init, , + AC_MSG_ERROR([ *** Unable to find SDL_net library])) + fi with_sdl2=no fi diff --git a/src/net/ea/network.h b/src/net/ea/network.h index 9298f021f..1473a1413 100644 --- a/src/net/ea/network.h +++ b/src/net/ea/network.h @@ -25,7 +25,11 @@ #include "net/serverinfo.h" +#if defined __native_client__ +#include "net/nacltcpnet.h" +#else #include "net/sdltcpnet.h" +#endif #include <SDL_thread.h> diff --git a/src/net/nacltcpnet.cpp b/src/net/nacltcpnet.cpp index ccdb5a3f6..f2db71b56 100644 --- a/src/net/nacltcpnet.cpp +++ b/src/net/nacltcpnet.cpp @@ -20,7 +20,7 @@ #if defined __native_client__ -#include "net/sdltcpnet.h" +#include "net/nacltcpnet.h" #if defined __linux__ || defined __linux #include "logger.h" |