visualboyadvance-m/tools/win/cygwin-cross-builder

69 lines
2.1 KiB
Plaintext
Raw Normal View History

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 08:09:41 +00:00
#!/bin/sh
set -e
# turn on real symlinks on cygwin
if [ "$(uname -o 2>/dev/null || :)" = Cygwin ]; then
new_cygwin= replaced=
for part in $CYGWIN; do
case "$part" in
winsymlinks:*)
new_cygwin="$new_cygwin winsymlinks:native"
replaced=1
;;
*)
new_cygwin="$new_cygwin $part"
;;
esac
done
if [ -n "$replaced" ]; then
export CYGWIN=$new_cygwin
else
export CYGWIN="winsymlinks:native $new_cygwin"
fi
fi
REQUIRED_CMAKE_ARGS="-DGETTEXT_MSGFMT_EXECUTABLE:FILEPATH=\"\$BUILD_ROOT/host/bin/msgfmt\" -DGETTEXT_MSGMERGE_EXECUTABLE=\"\$BUILD_ROOT/host/bin/msgmerge\""
. "${0%/*}/../builder/mingw-cross.sh"
table_line_append DIST_MAKE_ARGS unzip 'CFLAGS="$CFLAGS -DNO_LCHMOD"'
# parallel build of openssl doesn't work for cygwin layer
table_line_append DIST_MAKE_ARGS openssl -j1
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 08:09:41 +00:00
# FIXME: problems with autopoint that need to be sorted
table_line_remove DISTS flex
table_line_append DIST_PRE_BUILD pkgconfig ":; \
sed -i.bak ' \
s/platform_win32=yes/platform_win32=no/; \
s/#define G_PLATFORM_WIN32//; \
s/PLATFORMDEP=gwin32\\.lo/PLATFORMDEP=/ \
' glib/configure; \
"
table_line_append DIST_PRE_BUILD c2man ":; \
sed -i.bak '/test -d c:\\//,/^fi\$/d' Configure; \
"
table_line_replace DIST_CONFIGURE_TYPES freetype-target cmake
table_line_remove DIST_ARGS freetype-target
table_line_append DIST_POST_BUILD freetype-target ":; \
sed ' \
s,%prefix%,$BUILD_ROOT/root,g; \
s,%exec_prefix%,$BUILD_ROOT/root,g; \
s,%libdir%,$BUILD_ROOT/root/lib,g; \
s,%includedir%,$BUILD_ROOT/root/include,g; \
s,%ft_version%,20.0.14,g; \
s|%REQUIRES_PRIVATE%|zlib, bzip2, libpng|; \
s,%LIBS_PRIVATE%,-lpng -lz -lbz2 -llzma -lharfbuzz,; \
s/-lfreetype/-lfreetype -lpng -lz -lbz2 -llzma/; \
' ../builds/unix/freetype2.in > "$BUILD_ROOT"/root/lib/pkgconfig/freetype2.pc; \
"
table_line_append DIST_EXTRA_LIBS fontconfig-target '-lpng -lz -lbz2 -llzma'
builder "$@"