2015-11-08 07:31:46 +00:00
|
|
|
# Build script for ncurses
|
|
|
|
|
|
|
|
do_ncurses_get() { :; }
|
|
|
|
do_ncurses_extract() { :; }
|
|
|
|
do_ncurses_for_build() { :; }
|
|
|
|
do_ncurses_for_host() { :; }
|
|
|
|
do_ncurses_for_target() { :; }
|
|
|
|
|
|
|
|
if [ "${CT_NCURSES_TARGET}" = "y" -o "${CT_NCURSES}" = "y" ]; then
|
|
|
|
|
|
|
|
do_ncurses_get() {
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_Fetch NCURSES
|
2015-11-08 07:31:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_ncurses_extract() {
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_ExtractPatch NCURSES
|
2015-11-08 07:31:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# We need tic that runs on the build when building ncurses for host/target
|
|
|
|
do_ncurses_for_build() {
|
|
|
|
local -a opts
|
2015-11-10 00:08:28 +00:00
|
|
|
|
2015-11-08 07:31:46 +00:00
|
|
|
CT_DoStep INFO "Installing ncurses for build"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-ncurses-build-${CT_BUILD}"
|
|
|
|
opts=("--enable-symlinks" \
|
|
|
|
"--without-manpages" \
|
|
|
|
"--without-tests" \
|
|
|
|
"--without-cxx" \
|
|
|
|
"--without-cxx-binding" \
|
2017-04-02 02:17:31 +00:00
|
|
|
"--without-ada" \
|
|
|
|
"--without-fallbacks" )
|
2015-11-08 07:31:46 +00:00
|
|
|
do_ncurses_backend host="${CT_BUILD}" \
|
|
|
|
destdir="${CT_BUILDTOOLS_PREFIX_DIR}" \
|
2015-11-10 02:36:52 +00:00
|
|
|
cflags="${CT_CFLAGS_FOR_BUILD}" \
|
|
|
|
ldflags="${CT_LDFLAGS_FOR_BUILD}" \
|
2017-04-02 02:17:31 +00:00
|
|
|
install_target=install.progs \
|
2015-11-08 07:31:46 +00:00
|
|
|
"${opts[@]}"
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2015-11-10 00:08:28 +00:00
|
|
|
if [ "${CT_NCURSES}" = "y" ]; then
|
|
|
|
do_ncurses_for_host() {
|
|
|
|
local -a opts
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing ncurses for host"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-ncurses-host-${CT_HOST}"
|
|
|
|
opts=("--enable-symlinks" \
|
|
|
|
"--without-manpages" \
|
|
|
|
"--without-tests" \
|
|
|
|
"--without-cxx" \
|
|
|
|
"--without-cxx-binding" \
|
2017-02-05 21:13:14 +00:00
|
|
|
"--without-ada" )
|
|
|
|
if [ "${CT_NCURSES_HOST_DISABLE_DB}" = "y" ]; then
|
2018-01-30 06:47:26 +00:00
|
|
|
opts+=( "--disable-database" \
|
|
|
|
"--disable-db-install" )
|
2017-02-17 20:07:39 +00:00
|
|
|
fi
|
|
|
|
if [ -n "${CT_NCURSES_HOST_FALLBACKS}" ]; then
|
|
|
|
opts+=( "--with-fallbacks=${CT_NCURSES_HOST_FALLBACKS}" )
|
2017-02-05 21:13:14 +00:00
|
|
|
fi
|
|
|
|
opts+=( "${CT_NCURSES_HOST_CONFIG_ARGS[@]}" )
|
2015-11-10 00:08:28 +00:00
|
|
|
do_ncurses_backend host="${CT_HOST}" \
|
|
|
|
prefix="${CT_HOST_COMPLIBS_DIR}" \
|
2015-11-10 02:36:52 +00:00
|
|
|
cflags="${CT_CFLAGS_FOR_HOST}" \
|
|
|
|
ldflags="${CT_LDFLAGS_FOR_HOST}" \
|
2015-11-10 00:08:28 +00:00
|
|
|
"${opts[@]}"
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
2015-11-08 07:31:46 +00:00
|
|
|
if [ "${CT_NCURSES_TARGET}" = "y" ]; then
|
|
|
|
do_ncurses_for_target() {
|
2016-09-10 00:35:53 +00:00
|
|
|
local prefix
|
|
|
|
|
2015-11-08 07:31:46 +00:00
|
|
|
CT_DoStep INFO "Installing ncurses for target"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-ncurses-target-${CT_TARGET}"
|
|
|
|
opts=("--without-sysmouse")
|
|
|
|
[ "${CT_CC_LANG_CXX}" = "y" ] || opts+=("--without-cxx" "--without-cxx-binding")
|
|
|
|
[ "${CT_CC_LANG_ADA}" = "y" ] || opts+=("--without-ada")
|
2017-02-05 21:13:14 +00:00
|
|
|
if [ "${CT_NCURSES_TARGET_DISABLE_DB}" = "y" ]; then
|
2017-02-17 20:07:39 +00:00
|
|
|
opts+=( "--disable-database" )
|
|
|
|
fi
|
|
|
|
if [ -n "${CT_NCURSES_TARGET_FALLBACKS}" ]; then
|
|
|
|
opts+=( "--with-fallbacks=${CT_NCURSES_TARGET_FALLBACKS}" )
|
2017-02-05 21:13:14 +00:00
|
|
|
fi
|
|
|
|
opts+=( "${CT_NCURSES_TARGET_CONFIG_ARGS[@]}" )
|
2016-09-10 00:35:53 +00:00
|
|
|
case "${CT_TARGET}" in
|
|
|
|
*-*-mingw*)
|
|
|
|
prefix="/mingw"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
prefix="/usr"
|
|
|
|
;;
|
|
|
|
esac
|
2015-11-08 07:31:46 +00:00
|
|
|
do_ncurses_backend host="${CT_TARGET}" \
|
2016-09-10 00:35:53 +00:00
|
|
|
prefix="${prefix}" \
|
2015-11-08 07:31:46 +00:00
|
|
|
destdir="${CT_SYSROOT_DIR}" \
|
2016-12-09 21:51:44 +00:00
|
|
|
shared="${CT_SHARED_LIBS}" \
|
2017-10-01 01:47:35 +00:00
|
|
|
cflags="${CT_TARGET_CFLAGS}" \
|
2015-11-08 07:31:46 +00:00
|
|
|
"${opts[@]}"
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Build libncurses
|
|
|
|
# Parameter : description : type : default
|
|
|
|
# host : machine to run on : tuple : (none)
|
|
|
|
# prefix : prefix to install into : dir : (none)
|
|
|
|
# cflags : cflags to use : string : (empty)
|
|
|
|
# ldflags : ldflags to use : string : (empty)
|
2016-12-09 21:51:44 +00:00
|
|
|
# shared : build shared lib : bool : n
|
2015-11-08 07:31:46 +00:00
|
|
|
# --* : passed to configure : n/a : n/a
|
|
|
|
do_ncurses_backend() {
|
|
|
|
local -a ncurses_opts
|
|
|
|
local host
|
|
|
|
local prefix
|
|
|
|
local cflags
|
|
|
|
local ldflags
|
2016-12-09 21:51:44 +00:00
|
|
|
local shared
|
2015-11-08 07:31:46 +00:00
|
|
|
local arg
|
2017-04-02 02:17:31 +00:00
|
|
|
local install_target=install
|
2015-11-08 07:31:46 +00:00
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
case "$arg" in
|
|
|
|
--*)
|
|
|
|
ncurses_opts+=("$arg")
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2015-11-15 04:15:56 +00:00
|
|
|
if [ "${CT_NCURSES_NEW_ABI}" != "y" ]; then
|
|
|
|
ncurses_opts+=("--with-abi-version=5")
|
|
|
|
fi
|
|
|
|
|
2016-12-09 21:51:44 +00:00
|
|
|
case "${host}" in
|
2015-11-10 00:08:28 +00:00
|
|
|
*-*-mingw*)
|
|
|
|
# Needed to build for mingw, see
|
|
|
|
# http://lists.gnu.org/archive/html/info-gnu/2011-02/msg00020.html
|
|
|
|
ncurses_opts+=("--enable-term-driver")
|
|
|
|
ncurses_opts+=("--enable-sp-funcs")
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-12-09 21:51:44 +00:00
|
|
|
if [ "${shared}" = "y" ]; then
|
|
|
|
ncurses_opts+=("--with-shared")
|
|
|
|
fi
|
|
|
|
|
2015-11-08 07:31:46 +00:00
|
|
|
CT_DoLog EXTRA "Configuring ncurses"
|
|
|
|
CT_DoExecLog CFG \
|
2015-11-10 02:36:52 +00:00
|
|
|
CFLAGS="${cflags}" \
|
|
|
|
LDFLAGS="${ldflags}" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
2017-05-30 05:32:38 +00:00
|
|
|
"${CT_SRC_DIR}/ncurses/configure" \
|
2015-11-08 07:31:46 +00:00
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${host} \
|
|
|
|
--prefix="${prefix}" \
|
|
|
|
--with-install-prefix="${destdir}" \
|
2016-12-09 21:51:44 +00:00
|
|
|
--without-debug \
|
2015-11-08 07:31:46 +00:00
|
|
|
--enable-termcap \
|
|
|
|
"${ncurses_opts[@]}"
|
|
|
|
|
|
|
|
# FIXME: old ncurses build code was removing -static from progs/Makefile,
|
|
|
|
# claiming static linking does not work on MacOS. A knowledge base article
|
|
|
|
# (https://developer.apple.com/library/mac/qa/qa1118/_index.html) says that
|
|
|
|
# static linking works just fine, just do not use it for libc (or other
|
|
|
|
# libraries that make system calls). ncurses use -static only for linking
|
|
|
|
# the curses library, then switches back to -dynamic - so they should be fine.
|
|
|
|
# FIXME: for target, we only need tic (terminfo compiler). However, building
|
|
|
|
# it also builds ncurses anyway, and dedicated targets (install.includes and
|
|
|
|
# install.progs) do not do well with parallel make (-jX).
|
|
|
|
CT_DoLog EXTRA "Building ncurses"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
2018-01-30 06:47:26 +00:00
|
|
|
|
|
|
|
# STRIPPROG is handled by our wrapper around install.
|
2015-11-08 07:31:46 +00:00
|
|
|
CT_DoLog EXTRA "Installing ncurses"
|
2018-01-30 06:47:26 +00:00
|
|
|
CT_DoExecLog ALL \
|
|
|
|
STRIPPROG="${host}-strip" \
|
|
|
|
make "${install_target}"
|
2015-11-08 07:31:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fi
|