Source: cpufetch
Version: 0.98-1
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

cpufetch fails to cross build from source, because it uses uname to
figure out the host architecture cpu, but uname returns information
about the build architecture. A better way is to use cc -dumpmachine.
Please consider applying the attached patch.

Helmut
--- cpufetch-0.98.orig/Makefile
+++ cpufetch-0.98/Makefile
@@ -11,8 +11,8 @@
 COMMON_HDR = $(SRC_COMMON)ascii.h $(SRC_COMMON)cpu.h $(SRC_COMMON)udev.h $(SRC_COMMON)printer.h $(SRC_COMMON)args.h $(SRC_COMMON)global.h
 
 ifneq ($(OS),Windows_NT)
-	arch := $(shell uname -m)
-	ifeq ($(arch), $(filter $(arch), x86_64 i686))
+	arch := $(shell $(CC) -dumpmachine)
+	ifeq ($(arch), $(filter x86_64-% i686-%,$(arch)))
 		SRC_DIR=src/x86/
 		SOURCE += $(COMMON_SRC) $(SRC_DIR)cpuid.c $(SRC_DIR)apic.c $(SRC_DIR)cpuid_asm.c $(SRC_DIR)uarch.c
 		HEADERS += $(COMMON_HDR) $(SRC_DIR)cpuid.h $(SRC_DIR)apic.h $(SRC_DIR)cpuid_asm.h $(SRC_DIR)uarch.h

Reply via email to