2015-10-24 00:49:56 +00:00
|
|
|
# Build script for gettext
|
|
|
|
|
|
|
|
do_gettext_get() { :; }
|
|
|
|
do_gettext_extract() { :; }
|
|
|
|
do_gettext_for_build() { :; }
|
|
|
|
do_gettext_for_host() { :; }
|
2015-11-13 18:34:13 +00:00
|
|
|
do_gettext_for_target() { :; }
|
2015-10-24 00:49:56 +00:00
|
|
|
|
|
|
|
if [ "${CT_GETTEXT}" = "y" ]; then
|
|
|
|
|
|
|
|
do_gettext_get() {
|
|
|
|
CT_GetFile "gettext-${CT_GETTEXT_VERSION}" \
|
|
|
|
http://ftp.gnu.org/pub/gnu/gettext/
|
|
|
|
}
|
|
|
|
|
|
|
|
do_gettext_extract() {
|
|
|
|
CT_Extract "gettext-${CT_GETTEXT_VERSION}"
|
|
|
|
CT_Patch "gettext" "${CT_GETTEXT_VERSION}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Build gettext for running on build
|
|
|
|
do_gettext_for_build() {
|
|
|
|
local -a gettext_opts
|
|
|
|
|
2016-12-16 23:54:11 +00:00
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
|
|
|
native|cross) return 0;;
|
2015-10-24 00:49:56 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing gettext for build"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-gettext-build-${CT_BUILD}"
|
|
|
|
|
|
|
|
gettext_opts+=( "host=${CT_BUILD}" )
|
|
|
|
gettext_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
|
|
|
|
gettext_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
|
|
|
|
gettext_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
|
|
|
|
do_gettext_backend "${gettext_opts[@]}"
|
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
|
|
|
# Build gettext for running on host
|
|
|
|
do_gettext_for_host() {
|
|
|
|
local -a gettext_opts
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing gettext for host"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-gettext-host-${CT_HOST}"
|
|
|
|
|
|
|
|
gettext_opts+=( "host=${CT_HOST}" )
|
|
|
|
gettext_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
|
|
|
|
gettext_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
|
|
|
gettext_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
|
|
|
|
do_gettext_backend "${gettext_opts[@]}"
|
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
|
|
|
# Build gettext
|
|
|
|
# Parameter : description : type : default
|
|
|
|
# host : machine to run on : tuple : (none)
|
|
|
|
# prefix : prefix to install into : dir : (none)
|
2016-12-09 21:51:44 +00:00
|
|
|
# shared : build shared lib : bool : no
|
2015-10-24 00:49:56 +00:00
|
|
|
# cflags : host cflags to use : string : (empty)
|
|
|
|
# ldflags : host ldflags to use : string : (empty)
|
|
|
|
do_gettext_backend() {
|
|
|
|
local host
|
|
|
|
local prefix
|
2016-12-09 21:51:44 +00:00
|
|
|
local shared
|
2015-10-24 00:49:56 +00:00
|
|
|
local cflags
|
|
|
|
local ldflags
|
|
|
|
local arg
|
|
|
|
local -a extra_config
|
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
done
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Configuring gettext"
|
|
|
|
|
|
|
|
# A bit ugly. D__USE_MINGW_ANSI_STDIO=1 has its own {v}asprintf functions
|
|
|
|
# but gettext configure doesn't see this flag when it checks for that. An
|
|
|
|
# alternative may be to use CC="${host}-gcc ${cflags}" but that didn't
|
|
|
|
# work.
|
|
|
|
# -O2 works around bug at http://savannah.gnu.org/bugs/?36443
|
|
|
|
# gettext needs some fixing for MinGW-w64 it would seem.
|
2016-12-09 21:51:44 +00:00
|
|
|
# -DLIBXML_STATIC needed to link with libxml (provided by gnulib) under
|
|
|
|
# MinGW: without this flag, xmlFree is defined as `dllimport` by libxml
|
|
|
|
# headers and hence fails to link.
|
2015-10-24 00:49:56 +00:00
|
|
|
case "${host}" in
|
|
|
|
*mingw*)
|
|
|
|
case "${cflags}" in
|
|
|
|
*D__USE_MINGW_ANSI_STDIO=1*)
|
|
|
|
extra_config+=( --disable-libasprintf )
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
extra_config+=( --enable-threads=win32 )
|
2016-12-09 21:51:44 +00:00
|
|
|
cflags=$cflags" -O2 -DLIBXML_STATIC"
|
2015-10-24 00:49:56 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-12-09 21:51:44 +00:00
|
|
|
if [ "${shared}" != "y" ]; then
|
2015-10-24 00:49:56 +00:00
|
|
|
extra_config+=("--disable-shared")
|
|
|
|
fi
|
|
|
|
|
|
|
|
CT_DoExecLog CFG \
|
|
|
|
CFLAGS="${cflags}" \
|
|
|
|
LDFLAGS="${ldflags}" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
2015-10-24 00:49:56 +00:00
|
|
|
"${CT_SRC_DIR}/gettext-${CT_GETTEXT_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host="${host}" \
|
|
|
|
--prefix="${prefix}" \
|
2016-12-09 21:51:44 +00:00
|
|
|
--enable-static \
|
2015-10-24 00:49:56 +00:00
|
|
|
--disable-java \
|
|
|
|
--disable-native-java \
|
|
|
|
--disable-csharp \
|
|
|
|
--without-emacs \
|
|
|
|
--disable-openmp \
|
2016-12-17 08:12:34 +00:00
|
|
|
--with-included-libxml \
|
|
|
|
--with-included-gettext \
|
|
|
|
--with-included-glib \
|
|
|
|
--with-included-libcroco \
|
|
|
|
--with-included-libunistring \
|
|
|
|
--with-libncurses-prefix="${prefix}" \
|
|
|
|
--with-libiconv-prefix="${prefix}" \
|
|
|
|
--without-libpth-prefix \
|
2015-10-24 00:49:56 +00:00
|
|
|
"${extra_config[@]}"
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building gettext"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
2015-10-24 00:49:56 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing gettext"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make install
|
2015-10-24 00:49:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fi
|