summaryrefslogtreecommitdiff
path: root/scripts/build/companion_libs
diff options
context:
space:
mode:
authorBryan Hundven <bryanhundven@gmail.com>2015-11-15 01:40:21 (GMT)
committerBryan Hundven <bryanhundven@gmail.com>2015-11-15 01:40:21 (GMT)
commit465e5a8b9fd65555af44a404c9b2e3b8ac12a874 (patch)
tree572505b982d45632bb741d930025130f73424f60 /scripts/build/companion_libs
parent38f5ad90054c835da8119a4a765c5a7834114e37 (diff)
parent847d1d8abf62f40cbc31060c492b9858de7bec10 (diff)
Merge pull request #249 from stilor/expat_ncurses
Promote expat/ncurses to 'companion libs'
Diffstat (limited to 'scripts/build/companion_libs')
-rw-r--r--scripts/build/companion_libs/100-gmp.sh1
-rw-r--r--scripts/build/companion_libs/110-mpfr.sh1
-rw-r--r--scripts/build/companion_libs/120-ppl.sh1
-rw-r--r--scripts/build/companion_libs/121-isl.sh1
-rw-r--r--scripts/build/companion_libs/130-cloog.sh7
-rw-r--r--scripts/build/companion_libs/140-mpc.sh1
-rw-r--r--scripts/build/companion_libs/210-expat.sh86
-rw-r--r--scripts/build/companion_libs/220-ncurses.sh152
-rwxr-xr-xscripts/build/companion_libs/320-libiconv.sh1
-rwxr-xr-xscripts/build/companion_libs/330-gettext.sh1
10 files changed, 249 insertions, 3 deletions
diff --git a/scripts/build/companion_libs/100-gmp.sh b/scripts/build/companion_libs/100-gmp.sh
index f0c96a2..f0df3d1 100644
--- a/scripts/build/companion_libs/100-gmp.sh
+++ b/scripts/build/companion_libs/100-gmp.sh
@@ -6,6 +6,7 @@ do_gmp_get() { :; }
do_gmp_extract() { :; }
do_gmp_for_build() { :; }
do_gmp_for_host() { :; }
+do_gmp_for_target() { :; }
# Overide functions depending on configuration
if [ "${CT_GMP}" = "y" ]; then
diff --git a/scripts/build/companion_libs/110-mpfr.sh b/scripts/build/companion_libs/110-mpfr.sh
index bef2283..bcbe90f 100644
--- a/scripts/build/companion_libs/110-mpfr.sh
+++ b/scripts/build/companion_libs/110-mpfr.sh
@@ -6,6 +6,7 @@ do_mpfr_get() { :; }
do_mpfr_extract() { :; }
do_mpfr_for_build() { :; }
do_mpfr_for_host() { :; }
+do_mpfr_for_target() { :; }
# Overide function depending on configuration
if [ "${CT_MPFR}" = "y" ]; then
diff --git a/scripts/build/companion_libs/120-ppl.sh b/scripts/build/companion_libs/120-ppl.sh
index c95ea56..cf4f99f 100644
--- a/scripts/build/companion_libs/120-ppl.sh
+++ b/scripts/build/companion_libs/120-ppl.sh
@@ -6,6 +6,7 @@ do_ppl_get() { :; }
do_ppl_extract() { :; }
do_ppl_for_build() { :; }
do_ppl_for_host() { :; }
+do_ppl_for_target() { :; }
# Overide functions depending on configuration
if [ "${CT_PPL}" = "y" ]; then
diff --git a/scripts/build/companion_libs/121-isl.sh b/scripts/build/companion_libs/121-isl.sh
index 5a623e1..823dbd5 100644
--- a/scripts/build/companion_libs/121-isl.sh
+++ b/scripts/build/companion_libs/121-isl.sh
@@ -6,6 +6,7 @@ do_isl_get() { :; }
do_isl_extract() { :; }
do_isl_for_build() { :; }
do_isl_for_host() { :; }
+do_isl_for_target() { :; }
# Overide functions depending on configuration
if [ "${CT_ISL}" = "y" ]; then
diff --git a/scripts/build/companion_libs/130-cloog.sh b/scripts/build/companion_libs/130-cloog.sh
index fe5ba13..f7b5798 100644
--- a/scripts/build/companion_libs/130-cloog.sh
+++ b/scripts/build/companion_libs/130-cloog.sh
@@ -6,6 +6,10 @@ do_cloog_get() { :; }
do_cloog_extract() { :; }
do_cloog_for_build() { :; }
do_cloog_for_host() { :; }
+do_cloog_for_target() { :; }
+
+# Overide functions depending on configuration
+if [ "${CT_CLOOG}" = "y" ]; then
cloog_basename() {
printf "cloog"
@@ -18,9 +22,6 @@ cloog_basename_version() {
printf -- "-${CT_CLOOG_VERSION}"
}
-# Overide functions depending on configuration
-if [ "${CT_CLOOG}" = "y" ]; then
-
# Download CLooG
do_cloog_get() {
CT_GetFile "$(cloog_basename_version)" \
diff --git a/scripts/build/companion_libs/140-mpc.sh b/scripts/build/companion_libs/140-mpc.sh
index b15eea6..f68e18e 100644
--- a/scripts/build/companion_libs/140-mpc.sh
+++ b/scripts/build/companion_libs/140-mpc.sh
@@ -6,6 +6,7 @@ do_mpc_get() { :; }
do_mpc_extract() { :; }
do_mpc_for_build() { :; }
do_mpc_for_host() { :; }
+do_mpc_for_target() { :; }
# Overide functions depending on configuration
if [ "${CT_MPC}" = "y" ]; then
diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh
new file mode 100644
index 0000000..17acf29
--- /dev/null
+++ b/scripts/build/companion_libs/210-expat.sh
@@ -0,0 +1,86 @@
+# Build script for expat
+
+do_expat_get() { :; }
+do_expat_extract() { :; }
+do_expat_for_build() { :; }
+do_expat_for_host() { :; }
+do_expat_for_target() { :; }
+
+if [ "${CT_EXPAT_TARGET}" = "y" -o "${CT_EXPAT}" = "y" ]; then
+
+do_expat_get() {
+ CT_GetFile "expat-${CT_EXPAT_VERSION}" .tar.gz \
+ http://downloads.sourceforge.net/project/expat/expat/${CT_EXPAT_VERSION}
+}
+
+do_expat_extract() {
+ CT_Extract "expat-${CT_EXPAT_VERSION}"
+ CT_Patch "expat" "${CT_EXPAT_VERSION}"
+}
+
+if [ "${CT_EXPAT}" = "y" ]; then
+# Do not need expat for build at this time.
+
+do_expat_for_host() {
+ CT_DoStep INFO "Installing expat for host"
+ CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-host-${CT_HOST}"
+
+ do_expat_backend host="${CT_HOST}" \
+ prefix="${CT_HOST_COMPLIBS_DIR}" \
+ cflags="${CT_CFLAGS_FOR_HOST}" \
+ ldflags="${CT_LDFLAGS_FOR_HOST}"
+
+ CT_Popd
+ CT_EndStep
+}
+fi
+
+if [ "${CT_EXPAT_TARGET}" = "y" ]; then
+do_expat_for_target() {
+ CT_DoStep INFO "Installing expat for target"
+ CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-target-${CT_TARGET}"
+
+ do_expat_backend host="${CT_TARGET}" \
+ prefix="/usr" \
+ destdir="${CT_SYSROOT_DIR}"
+
+ CT_Popd
+ CT_EndStep
+}
+fi
+
+# Build libexpat
+# Parameter : description : type : default
+# host : machine to run on : tuple : (none)
+# prefix : prefix to install into : dir : (none)
+# destdir : install destination : dir : (none)
+do_expat_backend() {
+ local host
+ local prefix
+ local cflags
+ local ldflags
+ local arg
+
+ for arg in "$@"; do
+ eval "${arg// /\\ }"
+ done
+
+ CT_DoLog EXTRA "Configuring expat"
+
+ CT_DoExecLog CFG \
+ CFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
+ "${CT_SRC_DIR}/expat-${CT_EXPAT_VERSION}/configure" \
+ --build=${CT_BUILD} \
+ --host=${host} \
+ --prefix="${prefix}" \
+ --enable-static \
+ --disable-shared
+
+ CT_DoLog EXTRA "Building expat"
+ CT_DoExecLog ALL make ${JOBSFLAGS}
+ CT_DoLog EXTRA "Installing expat"
+ CT_DoExecLog ALL make install INSTALL_ROOT="${destdir}"
+}
+
+fi
diff --git a/scripts/build/companion_libs/220-ncurses.sh b/scripts/build/companion_libs/220-ncurses.sh
new file mode 100644
index 0000000..176e99f
--- /dev/null
+++ b/scripts/build/companion_libs/220-ncurses.sh
@@ -0,0 +1,152 @@
+# 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() {
+ CT_GetFile "ncurses-${CT_NCURSES_VERSION}" .tar.gz \
+ {http,ftp,https}://ftp.gnu.org/pub/gnu/ncurses \
+ ftp://invisible-island.net/ncurses
+}
+
+do_ncurses_extract() {
+ CT_Extract "ncurses-${CT_NCURSES_VERSION}"
+ CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}"
+ CT_Patch "ncurses" "${CT_NCURSES_VERSION}"
+}
+
+# We need tic that runs on the build when building ncurses for host/target
+do_ncurses_for_build() {
+ local -a opts
+
+ 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" \
+ "--without-ada")
+ do_ncurses_backend host="${CT_BUILD}" \
+ destdir="${CT_BUILDTOOLS_PREFIX_DIR}" \
+ cflags="${CT_CFLAGS_FOR_BUILD}" \
+ ldflags="${CT_LDFLAGS_FOR_BUILD}" \
+ "${opts[@]}"
+ CT_Popd
+ CT_EndStep
+}
+
+if [ "${CT_NCURSES}" = "y" ]; then
+do_ncurses_for_host() {
+ local -a opts
+
+ # Unlike other companion libs, we skip host build if build==host
+ # (i.e. in simple cross or native): ncurses may not be needed for
+ # host, but we still need them on build to produce 'tic'.
+ case "${CT_TOOLCHAIN_TYPE}" in
+ native|cross) return 0;;
+ esac
+
+ 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" \
+ "--without-ada")
+ do_ncurses_backend host="${CT_HOST}" \
+ prefix="${CT_HOST_COMPLIBS_DIR}" \
+ cflags="${CT_CFLAGS_FOR_HOST}" \
+ ldflags="${CT_LDFLAGS_FOR_HOST}" \
+ "${opts[@]}"
+ CT_Popd
+ CT_EndStep
+}
+fi
+
+if [ "${CT_NCURSES_TARGET}" = "y" ]; then
+do_ncurses_for_target() {
+ 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")
+ do_ncurses_backend host="${CT_TARGET}" \
+ prefix="/usr" \
+ destdir="${CT_SYSROOT_DIR}" \
+ "${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)
+# --* : passed to configure : n/a : n/a
+do_ncurses_backend() {
+ local -a ncurses_opts
+ local host
+ local prefix
+ local cflags
+ local ldflags
+ local arg
+ local for_target
+
+ for arg in "$@"; do
+ case "$arg" in
+ --*)
+ ncurses_opts+=("$arg")
+ ;;
+ *)
+ eval "${arg// /\\ }"
+ ;;
+ esac
+ done
+
+ case "$host" in
+ *-*-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
+
+ CT_DoLog EXTRA "Configuring ncurses"
+ CT_DoExecLog CFG \
+ CFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
+ "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}/configure" \
+ --build=${CT_BUILD} \
+ --host=${host} \
+ --prefix="${prefix}" \
+ --with-install-prefix="${destdir}" \
+ --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"
+ CT_DoExecLog ALL make ${JOBSFLAGS}
+ CT_DoLog EXTRA "Installing ncurses"
+ CT_DoExecLog ALL make install
+}
+
+fi
diff --git a/scripts/build/companion_libs/320-libiconv.sh b/scripts/build/companion_libs/320-libiconv.sh
index e8417e9..f3461aa 100755
--- a/scripts/build/companion_libs/320-libiconv.sh
+++ b/scripts/build/companion_libs/320-libiconv.sh
@@ -4,6 +4,7 @@ do_libiconv_get() { :; }
do_libiconv_extract() { :; }
do_libiconv_for_build() { :; }
do_libiconv_for_host() { :; }
+do_libiconv_for_target() { :; }
if [ "${CT_LIBICONV}" = "y" ]; then
diff --git a/scripts/build/companion_libs/330-gettext.sh b/scripts/build/companion_libs/330-gettext.sh
index 5a3f461..6be51bf 100755
--- a/scripts/build/companion_libs/330-gettext.sh
+++ b/scripts/build/companion_libs/330-gettext.sh
@@ -4,6 +4,7 @@ do_gettext_get() { :; }
do_gettext_extract() { :; }
do_gettext_for_build() { :; }
do_gettext_for_host() { :; }
+do_gettext_for_target() { :; }
if [ "${CT_GETTEXT}" = "y" ]; then