forked from openwrt/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openwrt#10503 from LoEE/jpc/master/git-macos-cross
git: fix cross compilation on macOS
- Loading branch information
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
net/git/patches/310-fix-uname-detection-for-crosscompiling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From 9dcf7e679c441b877b63ff8e6dfc3865af6c6720 Mon Sep 17 00:00:00 2001 | ||
From: Mauro Condarelli <mc5686 at mclink.it> | ||
Date: Sun, 22 May 2016 20:44:26 +0200 | ||
Subject: [PATCH 1/1] Fix config.mak.uname to allow cross-compilation | ||
|
||
Current implementation imperatively sets variables from "uname" output. | ||
This breaks cross-compilation because uname is run on host while target | ||
configuration may be different. | ||
|
||
Make current behavior a non-imperative default, so it's possible to | ||
force different values setting make variables. | ||
|
||
To cross-compile it will be necessary to explicitly set the various | ||
uname_X variables to values compatible with target. | ||
No change is needed with normal host compilation. | ||
Patch is trivial. | ||
|
||
Signed-off-by: Mauro Condarelli <mc5686 at mclink.it> | ||
--- | ||
config.mak.uname | 12 ++++++------ | ||
1 file changed, 6 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/config.mak.uname b/config.mak.uname | ||
index 40d6b29..d933b23 100644 | ||
--- a/config.mak.uname | ||
+++ b/config.mak.uname | ||
@@ -1,11 +1,11 @@ | ||
# Platform specific Makefile tweaks based on uname detection | ||
|
||
-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') | ||
-uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') | ||
-uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') | ||
-uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') | ||
-uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') | ||
-uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') | ||
+uname_S ?= $(shell sh -c 'uname -s 2>/dev/null || echo not') | ||
+uname_M ?= $(shell sh -c 'uname -m 2>/dev/null || echo not') | ||
+uname_O ?= $(shell sh -c 'uname -o 2>/dev/null || echo not') | ||
+uname_R ?= $(shell sh -c 'uname -r 2>/dev/null || echo not') | ||
+uname_P ?= $(shell sh -c 'uname -p 2>/dev/null || echo not') | ||
+uname_V ?= $(shell sh -c 'uname -v 2>/dev/null || echo not') | ||
|
||
ifdef MSVC | ||
# avoid the MingW and Cygwin configuration sections |