zsh: Work on binary loadable modules

This commit is contained in:
Fredrik Fornwall 2015-11-25 08:11:49 -05:00
parent b605215da0
commit 2ba1fa72aa
2 changed files with 38 additions and 0 deletions

View File

@ -6,6 +6,8 @@ TERMUX_PKG_SRCURL=http://www.zsh.org/pub/zsh-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_RM_AFTER_INSTALL="bin/zsh-${TERMUX_PKG_VERSION}"
TERMUX_PKG_DEPENDS="libandroid-support, ncurses, termux-tools, command-not-found"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-etcdir=$TERMUX_PREFIX/etc --disable-gdbm --disable-pcre ac_cv_header_utmp_h=no"
# Below needed to force loadable binary modules, but does not currently work:
# TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" zsh_cv_shared_environ=yes"
termux_step_post_make_install () {
# /etc/zshrc - Run for interactive shells (http://zsh.sourceforge.net/Guide/zshguide02.html):

View File

@ -0,0 +1,36 @@
diff -u -r ../zsh-5.1.1/Src/module.c ./Src/module.c
--- ../zsh-5.1.1/Src/module.c 2015-02-19 14:47:41.000000000 -0500
+++ ./Src/module.c 2015-11-24 18:38:12.383460402 -0500
@@ -1496,8 +1496,10 @@
#else
# ifdef HAVE_DL_H
# include <dl.h>
-# define RTLD_LAZY BIND_DEFERRED
-# define RTLD_GLOBAL DYNAMIC_PATH
+# ifndef __ANDROID__
+# define RTLD_LAZY BIND_DEFERRED
+# define RTLD_GLOBAL DYNAMIC_PATH
+# endif
# else
# include <sys/types.h>
# include <nlist.h>
@@ -1550,11 +1552,14 @@
/**/
#endif /* !AIXDYNAMIC */
-#ifndef RTLD_LAZY
-# define RTLD_LAZY 1
-#endif
-#ifndef RTLD_GLOBAL
-# define RTLD_GLOBAL 0
+#ifndef __ANDROID__
+/* On Android RTLD_LAZY and RTLD_LAZY are enum values so cannot ifdef check. */
+# ifndef RTLD_LAZY
+# define RTLD_LAZY 1
+# endif
+# ifndef RTLD_GLOBAL
+# define RTLD_GLOBAL 0
+# endif
#endif
/*