Skip to content

Commit 82fcd13

Browse files
Merge pull request #297 from loathingKernel/master
Makefile: remove dpkg-* usages, use cross-distro build tools
2 parents 9fe33a3 + 1d483fc commit 82fcd13

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,20 @@ libmspack-install: libmspack-dist
111111
# unzip
112112
#
113113

114-
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
115-
CC = $(DEB_HOST_GNU_TYPE)-gcc
116-
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
117-
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
118-
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
114+
# Flags are from Proton
115+
CFLAGS ?= -O2 -march=nocona -mtune=core-avx2
116+
LDFLAGS ?= -Wl,-O1,--sort-common,--as-needed
119117
DEFINES = -DACORN_FTYPE_NFS -DWILD_STOP_AT_DIR -DLARGE_FILE_SUPPORT \
120118
-DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE -DNO_LCHMOD \
121119
-DDATE_FORMAT=DF_YMD -DUSE_BZIP2 -DIZ_HAVE_UXUIDGID -DNOMEMCPY \
122120
-DNO_WORKING_ISPRINT
121+
UNZIP_PATCHES := $(shell cat subprojects/unzip/debian/patches/series)
123122

124123
$(OBJDIR)/.build-unzip-dist: | $(OBJDIR)
125124
$(info :: Building unzip )
126125
cd subprojects/unzip && \
127-
dpkg-source --before-build . && \
128-
make -f unix/Makefile prefix=/usr D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 CC="$(CC) -Wall" LF2="$(LDFLAGS)" CF="$(CFLAGS) $(CPPFLAGS) -I. $(DEFINES)" unzips
126+
$(foreach pch, $(UNZIP_PATCHES),patch -Np1 -i debian/patches/$(pch) &&) \
127+
make -f unix/Makefile prefix=/usr D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 LF2="$(LDFLAGS)" CF="$(CFLAGS) -I. $(DEFINES)" unzips
129128
touch $(@)
130129

131130
.PHONY: unzip-dist

0 commit comments

Comments
 (0)