jpeg-turbo: fix legal info
[buildroot-gz.git] / package / lftp / 0001-fix-static-link-with-readline.patch
blob339239668e38398958f5df2787b41d97ae153d6f
1 fix static link with readline
3 When readline is static library, we need to link against ncurses
4 because readline needs ncurses. It is because, dependent library's
5 symbols are not resolved when static library is built. Those symbols
6 are resolved program tries to link with static library.
8 We can't pass linker flags for ncurses by setting LIBS environment
9 variable via <PKG>_CONF_ENV because it looks like build system is not
10 taking that into account and even though it would have been, order of
11 linking is important.
13 We can't also pass linker flags for ncurses via --with-readline-libs
14 conf options because it causes lftp_LIB_READLINE macro to take readline
15 headers from host machine if available. To use --with-readline-libs
16 we need to set --with-readline=yes and --with-readline-inc to include
17 dir. But when --with-readline=yes, readline_prefix is computed based
18 on if headers can be found in /usr/local or /usr. If readline is
19 installed on host machine, then configure fails since we are using
20 headers for host machine. If headers are not found in /usr/local or /usr
21 then only path specified --with-readline-inc is taken into account.
22 So specifying linker flags for ncurses via --with-readline-libs will
23 not work in all cases.
25 So it looks like, updating linker flags directly is only option to fix
26 static link issue against readline.
28 Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
30 --- lftp-4.7.3/m4/lftp_lib_readline.m4.old 2016-08-08 19:49:12.217596470 +0530
31 +++ lftp-4.7.3/m4/lftp_lib_readline.m4 2016-08-08 19:49:46.265596398 +0530
32 @@ -108,7 +108,7 @@ AC_DEFUN([lftp_LIB_READLINE],
33 readline_include_dir="$readline_include_dir/readline"
35 readline_ld_flags="-L$readline_prefix/lib"
36 - readline_lib_flags="-lreadline"
37 + readline_lib_flags="-lreadline -lncurses"
38 run_readline_test="yes"
39 elif test "$readline_requested" = "yes"; then
40 if test -n "$readline_include_dir" -a -n "$readline_lib_flags"; then