Files
libreoffice/external/cppunit/android.patch
Khaled Hosny 7223027a3a fdo#70393: move cppunit to a subdir of external
Change-Id: I96ab796757af0c6c6741059b35fcaeefc2bf4507
Reviewed-on: https://gerrit.libreoffice.org/6286
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2013-10-17 17:17:22 +00:00

34 lines
1.0 KiB
Diff

--- misc/cppunit-1.13.1/config/ltmain.sh
+++ misc/build/cppunit-1.13.1/config/ltmain.sh
@@ -3228,6 +3228,12 @@
fi
else
+ # Force no versioning suffix for Android thanks to silly
+ # apkbuilder which doesn't add extra native libs unless their
+ # name ends with .so
+
+ version_type=none
+
# Parse the version information argument.
save_ifs="$IFS"; IFS=':'
set dummy $vinfo 0 0 0
--- misc/cppunit-1.13.1/src/cppunit/UnixDynamicLibraryManager.cpp
+++ misc/build/cppunit-1.13.1/src/cppunit/UnixDynamicLibraryManager.cpp
@@ -13,7 +13,15 @@
DynamicLibraryManager::LibraryHandle
DynamicLibraryManager::doLoadLibrary( const std::string &libraryName )
{
+#ifdef __ANDROID__
+ // Use our enhanced dlopen() wrapper, see sal/osl/android/jni/lo-wrapper.c
+ void *(*lo_dlopen)(const char *) = (void *(*)(const char *)) dlsym( RTLD_DEFAULT, "lo_dlopen" );
+ if (lo_dlopen == NULL)
+ return NULL;
+ return (*lo_dlopen)( libraryName.c_str() );
+#else
return ::dlopen( libraryName.c_str(), RTLD_NOW | RTLD_GLOBAL );
+#endif
}