Bug#941296: tuxcmd-modules FTCBFS: uses build architecture build tools
Source: tuxcmd-modules
Version: 0.6.70+ds-5
Tags: patch upstream
User: debian-cross@lists.debian.org
Usertags: ftcbfs
tuxcmd-modules fails to cross build from source, because it uses build
architecture build tools. Some (like pkg-config) are simply hard coded.
For others it uses wildly varying variable names making substitution
impossible. The attached patch makes tuxcmd-modules use standard
variables. Please consider applying it.
Helmut
--- tuxcmd-modules-0.6.70+ds.orig/zip/Makefile
+++ tuxcmd-modules-0.6.70+ds/zip/Makefile
@@ -6,7 +6,8 @@
# compiler options
CC = gcc
-CPP = g++
+CXX = g++
+PKG_CONFIG ?= pkg-config
CFLAGS =-I. -I$(DIR_ZIPARCHIVE) -I/usr/include \
-Wall -fPIC -O2 -g \
-DG_DISABLE_DEPRECATED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE \
@@ -21,15 +22,15 @@
.SUFFIXES: .c .cpp
.c.o:
- $(CPP) $(CFLAGS) `pkg-config glib-2.0 --cflags` -c $<
+ $(CXX) $(CFLAGS) `$(PKG_CONFIG) glib-2.0 --cflags` -c $<
.cpp.o:
- $(CPP) $(CFLAGS) `pkg-config glib-2.0 --cflags` -c $<
+ $(CXX) $(CFLAGS) `$(PKG_CONFIG) glib-2.0 --cflags` -c $<
all shared static: libzip_plugin.so
libzip_plugin.so: ziparchive $(VFS_COMMON_OBJECTS) $(VFS_CPP_OBJECTS) $(VFS_C_OBJECTS)
- $(CPP) -shared -o libzip_plugin.so zip.o $(VFS_COMMON_OBJECTS) $(DIR_ZIPARCHIVE)libziparch.a -lz -lm $(CFLAGS) `pkg-config glib-2.0 --libs`
+ $(CXX) -shared -o libzip_plugin.so zip.o $(VFS_COMMON_OBJECTS) $(DIR_ZIPARCHIVE)libziparch.a -lz -lm $(CFLAGS) `$(PKG_CONFIG) glib-2.0 --libs`
ziparchive:
( cd $(DIR_ZIPARCHIVE) && make -f ../Makefile.ziparch ) || exit 1
--- tuxcmd-modules-0.6.70+ds.orig/zip/Makefile.ziparch
+++ tuxcmd-modules-0.6.70+ds/zip/Makefile.ziparch
@@ -10,12 +10,6 @@
#otherwise, the system's bzip2 library will be used
#INTERNAL_BZIP2 = 1
-CC=g++
-
-CCC=cc
-#CCC=gcc
-
-
CFLAGS = -D ZIP_ARCHIVE_LNX -fPIC -g -O2
#CFLAGS =
@@ -56,9 +50,9 @@
.SUFFIXES: .c .cpp
.c.o:
- $(CCC) $(CFLAGS) $(INCLUDES) -c -o $*.o $<
+ $(CC) $(CFLAGS) $(INCLUDES) -c -o $*.o $<
.cpp.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c $<
+ $(CXX) $(CFLAGS) $(INCLUDES) -c $<
OBJS = $(ZLIBLOCATION)adler32.o $(ZLIBLOCATION)compress.o $(ZLIBLOCATION)crc32.o $(ZLIBLOCATION)uncompr.o $(ZLIBLOCATION)deflate.o $(ZLIBLOCATION)trees.o \
$(ZLIBLOCATION)zutil.o $(ZLIBLOCATION)inflate.o $(ZLIBLOCATION)infback.o $(ZLIBLOCATION)inftrees.o $(ZLIBLOCATION)inffast.o\
@@ -148,7 +142,7 @@
-rm -f *.o *~ $(ZIPARCHLIB) $(ZLIBLOCATION)*.o $(ZLIBLOCATION)*~ $(BZIP2LOCATION)*.o $(BZIP2LOCATION)*~
zippie:
- $(CC) -I$(zipardir) $(CFLAGS) -o zippie $(ZIPPIELOCATION)zippie.cpp $(ZIPPIELOCATION)CmdLine.cpp $(LIBS)
+ $(CXX) -I$(zipardir) $(CFLAGS) -o zippie $(ZIPPIELOCATION)zippie.cpp $(ZIPPIELOCATION)CmdLine.cpp $(LIBS)
#$(CC) -I$(zipardir) -L$(libdir) $(CFLAGS) -o zippie $(ZIPPIELOCATION)zippie.cpp $(ZIPPIELOCATION)CmdLine.cpp $(LIBS)
cleanzippie:
--- tuxcmd-modules-0.6.70+ds.orig/libarchive/Makefile
+++ tuxcmd-modules-0.6.70+ds/libarchive/Makefile
@@ -7,7 +7,8 @@
# compiler options
CC = gcc
-CPP = g++
+CXX = g++
+PKG_CONFIG ?= pkg-config
CFLAGS =-I. -I/usr/include -I$(DIR_COMMON) \
-Wall -fPIC -O2 -g \
-DG_DISABLE_DEPRECATED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE \
@@ -20,20 +21,20 @@
.SUFFIXES: .c .cpp
.c.o:
- $(CC) $(CFLAGS) `pkg-config glib-2.0 --cflags` -c $<
+ $(CC) $(CFLAGS) `$(PKG_CONFIG) glib-2.0 --cflags` -c $<
.cpp.o:
- $(CPP) $(CFLAGS) `pkg-config glib-2.0 --cflags` -c $<
+ $(CXX) $(CFLAGS) `$(PKG_CONFIG) glib-2.0 --cflags` -c $<
all: static
shared: $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS)
- $(CC) -shared -o libarchive_plugin.so $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS) $(CFLAGS) `pkg-config glib-2.0 --libs` -larchive -lz -lbz2
+ $(CC) -shared -o libarchive_plugin.so $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS) $(CFLAGS) `$(PKG_CONFIG) glib-2.0 --libs` -larchive -lz -lbz2
static: CFLAGS += -I$(DIR_LIBARCHIVE)/libarchive
static: lib_libarchive_compile $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS)
- $(CC) -shared -o libarchive_plugin.so $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS) $(DIR_LIBARCHIVE)/.libs/libarchive.a $(CFLAGS) `pkg-config glib-2.0 --libs` -lz -lbz2
+ $(CC) -shared -o libarchive_plugin.so $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS) $(DIR_LIBARCHIVE)/.libs/libarchive.a $(CFLAGS) `$(PKG_CONFIG) glib-2.0 --libs` -lz -lbz2
lib_libarchive_compile:
@which uudecode > /dev/null || exit 1;
--- tuxcmd-modules-0.6.70+ds.orig/gvfs/Makefile
+++ tuxcmd-modules-0.6.70+ds/gvfs/Makefile
@@ -5,6 +5,7 @@
# compiler options
CC = gcc
+PKG_CONFIG ?= pkg-config
CFLAGS =-I. -I/usr/include \
-Wall -fPIC -O2 -g \
-DG_DISABLE_DEPRECATED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
@@ -18,13 +19,13 @@
.SUFFIXES: .c
.c.o:
- $(CC) $(CFLAGS) `pkg-config glib-2.0 gio-2.0 --cflags` -c $<
+ $(CC) $(CFLAGS) `$(PKG_CONFIG) glib-2.0 gio-2.0 --cflags` -c $<
all shared static: libgvfs_plugin.so
libgvfs_plugin.so: $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS)
- $(CC) -shared -o libgvfs_plugin.so $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS) $(CFLAGS) `pkg-config glib-2.0 gio-2.0 --libs`
+ $(CC) -shared -o libgvfs_plugin.so $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS) $(CFLAGS) `$(PKG_CONFIG) glib-2.0 gio-2.0 --libs`
strutils.o: strutils.c strutils.h
treepathutils.o: treepathutils.c treepathutils.h
Reply to: