Fix some porting issues to make everything work on Debian 8 "Jessie"
and Ubuntu 14 "Trusty":
- set cmake minimum version to 2.8.12, this is the Ubuntu 14 version
- combine C and C++ flags and add all of them using
ADD_COMPILE_OPTIONS() without using generator expressions, which is a
cmake 3.2 or so feature
- add -fpermissive to force some non-const type casts to compile on
older versions of gcc
- add -std=c++11 for gcc to enable support on older versions of gcc
- check that the compiler supports -fstack-protector-strong before
adding it, older versions of gcc do not
- fix the debian section of ./installdeps to include libpng-dev instead
of libpng16-dev and add gettext for msginit etc.
- fix compat checks in src/common/ffmpeg.cpp and src/wx/cmdevents.cpp to
check for libavcodec >= 56 instead of > 56, the Debian Jessie version
is exactly version 56 . With the one exception of
AV_CODEC_FLAG_GLOBAL_HEADER which is defined in later versions.
Fix backcompat with wx 2.8. This involved writing
wxPositiveDoubleValidator and rewiring the DrawingPanel inheritance tree
and event handling mechanisms (because 2.8 does not have ->Bind, only
->Connect which is less flexible.) As a result all the event handling
has been gathered into GameArea and the affected code is somewhat
cleaner. 2.8 support is untested on Mac because it requires 32 bit libs
and Carbon.
Add support for cross-compiling for windows using the Fedora MinGW
packages in ./installdeps.
Check for OpenGL support in the wx library being linked, this was
necessary because the Fedora MinGW wx library does not have OpenGL
support.
Remove vbamDebug() in favor of wxLogDebug(), and add an override for it
so that it works in non-debug builds of wx as well as on Windows. Turn
off buffering on stdout and stderr on startup so that debug logging
works in msys2/cygwin mintty as well.
On Windows, build a console binary for debug builds.
Update README.md to reflect Fedora MinGW support and debug logging
support.
Add -Wextra to cflags for debug builds.
Detect and install deps for Fedora Linux in ./installdeps . On 64 bit
intel hosts install both 32 and 64 bit dev libs. Also update README.md
to note that Fedora is supported.
MISC: add nasm to all dep lists for various dists
Only allow running ./installdeps if $MSYSTEM is MINGW32 or MINGW64, that
is, the user started a MINGW 32 bit or 64 bit shell and **NOT** an MSYS
shell.
Use the value of $MSYSTEM to determine if 32 bit or 64 bit target deps
should be installed.
Update usage() text to reflect this.
MISC: rename generic_build_instructions() to build_instructions() .
Fix all cmake issues related to building for win32 with mxe.
Add support for ./installdeps win32 on Debian/Ubuntu using the mxe apt
repository.
Details:
* default to ENABLE_LTO=OFF on mxe
* set SFML_STATIC_LIBRARIES=TRUE on mxe
* fix the libintl/gettext checking logic
* fix the git dependencies submodule checking logic, and check that it
triggers for mxe
* revert FindSFML.cmake to upstream version, works fine with mxe
* make 'win32' an alias for the 'MinGW-w64-i686' target for
./installdeps, add support for mxe apt repository for Debian/Ubuntu
* change bin2c related cmake code to compile the tool on the host always
even when cross-compiling
* copy src/win32/res/VBA.ico to src/wx/icons since src/win32 has been
removed
TODO: generic mxe installer for other unix-likes
Allow selecting target for MSYS2 deps.
For Arch cross builds, do not run yaourt if all deps are already
satisfied.
For Mac Homebrew, only install formulae that do not already have some
version installed, otherwise if the user has a non-default version (such
as --HEAD) the script will error out.
Refactor ./installdeps and add support for mingw-w64 cross builds on
Arch Linux. The latter does not work currently because of a bug in
libuuid in the mingw-w64 crt, and the wxmsw AUR package does not build.
This will hopefully be resolved soon.
Put a copy of FindOpenAL.cmake into our own CMakeScripts/ because
searching for include files with PATH_SUFFIXES of include/ does not work
for cross builds, as it is done in the system version.
Add a more general purpose ./installdeps script to replace
./installdeps-msys2 that handles: Debian Linux, Arch Linux, MSYS2+MinGW,
Mac Homebrew, MacPorts and Fink for Mac. More OSes and distributions
will be added in the future, and the script may be generalized for use
in other projects.
Move Mac package manager setup code into MacPackageManagers.cmake and
greatly improve it. Handles Homebrew, MacPorts and Fink correctly.
Minor tweaks for FindSDL2.cmake: better include dir searching that works
on cygwin, fix flags for MinGW, and quiet pkg-config program errors.
Add MinGW cross-compilation toolchain files, they can be specified on
the cmake command line with:
-DCMAKE_TOOLCHAIN_FILE=../CMakeScripts/Toolchain-cross-MinGW-w64-i686.cmake
or
-DCMAKE_TOOLCHAIN_FILE=../CMakeScripts/Toolchain-cross-MinGW-w64-x86_64.cmake
these work for Cygwin and should work for MinGW on Linux as well.