rsync: Add a script to substitute known working configs
* Generating configs using the NDK disables few supported configs, due to missing headers/libs in the NDK.
* Since we already support these libraries and build it from source, we can add them in Android.bp as shared libs, and to use them to enable additional rsync features.
Test:
create a large compressable file: yes >> testfile
rsync copy testfile with and without flags: --compress --compress-choice=[zlib|lz4]
Rsync runs with both zlib and lz4 & testfile transfers considerably faster with compression.
Change-Id: Id9ca518193fdea0fc89b03bc97d3ed3fd738ca80
diff --git a/known_substitutions_android.sh b/known_substitutions_android.sh
new file mode 100644
index 0000000..7f666e2
--- /dev/null
+++ b/known_substitutions_android.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Known Working configs for AOSP
+sed -i 's|/\* #undef CAN_HARDLINK_SPECIAL \*/|#define CAN_HARDLINK_SPECIAL 1|g;' config.h
+sed -i 's|/\* #undef CAN_HARDLINK_SYMLINK \*/|#define CAN_HARDLINK_SYMLINK 1|g;' config.h
+sed -i 's|/\* #undef HAVE_SOCKETPAIR \*/|#define HAVE_SOCKETPAIR 1|g;' config.h
+sed -i 's|/\* #undef HAVE_XXHASH_H \*/|#define HAVE_XXHASH_H 1|g;' config.h
+sed -i 's|/\* #undef MKNOD_CREATES_FIFOS \*/|#define MKNOD_CREATES_FIFOS 1|g;' config.h
+sed -i 's|/\* #undef SUPPORT_LZ4 \*/|#define SUPPORT_LZ4 1|g;' config.h
+sed -i 's|/\* #undef SUPPORT_XXHASH \*/|#define SUPPORT_XXHASH 1|g;' config.h
+sed -i 's|/\* #undef USE_OPENSSL \*/|#define USE_OPENSSL 1|g;' config.h