Commit graph

1296 commits

Author SHA1 Message Date
Chris Taylor e7bb902d35 Allow frameworks and libraries to be packaged into the DXX-Rebirth app bundle for Mac OS X (under Contents/Frameworks).
Previously this could be achieved by setting the install path to @executable_path/../Frameworks/<path to framework> for each framework or library, but for Mac OS X 10.5 onwards, these frameworks (namely SDL and SDL_mixer) are set by default to install to @rpath for greater flexibility. @rpath is then set by the binary, in this case DXX-Rebirth to @loader_path/../Frameworks via SCons.

On Mac OS X it is common practice to distribute applications with any frameworks or libraries specific to that application within the application bundle.
2016-09-20 15:18:50 +08:00
Kp 94cc8c4d78 Blacklist -Wold-style-cast on buggy clang versions
clang on OS X incorrectly diagnoses mistakes in Apple system headers
even when -Wsystem-headers is not specified.  Move -Wold-style-cast from
the forced CXXFLAGS section to an SConf test that includes one of the
deficient headers.  This should cause SConf to declare OS X clang as
unable to use -Wold-style-cast, which is necessary to avoid spurious
failures when including Apple headers that use old style casts.
2016-09-15 01:50:56 +00:00
Kp 2ccb4e7066 Fix SCons OS X get_platform_objects build error 2016-09-14 01:59:32 +00:00
Kp 9a8bd1aecb Add disabled tests for curl/jsoncpp
The legacy UDP tracker does not need either curl or jsoncpp.
The new HTTP tracker requires both.  Add tests for both, guarded by
`use_tracker`.  Force `use_tracker` to False for now.  When the HTTP
tracker is made active, remove the assignment so that use_tracker=1 will
enable the new tests.
2016-09-11 18:49:16 +00:00
Kp be691aba0b Move git extra version from DXXProgram to Git 2016-09-11 18:49:16 +00:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp 0015b4282c Move IPv6 to dxxsconf.h; rename to DXX_USE_IPv6
Rename symbol IPv6 to DXX_USE_IPv6 to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl IPv6 -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(IPv6\)$/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(IPv6\))/#\1if \2DXX_USE_\3/'
2016-09-11 18:49:15 +00:00
Kp 435aa5a020 Move USE_UDP to dxxsconf.h; rename to DXX_USE_UDP
Rename symbol USE_UDP to DXX_USE_UDP to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -l USE_UDP -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(USE_UDP\)$/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(USE_UDP\))/#\1if \2DXX_\3/'
2016-09-11 18:49:15 +00:00
Kp 7c8c2b5aa4 Move USE_TRACKER to dxxsconf.h; rename to DXX_USE_TRACKER
Rename symbol USE_TRACKER to DXX_USE_TRACKER to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -l USE_TRACKER -- '*.h' '*.cpp' | xargs sed -i -e 's/^#ifdef \(USE_TRACKER\)$/#if DXX_\1/' -e 's/#\(el\)\?if \(.*\)defined(\(USE_TRACKER\))/#\1if \2DXX_\3/'
2016-09-11 18:49:15 +00:00
Kp ddf888cd72 Move USE_SDLMIXER to dxxsconf.h; rename to DXX_USE_SDLMIXER
Rename symbol USE_SDLMIXER to DXX_USE_SDLMIXER to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct and
inferno.cpp were manual.

git grep -l USE_SDLMIXER -- '*.h' '*.cpp' | xargs sed -i -e 's/^#ifdef \(USE_SDLMIXER\)$/#if DXX_\1/' -e 's/#\(el\)\?if \(.*\)defined(\(USE_SDLMIXER\))/#\1if \2DXX_\3/'
2016-09-11 18:49:15 +00:00
Kp baa8831bce Test whether compiler handles -Wuseless-cast
clang does not understand -Wuseless-cast.  Passing -Wuseless-cast to
clang causes clang to fail the compile.  Resolve this by adding an SConf
test for -Wuseless-cast instead of adding it unconditionally.  It cannot
be put in the compiler preferred options tuple since it must be set
before the test for whether casting a ptrdiff to int is useless.
2016-09-11 18:49:14 +00:00
Kp 8f9b9d7504 Unfold register_program comprehension
The folded form combined multiple targets into one, which is not the
desired result.

'''
unfolded
l=['gcc5,', 'mingw5,'] e='gcc5,' p=('gcc5', '')
l=['gcc5,', 'mingw5,'] e='mingw5,' p=('mingw5', '')
folded
l=['gcc5,', 'mingw5,'] e='mingw5,' p=('gcc5', '', 'mingw5', '')
'''

    import itertools
    l = ['gcc5,', 'mingw5,']
    print('unfolded')
    for e in l:
	    for p in itertools.product(*[v.split('+') for v in e.split(',')]):
		    print("l=%r e=%r p=%r" % (l, e, p))
    print('folded')
    for p in itertools.product(*[
		    v.split('+')    \
			    for e in l  \
			    for v in e.split(',')	\
	    ]):
	    print("l=%r e=%r p=%r" % (l, e, p))
2016-09-07 04:24:33 +00:00
Kp dee78671dc Enable -Wold-style-cast 2016-09-04 19:10:43 +00:00
Kp d851ee988d Fix wording of linker diagnostic report 2016-08-22 00:31:15 +00:00
Kp 63c5b5f9ea Clean up SConstruct global namespace 2016-08-20 22:28:43 +00:00
Kp ef93feca38 Enable -Wuseless-cast 2016-08-19 03:41:42 +00:00
Kp bbdecad649 Add helper macro to handle printf .* conversion for 32/64
Field width conversion `.*` always takes an `int`.

On Win32, casting `long` to `int` triggers a `-Wuseless-cast` warning.
Omitting the cast works correctly.

On Linux/amd64, casting `long` to `int` works correctly.
Omitting the cast triggers a `-Wformat` warning.

Add a macro that conditionally expands to `static_cast<int>` or to ``,
as necessary for the target platform.
2016-08-19 03:41:41 +00:00
Kp 9be68f4e99 Add SConf test for struct timespec 2016-08-19 03:41:40 +00:00
Kp c6f20901d3 Move lazy object getters into default argument scope 2016-08-19 03:41:40 +00:00
Kp bc7f627a36 Cache Link in SConstruct check_preferred_compiler_options 2016-08-17 04:44:22 +00:00
Kp 9924e66082 Replace implicit getter via property with explicit getter calls
Rename members to reflect that they are now explicit getters.
2016-08-17 04:44:22 +00:00
Kp a44498a1ae Improve reporting of bad $CXXFLAGS/$LDFLAGS/$LIBS 2016-08-17 04:44:22 +00:00
Kp 5df6dc47fb Simplify PCH filename passing 2016-08-17 04:44:22 +00:00
Kp 522c37b898 Move -mwindows from DXXProgram to DXXCommon
Environment tests should use it since it is used for the main
executable.
2016-08-14 23:47:27 +00:00
Kp 11519b4a75 Update documentation and test to exclude <gcc-4.9 2016-08-14 23:47:26 +00:00
Kp 1ca0dacb6c Cache context.sconf.Define 2016-08-13 22:20:13 +00:00
Kp 1cb62b1815 Compute Conftests self.Compile at __init__ time 2016-08-13 22:20:13 +00:00
Kp d3535e8486 Prefilter configure test names 2016-08-13 22:20:13 +00:00
Kp cbf745eb9a Switch DXXProgram._computed_extra_version to staticmethod
It did not use its class argument, so remove it.
2016-08-13 22:20:13 +00:00
Kp 20294a54ac Remove dead statements in DXXCommon.process_user_settings 2016-08-13 22:20:13 +00:00
Kp 74525090e7 Update get_found_includes hook for newer SCons
Newer SCons applied a performance optimization that breaks a technique
used in the check_header_includes=1 build.  Switch to a technique that
should work reliably on old and new SCons, although with slightly
reduced efficiency in both cases.  The effective performance penalty
should be unnoticeable and only applies to developers building with
check_header_includes=1.
2016-08-12 04:08:57 +00:00
Kp 8a4908ea2f Precompute and save C++11 required feature list
The C++11 required feature string was computed once per configured
environment.  When two or more environments were configured in a single
run, this was wasteful.  Reorder the SConf tests to precompute the
string.
2016-08-12 04:08:57 +00:00
Kp 7b173c3570 Fold use of raise StopError 2016-08-12 04:08:57 +00:00
Kp 4cb3d46148 Move <type_traits> test to Cxx11RequiredFeature
Commit 957016621e ("Remove support for
Boost.TypeTraits") removed support for any alternative implementation of
<type_traits>, so C++11 <type_traits> is now required.  Move it to
the Cxx11RequiredFeature array to combine it with the other required
feature tests.
2016-08-08 00:07:20 +00:00
Kp 95a53ed820 Require C++11 range-based for
Fallback support for Boost.Foreach is broken and no one has reported it.
The minimum required gcc version supports range-based for.  Recent Clang
supports range-based for.  No Microsoft compilers are supported.  Remove
support for the fallback Boost.Foreach and move the C++11 range-based
for test to the Cxx11RequiredFeature array.
2016-08-08 00:07:19 +00:00
Kp 7d3c3288a9 Remove support for array other than std::array
Building with Boost.Array fails due to name lookup errors.  These could
be fixed, but since no one has reported them and they are fairly old,
Boost.Array appears to be unused.  Remove support for it.

Building with std::tr1::array fails due to missing features in
std::tr1:array relative to std::array.  No one has reported this either,
so remove support for std::tr1:array.

Move the test for std::array into the Cxx11RequiredFeature list so that
it is run as part of the group test, rather than as a separate
statement.
2016-07-31 22:25:49 +00:00
Kp 1e07e4c566 Remove leading underscore for dxx_constructor_base_type 2016-07-21 01:43:22 +00:00
Kp c9d1928e8c Refactor recording build environment 2016-07-21 01:43:22 +00:00
Kp b0526d6928 Respect verbosebuild=0 for Windows resource files 2016-07-16 16:52:04 +00:00
Kp 3b0d4bf8be Fix lto run of size_type format test 2016-07-16 16:52:04 +00:00
Kp 674a9213f8 Add workaround for Win32 wrong type for size_t
GCC std::array uses std::size_t for its size_type.  On Linux/amd64,
`std::size_t` is `unsigned long`.  On Win32, `std::size_t` is
`unsigned int`.  This provokes format string warnings because an
unsigned int is passed where the format string declares an unsigned
long.  On Win32, `unsigned int` and `unsigned long` are the same size,
so `unsigned long` could have been used to avoid this problem by
maintaining consistency with Linux, but it was not.  This may have been
an attempt to achieve bug compatibility with Microsoft's types.

Add a workaround by defining a macro DXX_PRI_size_type in the style of
inttypes.h PRI* macros.  Use an SConf test to determine the correct
value by inspecting which compilation runs succeed.  Currently, Linux
needs "l", Win32 needs "", and Win64 needs "I64".
2016-07-15 03:43:03 +00:00
Kp a9aa5552b7 Pass SConf test macros into later tests
Some tests may benefit from the results of earlier tests.  Other tests
may give different results if the macros from earlier tests are defined.
SCons dependency checking rejects including dxxsconf.h during testing,
so save the results of self._check_macro and insert them into later
tests.  Some tests define their macros in other ways.  The macros from
those tests and are not yet inserted.
2016-07-15 03:43:03 +00:00
Kp 957016621e Remove support for Boost.TypeTraits
Boost enable_if works differently from std::enable_if, so the build is
broken when using Boost.TypeTraits.  The broken code has been present
for a long time and no one reported it.  Remove the fallback to Boost.
2016-07-15 03:43:01 +00:00
Kp a502342654 Remove -Wl,--insert-timestamp when $SOURCE_DATE_EPOCH is set 2016-07-14 01:59:02 +00:00
Kp a990bd9651 Describe git tag in banner output 2016-06-01 01:52:45 +00:00
Kp de219e3d48 Enable -Wshadow
All shadow warnings in the default build have been fixed.  Enable
-Wshadow by default to flag any new instances.
2016-05-22 17:50:13 +00:00
Kp 443b1f2915 Add file/line to valptridx output when available 2016-04-06 03:34:13 +00:00
Kp 27cef20eb3 Move namespace dsx handling to dsx-ns.h 2016-03-19 19:08:10 +00:00
Kp 20e72128de Add configure test and fallback code to support ancient Windows
Windows 2000 has no support for getaddrinfo.  Five years ago (Apr 5
2011), the addition of tracker support
(7f18afd5d7) brought a requirement for
getaddrinfo.  Recently, someone with a working Windows 2000 system
reported that Rebirth no longer starts on Windows 2000.  Although such
systems should not be connected to the Internet, they may still need
name resolution on a LAN.  Add a configure test to probe for getaddrinfo
support and fall back to gethostbyname if needed.

Compiling a binary that works on Windows 2000 requires one of:
* using an ancient SDK that does not declare getaddrinfo
* defining _WIN32_WINNT to exclude Windows XP support
* overriding the SConf test to force failure

Fixes: 7f18afd5d7 ("Client-side implementation for Tracker support by Matt 1360 Vandermeulen including improvements in udp_dns_filladdr and IPv4/IPv6 compability; Very little adjustments by me, too including IPv6 support for Windows (untested); Actual tracker code will follow later as seperate branch when it's done")
2016-03-18 02:05:16 +00:00
Kp 254feabd3a Tabs are 4 spaces 2016-03-02 02:52:44 +00:00
Kp 401f5581c8 Remove guessed -lSDL on OS X
OS X handles linking differently than other platforms.  Asking to link
to SDL breaks the test.
2016-02-23 04:18:13 +00:00
Kp 42ef6b2e72 Add applelink to Darwin tools 2016-02-23 04:18:13 +00:00
Kp 3cb4d99a49 Remove dsx safety net for clang
Clang becomes confused trying to resolve X::a when:
- both `namespace ::X` and `class ::B::X` exist
- `using namespace B;` is active

even if class ::B::X is only a forward-declaration.  Add an SConf test
to recognize when the compiler rejects this pattern and hide the safety
nets that are implemented using it.
2016-02-06 22:12:55 +00:00
Kp fa8ceaeb5f Use extend for OGL defines
Fixes: 04e3c1e9a3 ("Move OpenGL cpp flag tracking to SConf")
2016-02-03 03:00:32 +00:00
Kp 30783846fe Improve SCons ipv6 option documentation 2016-02-02 03:10:53 +00:00
Kp 42a1c560cd Move UDP cpp processing to sconf 2016-01-26 03:45:08 +00:00
Kp cb4600456d Move IPv6 cpp processing to sconf 2016-01-26 03:45:07 +00:00
Kp d35a51e766 Move editor cpp processing to sconf 2016-01-26 03:45:07 +00:00
Kp 29740cf80c Move memdebug cpp processing to sconf 2016-01-26 03:45:07 +00:00
Kp e73e44de79 Move developer-mode cpp processing to sconf 2016-01-26 03:45:07 +00:00
Kp 04e3c1e9a3 Move OpenGL cpp flag tracking to SConf 2016-01-26 03:45:07 +00:00
Kp 1a11370084 Pass archive to prepare_environment 2016-01-26 03:45:07 +00:00
Kp 7b2426fd3e Add gcc to Darwin tool list 2016-01-21 03:57:38 +00:00
Kp 5d7796c344 Swap single/double quote due to Windows shell bug
Microsoft cmd.exe has strange quoting rules.  Where other shells treat
single quote as a quote character, cmd.exe seems to pass it through to
the underlying process.  This breaks the vers_id compilation with
strange error messages.  In practice, SCons does not need the
no-interpolation semantics that single quote provides, so switch to
double quote for compatibility with Windows.  This is probably slightly
less efficient on Bash, since it will now scan the value for expansions.
However, the efficiency loss is tiny compared to overhead elsewhere in
the build.
2016-01-19 04:29:34 +00:00
Kp 65790ec925 Guess pkg-config flags when pkg-config is missing/broken 2016-01-13 04:33:44 +00:00
Kp 15e4130e1a Write more sconf actions to sconf.log 2016-01-12 03:28:45 +00:00
Kp 1e28cb52e3 Remove explicit assignment of subprocess.Popen(executable)
Windows systems get confused and fail to find the process if the
executable name is assigned.
2016-01-09 16:38:15 +00:00
Kp 0a2ef79242 Remove close_fds=True from StaticSubprocess
Per the documentation, on Linux, the default is true.  On Windows,
setting it to true causes a Python exception because Windows relies on
disabling inheritance as a hack to close all descriptors, but
inheritance needs to be enabled to capture the output of the child
process.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/173>
Fixes: bb3f414128 ("Cache scons subprocess calls")
2016-01-03 20:21:36 +00:00
Kp ba17de4cd5 Add -Wuninitialized to default warning options 2016-01-03 20:21:35 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp 30cb6d8c8d Improve dcx/dsx comments
Move the boilerplate up onto the outer namespace line.  Decorate each
collision with a comment stating its purpose, so that compiler error
output echoes the type of collision.
2015-12-13 18:00:48 +00:00
Kp 80ea17a61c Convert OSError to StopError for failed tool version checks 2015-12-11 03:39:40 +00:00
Kp 69c5a79058 Use inline namespace dcx for common/2d 2015-12-05 22:57:23 +00:00
Kp 60e6c23ccc Always pass tuple for argument prefix list
Fixes: dd59be7163 ("Cache various SConstruct temporaries")
2015-12-04 03:36:33 +00:00
Kp ff51ff5474 Copy sdl-config CPPDEFINES before modification
Fixes: 6111e5adbf ("Allow configuring max joysticks at build time")
2015-12-04 03:36:32 +00:00
Kp dd59be7163 Cache various SConstruct temporaries
This started as a project to make SConstruct take less time on an empty
build.  Unforunately, most of the major gains lie elsewhere and require
deeper changes to the build system.  These changes do not help much, but
they are better than nothing.
2015-12-03 03:26:49 +00:00
Kp 3528acb78d Add $DXX_EFFECTIVE_SOURCE to check_header_includes dependencies 2015-11-24 04:05:35 +00:00
Kp a2b4dcbd9c Use $DXX_EFFECTIVE_SOURCE for quiet header check builds 2015-11-24 04:05:35 +00:00
Kp 7b4eeb8c0c Suppress debug info for check_header_includes outputs 2015-11-17 03:31:21 +00:00
Kp d36e86f8bc Factor out some Scons None assignments 2015-11-14 18:17:22 +00:00
Kp 0c86fd507d Fix mingw32 build
Fixes: 38df160341 ("Create platform_settings, env on first use")
2015-11-07 21:56:00 +00:00
Kp 6111e5adbf Allow configuring max joysticks at build time 2015-11-01 21:15:40 +00:00
Kp 139f2aaa44 Reduce scope of LazyObjectConstructor.__strip_extension 2015-11-01 21:15:39 +00:00
Kp 0a041018c8 Let register_cpp_output_targets see check_header_includes 2015-11-01 21:15:39 +00:00
Kp 83f1a94ec4 Move __shared_header_file_list to create_header_targets 2015-11-01 21:15:39 +00:00
Kp afb1fc3383 Remove special-case for profiler support
Stackable build profiles allow this to be specified without a special
case in SConstruct.
2015-11-01 21:15:39 +00:00
Kp f5dfa1a3b2 Inline banner() 2015-11-01 21:15:39 +00:00
Kp 38df160341 Create platform_settings, env on first use 2015-11-01 21:15:39 +00:00
Kp b35ef80a0f Reduce global lookups 2015-11-01 21:15:38 +00:00
Kp bab5f5f1be Reduce env lookups 2015-11-01 21:15:38 +00:00
Kp e86e1a882a Combine adjacent env.Append calls 2015-10-29 03:01:42 +00:00
Kp fd51188e57 Simplify DXXCommon instance counter 2015-10-29 03:01:42 +00:00
Kp 9c4a4e3cf8 Remove unnecessary __init__ methods 2015-10-28 02:44:36 +00:00
Kp def268faf9 Combine lazy object caches 2015-10-28 02:44:36 +00:00
Kp edea687627 Remove HAVE_STRUCT_TIMEVAL
SConstruct defines it for all platforms.  It is only false on Mac OS 9,
which is no longer supported.
2015-10-27 03:04:49 +00:00
Kp e7c65dbc3f Use property for LinuxPlatformSettings ogllibs
It is only called once per instance, so caching it as an instance
value is not helpful.  Change it to a property so that __init__ can be
removed.
2015-10-27 03:04:49 +00:00
Kp a4eda5e6f7 Include commented tool versions in sconf tests
Encourage SCons not to reuse test results when the printed version
strings have changed.
2015-10-24 03:13:11 +00:00
Kp 4951cb0b8f Fix build break if no git and extra_version='' 2015-10-18 21:01:20 +00:00
Kp 927b14848f Add optional cpp output targets 2015-10-18 21:01:18 +00:00
Kp 091bcbec26 Support skipping configure/compile stages 2015-10-18 21:01:18 +00:00
Kp 2a1e07adfa Detect failure to git ls-files for check_header_includes 2015-10-13 02:43:25 +00:00
Kp d3198ab0bd Use env.Textfile to generate stub check_header_includes.cpp 2015-10-13 02:43:24 +00:00
Kp 365340560d Cache result of checking for .git 2015-10-13 02:43:24 +00:00
Kp c1b1da61e5 Support unusual values of CPP define SHAREPATH
Use the full CPP define quoting function instead of just hoping
sharepath is clean.
2015-10-13 02:43:24 +00:00
Kp 2e17c03c9e Remove unnecessary list comprehension for vers_id.cpp
It was a convenience for binding 's' to one value, but that can be
rewritten without the comprehension.
2015-10-13 02:43:24 +00:00
Kp a71e886fce Add scons option to skip pch optimization
Add option to compute indirect includes even when not necessary, since
indirect includes influence the inclusion count shown in the comments.
Enabling this option makes SCons work harder for the same output binary.
It should only be used by developers who want to see precise file
inclusion counts.
2015-10-09 02:46:10 +00:00
Kp 4041e3ba53 Test whether compiler can use PCHs it generates
Current gcc requires a non-PIE cc1plus for working PCH support.  If the
chosen compiler is PIE, it will succeed in building the PCH, then fail
when trying to use it.
2015-10-03 17:17:49 +00:00
Kp f37e55737c Shorten secondary calls to Git.pcall 2015-09-29 02:41:22 +00:00
Kp 433b80c0b3 Reduce copying of pkg-config result 2015-09-29 02:41:22 +00:00
Kp e2d16844a8 Fix handling of pch_cpp_assume_unchanged 2015-09-26 21:17:14 +00:00
Kp f3470cef5f Show tool versions in sconf output 2015-09-26 21:17:13 +00:00
Kp 51a86c62ef Hide undocumented options
If no help text is defined, hide the associated option from --help.
2015-09-26 21:17:13 +00:00
Kp 0b242833f5 Always set StaticSubprocess.stdout to PIPE 2015-09-26 21:17:13 +00:00
Kp 63dd2656ed Document some SConstruct tests 2015-09-26 21:17:12 +00:00
Kp 76b94de1de Add commented out hook for warning on valptridx exceptions 2015-09-26 21:17:12 +00:00
Kp 4afae87883 Remove -Wcast-align from default compiler options
Per issue from MattWatt, gcc for Raspberry Pi warns about alignment
issues.

Per issue from kreator, clang warns about alignment issues on OS X.
However, it does not warn on x86_64-pc-linux-gnu.

GCC only warns when compiling for a target architecture that requires
alignment, so it does not warn for i686-pc-linux-gnu or
x86_64-pc-linux-gnu.

Using this warning would be nice, but since it only triggers on
architectures not maintained by active developers, it causes more
trouble than it may solve.

Alignment sensitive users will have to get by with software fixups until
an active developer begins targeting alignment sensitive hardware.

Reported-by: MattWatt <https://github.com/dxx-rebirth/dxx-rebirth/issues/119>
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/120>
2015-09-19 23:04:36 +00:00
Kp f1021de448 Add SDL_NumJoysticks() to SDL library test
Some builds of SDL lack joystick support.  Rebirth requires joystick
support in SDL, even if the user never connects a joystick.  Add a call
to SDL_NumJoysticks during the SDL test so that systems without SDL
joystick support fail the "usable library SDL" test.
2015-09-19 23:04:36 +00:00
Kp ae5fc1b74b Remove wrapper Cxx11Compile
All compilation is now at least C++11.
2015-09-19 23:04:36 +00:00
Kp 348c656311 Explicitly require C++11 support 2015-09-19 23:04:36 +00:00
Kp 6c49f5b95d Disable ccache/distcc during SConf 2015-09-19 23:04:36 +00:00
Kp d18835bcf9 Invert sense of {} messages
Prefer to always have 'yes' for good results and 'no' for bad results.
2015-09-19 23:04:35 +00:00
Kp 22a7d121f5 Restructure compiler preferred option tests 2015-09-19 23:04:35 +00:00
Kp 61044df4f7 Use string formatting consistently 2015-09-19 23:04:35 +00:00
Kp 451325c89b Improve lazy object setup 2015-09-19 23:04:35 +00:00
Kp 54928db871 Cache os.environ.get 2015-09-19 23:04:35 +00:00
Kp 8f7ed1f5ee Remove unused program_specific_objects 2015-09-19 23:04:35 +00:00
Kp d954cdf279 Look up configure test docstring at record time 2015-09-13 21:02:19 +00:00
Kp 198b8295c4 Force sconf.log verbose for LINKCOMSTR 2015-09-13 21:02:19 +00:00
Kp f2d9ffe48d Rewrite PCH generation 2015-09-13 20:23:05 +00:00
Kp 0ec66ef673 Use collections.defaultdict for successful_flags 2015-09-13 20:23:05 +00:00
Kp 433fc96505 Avoid redefining LazyObjectConstructor.__strip_extension 2015-09-09 03:27:52 +00:00
Kp 80f70fbc34 Remove SConf test check_compiler_template_parentheses_warning
Test check_compiler_template_parentheses_warning probes for a bug in
gcc-4.6.  Upstream fixed the bug in gcc-4.7.  Using gcc-4.6 is no longer
supported, so remove the test for the bug.
2015-08-22 20:43:04 +00:00
Kp 37838329a1 Add SConf hook to check result against expected value 2015-08-22 20:43:04 +00:00
Kp 3bf0c93067 Factor out lookup of sconf overrides 2015-08-22 20:43:03 +00:00
Kp b5bf4cf9cc Change - to _ for check_compiler_option names 2015-08-22 20:43:03 +00:00
Kp 389cd42f47 Default verbosebuild on for non-tty outputs 2015-08-14 03:02:04 +00:00
Kp 41ecab004f Skip message for unknown variables when there is nothing to do
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/115>
Fixes: 870ed653b5 ("Warn about unknown scons variables")
2015-08-11 03:05:55 +00:00
Kp 001fdfff37 Add workaround for gcc-4.8 ref qualifier quirk
In gcc-4.8, a member method with const lvalue and const rvalue methods
is ambiguous.

	$ cat t.cpp
	class A
	{
	public:
	    void a() const &;
	    void a() const &&;
	};

	A b();
	void c()
	{
	    b().a();	// fails in gcc-4.8, works in later
	}
	$ gcc-4.8 -Wall -Wextra -std=gnu++0x -O2 -c t.cpp
	t.cpp: In function 'void c()':
	t.cpp:11:8: error: call of overloaded 'a()' is ambiguous
	  b().a();
		^
	t.cpp:11:8: note: candidates are:
	t.cpp:4:7: note: void A::a() const &
	  void a() const &;
	       ^
	t.cpp:5:7: note: void A::a() const &&
	  void a() const &&;
	       ^
	$ gcc-4.9 -Wall -Wextra -std=gnu++0x -O2 -c t.cpp
	$

Fixes: bda7fef3a0 ("Use get_local_player to compute reference to local player")
2015-08-05 02:59:03 +00:00
Kp b979f52ebf Centralize required C++11 features 2015-08-03 03:11:25 +00:00
Kp 7086bbae14 Simplify automatic compiler test 2015-08-03 03:11:24 +00:00
Kp 4d8ae44794 Add helper macro DXX_CONSTANT_TRUE 2015-07-29 03:05:28 +00:00
Kp 4a6ae13367 Centralize PCH object hook 2015-07-25 23:10:48 +00:00
Kp d4dc3df3de Support PCH+LTO 2015-07-25 23:10:48 +00:00
Kp 9a5654e002 Move similar/editor/autosave.cpp -> common/editor/autosave.cpp 2015-07-25 23:10:47 +00:00
Kp 15fb75c1c7 Fix check_header_includes build 2015-07-25 23:10:45 +00:00
Kp cdb113a050 Diagnose including compiler-type_traits without dxxsconf.h 2015-07-25 23:10:45 +00:00
Kp 9f84f0851d Enable clang LTO
clang does not support -flto=N syntax for parallel LTO.

Remove -fno-fat-lto-objects too.  clang does not understand it;
gcc 4.9 and later default to non-fat LTO.

Fixes: 1037a92d60 ("Allow parallel lto")
2015-07-18 21:01:56 +00:00
Kp 82e1ea5636 Move similar/mem/mem.cpp -> common/mem/mem.cpp 2015-07-18 21:01:56 +00:00
Kp a58e8f87a0 Move similar/misc/hash.cpp -> common/misc/hash.cpp 2015-07-18 21:01:56 +00:00
Kp cfdffa184f Move similar/arch/sdl/event.cpp -> common/arch/sdl/event.cpp 2015-07-18 21:01:56 +00:00
Kp 04d9f82a50 Move similar/arch/sdl/key.cpp -> common/arch/sdl/key.cpp 2015-07-18 21:01:56 +00:00
Kp c7542fe9fc Move similar/arch/sdl/mouse.cpp -> common/arch/sdl/mouse.cpp 2015-07-18 21:01:56 +00:00
Kp 51ee9d2833 SDL2: skip build of rbaudio.cpp 2015-07-14 02:42:12 +00:00
Kp a2cb5fea6e Add SConf option to use SDL2 2015-07-14 02:42:12 +00:00
Kp 658102a868 Improve static_assert test
Previously, SConstruct tested whether static_assert worked with trivial
constant expressions.  Extend the test to more complicated expressions
like the ones used in the program.

Replace the typedef based approach with an inline enum to avoid warnings
about unused local typedefs.

Allow use with compilers that lack working static_assert or that cannot
accept complicated expressions.  Add a non-checking definition that uses
the input parameter.  This prevents warnings when types or constants are
used only for the static_assert.
2015-07-09 03:12:45 +00:00
Kp c03fe30fc2 Move similar/arch/sdl/timer.cpp -> common/arch/sdl/timer.cpp 2015-07-04 21:01:17 +00:00
Kp 2bc1f786d5 Test for -Wlogical-op before using it
clang does not understand it, so using it unconditionally breaks the
clang build.
2015-06-20 03:50:46 +00:00
Kp 3905f1a668 Enable -Wcast-qual 2015-06-13 22:42:21 +00:00
Kp 92f44fcaaa Enable -Wmissing-include-dirs 2015-06-13 22:42:21 +00:00
Kp 7c436f1fbb Merge pull #39 into unification/master
Requested-by: btb <https://github.com/dxx-rebirth/dxx-rebirth/pull/39>
Acked-by: Matt1360 <https://github.com/dxx-rebirth/dxx-rebirth/pull/39#issuecomment-88712761>
Acked-by: zico <https://github.com/dxx-rebirth/dxx-rebirth/pull/39#issuecomment-88907523>
2015-06-07 16:21:37 +00:00
Kp ff452dbded Move CLI code to common
None of it depends on D1 vs D2.
2015-06-07 16:20:46 +00:00
Kp a8431a1933 Fix noreturn test with LTO 2015-05-28 03:08:38 +00:00
Kp 41c58ec70e Remove zlib.h from physfs test
The test does not use zlib functions directly.
2015-05-23 04:13:29 +00:00
Kp 3caea6d618 Enable -Wvla 2015-05-17 00:59:26 +00:00
Kp 0ece005dfa Use screen_mode for screen resolution 2015-05-14 02:23:13 +00:00
Kp 8daf33b422 Blacklist broken clang C++11 constructor inheritance 2015-05-09 17:39:02 +00:00
Kp f92e890f50 Improve valptridx exception reporting 2015-05-09 17:39:02 +00:00
Kp 1037a92d60 Allow parallel lto 2015-05-09 17:38:57 +00:00
Kp ee3731ccd1 Add workaround for clang -Wunused-parameter bug 2015-05-06 02:11:03 +00:00
Kp 9dc22b1ee6 Expand DXX_CXX11_EXPLICIT_DELETE
Various functions use the non-macro form, so support for =delete is
already mandatory.  Remove the remnants of support for compilers which
lack =delete and replace it with a hard stop when the compiler rejects
declaring explicitly deleted functions.
2015-05-01 02:18:33 +00:00
Kp 596ece352b Enable -Wextra 2015-04-26 20:15:57 +00:00
Kp 6792c1bc4b Enable -Wunused-parameter 2015-04-26 20:15:56 +00:00
Bradley Bell 844aad2639 Merge branch 'unification/master' into command-line 2015-04-24 20:54:35 -07:00
Kp bb3f414128 Cache scons subprocess calls 2015-04-22 02:44:30 +00:00
Kp f86f06f1d4 Add -fvisibility=hidden when supported
Saves ~4k of text on debug+editor build
2015-04-22 02:44:29 +00:00
Kp eee5e8d4b9 Require compiler support for constexpr 2015-04-22 02:44:29 +00:00
Kp 239f633356 Remove unused include directory 2015-04-19 04:18:50 +00:00
Kp be4eef36dd Always add -g to CXXFLAGS 2015-04-17 02:38:12 +00:00
Kp 6633eef18b Fix spurious quote on version string 2015-04-16 01:48:15 +00:00
Kp fa82c1bd3b Add special case for physfs requiring zlib
Dynamic linked physfs handles its own zlib dependencies.  If the user
links to a static physfs and physfs is built with support for zip files,
then we need to add zlib to the link line.
2015-04-09 02:29:58 +00:00
Kp add7107cc7 Fix preserving CCACHE_PREFIX 2015-04-04 17:23:47 +00:00
Kp 942f867926 Always set -Wredundant-decls
<gcc-4.7 no longer builds due to incomplete decltype handling
>=gcc-4.7 handles -Wredundant-decls correctly

Remove the SConf test and always set -Wredundant-decls.
2015-04-03 02:46:25 +00:00
Kp 85a777d300 Move pkg-config lookups into configure tests 2015-04-02 02:36:52 +00:00
Kp 66806e1f34 Enable -Wmissing-braces
clang includes it in -Wall, so add it for gcc
2015-04-02 02:36:52 +00:00
Kp 05bf944bee Fix gcc-4.7 objptridx narrowing error
Constructor forwarding using braces causes a -Wnarrowing warning in
objptridx constructors.  Switch to using parentheses to avoid the
warning.
2015-03-28 01:16:11 +00:00
Kp 9fe3fdd2bb Add sconf check for gcc bug #51064
Set -Wparentheses only if the compiler accepts template computed expressions.
2015-03-27 02:50:23 +00:00
Kp 06a1c74c18 Fix Windows OpenGL build
Fixes: 9d33fad4dd ("Implement different GL synchronization methods")
2015-03-25 01:59:21 +00:00
derhass 639b569496 Merge branch 'unification/master' into unification/syncgl_v2
Conflicts:
	similar/arch/ogl/gr.cpp
	similar/misc/args.cpp
2015-03-23 20:18:17 +01:00
derhass 6d41224638 move GL synchronization code into its own class 2015-03-22 21:19:06 +01:00
derhass db267af6f2 add basic OpenGL extension handling
Currently only used for fence sync objects.
2015-03-22 20:32:14 +01:00
Kp 945914f1d6 Enable -Wuninitialized, -Wempty-body, -Wignored-qualifiers, -Wunused 2015-03-22 18:49:21 +00:00
Kp d9bfced915 Blacklist moving _REENTRANT to dxxsconf.h
Passing -pthread implies -D_REENTRANT, so if -D_REENTRANT is moved to
dxxsconf.h, then _REENTRANT is defined twice.
2015-03-22 18:49:21 +00:00
Kp 28a5b70c7c Remove write-only osasmdef 2015-03-22 18:49:21 +00:00
derhass 6d4ee7a329 RPi: use CPPFLAGS instead of CXXFLAGS for -isystem
Suggested by Kp.
2015-03-21 17:54:04 +01:00
derhass beda132361 RPi: use SConstruct's message() function for the RPi build message 2015-03-21 17:53:58 +01:00
derhass f46e4a2a7c RPi: use -isystem for the VideoCore library header path
Rebirth builds with -Werror=redundant-decls -Werror=undef, which are
triggered by the bcm_host.h. Making gcc treat those paths as
system headers avoids these issues. This was suggested by Kp.
2015-03-21 17:53:13 +01:00
Kp 13d85fa38e Make d1x=value imply d2x=0 and vice versa 2015-03-12 02:21:21 +00:00
Kp 650831c0fe Set -O2 for debug builds
Enable optimization by default for all builds.  Users can pass -O0 if an
unoptimized build is needed.
2015-03-07 17:20:41 +00:00
Bradley Bell bbb32d0175 added cmd and cvar modules from d2x 2015-02-10 23:35:44 -08:00
Bradley Bell 0db11cc139 add d2x command-line interface to console 2015-02-10 17:01:00 -08:00
Kp 8d3f047427 Make udt_to_message __attribute__((unused))
Clang warns for unused static inline functions defined in a source file,
including those defined in a macro in a header, when the macro is
expanded in the source file.
2015-02-05 03:03:50 +00:00
Kp 4488458ed8 Reactivate check_attribute_alloc_size
Fixes: c8022a1001 ("Abstract socket array/sockaddr dispatch")
2015-01-25 05:32:45 +00:00
Kp c8022a1001 Abstract socket array/sockaddr dispatch 2015-01-18 01:58:33 +00:00
Kp 95aaf09ae0 Add -Wno-missing-field-initializers if needed
GCC with -Wmissing-field-initializers warns for a={}, but this is a
common construct in Rebirth code to zero-initialize an entire structure.
Users might add -Wmissing-field-initializers or a group option which
enables -Wmissing-field-initializers, so add code to explicitly disable
this warning when the compiler rejects this form of initialization.
2015-01-15 04:30:03 +00:00
Kp fd01d4c673 Reorder wall_is_doorway to favor likely results 2015-01-12 00:26:03 +00:00
Kp 484a2a705d Use strcasecmp when available 2015-01-12 00:26:03 +00:00
Kp e71d91d411 Skip ccache/distcc for link 2015-01-11 05:08:30 +00:00
Kp 662cf903ca Add $CXXFLAGS to $LINKFLAGS for LTO 2015-01-11 05:08:30 +00:00
Kp 4be02cd9c5 Add support for poison=overwrite 2015-01-03 23:44:32 +00:00
Kp 2cc77d647f Add ccache/distcc support 2015-01-03 23:44:32 +00:00
Kp 62f4a847bc Check for usable libSDL 2015-01-03 23:44:32 +00:00
Kp 44b4a54495 Fix duplicate -lSDL_mixer 2015-01-03 23:44:32 +00:00
Kp b86870f5ef Make d_debugbreak cold 2014-12-24 03:34:33 +00:00
Kp 100e6ceedf Shorten DXX_BUILD_DESCENT_I macro 2014-12-20 04:36:11 +00:00
Kp e1bb249176 Remove unused UI_GADGET_KEYTRAP 2014-12-20 04:36:09 +00:00
Kp 5f6a54875c Make pkg-config errors non-fatal
Later configure tests will abort if the package is not found some other
way.
2014-12-11 02:32:28 +00:00
Kp e216b709d4 Use pkg-config on Darwin if available 2014-12-05 04:11:37 +00:00
Kp 84932930c8 Fix escaping empty flags 2014-12-05 04:11:37 +00:00
Kp 813d88bb55 Combine pkg-config caches 2014-12-05 04:11:37 +00:00
Matt Vandermeulen b94274e5a5 Merge pull request #16 from btb/osx-issues
Osx issues
2014-12-04 21:46:19 -05:00
Bradley Bell 0cc88280ba Simplify by using generic Info.plist, builtin substitions 2014-12-04 18:11:57 -08:00
Bradley Bell 876c4522b3 use correct path for localized strings 2014-12-04 16:39:45 -08:00
Bradley Bell 6cf4e86185 use correct path for bundle executable 2014-12-04 15:58:50 -08:00
Kp a977d5d202 Search for SDL_mixer pkg-config too
Users might install SDL and SDL_mixer to separate paths, so search for
SDL_mixer.pc too.
2014-12-04 03:31:07 +00:00
Bradley Bell 3daa0f63b1 Add search SDL_mixer framework paths for headers instead of using <Framework/Header.h> notation 2014-12-03 15:14:18 -08:00
Bradley Bell 782e12fd49 For Darwin, code expects SDL_mixer to be in the framework path.
Use that here too.
2014-12-02 14:29:41 -08:00
Kp ec8738ca62 Merge branch 'btb/osx-fixes' into unification/master
Merge Mac OS X specific fixes from btb.  The Windows and Linux builds
are unaffected.  The OS X changes look sane, but cannot be tested here.

Changes not specific to OS X were previously committed separately.

Requested by btb: https://github.com/dxx-rebirth/dxx-rebirth/pull/12
2014-12-01 23:47:10 +00:00
Kp d0ec27898b Detect -Wnarrowing constructor calls even without inheritance 2014-11-26 02:57:36 +00:00
Bradley Bell 7f10bb28bf use NSAlert for cocoa. Carbon support totally deprecated 2014-11-23 19:53:02 -08:00
Bradley Bell d822d09d35 move messagebox and SDLMain to platform_objects 2014-11-23 04:25:42 -08:00
Kp 57ed5c24fd Add developer option to test header completeness 2014-11-17 04:02:25 +00:00
Kp 177c935b9d Move 3d/clipper.cpp to SDL-only build 2014-11-16 19:14:51 +00:00
Kp e766381265 Fix __builtin_constant_p test at -Og
Remove explicit 'inline' on __builtin_constant_p test, since -Og will
inline simple functions on request but not inline speculatively or
inline complex templates.  When testing at -Og with 'static inline',
__builtin_constant_p is marked as functional, but physfsx checks are not
inlined and result in spurious failures.  When testing at -Og with
'static', __builtin_constant_p is marked as broken and the physfsx
checks are skipped.  When testing at -O2, __builtin_constant_p is marked
as working and the physfsx checks are included.
2014-11-02 16:46:11 +00:00
Kp 1312008dca Filter duplicate prefixes in register_program
Without a filter, certain combinations add $CXXFLAGS multiple times.
2014-10-16 01:56:30 +00:00
Kp 870ed653b5 Warn about unknown scons variables 2014-10-10 02:58:05 +00:00
Kp ec1eb03cc2 Move d2x-rebirth/main/segment.cpp -> similar/main/segment.cpp 2014-10-04 17:53:09 +00:00
Kp d8ca0b2e70 Add initial LTO support 2014-09-28 21:09:19 +00:00
Kp 6384f8dffe Move main body into configure _Test method 2014-09-28 21:09:19 +00:00
Kp e6bd1ae52c Handle None in get_Werror_string 2014-09-27 00:32:22 +00:00
Kp 703f60ac3f Fix -Wtype-limits warnings 2014-09-21 21:41:55 +00:00
Kp fece9f51a4 Optimize serial using __builtin_bswap if available 2014-09-20 22:15:32 +00:00
Kp ef42a7cdad Compact version number definition 2014-09-17 02:45:32 +00:00
Kp 5b70836203 Fix -Werror leakage on failed CXXFLAGS-free tests 2014-09-17 02:11:43 +00:00
Kp 85b09fd380 Avoid redundant -Werror usage
If -Werror is set by the user, use -Wflag instead of -Werror=flag.
2014-09-17 02:09:53 +00:00
Kp d1a36bfc6a Add option to rebuild vers_id when any object file changes 2014-09-13 22:10:24 +00:00
Kp a11c4aed3d Shorten vers_id command line 2014-09-13 22:09:32 +00:00
Kp 0387a2c771 Disallow using RAIIdmem::operator T* on rvalues 2014-09-07 23:56:37 +00:00
Kp 7d166a70e0 Prevent accidental RAIIdmem construction 2014-09-07 23:56:37 +00:00
Kp 07176ece8b Add Valgrind poison stubs 2014-09-07 19:39:18 +00:00