Source: lm4tools
Version: 3:0.1.3-1
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

lm4tools fails to cross build from source, because the upstream
Makefiles hard code the build architecture pkg-config. Please consider
applying the attached patch to make pkg-config substitutable.

The patch will not make lm4tools cross buildable however as it uses
help2man, which is fundamentally incompatible with cross compilation.
Maybe you can write a real manual page?

Please close this bug even if you fix only the pkg-config issue.

Helmut
--- lm4tools-0.1.3.orig/lm4flash/Makefile
+++ lm4tools-0.1.3/lm4flash/Makefile
@@ -3,11 +3,12 @@
 CC ?= gcc
 CFLAGS += -Wall
 
+PKG_CONFIG ?= pkg-config
 ifeq ($(shell uname),FreeBSD)
 LDFLAGS += -lusb
 else
-CFLAGS += $(shell pkg-config --cflags libusb-1.0)
-LDFLAGS += $(shell pkg-config --libs libusb-1.0)
+CFLAGS += $(shell $(PKG_CONFIG) --cflags libusb-1.0)
+LDFLAGS += $(shell $(PKG_CONFIG) --libs libusb-1.0)
 endif
 
 all: $(EXE)
--- lm4tools-0.1.3.orig/lmicdiusb/Makefile
+++ lm4tools-0.1.3/lmicdiusb/Makefile
@@ -36,6 +36,7 @@
 #// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
 #//
 #//*****************************************************************************
+PKG_CONFIG ?= pkg-config
 ifeq ($(shell uname),Darwin)
 	LIBUSB_CFLAGS := -I/usr/local/include/libusb-1.0
 	LIBUSB_LIBDIR := /usr/local/lib
@@ -50,9 +51,9 @@
 endif
 
 ifeq ($(shell uname),Linux)
-	LIBUSB_CFLAGS ?= $(shell pkg-config --cflags libusb-1.0)
-	LIBUSB_LIBDIR ?= $(shell pkg-config --variable=libdir libusb-1.0)
-	LIBUSB_LIBS ?= $(shell pkg-config --libs-only-l libusb-1.0)
+	LIBUSB_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags libusb-1.0)
+	LIBUSB_LIBDIR ?= $(shell $(PKG_CONFIG) --variable=libdir libusb-1.0)
+	LIBUSB_LIBS ?= $(shell $(PKG_CONFIG) --libs-only-l libusb-1.0)
 endif
 
 VPATH += $(LIBUSB_LIBDIR)

Reply via email to