Hello,

This patch is in the same vein as
<http://lists.gnu.org/archive/html/libtool-patches/2011-11/msg00153.html>.
I use version_type to perform the fix instead and only give one library
name to library_names_spec.

Leo

>From 851a8da108f8bb248e05b65bc075ed116b59011a Mon Sep 17 00:00:00 2001
From: Leo Davis <lda...@speechfxinc.com>
Date: Thu, 29 Mar 2012 18:44:53 -0600
Subject: [PATCH] Android does not use SONAME versioning, so disable them when
 crosscompiling. Somewhat based on this patch
 <http://lists.gnu.org/archive/html/libtool-patches/2011-11/msg00153.html>

* m4/libtool.m4: Set version_type to none and only give one name for
library_names_spec.  Everything else (SONAME) should be handled implicitly.
---
 m4/libtool.m4 |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 75bfdb4..7a7966d 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2633,10 +2633,19 @@ linux*oldld* | linux*aout* | linux*coff*)
 
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
+  case $host_os in
+  linux-android*)
+    # See David Turner's response in <https://groups.google.com/forum/#!topic/android-ndk/_UhNpRJlA1k>.
+    version_type=none
+    library_names_spec='$libname$release$shared_ext'
+    ;;
+  *)
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    ;;
+  esac
   need_lib_prefix=no
   need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-- 
1.7.7

Reply via email to