Although this is a C++ option, some dists like ninja use CFLAGS instead
of CXXFLAGS for C++ code, and this becomes even more problematic with
XCode 10 which removes libstdc++ entirely.
Refactor the build environment evaluation, make build variables set
immediately so that they don't grow longer on re-evaluations and defer
all other variables. Export as many build related variables as possible.
Make one more crucial fix for cross builds: run the post_build after
LDFLAGS and LIBS are restored, so that this does not interfere with
setting and restoring the build environment for host builds.
Other changes:
- fontconfig 2.13.0 -> 2.13.1
- openal 1.19.0 -> 1.19.1
- set fontconfig configure type to autoreconf, disable tests
- disable the openssl parallel build patch, it fails unpredictably,
always build openssl with -j1
- configure libicu with --disable-tests and a few other things disabled,
the tests cause link issues on mingw i686
- also make a minor fix to libicu makefiles for mingw (replace echo -n
with printf)
- move $BUILD_ENV evaluation to the builder() main function to defer
some variable initializations
- add patch for openal to mingw-cross to use gcc instead of cmake to
build some native tools it uses, cmake causes issues with cross builds
- in host_env()/target_env() defer variable expansion and include a copy
of $BUILD_ENV in the appropriate sequence
Support building both 32 bit and 64 bit mac binaries, by passing the -32
or -64 flag just like for mingw.
Install libuuid on mac into a private path, because its uuid.h conflicts
with mac APIs when e.g. building python2.
Other improvements:
- add ccache to dists early on to not rely on the dist ccache
- update python2 version
- set python3 version to 3.6.5 until patches are updated
- TODO: rebase python3 patches
- configure cmake with --enable-ccache always
- TODO: remove all ccache optional stuff, make it required
- run cpanm through perl, because of possible issues with the script and
various paths
- support an install prefix other than /usr via DIST_PREFIX
ccache can apparently cause issues when building openssl, as I've
noticed on Mac OS 10.13, save the original values of $CC and $CXX and
pass them to make when building openssl.
Make mac builder use -m32 in CFLAGS etc. to produce a 32 bit binary
targetting 10.7 (Lion.) This provides the greatest backward
compatibility for older macs, and also allows for asm filters.
Fix an issue with m4 on 10.13 using a patch from macports.
Support `-pX` patch level args in DIST_PATCHES in builder.
Fix an issue with bison on 10.13 by bumping the version to 3.0.5.
Build libxslt `--without-crypto` so that it doesn't try to link the brew
libgcrypt.
Invoke cmake for dists with -DCMAKE_C_COMPILER_LAUNCHER=ccache and
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache to use ccache, and set
CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the actual compilers not
prefixed by ccache.
When checking for ccache in vbam cmake code, check that
CMAKE_CXX_COMPILER_LAUNCHER and CMAKE_C_COMPILER_LAUNCHER were not
already defined (generally on the command line.)
Remove align attributes from sections in 2xSaImmx.asm, macho format on
mac does not support this and the filter works fine without them.
In the Quartz2D renderer, pass the NSRect view.bounds through
NSRectToCGRect when calling CGContextDrawImage(), this is necessary for
the 32 bit API.
Bump openssl to 1.0.2o.
Bump libxml2 to 2.9.8.
Update URL for urw fonts, and improve the dist downloading/unpacking
code to handle URLs that do not contain the filename (for .tar.gz and
.zip as identified by `file`.)
Change post-build for harfbuzz from `rebuild_dist freetype;` to
`rebuild_dist freetype --with-harfbuzz=yes;` as it was supposed to have
been.
Build cmake itself with --parallel and --enable-ccache.
Silence errors from killed jobs due to tmp directory being gone.
Write a couple of string functions, rtrim() and gsub().
Make path_exists() handle globs with spaces in them, by escaping the
space.
Use --host and --build args to autoconf configure to "cross-compile" for
32 bits, this is necessary for some dists, and does not work for others,
remove it for dists where it does not work.
Add COMMAND_MODE=unix2003 to the build environment, this is necessary to
fix some build errors, why I have no clue, found it on stackoverflow.
Pass -Wl,-no_compact_unwind in LDFLAGS to openssl, this is necessary for
32 bits.
Force sfml to compile as 32 bit, it normally does not allow this.
Remove shared-mime-info from this build, it's not necessary for anything
and there are issues XML::Parser linked to our expat and brew perl that
need to be resolved.
Compile out the min/max functions in GBALink.cpp when compiling with
clang, clang does not like them because of some sort of changes in the
preprocessor.
Run the mac builder script with homebrew bash, system bash does not work
and dash no longer works.
TODO: fix dash compat
under `tools/` add some scripts to invoke the build system to build all
deps for vbam and vbam itself:
- `tools/linux/builder`
This builds a mostly static linux binary with a few dynamic deps for
xorg and wayland. Using gtk3. This will run on just about any dist.
- `tools/osx/builder`
Builds a static mac app targetting 10.7.
- `tools/win/linux-cross-builder`
Builds a static windows binary using the mingw-w64 toolchain.
- `tools/win/msys2-builder`
Builds a static windows binary in the MSYS2 environment, this may be
suffering from a few regressions.
Change some cmake code to support the build system, refactor a few
things in it.
Improve, refactor and clean up `tools/osx/builder` to build a relatively
full-featured ffmpeg as well. This requires lots of other dists. It's
kind of like a mini port system now. Will generalize it shortly to a
sourced library for using with both the mac and the mingw builds. Will
hopefully become a separate repo on github at some point.
Add perl dist support to the builder.
Add an `--env` flag to the builder to print the build environment
variables so that they can be read in with `eval` for debugging
purposes.
Also add the `FFMPEG_STATIC` cmake option to link static ffmpeg
libraries correctly.
Move the codesigning and zipping of the `.app` bundle to the builder
script and out of cmake, as this is something most users don't need.
Add POST_BUILD commands on Mac to codesign the `.app` and make a zip
file from it.
Also add xz/liblzma dist to `tools/osx/builder` because something
apparently wants liblzma.
Refactor the code in `tools/osx/builder` somewhat and make it cleaner.
Move a few table processing loops into functions to make things less
ugly.
Delete dists not listed in the table (e.g. when they are updated) and
when a dist is re-downloaded, delete the tree and the target file to
force a rebuild.
Use number version for gettext instead of `-latest`.
Specify full dist target, e.g. `lib/libfoo.a` instead of just
`libfoo.a`.
Add `tools/osx/builder`, a POSIX sh script to build all dependant
libraries as static, targetted to OS X 10.7, and build the project with
them (also targetted to OS X 10.7.)
ffmpeg currently does not link, as recording functionality is currently
non-functional anyway, this will be fixed later.
MISC:
- set WORKING_DIRECTORY and ERROR_QUIET for all git commands, for the
cases when the build directory is not under the git checkout
- #include <cerrno> in ConfigManager.cpp as it uses errno
- change `build*` in `.gitignore` to `build/*` so that files starting
with "build" are not affected