summaryrefslogtreecommitdiff
path: root/cppunit/android.patch
blob: 7628f5f9877fcac57d64685f6e866946ea7d92b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- misc/cppunit-1.12.1/config/config.sub
+++ misc/build/cppunit-1.12.1/config/config.sub
@@ -120,7 +120,7 @@
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -1250,7 +1250,7 @@
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- misc/cppunit-1.12.1/config/ltmain.sh
+++ misc/build/cppunit-1.12.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.12.1/src/cppunit/UnixDynamicLibraryManager.cpp
+++ misc/build/cppunit-1.12.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
 }