1
0
Fork 0
forked from fte/fteqw

try to fix some build types.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5108 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-05-23 07:48:45 +00:00
parent bdd0af432f
commit 9689f7680e
5 changed files with 769 additions and 739 deletions

View file

@ -109,6 +109,7 @@ if [ "$REUSE_CONFIG" != "y" ]; then
echo "Skipping Cygwin options." echo "Skipping Cygwin options."
fi fi
read -n 1 -p "Build for Windows? [Y/n] " BUILD_WINDOWS && echo read -n 1 -p "Build for Windows? [Y/n] " BUILD_WINDOWS && echo
read -n 1 -p "Build for Dos? [y/N] " BUILD_WINDOWS && echo
read -n 1 -p "Build for SDL? [y/N] " BUILD_SDL && echo read -n 1 -p "Build for SDL? [y/N] " BUILD_SDL && echo
read -n 1 -p "Build for Android? [y/N] " BUILD_ANDROID && echo read -n 1 -p "Build for Android? [y/N] " BUILD_ANDROID && echo
read -n 1 -p "Build for Emscripten? [y/N] " BUILD_WEB && echo read -n 1 -p "Build for Emscripten? [y/N] " BUILD_WEB && echo
@ -126,6 +127,7 @@ BUILD_LINUXx32=${BUILD_LINUXx32:-n}
BUILD_LINUXarmhf=${BUILD_LINUXarmhf:-n} BUILD_LINUXarmhf=${BUILD_LINUXarmhf:-n}
BUILD_CYGWIN=${BUILD_CYGWIN:-n} BUILD_CYGWIN=${BUILD_CYGWIN:-n}
BUILD_WINDOWS=${BUILD_WINDOWS:-y} BUILD_WINDOWS=${BUILD_WINDOWS:-y}
BUILD_DOS=${BUILD_DOS:-n}
BUILD_MSVC=${BUILD_MSVC:-n} BUILD_MSVC=${BUILD_MSVC:-n}
BUILD_SDL=${BUILD_SDL:-n} BUILD_SDL=${BUILD_SDL:-n}
BUILD_ANDROID=${BUILD_ANDROID:-n} BUILD_ANDROID=${BUILD_ANDROID:-n}
@ -154,6 +156,7 @@ if [ "$UID" != "0" ]; then
echo "BUILD_LINUXarmhf=\"$BUILD_LINUXarmhf\"" >>$FTECONFIG echo "BUILD_LINUXarmhf=\"$BUILD_LINUXarmhf\"" >>$FTECONFIG
echo "BUILD_CYGWIN=\"$BUILD_CYGWIN\"" >>$FTECONFIG echo "BUILD_CYGWIN=\"$BUILD_CYGWIN\"" >>$FTECONFIG
echo "BUILD_WINDOWS=\"$BUILD_WINDOWS\"" >>$FTECONFIG echo "BUILD_WINDOWS=\"$BUILD_WINDOWS\"" >>$FTECONFIG
echo "BUILD_DOS=\"$BUILD_DOS\"" >>$FTECONFIG
echo "BUILD_MSVC=\"$BUILD_MSVC\"" >>$FTECONFIG echo "BUILD_MSVC=\"$BUILD_MSVC\"" >>$FTECONFIG
echo "BUILD_ANDROID=\"$BUILD_ANDROID\"" >>$FTECONFIG echo "BUILD_ANDROID=\"$BUILD_ANDROID\"" >>$FTECONFIG
echo "BUILD_SDL=\"$BUILD_SDL\"" >>$FTECONFIG echo "BUILD_SDL=\"$BUILD_SDL\"" >>$FTECONFIG
@ -296,6 +299,11 @@ read -n 1 -p "Rebuild/update any toolchains now? [y/N] " REBUILD_TOOLCHAINS && e
REBUILD_TOOLCHAINS=${REBUILD_TOOLCHAINS:-n} REBUILD_TOOLCHAINS=${REBUILD_TOOLCHAINS:-n}
mkdir -p $FTEROOT mkdir -p $FTEROOT
#dos shit
if [ "$BUILD_DOS" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
echo "You'll need to manually install djgpp for DOS builds."
fi
#android shit. WARNING: should come first as it spits out some EULAs that need confirming. #android shit. WARNING: should come first as it spits out some EULAs that need confirming.
if [ "$BUILD_ANDROID" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then if [ "$BUILD_ANDROID" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
mkdir -p $ANDROIDROOT mkdir -p $ANDROIDROOT

View file

@ -159,6 +159,11 @@ fi
if [ "$BUILD_WINDOWS" != "n" ]; then if [ "$BUILD_WINDOWS" != "n" ]; then
build "NPFTE" npfte npfte-rel build "NPFTE" npfte npfte-rel
fi fi
if [ "$BUILD_DOS" == "y" ]; then
#no networking makes dedicated servers useless. and only a crappy sw renderer is implemented right now.
#the qcc might be useful to someone though!
build "DOS" dos m-rel qcc-rel
fi
if [ "$BUILD_WEB" != "n" ]; then if [ "$BUILD_WEB" != "n" ]; then
source $EMSDK/emsdk_env.sh >> /dev/null source $EMSDK/emsdk_env.sh >> /dev/null
build "Emscripten" web FTE_TARGET=web gl-rel CC=emcc build "Emscripten" web FTE_TARGET=web gl-rel CC=emcc

View file

@ -3474,7 +3474,7 @@ static void S_UpdateCard(soundcardinfo_t *sc)
} }
#ifdef HAVE_MIXER #ifdef HAVE_MIXER
static int S_GetMixerTime(soundcardinfo_t *sc) int S_GetMixerTime(soundcardinfo_t *sc)
{ {
int samplepos; int samplepos;
int fullsamples; int fullsamples;

View file

@ -94,7 +94,11 @@ typedef int (VARGS gnutls_certificate_verify_function)(gnutls_session_t session)
#else #else
#include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
#if GNUTLS_VERSION_MAJOR >= 3 && defined(HAVE_DTLS)
#include <gnutls/dtls.h> #include <gnutls/dtls.h>
#else
#undef HAVE_DTLS
#endif
#define gnutls_connection_end_t unsigned int #define gnutls_connection_end_t unsigned int
#if GNUTLS_VERSION_MAJOR < 3 || (GNUTLS_VERSION_MAJOR == 3 && GNUTLS_VERSION_MINOR < 3) #if GNUTLS_VERSION_MAJOR < 3 || (GNUTLS_VERSION_MAJOR == 3 && GNUTLS_VERSION_MINOR < 3)
@ -728,12 +732,16 @@ qboolean SSL_InitGlobal(qboolean isserver)
if (isserver) if (isserver)
{ {
#define KEYFILE "c:/games/tools/ssl/key.pem" int ret = -1;
#define CERTFILE "c:/games/tools/ssl/cert.pem" char keyfile[MAX_OSPATH];
int ret = qgnutls_certificate_set_x509_key_file(xcred[isserver], CERTFILE, KEYFILE, GNUTLS_X509_FMT_PEM); char certfile[MAX_OSPATH];
*keyfile = *certfile = 0;
if (FS_NativePath("key.pem", FS_ROOT, keyfile, sizeof(keyfile))
if (FS_NativePath("cert.pem", FS_ROOT, certfile, sizeof(certfile))
ret = qgnutls_certificate_set_x509_key_file(xcred[isserver], certfile, keyfile, GNUTLS_X509_FMT_PEM);
if (ret < 0) if (ret < 0)
{ {
Con_Printf("No certificate or key were found\n"); Con_Printf("No certificate or key were found in %s and %s\n", certfile, keyfile);
initstatus[isserver] = -1; initstatus[isserver] = -1;
} }
} }
@ -994,6 +1002,13 @@ neterr_t DTLS_Timeouts(void *ctx)
} }
return NETERR_SENT; return NETERR_SENT;
} }
#else
void DTLS_DestroyContext(void *ctx){}
qboolean DTLS_HasServerCertificate(void){return false;}
void *DTLS_CreateContext(void *cbctx, neterr_t(*push)(void *cbctx, const qbyte *data, size_t datasize), qboolean isserver){return NULL;}
neterr_t DTLS_Transmit(void *ctx, const qbyte *data, size_t datasize){return NETERR_DISCONNECTED;}
neterr_t DTLS_Received(void *ctx, qbyte *data, size_t datasize){return NETERR_DISCONNECTED;}
neterr_t DTLS_Timeouts(void *ctx) {return NETERR_SENT;}
#endif #endif
#endif #endif

View file

@ -2955,8 +2955,9 @@ qboolean NET_PortToAdr (netadrtype_t adrfamily, netproto_t adrprot, const char *
return false; return false;
} }
#ifdef HAVE_PACKET
/*just here to prevent the client from spamming new sockets, which can be a problem with certain q2 servers*/ /*just here to prevent the client from spamming new sockets, which can be a problem with certain q2 servers*/
qboolean FTENET_Datagram_ChangeLocalAddress(struct ftenet_generic_connection_s *con, netadr_t *adr) static qboolean FTENET_Datagram_ChangeLocalAddress(struct ftenet_generic_connection_s *con, netadr_t *adr)
{ {
struct sockaddr_qstorage address; struct sockaddr_qstorage address;
netadr_t current; netadr_t current;
@ -2980,6 +2981,7 @@ qboolean FTENET_Datagram_ChangeLocalAddress(struct ftenet_generic_connection_s *
//doesn't match how its currently bound, so I guess we need to rebind then. //doesn't match how its currently bound, so I guess we need to rebind then.
return false; return false;
} }
#endif
ftenet_generic_connection_t *FTENET_Datagram_EstablishConnection(qboolean isserver, const char *address, netadr_t adr) ftenet_generic_connection_t *FTENET_Datagram_EstablishConnection(qboolean isserver, const char *address, netadr_t adr)
{ {