repo/rsync/build

54 lines
1.3 KiB
Text
Raw Normal View History

2021-07-19 09:45:18 +03:00
wget https://download.samba.org/pub/rsync/src/rsync-3.2.2.tar.gz
tar -xf rsync-3.2.2.tar.gz
cd rsync-3.2.2
cat > mkproto.awk << "EOF"
#!/usr/bin/awk -f
BEGIN {
while ((getline i < "proto.h") > 0) old_protos = old_protos ? old_protos "\n" i : i
protos = "/* This file is automatically generated with \"make proto\". DO NOT EDIT */\n"
}
inheader {
protos = protos "\n" ((inheader = /\)[ \t]*$/ ? 0 : 1) ? $0 : $0 ";")
next
}
/^FN_(LOCAL|GLOBAL)_[^(]+\([^,()]+/ {
local = /^FN_LOCAL/
gsub(/^FN_(LOC|GLOB)AL_|,.*$/, "")
sub(/^BOOL\(/, "BOOL ")
sub(/^CHAR\(/, "char ")
sub(/^INTEGER\(/, "int ")
sub(/^STRING\(/, "char *")
protos = protos "\n" $0 (local ? "(int module_id);" : "(void);")
next
}
/^static|^extern|;/||!/^[A-Za-z][A-Za-z0-9_]* / { next }
/\(.*\)[ \t]*$/ {
protos = protos "\n" $0 ";"
next
}
/\(/ {
inheader = 1
protos = protos "\n" $0
}
END {
if (old_protos != protos) print protos > "proto.h"
print "" > "proto.h-tstamp"
}
EOF
sed 's/perl/awk -f/;s/mkproto.pl/mkproto.awk/' Makefile.in > _
mv -f _ Makefile.in
export CFLAGS="-static $CFLAGS"
./configure --prefix=/usr --with-included-popt --disable-xxhash --disable-zstd --disable-lz4 --without-included-zlib
make
make DESTDIR="$1" install