From cb9004e4cfa94251ab0d31f19fee187fc4e9abcc Mon Sep 17 00:00:00 2001
From: Steel Titanium <steeltitanium1@gmail.com>
Date: Tue, 7 Apr 2020 19:07:39 -0400
Subject: [PATCH] Fix some build errors

---
 .circleci/config.yml | 2 +-
 src/CMakeLists.txt   | 2 +-
 src/d_clisrv.c       | 6 ++++++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1784ba1ea..e7916074b 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -36,7 +36,7 @@ jobs:
             - v1-SRB2-APT
       - run:
           name: Install SDK
-          command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
+          command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
       - save_cache:
           key: v1-SRB2-APT
           paths:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f995d0460..19b0e07c6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -220,7 +220,7 @@ set(SRB2_CONFIG_HAVE_ZLIB ON CACHE BOOL
 	"Enable zlib support.")
 set(SRB2_CONFIG_HAVE_GME ON CACHE BOOL
 	"Enable GME support.")
-set(SRB2_CONFIG_HAVE_GME ON CACHE BOOL
+set(SRB2_CONFIG_HAVE_CURL ON CACHE BOOL
 	"Enable curl support, used for downloading files via HTTP.")
 set(SRB2_CONFIG_HWRENDER ON CACHE BOOL
 	"Enable hardware rendering through OpenGL.")
diff --git a/src/d_clisrv.c b/src/d_clisrv.c
index 083ad750e..c93f6e29a 100644
--- a/src/d_clisrv.c
+++ b/src/d_clisrv.c
@@ -1255,7 +1255,9 @@ static inline void CL_DrawConnectionStatus(void)
 				break;
 			case CL_ASKDOWNLOADFILES:
 			case CL_WAITDOWNLOADFILESRESPONSE:
+#ifdef HAVE_CURL
 			case CL_PREPAREHTTPFILES:
+#endif
 				cltext = M_GetText("Waiting to download files...");
 			default:
 				cltext = M_GetText("Connecting to server...");
@@ -1385,7 +1387,9 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
 		netbuffer->u.serverinfo.iszone = 0;
 
 	memset(netbuffer->u.serverinfo.maptitle, 0, 33);
+#ifdef HAVE_CURL
 	memset(netbuffer->u.serverinfo.httpsource, 0, MAX_MIRROR_LENGTH);
+#endif
 
 	if (!(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) && mapheaderinfo[gamemap-1]->lvlttl[0])
 	{
@@ -1437,6 +1441,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
 
 	netbuffer->u.serverinfo.actnum = 0; //mapheaderinfo[gamemap-1]->actnum
 
+#ifdef HAVE_CURL
 	mirror_length = strlen(cv_httpsource.string);
 	if (mirror_length > MAX_MIRROR_LENGTH)
 		mirror_length = MAX_MIRROR_LENGTH;
@@ -1446,6 +1451,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
 		strncpy(netbuffer->u.serverinfo.httpsource, "", MAX_MIRROR_LENGTH);
 
 	netbuffer->u.serverinfo.httpsource[MAX_MIRROR_LENGTH-1] = 0;
+#endif
 
 	p = PutFileNeeded(0);
 
-- 
GitLab