Fix shared library support on Android.

This patch fixes two problems:
1) A libtool library created with the -release option and no -version-info
   option was, when built with --enable-shared, installed without the
   symlink libNAME.so -> libNAME-RELEASE.so. This led to subsequent failures
   during "make install" of shared libraries that depend on it.
2) Executables were created without a RUNPATH property. These executables
   then did not find their shared libraries when run.

* m4/libtool.m4: On Android, fix library_names_spec and
hardcode_libdir_flag_spec.
This commit is contained in:
Bruno Haible 2023-09-18 12:47:08 +02:00 committed by Ileana Dumitrescu
parent 544675d6b5
commit 47c71f61df
No known key found for this signature in database
GPG Key ID: 6570EA01146F7354

7
m4/libtool.m4 vendored
View File

@ -2839,7 +2839,7 @@ 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'
library_names_spec='$libname$release$shared_ext $libname$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
@ -2851,8 +2851,9 @@ linux*android*)
hardcode_into_libs=yes
dynamic_linker='Android linker'
# Don't embed -rpath directories since the linker doesn't support them.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
# -rpath works at least for libraries that are not overridden by
# libraries installed in system locations.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
# This must be glibc/ELF.