Support for Android toolchains

David Turner <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <CACnJMqoe==QW-dw=5fiPa2GY849+pGK2k3tpqj3DkDjbeaeNHg@mail.gmail.com>
Hello,

This patch adds support for Android-specific toolchains [1], and ensures
that version-less libraries are generated by default.

I have tested this by recompiling a few open-source libraries (libffi,
libiconv, libgettext) after updating their libtool files manually with
"autoreconf --force --install".

Let me know if there are any issues.

Thanks

- Digit
0001-Add-Android-support.patch (application/octet-stream, 1.4 KB)
From a5b72c424c3a355dcee968639e4e3c1a68afc16e Mon Sep 17 00:00:00 2001
From: David 'Digit' Turner <[email protected]>
Date: Mon, 10 Jun 2013 11:04:36 +0200
Subject: Add Android support.

This patch adds proper Android support to libtool. The main issues
are the following:

  - Versioned libraries are not supported by the platform and its
    build/packaging tools.

  - The dynamic linker is not GNU ld, there is no support for
    DT_RUNPATH.

  - Similarly, there is no ldconfig.
---
 m4/libtool.m4 | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index d7013c5..cf5f965 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2630,6 +2630,24 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
-- 
1.7.12.146.g16d26b1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.