Source: latencytop
Version: 0.5
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

latencytop fails to cross build from source, because the upstream build
system hard codes build architecture build tools. The attached patch
makes them substitutable and cdbs substitutes them, so it makes
latencytop cross build successfully. Please consider applying it.
Regarding your question "FIXME: Use autoconf?" I can say that autoconf
would most likely have avoided this bug report.

Helmut
diff --minimal -Nru latencytop-0.5/Makefile latencytop-0.5+nmu1/Makefile
--- latencytop-0.5/Makefile	2018-05-28 20:41:44.000000000 +0200
+++ latencytop-0.5+nmu1/Makefile	2018-05-28 20:40:37.000000000 +0200
@@ -1,16 +1,17 @@
 # FIXME: Use autoconf ?
 HAS_GTK_GUI = 1
 
+PKG_CONFIG ?= pkg-config
 DESTDIR =
 SBINDIR = /usr/sbin
-XCFLAGS = -W  -g `pkg-config --cflags glib-2.0` -D_FORTIFY_SOURCE=2 -Wno-sign-compare -I/usr/include/ncursesw
-LDF = -Wl,--as-needed `pkg-config --libs glib-2.0`   -lncursesw 
+XCFLAGS = -W  -g `$(PKG_CONFIG) --cflags glib-2.0` -D_FORTIFY_SOURCE=2 -Wno-sign-compare -I/usr/include/ncursesw
+LDF = -Wl,--as-needed `$(PKG_CONFIG) --libs glib-2.0`   -lncursesw 
 
 OBJS= latencytop.o text_display.o translate.o fsync.o
 
 ifdef HAS_GTK_GUI
-  XCFLAGS += `pkg-config --cflags gtk+-2.0` -DHAS_GTK_GUI
-  LDF += `pkg-config --libs gtk+-2.0`
+  XCFLAGS += `$(PKG_CONFIG) --cflags gtk+-2.0` -DHAS_GTK_GUI
+  LDF += `$(PKG_CONFIG) --libs gtk+-2.0`
   OBJS += gtk_display.o 
 endif
 
@@ -26,10 +27,10 @@
 
 # We write explicity this "implicit rule"
 %.o : %.c
-	gcc -c $(CFLAGS) $(XCFLAGS) $< -o $@
+	$(CC) -c $(CFLAGS) $(XCFLAGS) $< -o $@
 
 latencytop:  $(OBJS) latencytop.h Makefile
-	gcc $(CFLAGS) $(OBJS) $(LDF) -o latencytop 
+	$(CC) $(CFLAGS) $(OBJS) $(LDF) -o latencytop 
 
 clean:
 	rm -f *~ latencytop DEADJOE *.o

Reply via email to