Bug#980064: scalpel FTCBFS: combines CFLAGS into CC

2022-12-26 Thread Eriberto Mota
Hi guys,

Due an NMU sent to Debian without considering previous commits on
Salsa, I 'injected' this NMU in Salsa and I did cherry-picks to put
all unreleased commits in a position after this NMU. Consequently, the
fix for #980064 is now at:

https://salsa.debian.org/pkg-security-team/scalpel/-/commit/a760f0bd202e2c2164be2d4025964c98dd8aa1a5

Regards,

Eriberto



Bug#980064: scalpel FTCBFS: combines CFLAGS into CC

2021-01-13 Thread Helmut Grohne
Source: scalpel
Version: 1.60-9
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

scalpel fails to cross build from source, because the upstream Makefile
combines CFLAGS into CC. When dh_auto_build overrides CC, the CFLAGS
(including -fcommon) get lost and scalpel fails to build. Please
consider applying the attached patch to separate them and make scalpel
cross buildable.

Helmut
--- scalpel-1.60.orig/Makefile
+++ scalpel-1.60/Makefile
@@ -2,9 +2,8 @@
 CC_OPTS = $(CFLAGS) $(LDFLAGS) $(CPPFLAGS)
 GOAL = scalpel
 
-CC += $(CC_OPTS) 
   .c.o: 
-	$(CC) -c $<
+	$(CC) $(CC_OPTS) -c $<
 
 HEADER_FILES = scalpel.h prioque.h dirname.h
 SRC =  helpers.c files.c scalpel.c dig.c prioque.c base_name.c
@@ -12,18 +11,18 @@
 
 all: linux
 
-linux: CC += -D__LINUX 
+linux: CC_OPTS += -D__LINUX
 linux: $(GOAL)
 
-bsd: CC += -D__OPENBSD 
+bsd: CC_OPTS += -D__OPENBSD
 bsd: $(GOAL)
 
-win32: CC += -D__WIN32 -Ic:\PThreads\include 
+win32: CC_OPTS += -D__WIN32 -Ic:\PThreads\include
 win32: $(SRC) $(HEADER_FILES)
-	$(CC) -o $(GOAL).exe $(SRC) -liberty -Lc:\PThreads\lib -lpthreadGC1
+	$(CC) $(CC_OPTS) -o $(GOAL).exe $(SRC) -liberty -Lc:\PThreads\lib -lpthreadGC1
 
 $(GOAL): $(OBJS) 
-	$(CC) -o $(GOAL) $(OBJS) -lm
+	$(CC) $(CC_OPTS) -o $(GOAL) $(OBJS) -lm
 
 scalpel.o: scalpel.c $(HEADER_FILES) Makefile
 dig.o: dig.c $(HEADER_FILES) Makefile