Compare commits

...

5 Commits

Author SHA1 Message Date
Lorekin
7a46d26096
Merge 92ba6b439e6aed8557a315ebfcd350016159be52 into bc463930aa26705c356a6e1d630ce97aa1266cfa 2024-12-24 19:58:08 +03:00
bol-van
bc463930aa
Merge pull request #989 from Hi-Angel/march=native
Use `-march=native` when building from install_easy.sh
2024-12-24 19:29:10 +03:00
Konstantin Kharlamov
6fe9471077 Use -march=native when building from install_easy.sh
install_easy.sh is used for local installation, which implies that if
it invokes make, the binaries are not being cross-compiled. That
allows us to pass `-march=native` to make sure the binaries are
optimized for the current CPU.

We prepend `-march=native` to CFLAGS to make sure that if a user sets
CFLAGS with a distinct `-march` option, ours will get overwritten.
2024-12-24 18:42:16 +03:00
Konstantin Kharlamov
884213f7ac install_easy.sh: remove trailing whitespaces 2024-12-24 18:40:44 +03:00
Lorekin
92ba6b439e
Add script to get antifilter domains 2024-11-27 23:58:54 +03:00
2 changed files with 45 additions and 6 deletions

View File

@ -70,7 +70,7 @@ check_bins()
elif [ -f "$EXEDIR/Makefile" ] && exists make; then elif [ -f "$EXEDIR/Makefile" ] && exists make; then
echo trying to compile echo trying to compile
[ "$SYSTEM" = "macos" ] && make_target=mac [ "$SYSTEM" = "macos" ] && make_target=mac
make -C "$EXEDIR" $make_target || { CFLAGS="-march=native ${CFLAGS}" make -C "$EXEDIR" $make_target || {
echo could not compile echo could not compile
make -C "$EXEDIR" clean make -C "$EXEDIR" clean
exitp 8 exitp 8
@ -772,7 +772,6 @@ deoffload_openwrt_firewall()
else else
echo system wide software flow offloading disabled. ok echo system wide software flow offloading disabled. ok
fi fi
} }

View File

@ -0,0 +1,40 @@
#!/bin/sh
IPSET_DIR="$(dirname "$0")"
IPSET_DIR="$(cd "$IPSET_DIR"; pwd)"
. "$IPSET_DIR/def.sh"
TMPLIST="$TMPDIR/list.txt"
URL="https://antifilter.download/list/domains.lst"
dl()
{
# $1 - url
# $2 - file
# $3 - minsize
# $4 - maxsize
curl -L -H "Accept-Encoding: gzip" -k --fail --max-time 60 --connect-timeout 10 --retry 4 --max-filesize 251658240 -o "$TMPLIST" "$1" ||
{
echo list download failed : $1
exit 2
}
dlsize=$(LANG=C wc -c "$TMPLIST" | xargs | cut -f 1 -d ' ')
if test $dlsize -lt $3; then
echo list is too small : $dlsize bytes. can be bad.
exit 2
fi
zzcat "$TMPLIST" | tr -d '\015' | zz "$2"
rm -f "$TMPLIST"
}
# useful in case ipban set is used in custom scripts
FAIL=
getipban || FAIL=1
"$IPSET_DIR/create_ipset.sh"
[ -n "$FAIL" ] && exit
dl "$URL" "$ZHOSTLIST" 32768 4194304
exit 0