Source: obsession Version: 20140608-2 Tags: patch upstream User: helm...@debian.org Usertags: rebootstrap
obsession fails to cross build from source, because it generally uses tools for the build architecture: * "gcc" rather than a properly substituted $(CC) * pkg-config without a triplet-prefix * strip, which is unnecessary anyway as dh_strip takes care of that * valac without --cc or --pkg-config The attached patch fixes all of them. Please consider applying it. Helmut
Index: obsession-20140608/Makefile =================================================================== --- obsession-20140608.orig/Makefile +++ obsession-20140608/Makefile @@ -5,10 +5,11 @@ # Building flags. +PKG_CONFIG ?= pkg-config CFLAGS ?=-march=native -mtune=generic -O2 -Wall VALAFLAGS:=$(foreach w,$(LDFLAGS) $(CFLAGS) $(CPPFLAGS),-X $(w)) -CFLAGS +=$(shell pkg-config --cflags gtk+-2.0 dbus-1 x11 gio-unix-2.0) -I. -LDFLAGS+=$(shell pkg-config --libs gtk+-2.0 glib-2.0 dbus-1 x11 gio-unix-2.0) +CFLAGS +=$(shell $(PKG_CONFIG) --cflags gtk+-2.0 dbus-1 x11 gio-unix-2.0) -I. +LDFLAGS+=$(shell $(PKG_CONFIG) --libs gtk+-2.0 glib-2.0 dbus-1 x11 gio-unix-2.0) # PO and MO files LINGUAS= $(shell ls po/*.po) @@ -21,22 +22,19 @@ .c.o: @echo "Compiling $<" - @gcc -o $@ -c $< $(CFLAGS) $(CPPFLAGS) + @$(CC) -o $@ -c $< $(CFLAGS) $(CPPFLAGS) obsession-exit: obsession-exit.o dbus-interface.o obsession-common.o config.h @echo "Building $@" @$(CC) -o $@ $(filter-out %.h,$^) $(LDFLAGS) - @strip -s $@ obsession-logout: obsession-logout.o dbus-interface.o obsession-common.o config.h @echo "Building $@" @$(CC) -o $@ $(filter-out %.h,$^) $(LDFLAGS) - @strip -s $@ xdg-autostart: autostart/xdg-autostart.vala @echo "Building $@" - @valac -o $@ $(VALAFLAGS) $^ - @strip -s $@ + @valac --cc=$(CC) --pkg-config=$(PKG_CONFIG) -o $@ $(VALAFLAGS) $^ po/%.mo: po/%.po msgfmt -o $@ $<