Commit graph

367 commits

Author SHA1 Message Date
David CARLIER
a15e53ce60 build fix proposal on mac where archs are well defined.
the arch normalization leads to arm32 bit build under mac m1.
2021-07-03 16:02:58 +01:00
Yamagi
376d97c54f Correct braino in LDFLAGS / LDLIBS, Windows build fix 2/2. 2021-06-29 09:01:13 +02:00
Yamagi
61c08eee13 Fix ASAN and UBSAN builds, enhance sanitizers a little bit.
At least for LLVM / Clang the -fsanitize= option must be passed to the
linker before any objects or libraries, otherwise the sanitizers will
either noch link or are disfunctional. Split LDFLAGS into LDFLAGS for
flags and LDLIBS for librariers, pass LDFLAGS before any objects and
LDLIBS after all objects. While at it set RTLD_NODELETE so that shared
libs opened by dlopen() are never deleted from memory when building
with sanitizers.
2021-06-26 16:28:08 +02:00
David Carlier
53c684525f solairs/illumos build fix proposal. 2021-06-13 08:25:56 +01:00
Yamagi
bb7bf8ef9e Disable floating-point expression contraction on gcc builds.
While this shouldn't be a problem with C code, better be safe than
sorry. @DanielGibson stumbled over this while debugging some strange
RB-Doom3 / dhewm3 issues with gcc. See this bug report for details:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100839
2021-06-06 18:48:38 +02:00
Yamagi
ce10213d91 Remove rev_vk from the Makefile. 2021-05-28 09:32:42 +02:00
Yamagi
2a18f02186 Don't build the vk renderer when WITH_REFVK is no.
This is the third or forth try, already. *grrr* WITH_REFVK isn't enough,
as long as the target is there. Wrap the whole target in an if-block.
2021-03-10 10:50:02 +01:00
Yamagi
d745e16523
Merge pull request #642 from DanielGibson/fix-lm-glitch
Makefile: Fix architecture detection on Windows
2021-01-13 18:11:03 +01:00
Daniel Gibson
ee7923a9dd Fix architecture detection on Windows in Makefile, bump SAVEGAMEVER
$PROCESSOR_ARCHITECTURE seems to contain the architecture of the host,
but we need the architecture the current MinGW shell is targeting.
$MINGW_CHOST seems to be just that, and on my system it's either
i686-w64-mingw32 (mingw32.exe) or x86_64-w64-mingw32 (mingw64.exe)
(No idea what it looks like for Windows on ARM...)

As fixing this would otherwise break existing savegames, I bumped the
SAVEGAMEVER to "YQ2-4" and added a quirk for older savegameversions:
On Windows i386 savegames that contain "AMD64" instead of "i386" as
architecture are also accepted.
(For YQ2-1 this didn't seem necessary, apparently "i386" was hardcoded)
2021-01-12 05:04:11 +01:00
Yamagi
a52402fd3c Add undefined behaviour sanitizer to the Makefile.
While here update some comments and add a comment sections for the
command line variables.
2021-01-10 18:55:42 +01:00
Yamagi
85b9f84b3d Don't link against the Vulkan loader, load it at runtime. 2020-12-12 14:45:04 +01:00
Denis Pauk
896346cf1a Fix MINGW64 windows build 2020-12-12 14:45:04 +01:00
Denis Pauk
b94afbc6c1 remove unused vk_mem_alloc 2020-12-12 14:45:04 +01:00
Denis Pauk
518f46953b Build vk_util as part of ref_vk 2020-12-12 14:45:04 +01:00
Yamagi
d291e0bbc5 Add header dependencies for the Vulkan renderer.
While here load the software renderer header dependencies. No one ever
complained about that... -_- And fix a long standing typo.
2020-12-12 14:45:04 +01:00
Yamagi
9801db5c5c Simplify the Vulkan renderer build.
* No need for global CXXFLAGS. The only difference to CFLAGS is the
  standard selector, use $(subst) to derive them from CFLAGS.
* libstd++ must never be manually linked. Doing so only works for the
  GNU C++ stack, not for the LLVM stack and anything else. Link with
  the C++ frontend instead.
* Force MingW to g++ as CXX.Force MingW to g++ as CXX.
* No need to specify -lm, libm is already part of the global LDFLAGS.
* Windows doesn't need -fPIC.
* The Vulkan renderer doesn't use glad.
2020-12-12 14:45:04 +01:00
Yamagi
c895d004d2 Remove artificial Linux only limitation for the Vulkan renderer. 2020-12-12 14:45:04 +01:00
Denis Pauk
ca60275694 move headers to right place 2020-12-12 14:45:03 +01:00
Denis Pauk
823e0eb915 Add experemental vulkan render 2020-12-12 14:45:03 +01:00
nia
e814446595 Set runtime library paths 2020-11-24 14:11:19 +01:00
nia
c211176149 Support building on NetBSD with the GNU make build system 2020-11-24 14:07:58 +01:00
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