void-packages/srcpkgs/7zip/patches/build_flags.patch

57 lines
1.8 KiB
Diff
Raw Normal View History

2022-08-29 19:01:17 +02:00
adapted from https://sources.debian.org/patches/7zip/22.01+dfsg-4/0001-Accept-Debian-build-flags.patch/
and https://gitlab.alpinelinux.org/alpine/aports/-/raw/291a2b61d6e613fbe3ed057c1f2ee41fd2aea9ac/community/7zip/7-zip-flags.patch
--- a/CPP/7zip/7zip_gcc.mak
+++ b/CPP/7zip/7zip_gcc.mak
@@ -18,13 +18,13 @@
ifneq ($(CC), xlc)
-CFLAGS_WARN_WALL = -Wall -Werror -Wextra
+CFLAGS_WARN_WALL = -Wall -Wextra
endif
# for object file
CFLAGS_BASE_LIST = -c
# CFLAGS_BASE_LIST = -S
-CFLAGS_BASE = -O2 $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \
+CFLAGS_BASE = $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \
-DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-fPIC
@@ -82,7 +82,7 @@
else
-LDFLAGS = $(LDFLAGS_STATIC)
+LDFLAGS = $(VOID_LDFLAGS) $(LDFLAGS_STATIC)
# -s is not required for clang, do we need it for GGC ???
# -s
@@ -138,7 +138,7 @@
-CFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CFLAGS_BASE2) $(CFLAGS_BASE) $(CC_SHARED) -o $@
+CFLAGS = $(VOID_CFLAGS) $(VOID_CPPFLAGS) $(MY_ARCH_2) $(LOCAL_FLAGS) $(CFLAGS_BASE2) $(CFLAGS_BASE) $(CC_SHARED) -o $@
ifdef IS_MINGW
@@ -179,7 +179,7 @@
#-Wno-invalid-offsetof
#-Wno-reorder
-CXXFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(CXXFLAGS_EXTRA) $(CC_SHARED) -o $@ $(CXX_WARN_FLAGS)
+CXXFLAGS = $(VOID_CXXFLAGS) $(VOID_CPPFLAGS) $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(CXXFLAGS_EXTRA) $(CC_SHARED) -o $@ $(CXX_WARN_FLAGS)
STATIC_TARGET=
ifdef COMPL_STATIC
@@ -192,7 +192,7 @@
$(O):
$(MY_MKDIR) $(O)
-LFLAGS_ALL = -s $(MY_ARCH_2) $(LDFLAGS) $(LD_arch) $(OBJS) $(MY_LIBS) $(LIB2)
+LFLAGS_ALL = $(MY_ARCH_2) $(LDFLAGS) $(LD_arch) $(OBJS) $(MY_LIBS) $(LIB2)
$(PROGPATH): $(OBJS)
$(CXX) -o $(PROGPATH) $(LFLAGS_ALL)