blob: 4b884d2984d843b22564ace775a41575684f83a5 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 9dcf7e679c441b877b63ff8e6dfc3865af6c6720 Mon Sep 17 00:00:00 2001
2From: Mauro Condarelli <mc5686 at mclink.it>
3Date: Sun, 22 May 2016 20:44:26 +0200
4Subject: [PATCH 1/1] Fix config.mak.uname to allow cross-compilation
5
6Current implementation imperatively sets variables from "uname" output.
7This breaks cross-compilation because uname is run on host while target
8configuration may be different.
9
10Make current behavior a non-imperative default, so it's possible to
11force different values setting make variables.
12
13To cross-compile it will be necessary to explicitly set the various
14uname_X variables to values compatible with target.
15No change is needed with normal host compilation.
16Patch is trivial.
17
18Signed-off-by: Mauro Condarelli <mc5686 at mclink.it>
19---
20 config.mak.uname | 12 ++++++------
21 1 file changed, 6 insertions(+), 6 deletions(-)
22
23--- a/config.mak.uname
24+++ b/config.mak.uname
25@@ -4,12 +4,12 @@
26 # Microsoft's Safe Exception Handling in libraries (such as zlib).
27 # Typically required for VS2013+/32-bit compilation on Vista+ versions.
28
29-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
30-uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
31-uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
32-uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
33-uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
34-uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
35+uname_S ?= $(shell sh -c 'uname -s 2>/dev/null || echo not')
36+uname_M ?= $(shell sh -c 'uname -m 2>/dev/null || echo not')
37+uname_O ?= $(shell sh -c 'uname -o 2>/dev/null || echo not')
38+uname_R ?= $(shell sh -c 'uname -r 2>/dev/null || echo not')
39+uname_P ?= $(shell sh -c 'uname -p 2>/dev/null || echo not')
40+uname_V ?= $(shell sh -c 'uname -v 2>/dev/null || echo not')
41
42 ifneq ($(findstring MINGW,$(uname_S)),)
43 uname_S := MINGW