mirror of
https://github.com/bol-van/zapret2.git
synced 2026-10-29 06:02:05 +00:00
builder_linux: zlib_ng optional support
This commit is contained in:
1 parent
dd85b1f852
commit
5f2807e0c5
3 files changed
+14
-6
No files matched your search
@@ -5,7 +5,7 @@ make -C /opt/zapret2 systemd
|
|||||||
|
|
||||||
* fedora, rhel, centos, alma
|
* fedora, rhel, centos, alma
|
||||||
|
|
||||||
dnf add make gcc zlib-devel libcap-devel libnetfilter_queue-devel libmnl-devel systemd-devel luajit-devel
|
dnf install make gcc zlib-ng-compat-devel libcap-devel libnetfilter_queue-devel libmnl-devel systemd-devel luajit-devel
|
||||||
make -C /opt/zapret2 systemd
|
make -C /opt/zapret2 systemd
|
||||||
|
|
||||||
* linux static :
|
* linux static :
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ dl_deps()
|
|||||||
curl $CURL_OPT -Lo - https://www.netfilter.org/pub/libmnl/libmnl-1.0.5.tar.bz2 | tar -xj || exit 5
|
curl $CURL_OPT -Lo - https://www.netfilter.org/pub/libmnl/libmnl-1.0.5.tar.bz2 | tar -xj || exit 5
|
||||||
exists_dir libnetfilter_queue-* ||
|
exists_dir libnetfilter_queue-* ||
|
||||||
curl $CURL_OPT -Lo - https://www.netfilter.org/pub/libnetfilter_queue/libnetfilter_queue-1.0.5.tar.bz2 | tar -xj || exit 5
|
curl $CURL_OPT -Lo - https://www.netfilter.org/pub/libnetfilter_queue/libnetfilter_queue-1.0.5.tar.bz2 | tar -xj || exit 5
|
||||||
exists_dir zlib-* ||
|
exists_dir zlib-ng-${ZLIB_NG_VER} ||
|
||||||
curl $CURL_OPT -Lo - https://zlib.net/fossils/zlib-1.3.2.tar.gz | tar -xz || exit 5
|
curl $CURL_OPT -Lo - https://github.com/zlib-ng/zlib-ng/archive/refs/tags/${ZLIB_NG_VER}.tar.gz | tar -xz || exit 5
|
||||||
|
exists_dir zlib-${ZLIB_VER} ||
|
||||||
|
curl $CURL_OPT -Lo - https://zlib.net/fossils/zlib-${ZLIB_VER}.tar.gz | tar -xz || exit 5
|
||||||
exists_dir luajit2-* ||
|
exists_dir luajit2-* ||
|
||||||
curl $CURL_OPT -Lo - https://github.com/openresty/luajit2/archive/refs/tags/v${LUAJIT_RELEASE}.tar.gz | tar -xz || exit 5
|
curl $CURL_OPT -Lo - https://github.com/openresty/luajit2/archive/refs/tags/v${LUAJIT_RELEASE}.tar.gz | tar -xz || exit 5
|
||||||
exists_dir lua-* ||
|
exists_dir lua-* ||
|
||||||
@@ -42,11 +44,15 @@ build_netlink()
|
|||||||
build_zlib()
|
build_zlib()
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
cd zlib-*
|
if [ "$ZLIB_NG" = 1 ]; then
|
||||||
|
cd zlib-ng-${ZLIB_NG_VER}
|
||||||
|
else
|
||||||
|
cd zlib-${ZLIB_VER}
|
||||||
|
fi
|
||||||
[ -f "Makefile" ] && make clean
|
[ -f "Makefile" ] && make clean
|
||||||
CFLAGS="$OPTIMIZE $MINSIZE $CFLAGS" \
|
CFLAGS="$OPTIMIZE $MINSIZE $CFLAGS" \
|
||||||
LDFLAGS="$LDMINSIZE $LDFLAGS" \
|
LDFLAGS="$LDMINSIZE $LDFLAGS" \
|
||||||
./configure --prefix= --static
|
./configure --prefix= --static --zlib-compat
|
||||||
make install -j$nproc DESTDIR=$STAGING_DIR
|
make install -j$nproc DESTDIR=$STAGING_DIR
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -107,8 +113,8 @@ for t in $TGT; do
|
|||||||
CFLAGS="$CFLAGS $CFLAGS_PIC"
|
CFLAGS="$CFLAGS $CFLAGS_PIC"
|
||||||
pushd "$DEPS"
|
pushd "$DEPS"
|
||||||
install_h_files
|
install_h_files
|
||||||
build_netlink
|
|
||||||
build_zlib
|
build_zlib
|
||||||
|
build_netlink
|
||||||
build_lua
|
build_lua
|
||||||
build_luajit_for_target $t
|
build_luajit_for_target $t
|
||||||
popd
|
popd
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ LDFLAGS="-lgcc_eh $LDFLAGS"
|
|||||||
# PIE does not work for arm32 and all mips
|
# PIE does not work for arm32 and all mips
|
||||||
PIE=${PIE:-0}
|
PIE=${PIE:-0}
|
||||||
HOSTCC=${HOSTCC:-cc}
|
HOSTCC=${HOSTCC:-cc}
|
||||||
|
ZLIB_VER=${ZLIB_VER:-1.3.2}
|
||||||
|
ZLIB_NG_VER=${ZLIB_NG_VER:-2.3.3}
|
||||||
LUA_VER=${LUA_VER:-5.5}
|
LUA_VER=${LUA_VER:-5.5}
|
||||||
LUA_RELEASE=${LUA_RELEASE:-5.5.0}
|
LUA_RELEASE=${LUA_RELEASE:-5.5.0}
|
||||||
LUAJIT_VER=${LUAJIT_VER:-2.1}
|
LUAJIT_VER=${LUAJIT_VER:-2.1}
|
||||||
|
|||||||
Reference in new issue
Block a user