chiark / gitweb /
zsh: Work on binary loadable modules
authorFredrik Fornwall <fredrik@fornwall.net>
Wed, 25 Nov 2015 13:11:49 +0000 (08:11 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Wed, 25 Nov 2015 13:11:49 +0000 (08:11 -0500)
packages/zsh/build.sh
packages/zsh/src-module.c.patch [new file with mode: 0644]

index b881e3dac420510e14dee7ac4d07e0b74433ddec..c4c88b1456c29345c1384bece19e3473a285c6d6 100644 (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):
diff --git a/packages/zsh/src-module.c.patch b/packages/zsh/src-module.c.patch
new file mode 100644 (file)
index 0000000..2ceb347
--- /dev/null
@@ -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
+ /*