Commit Graph

60 Commits

Author SHA1 Message Date
Rafael Kitover ffc9309253
builder: freetype 2.9.1 -> 2.10.0, verbose make
make project with `VERBOSE=1`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 13:05:43 +00:00
Rafael Kitover d08dd6cd18
builder: opensuse update 2
Install python3 in cross deps and call glib configure with the path to
it.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 00:08:45 +00:00
Rafael Kitover 9b38a38428
builder: updates for opensuse, refactor cross deps
Move linux distribution detection into `detect_os()` in the core.

The appropriate routine is then called with eval.

Move linux deps installation (for fedora previously) from
`linux-cross-builder` to `mingw-cross.sh` using the `linux_distribution`
variable set by `detect_os()`.

Add a routine to install suse cross dependencies as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-15 23:38:26 +00:00
Rafael Kitover 286d7ee93a builder: fix 32bit mac build
Compile libicu not in cross mode for 32 bit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-02-25 03:07:08 -08:00
Rafael Kitover d94d6d5363 osx builder: add -stdlib=libc++ to CFLAGS/LDFLAGS
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.
2019-01-22 18:50:33 -08:00
ZachBacon 3eb591cac5 Update wxwidgets to 3.1.2 2019-01-21 15:27:03 -05:00
ZachBacon 8628db1359 Revert faudio inclusion, causing builder to fail because I didn't properly hook up the build instructions, will try and fix later 2019-01-10 16:34:58 -05:00
ZachBacon a7773bc96f Bump FAudio to 19.01 2019-01-02 18:00:51 -05:00
ZachBacon 969046ea83 Add faudio to the build script 2018-12-26 06:21:25 -05:00
Rafael Kitover 3cb38420bd builder: add patch for glibc 2.28 compat to m4
glibc 2.28 breaks the gnulib shipped with m4, this patch from gentoo
makes it compile.
2018-12-06 14:28:46 -08:00
Rafael Kitover 61b3084e4a builder: set host cc for libgpg-error to gcc
Set the var CC_FOR_BUILD=gcc in the core build environment. This is used
by libgpg-error to make host build tools when cross compiling, may be
used by other things as well.
2018-12-06 14:27:17 -08:00
Rafael Kitover 3b185e235e builder: libvorbis fix
libvorbis autogen.sh calls the version-suffixed autoconf/automake
scripts, which ends up calling the wrong scripts, so remove the
autogen.sh and reconfigure manually.
2018-12-05 01:59:51 -08:00
Rafael Kitover c68f372e5a fix wrong copy-pasta in 36e412df
Set the CPPFLAGS/CFLAGS/CXXFLAGS/OBJCXXFLAGS variables correctly in
build_dist(), were set incorrectly in 36e412df.
2018-12-03 16:24:42 -08:00
Rafael Kitover 36e412df53 builder: mingw: fix libffi for i686 + improvemnts
Add the tables DIST_EXTRA_{CPPFLAGS,CFLAGS,CXXFLAGS,OBJCXXFLAGS} for
adjustments during builds.

Add -DSYMBOL_UNDERSCORE to DIST_EXTRA_CPPFLAGS for libffi on mingw when
the target is i686, see:

https://bugzilla.mozilla.org/show_bug.cgi?id=1336569

Also set target_bits and target_cpu appropriately in the msys2 script.
2018-12-03 00:37:04 -08:00
Rafael Kitover 5b0f2e8aa6 builder: msys2: fix links to host binaries
Factor out non-environment code from host_env()/target_env() into
host_env_base()/target_env_base(). Such as that for creating symlinks to
root, link host binaries to the target root, as well as calling the
hook.

Call the _base() functions from the msys2 overrides so that symlinks are
created properly, remove redundant symlink code.
2018-12-02 20:35:29 -08:00
Rafael Kitover db8aaeca87 builder: mingw: build zlib-target after cmake
Since mingw zlib is built with cmake, move the dist to after cmake in
the build order.
2018-11-27 06:18:46 -08:00
Rafael Kitover beaf934082 builder: bump libxslt 1.1.33-rc1 -> 1.1.33-rc2 2018-11-27 04:51:53 -08:00
Rafael Kitover afbe647aed builder: catgets fix for msys2 + minor changes
Change `ln -s` to `cp` in the catgets makefile in the applied patch,
this is used for making symlinks to some header files, this will
hopefully fix building catgets for @ZachBacon on msys2. There seems to
be a problem with the mingw gcc reading headers that are symlinks, even
if they are real windows symlinks.

Also slightly refactor checking for target built files. Add the `-f`
flag for `install_artifact([-f] $dist)` for the full path to the target
file, and add the helper functions `check_install_artifact($dist)` and
`check_install_artifact_relative($dist $root_path)`.

These helper functions also display error messages if the target file
does not exist, as opposed to the previous behavior where it would just
silently exit nonzero.
2018-11-23 09:48:48 -08:00
Rafael Kitover a6034ddfa2 builder: disable building openssl tests
Remove the build_tests dependency from build_all in the openssl makefile
due to a possible build issue on msys2.
2018-11-18 09:03:24 -08:00
Rafael Kitover 9ebc3fc28c builder: build mingw dlfcn after cmake
dlfcn requires cmake to build.
2018-11-16 02:19:05 -08:00
Rafael Kitover 115fce6958 builder: do not defer env eval for msys2 host hook
Do not defer evaluating $BUILD_ENV in the msys2 host/target environment
overrides, as that causes the subsequent eval to try to run the variable
as a command.
2018-11-15 19:22:56 -08:00
Rafael Kitover b9911a5759 builder: fix regressions from 37869441..a3ec309b
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
2018-11-15 01:54:19 -08:00
Rafael Kitover a3ec309bd6 builder: more minor mingw cross fixes
Do not defer evaluating build env variables in mingw-cross.sh, this
interferes with switching them between host/target.

In build_dist() adjust the LDFLAGS and LIBS after pre_build has run,
because host/target env setting happens in pre_build and adjustments get
lost.
2018-11-12 09:48:35 -08:00
Rafael Kitover d725978abf builder: fix openssl parallel make patch
Fix sed regex for the openssl POST_CONFIGURE to work with the mac/BSD
sed (anchor to beginning of line.)
2018-11-12 05:40:24 -08:00
Rafael Kitover cf3ed8f370 builder: fix quoting issues introduced in 37869441
In host_env/target_env/etc. functions, quote all variables values so
that they pass through eval correctly.
2018-11-12 04:47:59 -08:00
Rafael Kitover 37869441d2 builder: msys2 fixes + misc improvements
- Fix leading spaces in build env vars.

- Pass -Dcc="$CC" to the c2man metaconfig, it tries to use cc on msys2
  which fails.

- Pass LDFLAGS to openssl make to fix link errors.

- Change the host_env, target_env and related functions to output a list
  of commands for eval.

- Add a --host-env flag to output the host env for cross build
  environments.

- Ignore symlink failures when installing dists, symlinks fail on msys2
  sometimes for some reason.

- Put libicu in the list of both host and target dists only in
  mingw-cross, the host libicu does not build on msys2, and everything
  works fine without it.

- Add -j1 to openssl make args to disable parallel builds for the msys2
  and cygwin host builds, because they fail otherwise.

- Add "-ldl -lcatgets -lws2_32" to libicu LDFLAGS for the target build,
  ws2_32 may be necessary for 32 bit builds.
2018-11-12 04:07:48 -08:00
Rafael Kitover 1bf51ec1fa builder: 32 bit mingw fixes
Add -lm (the math library) to CFLAGS/CXXFLAGS/OBJCXXFLAGS/LDFLAGS and
LIBS for the cases where it is used but not explicitly linked.

Improve the sed script to override building the openal native tools as
it was failing for mingw 32 bit. Add -lm and remove flags from the
environment.
2018-10-14 21:34:00 -07:00
Rafael Kitover ed8c928adb builder: support gentoo crossdev + misc fixes
Support the gentoo crossdev mingw environment for the mingw cross
builder:

- For the cmake toolchains, add /usr/<arch>/usr to root paths, as this
  is the mingw root for crossdev.

- -Wno-error=all no longer works with gcc 8.2, instead remove all
  -Werror flags in dist_post_configure().

- Also remove all -I/usr/include flags in dist_post_configure().

- Don't prepend ROOT/host/bin to the PATH globally, only in
  set_host_env(). This way the target config scripts are correctly found
  in PATH.

- Bump openssl 1.0.2o -> 1.0.2p, cmake 3.10.3 -> 3.13.0-rc1, gd 2.2.4 ->
  2.2.5 and glib 2.57.2 -> 2.58.1.

- Add libicu unicode handling library, needed by some deps. Put into the
  list of dists that must be built for both the host and the target. Use
  a whole bunch of patches from MSys2 for it.

- Make openssl build in parallel by using a sed script to prepend a + to
  the appropriate make rules.

- Replace fontconfig EXTRA_LIBS with MAKE_ARGS: LIBS="-lintl -liconv"
  because these libs were being stripped out from LIBS and LDFLAGS.

- Add V=1 VERBOSE=1 to all make invocations for extra verbosity (to see
  compile/link invocations.)

- As a consequence, use dist_ninja_args() for ninja, it will still take
  options in DIST_MAKE_ARGS.

- Add CONFIGURE_TYPE "cmakeninja" which is like the "cmake" type except
  with -G Ninja to use the ninja generator and built with ninja. Nothing
  uses this yet.

- Fix dist_patch() output for already applied patches.

- Add -L/usr/<arch>/usr/lib64 to CFLAGS/CXXFLAGS/OBJCXXFLAGS/LDFLAGS,
  because crossdev libpthreads.a is in that directory and it's not in
  gcc search paths. It cannot go into CPPFLAGS because those are used
  for windres invocations, and windres errors out with non-cpp flags.

- Add -DMINGW_HAS_SECURE_API to all flags to fix a problem with the
  mingw headers in crossdev.

- Add -lpthread to a default LIBS env var so that it's often linked last
  against any libraries that may need it, at least for autoconf.

- Set the PKG_CONFIG env var to the path of the built pkg-config binary,
  not exactly sure why this was necessary.

- Overhaul environment variable saving/restoring for set_host_env() so
  that more variables are covered and have good host defaults.

- Add the dlfcn-win32 for mingw for dependencies that need -ldl.

- Add some MSys2 patches for fontconfig.

- Use a sed script to fix the native tools compilation when cross
  compiling openal.

- Replace the fedora glib patches for mingw with MSys2 ones for the
  newer glib.

- Add --with-threads=posix --disable-libelf to glib DIST_ARGS.
2018-10-11 06:55:53 -07:00
ZachBacon b60cd3326f Update openal to use github url 2018-10-07 22:42:59 -04:00
Rafael Kitover b9d0f81843 builder: fix ccache on msys2
Apply msys2 patch for ccache, otherwise it hangs when compiling.
2018-09-16 10:13:04 -07:00
Rafael Kitover be0d49a304 builder: msys2 fixes
Build zlib before ccache so that ccache does not try to use its bundled
zlib, which does not compile cleanly on cygwin/msys2.

A couple of related PRs for ccache:

https://github.com/ccache/ccache/pull/311
https://github.com/ccache/ccache/pull/310

Replace the usage of xzcat/bzcat in archive unpacking with `xz -dc` and
`bzip2 -dc` because @ZachBacon had some issues with xzcat trying to
compress instead of decompress.

When switching msys2 build modes, unset related env vars first,
sometimes they can get mixed up for some reason.
2018-09-12 17:21:40 -07:00
Rafael Kitover 3aa00bfbbf builder: fix libuuid_mingw for mingw cross
Unset UUID_LIBS when building host fontconfig, which contains
-luuid_mingw for the cross fontconfig.

Add trailing semicolons on core POST_BUILD actions.
2018-09-08 19:59:07 +00:00
Rafael Kitover 5b5e319378 builder: don't install cpanm with local::lib
Don't pass -I to cpan when installing App::cpanminus, because that may
ignore our env vars and put things into ~/perl5 .
2018-09-08 19:48:29 +00:00
Rafael Kitover 88f66ef6f8 builder: fix building ccache for win targets
Add ccache as a host dist when compiling with mingw.
2018-09-08 19:08:00 +00:00
Rafael Kitover d1c82cac9e fix typo in builder core
Fix line with a / at the beginning which causes a syntax error.
2018-09-05 12:12:18 -07:00
Rafael Kitover dcd7d5e092 support 32/64 bit mac builds, build improvements
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
2018-09-04 08:29:24 -07:00
Rafael Kitover 571ecbe3e8 support mac-hosted mingw builds, misc. fixes
- Add the cross root from the mingw-w64 mac brew to the cmake toolchain
  files.

- Remove strerror_r/strerror_s from ConfigManager.cpp because the
  mingw-w64 brew does not support strerror_s for some reason.

- Strip the vbam executable from the builder script in the build_project
  phase.

- Change the bzip2 URL to the github mirror because the bzip.org domain
  expired.

- Add libuuid as it's required by the new fontconfig, use the mingw
  version for mingw builds, for mingw also set UUID_LIBS to
  '-luuid_mingw -luuid' in mingw.sh for fontconfig, the mingw version
  is called uuid_mingw because uuid is a core win32 library.

- Lower glib version to 2.57.2 stable.

- Update wxwidgets version to current master sha.

- Fix a bug in flex-2.5.3 post_build where it tries to build flex
  current but flex has been removed, and it was just rebuilding 2.5.3.

- Fix "aggressive" relocation and the relocation of .l[ao] and .pc files
  in install_dist to ignore /usr/local, and only match /usr.

- Add a "project" pre_build and post_build hooks.

- Add getopt to host-only dists in mingw-cross.sh.

- Use perl instead of readlink -f to get the absolute path of the cmake
  toolchain files in mingw-cross.sh, as readlink -f is linux-only.

- In mingw-cross.sh, replace the glib post_build to rebuild
  gettext-target instead of gettext --without-included-glib.

- Add overridable functions set_host_env_hook and unset_host_env_hook in
  mingw.sh to override in other scripts, in this case mac-cross-builder.

- Update mingw glib patches to current fedora versions.

- Add tools/win/mac-cross-builder script to build mingw windows binaries
  on mac, it borrows some necessary parts from the mac native builder
  for host dists, and inherits from mingw-cross.sh.

TODO: currently the resulting mac-built binary segfaults due to gcc
8.2.0, just as the msys2-built binary does, this is a separate issue.
2018-08-10 04:31:05 -07:00
Rafael Kitover 594ecc3947 msys2 builder: redo fontconfig patch, bumb wx
Replace fontconfig gperf bug workaround patch with the one worked out in
the upstream bugzilla report.

Bump wxWidgets version up to current sha to fix an incompatibility with
mingw.
2018-08-01 01:48:52 -07:00
Rafael Kitover 6bc301018f update msys2 builder
Bump freetype2 and fontconfig versions.

Add patch to fix a gperf bug that causes an error in the fontconfig
build to fontconfig (.gperf file must not have blank lines.)

Add -lintl -liconv to extra libs for fontconfig.
2018-07-30 20:50:15 -07:00
Rafael Kitover 459a1fbebb builder: fix ccache, mingw-cross
Update mingw cmake toolchain files to work-around a bug in cmake where
find_program() would return the current working directory instead of the
executable path if CMAKE_C_COMPILER and related are passed on the
command line.

Fix $CC/$CC_ORIG and $CXX/$CXX_ORIG handling for the core and
mingw-cross (_ORIG is without ccache.)
2018-07-01 22:18:59 -04:00
Rafael Kitover f937aa72f5 builder: disable ccache for openssl
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.
2018-06-30 15:48:58 -07:00
Rafael Kitover 68028b503b minor fix for mingw cross build
Fix regex that changes the command to rebuild freetype with harfbuzz for
cross building, as previous commit fixed that command.
2018-06-30 07:50:05 -04:00
Rafael Kitover 498019a39b support older 32 bit macs running 10.7, fix build
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.
2018-06-30 03:40:47 -07:00
Rafael Kitover 63431916a7 fix 2 broken URLs in builder script
The libxslt and urw URLs were broken, replace them with working ones.
2018-06-27 14:36:34 -07:00
Rafael Kitover 430b5d638d fix Mac OS 10.13 build issues
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
2018-06-17 16:01:40 -07:00
Rafael Kitover 85dea8a57b add cygwin cross build support
Put shared code for linux cross builds and cygwin cross builds into
builder/mingw-cross.sh .

Call wxrc when the build platform is cygwin with files resolved via
`cygpath -m` in case the wxrc is a native binary.

Add -fpermissive to CXX/OBJCXX flags.

Reenable libzvbi support for ffmpeg.

Stop building ffmpeg and related dists by default until we fix game
recording.

Set CMAKE_PREFIX_PATH in cmake args as a FILEPATH type variable.

Support xml catalog made with native libxml2 using cygpath in related
commands, make cygpath a noop on non-cygwin platforms.

Remove gdb and zip from msys2 deps.

Add a cygwin installdeps routine using a copy of cyg-apt that it
fetches.

When creating symlinks in install_dist() fully resolve all symlinks in
path parts for the source file, so that host and target binaries are
correctly linked.

When cp -af fails to preserve permission related data, fall back to cp
-rf.

When installing libs with a cross suffix, make a symlink for the lib
without the cross suffix.

Make sure cygwin runs with CYGWIN=winsymlinks:native .

Add paths to host gettext executables to cmake args, otherwise it tries
to use the target executables and fails on paths.

For the pkgconfig bundled glib, turn off win32 platform for the cygwin
host build.

For gettext, remove --disable-auto-import from link flags.

Compile target freetype on cygwin with cmake and manually install the
pkgconfig .pc file using sed.

Add a relocation type 'aggressive', when a dist is marked with this
type, rewrite all '/usr' prefixes to the build root. By default only
files that exist in the dist are matched and rewritten.

Fix regression in linux build by adding some iconv related flags to the
cmake invocation for doxygen and disabling -Werror for xorg dists.

When relocating scripts, use the actual resolved root path for host or
target.

Build libxslt --without-python so that it doesn't try to pick up the
msys2 python.

Other misc. minor tweaks and cleanups.
2018-05-01 04:11:57 -04:00
ZachBacon 9933b6bb7e if cross compiling openssl, need to add --cross-compile-prefix=- 2018-04-20 20:39:19 -04:00
Rafael Kitover 55caf62e01 win cross script: pass RANLIB to openssl make
Pass RANLIB=${prefix}-ranlib to openssl for the linux mingw cross
compile script.
2018-04-20 16:40:03 -04:00
Rafael Kitover 9cd26b255f windows cross build script: use autoconf for bzip2
When cross compiling bzip2, it may use host tools such as ranlib instead
of the cross tools.

Apply the msys2 autotools patch to the cross bzip2 and move it to after
automake in the chain.
2018-04-20 15:49:18 -04:00
Rafael Kitover d5f90f0a05 fix SDL sound on windows
In SoundSDL, when building on windows add this init code:

```
SDL_setenv("SDL_AUDIODRIVER", "directsound", true);
```

Otherwise there is no sound on windows.

Also update SDL to 2.0.8 from 2.0.7 in build scripts.
2018-04-16 13:10:12 -04:00