diff options
author | Alexey Neyman <stilor@att.net> | 2016-12-09 21:51:44 (GMT) |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2016-12-11 08:46:06 (GMT) |
commit | 3dbb576c1708c1683ef780a43dec31a220458f39 (patch) | |
tree | d1d3a7cc6a6dde85899df10ad371b8e98e15fd04 /scripts/build/companion_libs/220-ncurses.sh | |
parent | da3f8c4ec5345b709a330eebab01cd62c574295d (diff) |
Make companion libs static.
This follows the trend set by 1*.sh scripts that configure ISL, GMP,
MPFR, CLooG, etc. Building with shared libraries presents all kinds
of problems:
- The shared libraries need to be installed into ${CT_PREFIX_DIR}.
- The binaries linked against companion libs need to have proper
RPATH, or they're looking for shared libs in
.build/${CT_PREFIX}/buildtools/lib.
- All libraries must agree as to whether they're built shared,
static, or both. Otherwise, gettext tries to link in static libncurses.a
into a shared library and fails (since libncurses was compiled without
the -fPIC switch and hence contains relocations that cannot be handled
in a shared library).
So this fixes the current mess. If we decide to re-enable building
the companion libs shared, we should probably make this dependent on
a separate suboption of CT_STATIC_TOOLCHAIN.
Add a config loosely based on one reported in the issue 274.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/companion_libs/220-ncurses.sh')
-rw-r--r-- | scripts/build/companion_libs/220-ncurses.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/build/companion_libs/220-ncurses.sh b/scripts/build/companion_libs/220-ncurses.sh index 6366049..ed7df2b 100644 --- a/scripts/build/companion_libs/220-ncurses.sh +++ b/scripts/build/companion_libs/220-ncurses.sh @@ -90,6 +90,7 @@ do_ncurses_for_target() { do_ncurses_backend host="${CT_TARGET}" \ prefix="${prefix}" \ destdir="${CT_SYSROOT_DIR}" \ + shared="${CT_SHARED_LIBS}" \ "${opts[@]}" CT_Popd CT_EndStep @@ -102,6 +103,7 @@ fi # prefix : prefix to install into : dir : (none) # cflags : cflags to use : string : (empty) # ldflags : ldflags to use : string : (empty) +# shared : build shared lib : bool : n # --* : passed to configure : n/a : n/a do_ncurses_backend() { local -a ncurses_opts @@ -109,6 +111,7 @@ do_ncurses_backend() { local prefix local cflags local ldflags + local shared local arg local for_target @@ -127,7 +130,7 @@ do_ncurses_backend() { ncurses_opts+=("--with-abi-version=5") fi - case "$host" in + case "${host}" in *-*-mingw*) # Needed to build for mingw, see # http://lists.gnu.org/archive/html/info-gnu/2011-02/msg00020.html @@ -136,6 +139,10 @@ do_ncurses_backend() { ;; esac + if [ "${shared}" = "y" ]; then + ncurses_opts+=("--with-shared") + fi + CT_DoLog EXTRA "Configuring ncurses" CT_DoExecLog CFG \ CFLAGS="${cflags}" \ @@ -145,6 +152,7 @@ do_ncurses_backend() { --host=${host} \ --prefix="${prefix}" \ --with-install-prefix="${destdir}" \ + --without-debug \ --enable-termcap \ "${ncurses_opts[@]}" |