Build fix: Enable SDL2_net if SDL2

This may fix #1624 and #1692.
This commit is contained in:
tokumeiwokiboushimasu 2020-07-09 10:03:03 +09:00 committed by GitHub
parent a8be3fcda5
commit 0bffa018de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -392,7 +392,7 @@ LDFLAGS="$LDFLAGS -L$pwd/vs2015/sdlnet/linux-host/lib"
CPPFLAGS="$CPPFLAGS -I$pwd/vs2015/sdlnet/linux-host/include -I$pwd/vs2015/sdlnet/linux-host/include/SDL"
CXXFLAGS="$CXXFLAGS -I$pwd/vs2015/sdlnet/linux-host/include -I$pwd/vs2015/sdlnet/linux-host/include/SDL"
dnl LIBRARY TEST: SDLnet 1.x initial test
dnl LIBRARY TEST: SDLnet initial test
AC_CHECK_HEADER(SDL_net.h,have_sdl_net_h=yes,)
if test x$enable_emscripten != xyes; then
@ -561,8 +561,9 @@ dnl This may be provided by glibc itself, -liconv may not be needed.
AC_CHECK_HEADER(iconv.h,have_iconv_h=yes,)
AC_CHECK_LIB(iconv, libiconv_open, have_iconv_lib=yes, ,-liconv)
dnl LIBRARY TEST: SDLnet 1.x
dnl LIBRARY TEST: SDLnet
AC_CHECK_HEADER(SDL_net.h,have_sdl_net_h=yes,)
AC_CHECK_LIB(SDL2_net, SDLNet_Init, have_sdl2_net_lib=yes, , )
AC_CHECK_LIB(SDL_net, SDLNet_Init, have_sdl_net_lib=yes, , )
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
@ -855,14 +856,30 @@ AH_TEMPLATE(C_SDL_NET,[Indicate whether SDL_net is present])
AH_TEMPLATE(C_MODEM,[Define to 1 to enable internal modem support, requires SDL_net])
AH_TEMPLATE(C_IPX,[Define to 1 to enable IPX over Internet networking, requires SDL_net])
# HACK: Don't enable SDL2 net if SDL2
if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
LIBS="$LIBS -lSDL_net"
AC_DEFINE(C_SDL_NET,1)
AC_DEFINE(C_MODEM,1)
AC_DEFINE(C_IPX,1)
else
AC_MSG_WARN([Can't find SDL_net, internal modem and ipx disabled])
dnl enable SDL2 net if SDL2
if test -n "$SDL2_LIBS"; then
if test x$have_sdl2_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
LIBS="$LIBS -lSDL2_net"
AC_DEFINE(C_SDL_NET,1)
AC_DEFINE(C_MODEM,1)
AC_DEFINE(C_IPX,1)
elif test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
LIBS="$LIBS -lSDL_net"
AC_DEFINE(C_SDL_NET,1)
AC_DEFINE(C_MODEM,1)
AC_DEFINE(C_IPX,1)
else
AC_MSG_WARN([Can't find SDL_net, internal modem and ipx disabled])
fi
else
if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
LIBS="$LIBS -lSDL_net"
AC_DEFINE(C_SDL_NET,1)
AC_DEFINE(C_MODEM,1)
AC_DEFINE(C_IPX,1)
else
AC_MSG_WARN([Can't find SDL_net, internal modem and ipx disabled])
fi
fi
dnl FEATURE: Whether to support libz, and enable snapshots