[build]: enable parallel build for isc-dhcp-relay (#16673)

Before: 52s
After: 26s
This commit is contained in:
Konstantin Vasin 2023-09-30 11:19:18 +03:00 committed by GitHub
parent bca2ce25ef
commit 49d0e1b047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,42 @@
diff --git a/debian/rules b/debian/rules
index 3c8318f..28f4657 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,6 +37,13 @@ export DO_LPF=1
CONFFLAGS+=--enable-use-sockets
endif
+ifeq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ PARALLEL :=
+else
+ PARALLEL := \
+ -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+endif
+
%:
dh $@ --parallel --with autoreconf
@@ -46,17 +53,17 @@ override_dh_auto_build:
# ldap-enabled build
test -f Makefile && $(MAKE) distclean || true
./configure --with-ldap --with-ldapcrypto CFLAGS="$(CFLAGS) -DNSUPDATE" LIBS="-lirs-export $(LIBS)" $(CONFFLAGS)
- $(MAKE)
+ $(MAKE) $(PARALLEL)
mv server/dhcpd dhcpd
# ddns-disabled build
test -f Makefile && $(MAKE) distclean || true
./configure CFLAGS="$(CFLAGS)" $(CONFFLAGS)
- $(MAKE)
+ $(MAKE) $(PARALLEL)
mv client/dhclient dhclient
# ldap-disabled build
test -f Makefile && $(MAKE) distclean || true
./configure CFLAGS="$(CFLAGS) -DNSUPDATE" LIBS="-lirs-export $(LIBS)" $(CONFFLAGS)
- $(MAKE)
+ $(MAKE) $(PARALLEL)
override_dh_install:
# rename some upstream files
--
2.34.1

View File

@ -12,3 +12,4 @@
0011-dhcp-relay-Prevent-Buffer-Overrun.patch
0012-add-option-si-to-support-using-src-intf-ip-in-relay.patch
0013-Fix-dhcrelay-agent-option-buffer-pointer-logic.patch
0014-enable-parallel-build.patch