summaryrefslogtreecommitdiff
path: root/scripts/build/companion_libs/320-libiconv.sh
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2016-12-09 21:51:44 (GMT)
committerAlexey Neyman <stilor@att.net>2016-12-11 08:46:06 (GMT)
commit3dbb576c1708c1683ef780a43dec31a220458f39 (patch)
treed1d3a7cc6a6dde85899df10ad371b8e98e15fd04 /scripts/build/companion_libs/320-libiconv.sh
parentda3f8c4ec5345b709a330eebab01cd62c574295d (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/320-libiconv.sh')
-rw-r--r--scripts/build/companion_libs/320-libiconv.sh18
1 files changed, 4 insertions, 14 deletions
diff --git a/scripts/build/companion_libs/320-libiconv.sh b/scripts/build/companion_libs/320-libiconv.sh
index ffe60c2..55da586 100644
--- a/scripts/build/companion_libs/320-libiconv.sh
+++ b/scripts/build/companion_libs/320-libiconv.sh
@@ -35,7 +35,6 @@ do_libiconv_for_build() {
libiconv_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
libiconv_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
libiconv_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
- libiconv_opts+=( "static_build=y" )
do_libiconv_backend "${libiconv_opts[@]}"
CT_Popd
@@ -46,12 +45,6 @@ do_libiconv_for_build() {
do_libiconv_for_host() {
local -a libiconv_opts
- case "$CT_HOST" in
- *darwin*|*linux*)
- return 0
- ;;
- esac
-
CT_DoStep INFO "Installing libiconv for host"
CT_mkdir_pushd "${CT_BUILD_DIR}/build-libiconv-host-${CT_HOST}"
@@ -59,7 +52,6 @@ do_libiconv_for_host() {
libiconv_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
libiconv_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
libiconv_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
- libiconv_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" )
do_libiconv_backend "${libiconv_opts[@]}"
CT_Popd
@@ -70,13 +62,13 @@ do_libiconv_for_host() {
# Parameter : description : type : default
# host : machine to run on : tuple : (none)
# prefix : prefix to install into : dir : (none)
-# static_build : build statically : bool : no
+# shared : build shared lib : bool : no
# cflags : host cflags to use : string : (empty)
# ldflags : host ldflags to use : string : (empty)
do_libiconv_backend() {
local host
local prefix
- local static_build
+ local shared
local cflags
local ldflags
local arg
@@ -88,11 +80,8 @@ do_libiconv_backend() {
CT_DoLog EXTRA "Configuring libiconv"
- CT_DoExecLog ALL cp -aT "${CT_SRC_DIR}/libiconv-${CT_LIBICONV_VERSION}/." "."
-
- if [ "${static_build}" = "y" ]; then
+ if [ "${shared}" != "y" ]; then
extra_config+=("--disable-shared")
- extra_config+=("--enable-static")
fi
CT_DoExecLog CFG \
@@ -102,6 +91,7 @@ do_libiconv_backend() {
--build=${CT_BUILD} \
--host="${host}" \
--prefix="${prefix}" \
+ --enable-static \
--disable-nls \
"${extra_config[@]}" \