Commit graph

346 commits

Author SHA1 Message Date
Yamagi
e9a0162eea -fvisibility=hidden is a compiler option, don't pass it to the linker. 2020-10-08 12:02:35 +02:00
Yamagi
bf83db4d6d Add an ASAN option to the Makefile.
ASAN includes DEBUG. ASAN can be overriden by the environment.
2020-10-08 11:56:41 +02:00
David Carlier
1412d0201c Backport changes to old Makefile 2020-08-09 15:52:11 +00:00
David Carlier
3e63226bad Translate changes to the Makefile build too 2020-06-26 12:43:06 +00:00
Alex Petty
a2d6cc9cdc Mac OS uses @executable_path not for rpath 2020-05-20 19:39:09 -05:00
Alex Petty
895c7bc850 Enable rpath with Mac OS linker 2020-05-20 19:30:52 -05:00
Yamagi
00e6eb6303 Remove unnecessary OSX_ARCH setting, replace it with YQ2_ARCH. 2020-04-21 13:57:09 +02:00
Yamagi
5b327c0417 Don't use yield opcode if unsupported.
This is an enhancement to the previous `yield` work:

* Don't enforce `-march=armv8-a` for aarch64 builds, because it is the
  initial ARMv8 revision and compilers will either use that or something
  newer.
* Refine preprocessor guards around `asm("yield");` so the code isn't
  compiled in if unsupported by the current `-march='.

Submitted by @smcv in #535.
2020-04-03 08:30:41 +02:00
Yamagi
9f7c5c205b Enforce the YQ2_OSTYPE override for mingw. 2020-03-24 13:37:31 +01:00
Yamagi
142690e164 Enforce a minimum architecture for ARM.
This was added in 558ee7 to master.
2020-03-23 16:48:56 +01:00
Yamagi
c904880dc9 Another round of small Makefile fixes:
* ZIPCFLAGS was never defined, just appended to.
* Make INCLUDE overrideable.
2020-03-23 16:47:34 +01:00
Yamagi
11cb64ede2 Mark global additions to CFLAGS and LDFLAGS as override.
This prevents them from being overriden by command line variables, e.g.
something like `make CFLAGS=-0`. Requested by @smcv in #523.
2020-03-23 16:47:34 +01:00
Yamagi
b48cc47465 Make setting the RPATH optional.
When WITH_RPATH is set to no, the default RPATH to $ORIGIN/lib isn't
set.

This was requested in #523.
2020-03-23 16:47:34 +01:00
Yamagi
aa36dcad6c Make YQ2_OSTYPE and the hardcoded CC define for Windows overrideable. 2020-03-23 16:47:34 +01:00
Yamagi
a26666d805 Mention CURL in the header and the build config. 2020-03-23 16:47:34 +01:00
Yamagi
36f77aa318 Make LDFLAGS overrideable. 2020-03-23 16:47:34 +01:00
Yamagi
09aad64202 Make the base CFLAGS overridable.
This was requested several times, the last time in pull request #523.
Only the optimization level, warning level and debug stuff may be
overridden. All other options are enforces because they're required.

While here add a new variable to force a debug build: `make DEBUG=1`.
2020-03-23 16:47:34 +01:00
Denis Pauk
eeff4dae43 fix march armv8 2020-03-20 08:01:36 +02:00
David Carlier
558ee70b3e Issue 'yield' in main loop to give CPU time to cool down.
This is functional equvalent to the 'pause' instruction on x86.
2020-03-18 15:50:45 +01:00
Denis Pauk
07c472cfd2 Remove adivtab 2019-01-30 22:42:21 +02:00
Yamagi Burmeister
04a1a6958d Fix USE_CURL build under Windows. 2018-12-20 18:01:38 +01:00
Yamagi Burmeister
f0d244e7b4 Rename cl_http.c to curl/download.c and http.h to download.h.
This is more in line with our file structure and other changes that
added functionality to the client.
2018-12-20 18:01:38 +01:00
Yamagi Burmeister
c0a6e4270f Load libcurl.so at runtime.
Loading libcurl at runtime instead of linking it at compile time makes
things a lot easier and more reliable on Windows. On other platform
libcurl can be installed as optional dependency instead as an hard one.
2018-12-20 18:01:38 +01:00
Yamagi Burmeister
0a94a8ee92 Port the HTTP / CURL download stuff from q2dos.
This is a very first cut:
* It compiles
* It doesn't crash

What's missing:
* cmake integration
* CURL should be loaded dynamically
* Integration between download code and filesystem
* Likely UTF-8 stuff
* cl_http.c needs cleanup
* Windows support
2018-12-20 18:01:38 +01:00
Elkan Roelen
0043977566
Fix macOs build 2018-09-11 15:05:19 +02:00
Yamagi Burmeister
f7e80c1428 General cleanup to the Makefile. 2018-08-14 15:01:45 +02:00
Yamagi Burmeister
cf09fb2a99 Remove support for static linked OpenAL.
We haven't used that for years and it just complicates things.
2018-08-14 11:51:55 +02:00
Yamagi Burmeister
daf3dc6f41 Remove ZIP compile time option.
Having ZIP optional only complicates things and is unnecessary now that
the dependency to zlib is gone.
2018-08-14 11:12:38 +02:00
Yamagi Burmeister
0264c6d946 Remove DOGG compile time option.
Having OGG optional only complicates things and is unnecessary now that
the dependencies to libvorbis and libogg are gone.
2018-08-14 10:40:50 +02:00
Yamagi Burmeister
e7fa5518a9 Replace zlib dependency by miniz single header library.
I've chosen the minimal invasive way for this:

  * Import miniz and remove -lz linker flags.
  * Create a short header minizconf.h roviding everything we need
    originally defined by zconf.h and not provided by miniz.
  * Replace zlib.h with miniz.h and minizconf.h.
2018-08-10 10:24:25 +02:00
Yamagi Burmeister
79e8c1377b Replace libvorbisfile with stb_vorbis single header lib.
This is (or at least should) work exactly the same a before but
saves us the dependencies to libogg, libvorbis and libvorbisfile.
2018-08-08 15:05:23 +02:00
Yamagi Burmeister
10bdaaec06 Move stb_image_write.h into vid. It's used there, only. 2018-08-07 11:45:26 +02:00
Yamagi Burmeister
5bff7e1568 Move refresh.c into the client and rename to glimp_sdl.c.
The GL backends have been an integral part of the vid interface for
years.
2018-08-07 10:08:20 +02:00
Yamagi Burmeister
b805b4e044 Move vid.c and dependencies into the client.
The vid interface has been exclusive to the client for years, trace
that in the file hierarchy.
2018-08-07 10:00:21 +02:00
Yamagi Burmeister
61400d1ae8 Move input.c and input.h into the client and rename to sdl.c.
The input system backend was once used in the client and the renderers,
but for some years now it has been an integral part of the client only.
Move it there.
2018-08-07 09:43:34 +02:00
Yamagi Burmeister
956902538f Move sound.c into the sound system source and rename to sdl.c.
The OpenAL backend was already part of the sound system source. And
there's no need for the SDL backend to be part of the generic backends.
2018-08-07 09:31:08 +02:00
Yamagi Burmeister
5501c38736 Move qal.c and qal.h to the other sound system sources.
The OpenAL backends used only by the sound system, there no need to
have them in the generic part of the sources.
2018-08-07 09:23:07 +02:00
Yamagi Burmeister
333d19766f Remove SDL 1.2 support from the build systems. 2018-07-31 14:32:13 +02:00
Yamagi Burmeister
307d5eecf7 Remove CDA and X11GAMMA build system support.
* CDA was only supported of the client was build with SDL 1.2. Our
  Windows binaries had no CDA support for years, I'm pretty sure that
  it never worked on Linux and no computer build after 2005 has even
  the necessary hardware. So let's just remove it.
* X11GAMMA was a hack to work around SDL 1.2s inability to set the
  gamma on newer xorg-server versions. It has been broken for some
  time now an is rather ugly. Remove it.

This is the first step in removing SDL 1.2 support.
2018-07-31 14:24:28 +02:00
Denis Pauk
e1a9e7e4e2 add auto reallocate 2018-07-24 17:49:14 +03:00
Denis Pauk
25cb7acda8 Restore allocate buffers on render init 2018-07-24 16:56:42 +03:00
Denis Pauk
f9a77d2d66 Share same Mod_DecompressVis 2018-07-23 17:40:06 +03:00
Yamagi Burmeister
176f95cc7c Enable backtrace printing on FreeBSD.
FreeBSD has supported printing backtraces for years. The API is the same
as on Linux, the only difference is that libexecinfo must be linked as a
seperate library. Since the last FreeBSD version with backtrace support
(FreeBSD 9.3) went out of support some time ago unconditionally enable
the printing.
2018-07-13 14:32:31 +02:00
Simon McVittie
a0e86c3c36 Make uses of pkg-config cross-compilation-friendly
Signed-off-by: Simon McVittie <smcv@debian.org>
2018-06-12 12:10:32 +01:00
Yamagi Burmeister
d6f9cf64a4 Enforce 32 bit IO-API for minizip on !Linux and !Windows.
By default minizip uses fopen64(), fseek64() and so on. Those may not
be defined on all system, especially the BSDs. While FreeBSD already
has a special case, for example OpenBSD hasn't. Work around this by
forcing minizip to use fopen(), fseek() and so on everything that's not
Linux or Windows. This is not 100% correct, it may prevent the usage of
ZIPs lager than 2GB on Solaris and other rarely used systems. But I
doubt that anyone has such large ZIPs with assets, they would likely hit
other internal limits.

In the future Quake II should use off_t instead of int were applicable.
With that we could set -D_FILE_OFFSET_BITS=64.

This change is based upon a patch send by @devnexen in pr #279.
2018-02-20 09:43:13 +01:00
Yamagi Burmeister
a65401d1af Rename mem.c to hunk.c.
hunk.c better describes the purpose of the code and matches the unix
backend.
2018-02-04 11:35:10 +01:00
Yamagi Burmeister
acb50c6907 Move the platform independent stuff from main() into Qcommon_*().
There's no need to duplicate machine independent parts of the client
initialization and the main loop for every platform.

While at it remove the nearly empty unix.h header and move Windows
main() into an own file. Not both platform have the same basic layout.
2018-02-04 11:35:10 +01:00
Yamagi Burmeister
bed6439d19 Convert the quake2.exe wrapper to a Windows GUI application.
While building the wrapper as a console application is completely fine
there're some advantages by creating a "real" Windows GUI Application:

* Console applications always spawn an annoying console window.
* Windows GUI applications seem to have a much lower chance to trigger
  my new best friend, the Windows Defender. As a console application
  quake.exe triggered every time I started it, as Windows GUI
  application not only once.

Use WinMain() instead of wWinMain() because MinGW doesn't know about
the later and it doesn't matter anyways.
2018-02-04 11:35:10 +01:00
Yamagi Burmeister
cfddff132b Switch the windows backend SDLmain.
libSDLmain.a has to be linked and must run anyways. So there's no need
for us to reinvent the wheel, just rely on SDLs process setup, argument
parsing, message handling and so on. As a nice side effect this may fix
some strange bugs related to message handling and argument parsing...
2018-02-04 11:35:10 +01:00
Daniel Gibson
5c4f2cc5b0 quake2.exe wrapper: add icon 2018-01-21 16:40:05 +01:00