Commit Graph

390 Commits

Author SHA1 Message Date
Zack Middleton 17cadb5369 Fix using emscripten 3.1.27+
emscripten 3.1.27 reduced the stack size from 5MB to 64KB. This caused
run-time errors: Uncaught RuntimeError: index out of bounds

Co-authored-by: James Darpinian <jdarpinian@gmail.com>
2024-06-09 22:10:52 -04:00
Zack Middleton 6f5c038947 Use BASEGAME for emscripten assets 2024-06-08 23:28:09 -04:00
Zack Middleton 4fc059b940 Fix emscripten build directions 2024-06-07 19:11:40 -04:00
Zack Middleton f41bd37fde Add minimal emscripten support 2024-06-06 20:51:44 -04:00
rilysh 735d987303 Makefile: fix compilation on FreeBSD 2024-05-18 12:48:44 +01:00
Zack Middleton 78359180a4 Build QVMs even if there is no QVM JIT
The QVM interpreter works on all platforms. If building QVMs is an
issue, that should probably be handled separate from whether there
is a QVM JIT compiler.

This enables building QVMs by default on Linux arm64.
2023-10-22 22:21:07 -04:00
Zack Middleton 819e9830d8 Update macOS UB1 to SDL 2.0.22
Fix crash when scrolling using touchpad on macOS 10.6 (I fixed it
in SDL 2.0.18) and fix failing to start on x86 due to ioq3 SDL dylib
having absolute path instead of "@executable_path/libSDL2-2.0.0.dylib".

SDL 2.24.0 removed macOS 10.6 support (last with x86). Offically at
least, they also dropped x86_64 on macOS 10.7 and 10.8. So ioq3 UB1
is limited to SDL 2.0.22.

- Update x86 and x86_64 to SDL 2.0.22. Compiled with 10.13 SDK as
  10.14 SDK dropped running on older than macOS 10.9 and I ran
  "strip -x" on the libraries. Ad-hoc signed with PyOxidizer rcodesign.
- PPC is still MAN-AT-ARMS' SDL 2.0.1 build but I ran "strip -x"
  on it to reduce the file size.
- ARM64 build was removed from UB1 as UB2 with SDL 2.24.0 should
  be used instead.
2023-02-19 13:08:36 -05:00
Zack Middleton 02a12f2dec Update to SDL 2.24.0 and add separate macOS UB2 dylib
Update mingw and macOS SDL libraries to 2.24.0. (MSVC .lib files and
Xcode project haven't been updated.)

There is now a separate SDL dylib for macOS Universal Binary 1 and 2
because SDL 2.24.0 dropped support for macOS 10.6 (which is last to
support x86). Documentation says SDL 2.24.0 also dropped macOS 10.7
and 10.8 too. So UB2 is now 10.9 or later while 10.5 to 10.8 live in
UB1.

Compiled using osxcross with macOS 11.3 SDK. Ran "strip -x" on Windows
and macOS libraries. Ad-hoc signed dylib using PyOxidizer rcodesign to
fix digest checksums after strip.
2023-02-19 13:08:36 -05:00
Zack Middleton 9543cf24df Fix compiling on older macOS
ranlib errors on older macOS because of arm64 arch in code/libs/macosx/-
libSDL2main.a. Use lipo to extract the library for the specific arch
that is being linked.
2021-11-19 15:04:11 -05:00
Zack Middleton 68ac81316d Fix error when cross-compiling for macOS arm64 using Makefile
Fix "Architecture arm64 is not supported when cross compiling" and
also be more be more flexible for manually specifying CC or the
osxcross darwin version (which corresponds with a macOS SDK version
to build against).
2021-11-06 23:50:20 -04:00
Zack Middleton 7dd90123b7 Make macOS arm64 default to target macOS 11 in Makefile 2021-11-06 23:35:54 -04:00
Tom Kidd 6133df65fc Added shell script to compile Universal 2 binary (x86_64+arm64) 2021-07-06 17:30:27 -05:00
Tom Kidd 52a43ae1c4 Upgrades to Xcode project and Apple Silicon support
- Reorganized Xcode project
- Added missionpack support to Xcode project
- Incorporated changes from MaddTheSane for Apple Silicon support https://github.com/maddthesane/ioq3
- Built SDL 2.0.14 for Apple Siicon, added to existing SDL dylib
- Built SDLMain for Apple Silicon, added to existing libSDL2main.a
2021-07-06 17:30:27 -05:00
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