From 8ba0077ea3b946efff40cd96ee0bfb36c776dfca Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Thu, 21 May 2020 19:53:42 +0200 Subject: [PATCH] Add shell script and cross-compilation file to compile Harfbuzz with meson --- meson-mingw-cross.txt | 17 +++++++++++++++++ mingw-meson.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 meson-mingw-cross.txt create mode 100644 mingw-meson.sh diff --git a/meson-mingw-cross.txt b/meson-mingw-cross.txt new file mode 100644 index 000000000..00de34474 --- /dev/null +++ b/meson-mingw-cross.txt @@ -0,0 +1,17 @@ +[binaries] +c = '@host@-gcc' +cpp = '@host@-g++' +ar = '@host@-ar' +ranlib = '@host@-ranlib' +strip = '@host@-strip' +windres = '@host@-windres' +pkgconfig = 'pkg-config' + +[host_machine] +system = 'windows' +cpu_family = '@cpu@' +cpu = '@cpu@' +endian = 'little' + +[properties] +cpp_args = ['-D_WIN32_WINNT=0x0601', '-O2', '-pipe', '-march=@arch@'] diff --git a/mingw-meson.sh b/mingw-meson.sh new file mode 100644 index 000000000..9e871a3d2 --- /dev/null +++ b/mingw-meson.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# Usage: ./mingw-meson.sh prefix host +# host being i686 or x86_64 + +case $2 in + i686 | x86_64) ;; + *) echo "Usage: $0 prefix i686|x86_64" >&2; exit 1 ;; +esac + +cpu=$2 +host=$2-w64-mingw32 +if test "x$2" = "xx86_64" ; then + arch=x86-64 +else + arch=i686 +fi + +rm -rf builddir && mkdir builddir && cd builddir && cp ../meson-mingw-cross.txt . + +sed -i -e "s/@cpu_family@/$cpu/g;s/@cpu@/$cpu/g;s/@host@/$host/g;s/@arch@/$arch/g" meson-mingw-cross.txt + +meson .. \ + --prefix=$1 \ + --libdir=lib \ + --buildtype=release \ + --strip \ + --cross-file meson-mingw-cross.txt \ + --default-library shared \ + -Dgraphite=enabled + +ninja +ninja install