b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From 9dcf7e679c441b877b63ff8e6dfc3865af6c6720 Mon Sep 17 00:00:00 2001 |
| 2 | From: Mauro Condarelli <mc5686 at mclink.it> |
| 3 | Date: Sun, 22 May 2016 20:44:26 +0200 |
| 4 | Subject: [PATCH 1/1] Fix config.mak.uname to allow cross-compilation |
| 5 | |
| 6 | Current implementation imperatively sets variables from "uname" output. |
| 7 | This breaks cross-compilation because uname is run on host while target |
| 8 | configuration may be different. |
| 9 | |
| 10 | Make current behavior a non-imperative default, so it's possible to |
| 11 | force different values setting make variables. |
| 12 | |
| 13 | To cross-compile it will be necessary to explicitly set the various |
| 14 | uname_X variables to values compatible with target. |
| 15 | No change is needed with normal host compilation. |
| 16 | Patch is trivial. |
| 17 | |
| 18 | Signed-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 |