Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 28 additions & 52 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,8 @@ ifndef USE_OPENAL_DLOPEN
USE_OPENAL_DLOPEN=1
endif

ifndef USE_CURL
USE_CURL=1
endif

ifndef USE_CURL_DLOPEN
ifdef MINGW
USE_CURL_DLOPEN=0
else
USE_CURL_DLOPEN=1
endif
ifndef USE_HTTP
USE_HTTP=1
endif

ifndef USE_CODEC_VORBIS
Expand Down Expand Up @@ -275,6 +267,7 @@ NDIR=$(MOUNT_DIR)/null
UIDIR=$(MOUNT_DIR)/ui
Q3UIDIR=$(MOUNT_DIR)/q3_ui
JPDIR=$(MOUNT_DIR)/jpeg-9f
CURLDIR=$(MOUNT_DIR)/curl-8.15.0
OGGDIR=$(MOUNT_DIR)/libogg-1.3.6
VORBISDIR=$(MOUNT_DIR)/libvorbis-1.3.7
OPUSDIR=$(MOUNT_DIR)/opus-1.5.2
Expand Down Expand Up @@ -328,6 +321,10 @@ else
OPENAL_LIBS ?= -lopenal
endif

ifeq ($(USE_LOCAL_HEADERS),1)
CURL_CFLAGS+=-I$(CURLDIR)/include
endif

# Use sdl2-config if all else fails
ifeq ($(SDL_CFLAGS),)
ifneq ($(call bin_path, sdl2-config),)
Expand Down Expand Up @@ -419,11 +416,9 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")
endif
endif

ifeq ($(USE_CURL),1)
ifeq ($(USE_HTTP),1)
CLIENT_CFLAGS += $(CURL_CFLAGS)
ifneq ($(USE_CURL_DLOPEN),1)
CLIENT_LIBS += $(CURL_LIBS)
endif
CLIENT_LIBS += $(CURL_LIBS)
endif

ifeq ($(USE_MUMBLE),1)
Expand Down Expand Up @@ -578,11 +573,9 @@ ifeq ($(PLATFORM),darwin)
endif
endif

ifeq ($(USE_CURL),1)
ifeq ($(USE_HTTP),1)
CLIENT_CFLAGS += $(CURL_CFLAGS)
ifneq ($(USE_CURL_DLOPEN),1)
CLIENT_LIBS += $(CURL_LIBS)
endif
CLIENT_LIBS += $(CURL_LIBS)
endif

BASE_CFLAGS += -D_THREAD_SAFE=1
Expand Down Expand Up @@ -756,20 +749,8 @@ ifdef MINGW
FREETYPE_CFLAGS = -Ifreetype2
endif

ifeq ($(USE_CURL),1)
CLIENT_CFLAGS += $(CURL_CFLAGS)
ifneq ($(USE_CURL_DLOPEN),1)
ifeq ($(USE_LOCAL_HEADERS),1)
CLIENT_CFLAGS += -DCURL_STATICLIB
ifeq ($(ARCH),x86_64)
CLIENT_LIBS += $(LIBSDIR)/win64/libcurl.a -lcrypt32
else
CLIENT_LIBS += $(LIBSDIR)/win32/libcurl.a -lcrypt32
endif
else
CLIENT_LIBS += $(CURL_LIBS)
endif
endif
ifeq ($(USE_HTTP),1)
CLIENT_LIBS += -lwininet
endif

ifeq ($(ARCH),x86)
Expand Down Expand Up @@ -846,11 +827,9 @@ ifeq ($(PLATFORM),freebsd)
endif
endif

ifeq ($(USE_CURL),1)
ifeq ($(USE_HTTP),1)
CLIENT_CFLAGS += $(CURL_CFLAGS)
ifeq ($(USE_CURL_DLOPEN),1)
CLIENT_LIBS += $(CURL_LIBS)
endif
CLIENT_LIBS += $(CURL_LIBS)
endif

# cross-compiling tweaks
Expand Down Expand Up @@ -910,9 +889,9 @@ ifeq ($(PLATFORM),openbsd)
endif
endif

ifeq ($(USE_CURL),1)
ifeq ($(USE_HTTP),1)
CLIENT_CFLAGS += $(CURL_CFLAGS)
USE_CURL_DLOPEN=0
CLIENT_LIBS += $(CURL_LIBS)
endif

# no shm_open on OpenBSD
Expand All @@ -935,12 +914,6 @@ ifeq ($(PLATFORM),openbsd)
CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS)
endif
endif

ifeq ($(USE_CURL),1)
ifneq ($(USE_CURL_DLOPEN),1)
CLIENT_LIBS += $(CURL_LIBS)
endif
endif
else # ifeq openbsd

#############################################################################
Expand Down Expand Up @@ -1069,6 +1042,7 @@ ifeq ($(PLATFORM),emscripten)
BUILD_GAME_SO=0
BUILD_RENDERER_OPENGL1=0
BUILD_SERVER=0
USE_HTTP=0

CLIENT_CFLAGS+=-s USE_SDL=2

Expand Down Expand Up @@ -1263,11 +1237,8 @@ ifeq ($(USE_OPENAL),1)
endif
endif

ifeq ($(USE_CURL),1)
CLIENT_CFLAGS += -DUSE_CURL
ifeq ($(USE_CURL_DLOPEN),1)
CLIENT_CFLAGS += -DUSE_CURL_DLOPEN
endif
ifeq ($(USE_HTTP),1)
CLIENT_CFLAGS += -DUSE_HTTP
endif

ifeq ($(USE_VOIP),1)
Expand Down Expand Up @@ -1945,8 +1916,6 @@ Q3OBJ = \
$(B)/client/qal.o \
$(B)/client/snd_openal.o \
\
$(B)/client/cl_curl.o \
\
$(B)/client/sv_bot.o \
$(B)/client/sv_ccmds.o \
$(B)/client/sv_client.o \
Expand Down Expand Up @@ -2002,6 +1971,14 @@ Q3OBJ = \
$(B)/client/sys_autoupdater.o \
$(B)/client/sys_main.o

ifdef MINGW
Q3OBJ += \
$(B)/client/cl_http_windows.o
else
Q3OBJ += \
$(B)/client/cl_http_curl.o
endif

ifdef MINGW
Q3OBJ += \
$(B)/client/con_passive.o
Expand Down Expand Up @@ -3241,7 +3218,6 @@ ifdef MINGW
SDLDLL=$(SDLDLL) \
USE_RENDERER_DLOPEN=$(USE_RENDERER_DLOPEN) \
USE_OPENAL_DLOPEN=$(USE_OPENAL_DLOPEN) \
USE_CURL_DLOPEN=$(USE_CURL_DLOPEN) \
USE_INTERNAL_OPUS=$(USE_INTERNAL_OPUS) \
USE_INTERNAL_ZLIB=$(USE_INTERNAL_ZLIB) \
USE_INTERNAL_JPEG=$(USE_INTERNAL_JPEG)
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ Makefile.local:
MISSIONPACK_CFLAGS - custom CFLAGS for missionpack (default '-DMISSIONPACK')
USE_OPENAL - use OpenAL where available
USE_OPENAL_DLOPEN - link with OpenAL at runtime
USE_CURL - use libcurl for http/ftp download support
USE_CURL_DLOPEN - link with libcurl at runtime
USE_HTTP - enable http download support
USE_CODEC_VORBIS - enable Ogg Vorbis support
USE_CODEC_OPUS - enable Ogg Opus support
USE_MUMBLE - enable Mumble support
Expand Down Expand Up @@ -208,7 +207,7 @@ set using command line arguments:
cl_aviFrameRate - the framerate to use when capturing video
cl_aviMotionJpeg - use the mjpeg codec when capturing video
cl_guidServerUniq - makes cl_guid unique for each server
cl_cURLLib - filename of cURL library to load
cl_cURLLib - filename of cURL library to load (non-Windows)
cl_consoleKeys - space delimited list of key names or
characters that toggle the console
cl_mouseAccelStyle - Set to 1 for QuakeLive mouse acceleration
Expand Down
102 changes: 0 additions & 102 deletions code/client/cl_curl.h

This file was deleted.

34 changes: 34 additions & 0 deletions code/client/cl_http.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
===========================================================================
Copyright (C) 2006 Tony J. White (tjw@tjw.org)

This file is part of Quake III Arena source code.

Quake III Arena source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.

Quake III Arena source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Quake III Arena source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/

#ifndef __CL_HTTP_H__
#define __CL_HTTP_H__

#include "../qcommon/q_shared.h"

qboolean CL_HTTP_Init( void );
qboolean CL_HTTP_Available( void );
void CL_HTTP_Shutdown( void );
void CL_HTTP_BeginDownload( const char *remoteURL );
qboolean CL_HTTP_PerformDownload( void );

#endif // __CL_HTTP_H__
Loading