forked from msys2/MSYS2-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0007-fix-static-build.patch
63 lines (61 loc) · 2.27 KB
/
0007-fix-static-build.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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