[gnome-build-meta/abderrahim/cross-compile-fix] project.conf: set cmake and autotools cross-compile options globally



commit ede96275fb0c1142c62f78a504a0432f1fbf2ef6
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Fri Dec 21 07:23:41 2018 +0100

    project.conf: set cmake and autotools cross-compile options globally

 elements/core-deps/mozjs52.bst |  8 +-------
 elements/sdk/WebKitGTK+.bst    | 14 ++++----------
 files/webkitgtk/toolchain.arm  |  2 --
 files/webkitgtk/toolchain.i686 |  2 --
 project.conf                   | 22 ++++++++++++++++++++--
 5 files changed, 25 insertions(+), 23 deletions(-)
---
diff --git a/elements/core-deps/mozjs52.bst b/elements/core-deps/mozjs52.bst
index fa9dcba..24dfbdc 100644
--- a/elements/core-deps/mozjs52.bst
+++ b/elements/core-deps/mozjs52.bst
@@ -13,14 +13,8 @@ depends:
   junction: freedesktop-sdk.bst
 variables:
   mozjs_target: ''
-  (?):
-    - arch == "i686":
-        mozjs_target: "--host=i686-unknown-linux-gnu"
-    - arch == "arm":
-        mozjs_target: "--host=arm-unknown-linux-gnueabi"
   command-subdir: _build
-  conf-local: --enable-posix-nspr-emulation --with-system-zlib --with-intl-api --disable-jemalloc 
%{mozjs_target}
-    AUTOCONF=autoconf
+  conf-local: --enable-posix-nspr-emulation --with-system-zlib --with-intl-api --disable-jemalloc 
AUTOCONF=autoconf
   conf-cmd: '%{build-root}/js/src/configure'
   # not a real autotools project
   autogen: ''
diff --git a/elements/sdk/WebKitGTK+.bst b/elements/sdk/WebKitGTK+.bst
index 5d82edc..595735d 100644
--- a/elements/sdk/WebKitGTK+.bst
+++ b/elements/sdk/WebKitGTK+.bst
@@ -10,10 +10,6 @@ sources:
   path: files/webkitgtk/i686-build.patch
 - kind: patch
   path: files/webkitgtk/gtk-doc-introspection-cross-compiling.patch
-- kind: local
-  path: files/webkitgtk/toolchain.i686
-- kind: local
-  path: files/webkitgtk/toolchain.arm
 depends:
 - sdk/at-spi2-core.bst
 - sdk/brotli.bst
@@ -51,17 +47,15 @@ depends:
 - filename: base-platform.bst
   junction: freedesktop-sdk.bst
 variables:
-  webkitgtk_toolchain: ''
+  webkitgtk-extra: ''
   (?):
-    - arch == "i686":
-        webkitgtk_toolchain: -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=toolchain.i686
-    - arch == "arm":
-        webkitgtk_toolchain: -DCMAKE_TOOLCHAIN_FILE=toolchain.arm
+  - arch == "i686":
+      webkitgtk-extra: -DCMAKE_BUILD_TYPE=Release
   cmake-local:
     -DPORT=GTK
     -DENABLE_PLUGIN_PROCESS_GTK2=OFF
     -DENABLE_BUBBLEWRAP_SANDBOX=OFF
-    %{webkitgtk_toolchain}
+    %{webkitgtk-extra}
 (?):
 - arch == "i686":
     environment:
diff --git a/project.conf b/project.conf
index 6f13494..9e9a7e3 100644
--- a/project.conf
+++ b/project.conf
@@ -98,7 +98,14 @@ environment:
 elements:
   autotools:
     variables:
-      conf-extra: --disable-static --disable-Werror
+      target: ''
+      (?):
+      - arch == "i686":
+          target: --host=i686-unknown-linux-gnu
+      - arch == "arm":
+          target: --host=arm-unknown-linux-gnueabi
+
+      conf-global: --disable-static --disable-Werror %{target}
 
       # Temporary workaround to avoid regenerating existing
       # configure scripts when building tarballs.
@@ -123,8 +130,19 @@ elements:
 
   cmake:
     variables:
-      cmake-global: -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      toolchain: ''
+      cmake-global: -DCMAKE_BUILD_TYPE=RelWithDebInfo %{toolchain}
       generator: Ninja
+    (?):
+    - arch in ("i686", "arm"):
+        variables:
+          toolchain: -DCMAKE_TOOLCHAIN_FILE=toolchain
+        config:
+          configure-commands:
+            (<):
+              - |
+                echo 'set(CMAKE_SYSTEM_NAME Linux)' > toolchain
+                echo 'set(CMAKE_SYSTEM_PROCESSOR %{arch})' >> toolchain
   distutils:
     variables:
       prefix: /usr/local


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]