Source: gman
Version: 0.9.3-5.4
User: debian-cr...@lists.debian.org
Usertags: ftcbfs
Tags: patch upstream

gman fails to cross build from source due to multiple issues with the
makefile. For one thing, it hard codes the build architecture
pkg-config. Making it substitutable is part of the solution. Then it
tries to overwrite CC with a C++ compiler and its compiler flags.
Unfortunately, dh_auto_build overrides that assignment. The attached
patch makes it stop use $(CC) and rewrites the relevant rules instead.
Please consider applying it.

Helmut
--- gman-0.9.3.orig/Makefile
+++ gman-0.9.3/Makefile
@@ -2,8 +2,8 @@
 # You can adjust the following variables.
 
 CXX = g++
-CXXFLAGS = -DVERSION=\"0.9.3\" $(shell pkg-config --cflags gtk+-2.0) -O2 -Wall $(DEBUG)
-CC = $(CXX) $(CXXFLAGS)
+PKG_CONFIG ?= pkg-config
+CXXFLAGS = -DVERSION=\"0.9.3\" $(shell $(PKG_CONFIG) --cflags gtk+-2.0) -O2 -Wall $(DEBUG)
 
 prefix ?= /usr
 cgi_bin_prefix = ${prefix}/lib/cgi-bin
@@ -14,12 +14,13 @@
 objectfiles = menu.o mandata.o util.o gman.o list.o context.o task.o \
               taskfunc.o window2.o
 
-GTK_LIBS = $(shell pkg-config --libs gtk+-2.0)
+GTK_LIBS = $(shell $(PKG_CONFIG) --libs gtk+-2.0)
 
 gman: $(objectfiles)
-	$(CC) -rdynamic $(objectfiles) -o gman -lpthread $(GTK_LIBS)
+	$(CXX) $(CXXFLAGS) -rdynamic $(objectfiles) -o gman -lpthread $(GTK_LIBS)
 
 %.o: %.c %.h
+	$(CXX) $(CXXFLAGS) -c $< -o $@
 gman.o: gman.c gman.h menu.h
 menu.o: menu.c menu.h mandata.h util.h
 mandata.o: mandata.c mandata.h util.h mandatadef.h

Reply via email to