MSYS2-packages/bash/0007-fix-static-build.patch
Christoph Reiter 150d823c24 bash: Update to 5.2
sync with g4w
2022-11-04 23:00:59 +01:00

64 lines
2.3 KiB
Diff

diff --git a/bashline.c b/bashline.c
index 6d285c5..1738d2c 100644
--- a/bashline.c
+++ b/bashline.c
@@ -551,12 +551,20 @@ initialize_readline ()
kseq[0] = CTRL('J');
kseq[1] = '\0';
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
+#ifndef _STATIC_BUILD
extern rl_command_func_t *IMP(rl_vi_editing_mode);
if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
+#else
+ if (func == rl_vi_editing_mode)
+#endif
rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
kseq[0] = CTRL('M');
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
+#ifndef _STATIC_BUILD
if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
+#else
+ if (func == rl_vi_editing_mode)
+#endif
rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
#if defined (VI_MODE)
kseq[0] = CTRL('E');
@@ -578,8 +586,12 @@ initialize_readline ()
kseq[0] = '~';
kseq[1] = '\0';
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
+#ifndef _STATIC_BUILD
extern rl_command_func_t *IMP(rl_tilde_expand);
if (func == 0 || func == rl_tilde_expand || func == IMP(rl_tilde_expand))
+#else
+ if (func == 0 || func == rl_tilde_expand)
+#endif
rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap);
@@ -602,8 +614,12 @@ initialize_readline ()
kseq[0] = TAB;
kseq[1] = '\0';
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
+#ifndef _STATIC_BUILD
extern rl_command_func_t *IMP(rl_tab_insert);
if (func == 0 || func == rl_tab_insert || func == IMP(rl_tab_insert))
+#else
+ if (func == 0 || func == rl_tab_insert)
+#endif
rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
/* Tell the completer that we want a crack first. */
diff --git a/configure.ac b/configure.ac
index f770177..a934a5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -515,6 +515,7 @@ if test "$opt_static_link" = yes; then
# if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2
if test "$GCC" = "yes"; then
STATIC_LD="-static"
+ CFLAGS="$CFLAGS -D_STATIC_BUILD"
case "$host_os" in
solaris2*|linux*) ;;
*) LDFLAGS="$LDFLAGS -static" ;; # XXX experimental