Source: par Version: 1.52-3 Tags: patch User: helm...@debian.org Usertags: rebootstrap
par fails to cross build from source, because its upstream build system uses the build architecture compiler. It ignores cdbs' passing of cross compilers on the environment and uses CC in an uncommon way: It expects it to contain CFLAGS and -c. The attached patch makes it CC have the usual meaning and makes all compiler invocations use CC. After doing so, par cross builds successfuly. Please consider applying the patch. Helmut
diff -u par-1.52/debian/changelog par-1.52/debian/changelog --- par-1.52/debian/changelog +++ par-1.52/debian/changelog @@ -1,3 +1,11 @@ +par (1.52-3.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix FTCBFS: Add p/patches/cross. Update d/patches/add_Makefile. Closes: + #-1. + + -- Helmut Grohne <hel...@subdivi.de> Sun, 04 Feb 2018 17:15:38 +0100 + par (1.52-3) unstable; urgency=low * debian/README.Debian: diff -u par-1.52/debian/patches/add_Makefile par-1.52/debian/patches/add_Makefile --- par-1.52/debian/patches/add_Makefile +++ par-1.52/debian/patches/add_Makefile @@ -14,7 +14,7 @@ + +include protoMakefile + -+CC = cc $(CFLAGS) -c -D_GNU_SOURCE ++CC := $(CC) $(CFLAGS) -D_GNU_SOURCE + +install: par par.doc + install -o root -g root -m 0755 par $(BIN)/par diff -u par-1.52/debian/patches/series par-1.52/debian/patches/series --- par-1.52/debian/patches/series +++ par-1.52/debian/patches/series @@ -1,3 +1,4 @@ +cross catch_output_errors fix_man_spellings add_Makefile --- par-1.52.orig/debian/patches/cross +++ par-1.52/debian/patches/cross @@ -0,0 +1,46 @@ +From: Helmut Grohne <hel...@subdivi.de> +Subject: fix cross compilation + + * Make CC have the usual semantics: Drop the -c and move it into the rule. + * Make CC and LINK1 substitutable to allow debhelper substituting it. + +--- a/protoMakefile ++++ b/protoMakefile +@@ -34,7 +34,7 @@ + + # Define CC so that the command + # +-# $(CC) foo.c ++# $(CC) -c foo.c + # + # compiles the ANSI C source file "foo.c" into the object file "foo.o". + # You may assume that foo.c uses no floating point math. +@@ -45,9 +45,8 @@ + # time efficiency by defining DONTFREE. + # + # Example (for Solaris 2.x with SPARCompiler C): +-# CC = cc -c -O -s -Xc -DDONTFREE ++# CC = cc -O -s -Xc -DDONTFREE + +-CC = cc -c + + # Define LINK1 and LINK2 so that the command + # +@@ -61,7 +60,7 @@ + # LINK1 = cc -s + # LINK2 = -o + +-LINK1 = cc ++LINK1 = $(CC) + LINK2 = -o + + # Define RM so that the command +@@ -93,7 +92,7 @@ + OBJS = buffer$O charset$O errmsg$O par$O reformat$O + + .c$O: +- $(CC) $< ++ $(CC) -c $< + + par$E: $(OBJS) + $(LINK1) $(OBJS) $(LINK2) par$E