Source: audtty
Version: 0.1.12-5
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

audtty fails to cross build from source, because it uses the build
architecture compiler and pkg-config. That's unusual for an autotools
project and indeed configure detects the correct compiler. It happens
that Makefile.in fails to pick up the detected compiler. Makefile.in
also tries to detect glib with a hard coded pkg-config. It is much
better to let configure do that detection and have it fail early in case
glib is missing. Please consider applying the attached patch.

Helmut
--- audtty-0.1.12.orig/Makefile.in
+++ audtty-0.1.12/Makefile.in
@@ -7,9 +7,11 @@
 sysconfdir=${DESTDIR}/@sysconfdir@
 
 
+CC=@CC@
 AUDACIOUS_CFLAGS=@AUDACIOUS_CFLAGS@ -I/usr/include/dbus-1.0
-GLIB_CFLAGS=`pkg-config --cflags glib-2.0`
-LDADD=-ldbus-glib-1 -lncursesw -laudclient -lgobject-2.0 `pkg-config --libs glib-2.0 `
+GLIB_CFLAGS=@GLIB_CFLAGS@
+GLIB_LIBS=@GLIB_LIBS@
+LDADD=-ldbus-glib-1 -lncursesw -laudclient -lgobject-2.0 $(GLIB_LIBS)
 
 SOURCES=main.c curses_printf.c playlist.c playlist_jump.c playlist_addurl.c settings.c connect.c browse.c playlist_create.c
 BINS=$(SOURCES:.c=.o)
@@ -19,10 +21,10 @@
 all: audtty
 
 audtty: ${BINS}
-	cc -g -O2 -g2 -Wall -Werror ${LDFLAGS} -o audtty $(BINS) $(LDADD)
+	$(CC) -g -O2 -g2 -Wall -Werror ${LDFLAGS} -o audtty $(BINS) $(LDADD)
 
 .c.o:
-	cc -g -Wall ${AUDACIOUS_CFLAGS} ${GLIB_CFLAGS} ${CFLAGS} -o $@ -c $<
+	$(CC) -g -Wall ${AUDACIOUS_CFLAGS} ${GLIB_CFLAGS} ${CFLAGS} -o $@ -c $<
 
 install: audtty
 	mkdir -p ${bindir}
--- audtty-0.1.12.orig/configure.ac
+++ audtty-0.1.12/configure.ac
@@ -22,6 +22,8 @@
 	[],
 	[AC_MSG_ERROR([Can't find Audacious development files.])])
 
+PKG_CHECK_MODULES([GLIB],[glib-2.0])
+
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([stdlib.h])

Reply via email to