Commit Graph

92 Commits

Author SHA1 Message Date
helixhorned 0d0f3a1cd2 Add Makefile.common switch ALLOCACHE_AS_MALLOC, remove DEBUG_WITH_VALGRIND.
git-svn-id: https://svn.eduke32.com/eduke32@4298 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:41 +00:00
helixhorned 842cce37b7 Lunatic: Fix compilation of C++ build, but not starting up yet.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4286 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:13:03 +00:00
hendricks266 3e6fc00474 Remove "-fpermissive" from C++ builds because we don't need it.
git-svn-id: https://svn.eduke32.com/eduke32@4273 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-27 10:31:20 +00:00
hendricks266 3b1b5bb41d For DISABLEINLINING=1, apply __fastcall to make up for the lack of inlining.
git-svn-id: https://svn.eduke32.com/eduke32@4247 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:04:02 +00:00
helixhorned e71df2b6e3 Lunatic/m32: make Mapster23 actually start stand-alone, oops.
git-svn-id: https://svn.eduke32.com/eduke32@4238 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-02 00:08:36 +00:00
helixhorned 7791f94073 Lunatic: make it possible to build with LuaJIT 2.1, add -Lopts=profile there.
git-svn-id: https://svn.eduke32.com/eduke32@4107 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:06 +00:00
hendricks266 401a73862a Wii: Fix build and add custom headers and libs to SVN. (It's helpful to set up a build system from scratch.)
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4102 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 09:08:31 +00:00
hendricks266 b40f0aba04 Fix ebacktrace1 under MinGW's GCC 4.8 and binutils 2.23.2.
We keep needing more and more hacks as libbfd keeps becoming dependent on additional libraries we don't need...

git-svn-id: https://svn.eduke32.com/eduke32@4076 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:02:33 +00:00
helixhorned eac9dd04bf Add WIP x86_64 assembly texture mapping routines.
- Currently: only tvlineasm1 and tvlineasm2, but incomplete (no reverse
  translucency, nonpow2 textures will crash)
- For System V AMD64 calling conventions; requires YASM

git-svn-id: https://svn.eduke32.com/eduke32@4066 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:37:31 +00:00
helixhorned 77dc57aee7 When building Lunatic from synthesis, tell LuaJIT to generate PE object files.
BUILD_LUNATIC, third attempt.

git-svn-id: https://svn.eduke32.com/eduke32@4023 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 21:14:37 +00:00
helixhorned bac4265a0b For Clang debugging build, only pass selected UBSanitizer options.
This makes CLANG=1 RELEASE=0 DEBUGANYWAY=2 OPTLEVEL=1 builds definitely pretty
playable (only Polymost tested) while having a decent amount of sanitization.

git-svn-id: https://svn.eduke32.com/eduke32@4020 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 19:24:15 +00:00
helixhorned e947f1fe87 Lunatic: prepare Makefiles for synthesis build.
- libs and headers are expected in platform/Windows/* (not there yet)
- prefix Lua #includes with luajit-2.0/
- build bytecode objects with absolute path name (used for debug info)

git-svn-id: https://svn.eduke32.com/eduke32@4000 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:42 +00:00
hendricks266 62cdb8a9e6 Patch from johnnyonflame to fix the GCW and Dingoo build process.
git-svn-id: https://svn.eduke32.com/eduke32@3972 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:54 +00:00
helixhorned 4872adb3c8 Makefile.common: disable -Wstrict-overflow.
It didn't turn out that useful and was giving a warning with one of the
preceding changes.

git-svn-id: https://svn.eduke32.com/eduke32@3963 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:16 +00:00
helixhorned 8c9f0b740d Makefile.common: make LUNATIC be set to 0 if not set from env ("?=0").
Also override LTO to 0 in Lunatic builds.

git-svn-id: https://svn.eduke32.com/eduke32@3957 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:05 +00:00
helixhorned 750fbb0a0e Lunatic: slight Makefile tweak for Windows preparation.
Add doc/how_to_build_lunatic.txt and doc/lpeg-lunatic.patch.

git-svn-id: https://svn.eduke32.com/eduke32@3938 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:14 +00:00
helixhorned a082ec76dd Lunatic: fix randgen module after md4 removal, run DEFS_BC_SIZE cmd only once.
git-svn-id: https://svn.eduke32.com/eduke32@3785 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 10:41:57 +00:00
Plagman c2a5b60a14 Fix Makefile fuckery.
git-svn-id: https://svn.eduke32.com/eduke32@3728 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 03:12:29 +00:00
helixhorned 6deabcdb5d Makefiles: allow overriding the optimization level with debugging builds.
git-svn-id: https://svn.eduke32.com/eduke32@3725 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-04 16:36:10 +00:00
helixhorned bdecbc45db Fix debugging builds with Clang 3.2 and up.
In those Clang versions, -fcatch-undefined-behavior was replaced by
-fsanitize=<what>.  For Clang 3.2, we enable the address sanitizer
and for 3.3 also the miscellaneous undefined behavior one.
Currently, there's no version auto-detection from the Makefiles, it's
set to 3.3 and the others are commented out.

git-svn-id: https://svn.eduke32.com/eduke32@3716 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-29 19:24:15 +00:00
helixhorned e64ecfbf4f OS X: Pass -Wno-narrowing only with GCC 4.3+, fixing arttool build on my setup.
git-svn-id: https://svn.eduke32.com/eduke32@3691 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-17 20:34:51 +00:00
terminx 3e4ea93b20 Directory cleanup. Move the "Apple", "Windows", and "Wii" directories to a new "platform" dir, move the contents of "psd" to "rsrc/source", move eobj* and obj* directories so that they're under the "source" dir.
git-svn-id: https://svn.eduke32.com/eduke32@3551 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-04 04:14:19 +00:00
helixhorned 1685228ab7 Lunatic: compile defs.ilua as bytecode and load it from the executable.
git-svn-id: https://svn.eduke32.com/eduke32@3517 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:31 +00:00
hendricks266 719efefbf0 Wii: Take advantage of libogc features: PNG screenshots (libpng/zlib), Ogg Vorbis audio (libtremor), and high-resolution profiling timers.
FLAC and VPX remain out in the cold.

git-svn-id: https://svn.eduke32.com/eduke32@3497 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:42 +00:00
hendricks266 624841257c Wii: Fix most warnings. Three remain: two are labeled with FIXMEs; the third consists of signed/unsigned comparisons involving LSWAPIB() in kplib.c.
git-svn-id: https://svn.eduke32.com/eduke32@3496 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:08 +00:00
helixhorned f10a0fb086 Makefiles: fix wrongly stripping debug binaries...
... when 'make' is invoked like "make ... STRIP=some_strip".

git-svn-id: https://svn.eduke32.com/eduke32@3423 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-21 21:18:10 +00:00
helixhorned 17d62458f4 Makefiles: simplify how to determine whether the final binary is stripped.
Whenever it should be not, STRIP is set to the empty string.
This fixes the Lunatic RELEASE=1 build.

git-svn-id: https://svn.eduke32.com/eduke32@3422 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:36 +00:00
helixhorned 2b0b8d34cc Remove mixed Lunatic/legacy build option.
git-svn-id: https://svn.eduke32.com/eduke32@3410 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:29:00 +00:00
hendricks266 748e217a19 Bring the SDL.h include in SDLMain.m up to speed with driver_sdl.c in jaudiolib and sdl_inc.h in the engine. Also address some Apple macro problems.
git-svn-id: https://svn.eduke32.com/eduke32@3368 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-04 17:28:13 +00:00
helixhorned 80ee967b8e Lunatic: beginning to glue things together. Introducing LUNATIC_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3343 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:24 +00:00
hendricks266 95dd57154e Clean up some file and directory structure.
* Renamed source/jaudiolib/third-party/mingw32 to source/jaudiolib/third-party/Windows.
* Moved source/jaudiolib/third-party/Windows/include to source/jaudiolib/third-party/common/include to use both on Windows and Apple.
* Deleted Apple/lib/include/{ogg,vorbis}/, see previous point.
* Deleted Apple/lib/libvorbisenc.a, 6MB saved.
* Moved Apple/lib/lib{ogg,vorbis,vorbisfile}.a to source/jaudiolib/third-party/Apple/lib, where they belong.
* Moved source files in Apple/ to source/, where they belong. (SDLMain.[mh] stay.)
* Deleted source/jaudiolib/third-party/{ogg,vorbis}.framework, not used any more.
* Renamed "StartupWinController*" to "startosx*".

git-svn-id: https://svn.eduke32.com/eduke32@3334 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:54:35 +00:00
helixhorned d7132e587f Fix CLANG=1 NOASM=1 build.
git-svn-id: https://svn.eduke32.com/eduke32@3292 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:20 +00:00
hendricks266 dac94ce284 Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)

To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.

All compiler and linker warnings when building in 64-bit mode have been fixed.

Remaining 64-bit to-do:
 - The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
 - RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
 - DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
 - Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)

This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.

In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.

git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
hendricks266 9fcba228b1 Build tweaks:
Set up the use of {Windows,Apple}/{include,lib} regardless of feature toggles in Makefile.common using $(abspath ) in reference to the directory Makefile.common is in.
Add the three DirectX headers that are actually used to the repo. (from: http://alleg.sourceforge.net/files/dx9mgw.zip)
Since current MinGW versions include DirectX libs (for dynamic linking), remove "-L$(DXROOT)/lib".
The DirectX headers are no longer a separate dependency for building.
Add $(SDLROOT_OVERRIDE). $(SDLROOT) only functions for Windows and Mac OS X.
Factor handling of $(DXROOT_OVERRIDE) and $(SDLROOT_OVERRIDE) into Makefile.shared using $(abspath ).

git-svn-id: https://svn.eduke32.com/eduke32@3275 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:34:30 +00:00
hendricks266 ae59db2390 Makefiles: Replace all "ifeq ($(PLATFORM),LINUX)" with "ifeq ($(SUBPLATFORM),LINUX)" and set SUBPLATFORM=LINUX when PLATFORM equals LINUX, DINGOO, GCW, or CAANOO.
git-svn-id: https://svn.eduke32.com/eduke32@3272 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:32:59 +00:00
helixhorned fc048658dc Experimental NETCODE Makefile variable, enabled by default.
Disabling netcode compilation can be interesting on memory-constrained
systems, or those that have no means of accessing the network anyway.
Note: I'm OK with maintaining this myself, i.e. it's fine if netcode dev
breaks compilation with NETCODE=0.

git-svn-id: https://svn.eduke32.com/eduke32@3260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:44 +00:00
hendricks266 b6f41b6ae5 Add FORCEWARNINGS Makefile flag to prevent disabling compiler warnings within the source.
git-svn-id: https://svn.eduke32.com/eduke32@3237 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:25:26 +00:00
hendricks266 be899ba3af For novelty, add support for RENDERTYPE=SDL under Windows.
This needs improvements to bring it up to par with winlayer, but it is functional. In particular, a good amount of code from winlayer could be used for both layers, including the profiling timers, the version printing code, and the hInstance and hModule sharing.

Known problems: the mouse cursor is not trapped, and the game starts before the startup window shows options.

git-svn-id: https://svn.eduke32.com/eduke32@3219 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:13:29 +00:00
helixhorned f20a001618 Split r3159..r3161, part 1: Makefile and MSVC project file changes.
git-svn-id: https://svn.eduke32.com/eduke32@3166 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:49 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00
terminx 3ff46c02b2 Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!)


git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-14 23:32:43 +00:00
helixhorned 3bcdc5acb8 Lunatic reorganization part 2: split into engine and editor/game parts.
On the engine side (functions starting with L_), there are now the basic
parts like state creation and running code from strings and files.
The game and editor can add to that by e.g. loading whatever they please
into the state. Their functions start with El_ and Em_, respectively.
The Lua scripts still reside in source/lunatic, even for the common ones.
This is because they will be embedded into the binaries as bytecode or
compressed source eventually, so their location on disk will be irrelevant.

git-svn-id: https://svn.eduke32.com/eduke32@3148 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 20:59:00 +00:00
Plagman a0dd0c85a5 Add automatic tracking to the sector[], wall[], sprite[] and tsprite[]
arrays; any write access to them will run the corresponding hook and write
to the [sector/wall/sprite/tsprite]clean array.

Note: tsprite and sprite use the same hook and require running a few more
instructions per access in order to disambiguiate; this could be made more
optimal (like the other arrays) by clearly separating the types in the game
code.

Note #2: taking a member's address currently marks it dirty because of tons
of helper functions across the editor code. I don't know how many read-only
accesses we have after taking a member address, but it could also be fixed
with some finessing of the code.

git-svn-id: https://svn.eduke32.com/eduke32@3138 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-09 22:31:02 +00:00
Plagman 27a39f1982 Fix the Linux mapster32 build with LTO enabled.
git-svn-id: https://svn.eduke32.com/eduke32@3136 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-09 17:35:58 +00:00
hendricks266 a0c6fb9805 Fix linking with CLANG=1 by separating $(INVOCATION) into $(COMPILER) and $(LINKER) and removing "-x" from clang as a linker in Makefile.common. Additionally, the Build tools are now affected by CPLUSPLUS=1, for which small corrections have been made.
git-svn-id: https://svn.eduke32.com/eduke32@3122 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 07:49:44 +00:00
hendricks266 fcf9beae6a Work-in-progress adjustment to the C code to compile under C++. It builds for me without errors using Win32 MinGW-GCC, but it still generates warning soup. No guarantees about MSVC or anything using SDL. Enable C++ by building with CPLUSPLUS=1. C remains the default and should compile with no change in setup.
Credit to Plagman for the idea and doing the work on the game side, which is included in this commit.

(Building as C++ will give us features with which we can make improvements and optimizations on the multiplayer code and Polymer.)

git-svn-id: https://svn.eduke32.com/eduke32@3116 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 02:49:08 +00:00
hendricks266 7e4e760e9c Fix harmless warnings in the Build tools.
git-svn-id: https://svn.eduke32.com/eduke32@3097 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:28:10 +00:00
hendricks266 f51bdc2faa Slight makefile reorganization and cleanup.
* Centralize optimization strategies in Makefile.common. This required moving detection of $(PLATFORM), which makes sense if we work on the paradigm that Makefile.common is for generic compiler setup and Makefile.shared works with libraries and things closer to the engine and game code itself.
* New Makefile variables OPTOPT (Optimization Options) and CUSTOMOPT (Custom Optimizations). OPTOPT by default contains -march, -mtune, etc. Setting this variable from Make invocation will blank these. CUSTOMOPT (Custom Optimizations) works the same but in an additive fashion, overwriting nothing. Technically CUSTOMOPT could stand for (Custom Options) and include any additional parameters sent to both linker and compiler.
* Factor out literal names of the main executables.
* The build process now prints assembler (if NOASM=0) and linker settings in addition to compiler settings.

git-svn-id: https://svn.eduke32.com/eduke32@3096 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:26:25 +00:00
terminx a5f479787f Remove built-in copy of nedmalloc and update nedmalloc.dll. Note that the built-in copy of nedmalloc hasn't been updated or enabled in a really long time as modern system allocators (Windows 7 and Linux 3.x at least) are no longer consistently beat by nedmalloc (but nor are they consistently faster). So, the dll remains for users of Windows XP because it may still improve performance there (while not likely degrading it on Vista/7).
git-svn-id: https://svn.eduke32.com/eduke32@3086 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-15 00:17:30 +00:00
hendricks266 6650f34105 Disable questionable lines from Makefile.common that were causing my build system to deep crash.
git-svn-id: https://svn.eduke32.com/eduke32@2972 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-27 03:48:27 +00:00