Commit Graph

377 Commits

Author SHA1 Message Date
Tim Angus 05180e32dc Use the correct compiler for tools when cross building under cygwin 2020-12-26 21:54:58 +00:00
Tim Angus 44270f7557 Fix use of TOOLS_CC being reported as CC 2020-12-25 21:34:49 +00:00
Tim Angus b388535307 Add TOOLS_CFLAGS to build preamble 2020-12-25 20:28:40 +00:00
Tim Angus 8e74119d0f Avoid platform sed differences 2020-09-08 13:25:50 +01:00
Tim Angus 2ec57b3a0e Fix shader stringify 2020-09-08 10:46:18 +01:00
Tim Angus c0d797f308 Simplify glsl -> C stringification 2020-08-29 21:40:57 +01:00
Zack Middleton 302f12b8f6 Don't use host pkg-config when cross-compiling
Fix cross-compiling using mingw-w64 on Ubuntu 18.04.

pkg-config --cflags libcurl is now pulling in a Linux include directory
which breaks compiling.
2018-10-01 23:48:45 -05:00
Simon McVittie fb4b206709 Allow pkg-config binary to be overridden with PKG_CONFIG
This is one of the de facto standard interfaces used in Linux
distributions for cross-compilation (alongside overriding CC and
similar variables), and in particular is used in Debian and its
derivatives.

Signed-off-by: Simon McVittie <smcv@debian.org>
2018-06-12 11:27:42 +01:00
Zack Middleton f4db711024 Use SDL 2.0.1 headers for macOS ppc64
The libSDL2-2.0.0.dylib in repo doesn't support ppc64 though.

Based on patch by MAN-AT-ARMS.
2018-05-12 13:41:35 -05:00
Zack Middleton ffd9ce1902 Limit -maltivec to specific source files on OpenBSD too (untested) 2018-05-12 13:30:40 -05:00
Simon McVittie 5909b9a1cf Isolate the Altivec code so non-Altivec PPC targets can use the same binary.
Moved all the code using Altivec intrinsics to separate files. This 
means we can optionally use GCC's -maltivec on just these files, which
are chosen at runtime if the CPU supports Altivec, and compile the rest
without it, making a single binary that has Altivec optimizations but
can still work on G3.

Unlike SSE and similar extensions on x86, there does not seem to be
a way to enable conditional, targeted use of Altivec based on runtime
detection (which is what ioquake3 wants to do) without also giving the
compiler permission to use Altivec in code generation; so to not crash
on CPUs that do not implement Altivec, we'll have to turn it off
altogether, except in translation units that are only entered when
runtime Altivec detection is successful.

This has been tested on Linux PPC (on an Altivec-enabled CPU),
but we may need further work after testing trickles out to other
PowerPC devices and ancient Mac OS X builds.

I did a little work on this patch, but the majority of the effort belongs 
to Simon McVittie (thanks!).
2018-05-12 14:14:47 -04:00
Zack Middleton 1caf1fb875 Fix compiling Makefile (broke in macOS frameworks commit) 2018-04-26 11:47:11 -05:00
Zack Middleton 3bc3fa1b3b Fix compiling against macOS system OpenAL and SDL2 frameworks 2018-04-26 11:23:47 -05:00
Zack Middleton 45af2594a0 Add SDL 2.0.1 headers for macOS PPC
code/libs/macosx/libSDL2-2.0.0.dylib has 2.0.8 for x86 and x86_64 and
2.0.1 for PPC. Add 2.0.1 headers for PPC with modifed SDL_platform.h to
allow compiling using macOS 10.5 SDK. Using separate headers allows the
engine to check the SDL version for enabling newer SDL features.
2018-04-26 11:21:36 -05:00
Zack Middleton 1284205012 Remove duplicate setting of FREETYPE_CFLAGS in Makefile 2018-04-03 20:11:53 -05:00
Zack Middleton acef71af5e Rename (already updated) opusfile-0.8 to opusfile-0.9 2018-03-16 13:29:20 -05:00
Zack Middleton 8611eb421d Rename (already updated) opus-1.1.4 to opus-1.2.1 2018-03-16 13:29:19 -05:00
Zack Middleton cb24c59567 Update opus from 1.1.4 to 1.2.1 2018-03-16 13:29:19 -05:00
Zack Middleton c38c823a2a Rename (already updated) libvorbis-1.3.5 to libvorbis-1.3.6 2018-03-16 13:29:19 -05:00
Zack Middleton ebd3d516ac Rename (already updated) libogg-1.3.2 to libogg-1.3.3 2018-03-16 13:11:27 -05:00
Zack Middleton d4e7d987a3 Fix MAC_OS_X_VERSION_MIN_REQUIRED for macOS 10.10 and later
Manually specifying MACOSX_VERSION_MIN=10.10 or later would use the
wrong value for MAC_OS_X_VERSION_MIN_REQUIRED define. 1100 instead of
101000.
2018-02-08 10:23:44 -06:00
Zack Middleton 7166a3cd39 Enable compiler optimization on all macOS architectures
It seems to improve framerate and still work on x86 and x86_64. I
haven't tested ppc64 as I don't have the hardware. ppc64 isn't built
into the universal bundle either.

I noticed this because compiling opus warns it may be slow due to
optimization being disabled.
2017-12-16 12:51:56 -06:00
Mickaël Thomas 6ecfa4f263 Fix shader corruption on OpenBSD
OpenBSD's sed (and possibly other platforms') interprets `\r` as a
literal `r` rather than a carriage return, which leads to all `r`
letters being stripped from the shaders' source.

This fixes the issue by using the POSIX-compliant `tr -d '\r'` to remove
carriage returns.

Thanks to @ryan-sg for reporting the issue
2017-10-16 16:23:14 +01:00
Mickaël Thomas 7d012f229e Fix a race condition in the makedirs target
A race condition can happen when running "make all" with parallel jobs.

The issue is that the build directory can be created by another
concurrent job between the moment it was detected as missing and the
moment mkdir is called (which fails if the directory already exists).

This fixes the problem by always using `mkdir -p` which doesn't fail if
the directory already exists.
2017-10-16 16:22:37 +01:00
Walter Barrett 96f94a2891 Fix compiling GLSL shaders under Windows.
Now the `sed` command cope with files using Windows-style line endings.
2017-10-07 08:02:25 -05:00
Zack Middleton e657dbd6b2 Fix setting cflags/libs from sdl2-config
SDL_CFLAGS and SDL_LIBS assignment was "only if absent". However due
to previously assigning them to "pkg-config sdl2" values, the values
from sdl2-config were ignored.
2017-10-02 02:03:16 -05:00
Zack Middleton 20573bce43 Don't link to libGL at compile time
Get all OpenGL functions using SDL_GL_GetProcAddress(). This makes it
easier to cross-arch compile on Linux and add support for OpenGL ES
in the future.

Users still have to supply their own libSDL2 for cross-arch compiling
on Linux. But now the user does not have to re-install libgl1-mesa-dev
package for i386 or amd64 on Debian when switching between compiling
ioquake3 for x86 and x86_64.
2017-10-01 23:07:33 -05:00
Zack Middleton eeaade70bd Statically link libgcc on Windows
Fix for ioq3 test builds for Windows x86 (cross-compiled from Ubuntu
using mingw-w64) requiring libgcc_s_sjlj-1.dll. I'm unable to reproduce
the issue using mingw-w64 in Debian or Cygwin.
2017-09-26 01:15:25 -05:00
Zack Middleton 414f3c5e3e Enable Ogg Vorbis support by default
libvorbis is included in-tree so this doesn't require additional
dependencies.
2017-09-23 19:56:42 -05:00
Zack Middleton aeaecb4ae5 Add Windows application manifest
- Use common controls 6 so error dialogs use correct visuals on
Windows XP or later!
- Specify running as invoker so Windows doesn't guess if it should
prompt for admin permission on Vista or later.
- Specify compatible with Vista through Windows 10. Tells Windows
not to emulate Vista behavior, not sure if it affects anything.

Makefile automatically runs windres when manifest changes.
2017-09-07 21:04:52 -05:00
MAN-AT-ARMS e07ffa715c Update internal curl to 7.54.0 2017-07-28 16:32:22 +01:00
Ryan C. Gordon 76e6b3c534 Removed unnecessary trailing backslash. 2017-06-04 16:43:50 -04:00
Ryan C. Gordon a761684a23 Windows support for autoupdater manifest signatures. 2017-06-04 02:21:55 -04:00
Ryan C. Gordon 62f6f0c7e0 Wire up libTom stuff to build system. 2017-06-04 01:16:37 -04:00
Zachary J. Slater 87eecd7bc1 Merge pull request #290 from rcgordon/autoupdater
Initial shot at writing an ioquake3 autoupdater. Thank you icculus, and everyone who contributed to his patreon! https://www.patreon.com/icculus
2017-06-02 22:46:22 -10:00
Ryan C. Gordon 0eb497b01b Disable the autoupdater; enable only if intentional, like for official builds. 2017-06-02 02:29:09 -04:00
Ryan C. Gordon 063875e89a Fixed linking on things that need -ldl, and compiler warnings. 2017-06-02 01:39:03 -04:00
Ryan C. Gordon 82977da9c8 Working Windows port of the autoupdater! 2017-06-02 00:49:42 -04:00
Ryan C. Gordon d0da0724e7 Move the autoupdater launcher into its own public domain source file.
So other games can steal this piece if they want.
2017-05-31 01:22:40 -04:00
Ryan C. Gordon f518f75149 Don't link directly to libcurl.
Lots of Linux distros have different names (libcurl-gnutls.so vs etc), and
version the symbols (curl_global_init@@CURL_LIBSSL_3), so it's more compatible
to just dlsym the basic entry points we need and just demand that libcurl is
installed at all.

Alternately: we'll use our own libcurl build, but we'll probably have to dump
SSL support to make this sane to do.
2017-05-30 20:15:59 -04:00
Ryan C. Gordon 86e71b11eb Fixed failure to link libcurl on some platforms. 2017-05-30 17:39:13 -04:00
Ryan C. Gordon 240965ddbc Removed extraneous '\' in Makefile in autoupdater source file list. 2017-05-25 22:02:33 -04:00
Ryan C. Gordon 8e001e6b99 autoupdater should build with $(CC), not $(TOOLS_CC), in Makefile. 2017-05-25 22:01:47 -04:00
Ryan C. Gordon 4729c683fd Initial shot at writing an ioquake3 autoupdater. 2017-05-25 14:13:18 -04:00
Zack Middleton abce15055c Fix compiling Mac OS 10.5 Universal App Bundle
Need to be able to specify minimum Mac OS X version outside of the
Makefile to avoid conflicting CFLAGS.
Moved -mmacosx-version-min LDFLAGS into the Makefile.
Moved -arch x86_64 from OPTIMIZEVM to CFLAGS to fix linker errors
(previously make-macosx-ub.sh passed it to CFLAGS manually).
2017-05-24 15:50:44 -05:00
Zack Middleton f4739e9c4d Rename (already updated) opusfile-0.5 to opusfile-0.8 2017-05-23 11:47:27 -05:00
Zack Middleton ef8ad54421 Rename (already updated) opus-1.1 to opus-1.1.4 2017-05-23 11:47:27 -05:00
Zack Middleton 853110d5d4 Update opus from 1.1 to 1.1.4
Define FLOAT_APPROX in Makefile and misc/msvc12/quake3.vcxproj.
2017-05-23 11:47:26 -05:00
Zack Middleton 67bfe8f8d6 Rename (already updated) libvorbis-1.3.4 to libvorbis-1.3.5 2017-05-23 11:47:26 -05:00
Zack Middleton d87bd792c3 Rename (already updated) libogg-1.3.1 to libogg-1.3.2 2017-05-23 11:47:26 -05:00