summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre De Jesus DIAZ <jean@foundationdevices.com>2024-02-29 16:20:46 +0100
committerLudovic Courtès <ludo@gnu.org>2024-04-17 12:13:02 +0200
commitc3aba93823583bfebae93ce1b9484a0c37fb3008 (patch)
tree0aea45a462700abb5784b181813237c838485f95
parentaf181ac5d14ae639499ff1a57b5a9d615aee0ed2 (diff)
gnu: ath9k-htc-firmware: Allow using other targets.
* gnu/packages/firmware.scm (ath9k-htc-firmware): Override the TARGET environment variable in the configure script to use xtensa-elf. * gnu/packages/patches/ath9k-htc-firmware-objcopy.patch: Adapt to use TARGET environment variable for objcopy. Change-Id: Ia44f0f25dde532b90168f2f2456412a43ac9af24 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/packages/firmware.scm1
-rw-r--r--gnu/packages/patches/ath9k-htc-firmware-objcopy.patch4
2 files changed, 3 insertions, 2 deletions
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 1d89dfba00..7923f5c908 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -121,6 +121,7 @@
;; 'configure' is a simple script that runs 'cmake' with
;; the right flags.
(substitute* "configure"
+ (("^TARGET.*$") "TARGET=xtensa-elf\n")
(("^TOOLCHAIN=.*$")
(string-append "TOOLCHAIN="
(assoc-ref (or native-inputs inputs) "cross-gcc")
diff --git a/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch b/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch
index 2172f8353f..13c3ca1413 100644
--- a/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch
+++ b/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch
@@ -1,5 +1,5 @@
The firmware is cross-compiled, but the build system ends up using
-'objcopy' instead of 'xtensa-elf-objcopy' by default. Force it to
+'objcopy' instead of '$TARGET-objcopy' by default. Force it to
use the right one.
--- source/target_firmware/configure 2014-10-28 20:57:26.834436561 +0100
@@ -8,7 +8,7 @@ use the right one.
cat > "$TOOLCHAIN_FILE" <<EOF
INCLUDE(CMakeForceCompiler)
-+SET(CMAKE_OBJCOPY xtensa-elf-objcopy)
++SET(CMAKE_OBJCOPY ${TARGET}-objcopy)
SET(CMAKE_SYSTEM_PROCESSOR xtensa)
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN}/$TARGET)
SET(CMAKE_STRIP :)