From 5490bd3a2ff0c128d1403b5416c52bbbe1868a4d Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Tue, 29 Mar 2016 00:04:40 -0700 Subject: [PATCH 1/2] Build fixes for Android. Cross-compiling for any platform currently requires configuring with the --disable-openssl option, due to use of an AC_TRY_RUN macro for OpenSSL detection. Depending on the targeted Android version, it may be necessary to supply 'CFLAGS=-fPIE' and 'LDFLAGS=-fPIE -pie' to create runnable binaries. --- src/twadmin/twadmincl.cpp | 4 ++-- src/twparser/policyparser.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/twadmin/twadmincl.cpp b/src/twadmin/twadmincl.cpp index 7e50dd1..4e55b36 100644 --- a/src/twadmin/twadmincl.cpp +++ b/src/twadmin/twadmincl.cpp @@ -62,8 +62,8 @@ #include "twcrypto/crypto.h" #include "core/displayencoder.h" -//Syllable OS doesn't provide swab(), so we'll borrow one from glibc. -#ifdef __SYLLABLE__ +//Provide a swab() impl. from glibc, for platforms that don't have one +#if defined(__SYLLABLE__) || defined(__ANDROID_API__) void swab (const void *bfrom, void *bto, ssize_t n) { const char *from = (const char *) bfrom; diff --git a/src/twparser/policyparser.cpp b/src/twparser/policyparser.cpp index e8ec88d..c1c12e7 100644 --- a/src/twparser/policyparser.cpp +++ b/src/twparser/policyparser.cpp @@ -216,8 +216,12 @@ std::string convert_to_encoded_hex( char ch ) return sstr.str(); } + std::string util_ConvertMB( const std::string& sIn ) { +#if defined(__ANDROID_API__) || defined(__AROS__) + return sIn; +#else cDebug d( "cPolicyParser::util_ConvertMB" ); std::string sOut; @@ -265,5 +269,6 @@ std::string util_ConvertMB( const std::string& sIn ) } return sOut; +#endif } From a8d0a2ff796a430220115edc138aa021a9b8dd66 Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Tue, 29 Mar 2016 14:08:34 -0700 Subject: [PATCH 2/2] File offsets should be off_t, not int32, for large file support. Per OpenSuSE patch: https://build.opensuse.org/package/view_file/security/tripwire/tripwire-2.4.1.2-src.off_t.patch?expand-1 --- src/core/file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/file.h b/src/core/file.h index a29d7d7..29f0630 100644 --- a/src/core/file.h +++ b/src/core/file.h @@ -73,7 +73,7 @@ class cFile { public: #if IS_UNIX - typedef int32 File_t; + typedef off_t File_t; #else //WIN32 typedef int64 File_t;