2009-05-24 22:04:14 +00:00
|
|
|
# This file adds the functions to build the CLooG library
|
|
|
|
# Copyright 2009 Yann E. MORIN
|
|
|
|
# Licensed under the GPL v2. See COPYING in the root of this package
|
|
|
|
|
|
|
|
do_cloog_get() { :; }
|
|
|
|
do_cloog_extract() { :; }
|
2011-07-24 21:53:14 +00:00
|
|
|
do_cloog_for_build() { :; }
|
2011-07-17 16:56:30 +00:00
|
|
|
do_cloog_for_host() { :; }
|
2015-11-05 23:49:19 +00:00
|
|
|
do_cloog_for_target() { :; }
|
|
|
|
|
|
|
|
# Overide functions depending on configuration
|
|
|
|
if [ "${CT_CLOOG}" = "y" ]; then
|
2009-05-24 22:04:14 +00:00
|
|
|
|
|
|
|
# Download CLooG
|
|
|
|
do_cloog_get() {
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_Fetch CLOOG
|
2009-05-24 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Extract CLooG
|
|
|
|
do_cloog_extract() {
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_ExtractPatch CLOOG
|
2009-05-24 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
2013-05-04 22:01:05 +00:00
|
|
|
# Build CLooG for running on build
|
2011-07-24 21:53:14 +00:00
|
|
|
# - always build statically
|
|
|
|
# - install in build-tools prefix
|
|
|
|
do_cloog_for_build() {
|
|
|
|
local -a cloog_opts
|
|
|
|
|
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
|
|
|
native|cross) return 0;;
|
|
|
|
esac
|
|
|
|
|
2013-05-04 22:01:05 +00:00
|
|
|
CT_DoStep INFO "Installing CLooG for build"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-build-${CT_BUILD}"
|
2011-07-24 21:53:14 +00:00
|
|
|
|
|
|
|
cloog_opts+=( "host=${CT_BUILD}" )
|
|
|
|
cloog_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
|
2012-11-16 14:25:57 +00:00
|
|
|
cloog_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
|
|
|
|
cloog_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
|
2011-07-24 21:53:14 +00:00
|
|
|
do_cloog_backend "${cloog_opts[@]}"
|
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2013-05-04 22:01:05 +00:00
|
|
|
# Build CLooG for running on host
|
2011-07-17 16:56:30 +00:00
|
|
|
do_cloog_for_host() {
|
|
|
|
local -a cloog_opts
|
2009-09-13 10:25:33 +00:00
|
|
|
|
2013-05-04 22:01:05 +00:00
|
|
|
CT_DoStep INFO "Installing CLooG for host"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-host-${CT_HOST}"
|
2009-05-24 22:04:14 +00:00
|
|
|
|
2011-07-17 16:56:30 +00:00
|
|
|
cloog_opts+=( "host=${CT_HOST}" )
|
2011-07-25 17:04:17 +00:00
|
|
|
cloog_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
|
2011-07-17 16:56:30 +00:00
|
|
|
cloog_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
2012-11-16 14:25:57 +00:00
|
|
|
cloog_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
|
2011-07-17 16:56:30 +00:00
|
|
|
do_cloog_backend "${cloog_opts[@]}"
|
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2013-05-04 22:01:05 +00:00
|
|
|
# Build CLooG
|
2011-07-17 16:56:30 +00:00
|
|
|
# Parameter : description : type : default
|
|
|
|
# host : machine to run on : tuple : (none)
|
|
|
|
# prefix : prefix to install into : dir : (none)
|
2012-11-16 14:25:57 +00:00
|
|
|
# cflags : cflags to use : string : (empty)
|
|
|
|
# ldflags : ldflags to use : string : (empty)
|
2011-07-17 16:56:30 +00:00
|
|
|
do_cloog_backend() {
|
|
|
|
local host
|
|
|
|
local prefix
|
|
|
|
local cflags
|
2012-11-16 14:25:57 +00:00
|
|
|
local ldflags
|
2011-07-17 16:56:30 +00:00
|
|
|
local arg
|
2013-05-04 22:01:05 +00:00
|
|
|
local -a cloog_opts
|
2011-07-17 16:56:30 +00:00
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
done
|
2009-05-24 22:04:14 +00:00
|
|
|
|
2019-01-30 08:09:30 +00:00
|
|
|
cloog_opts+=( --with-gmp=system --with-gmp-prefix="${prefix}" )
|
|
|
|
cloog_opts+=( --with-isl=system --with-isl-prefix="${prefix}" )
|
|
|
|
cloog_opts+=( --without-osl )
|
2013-05-04 22:01:05 +00:00
|
|
|
|
2022-12-13 20:16:22 +00:00
|
|
|
if [ "${CT_CC_LANG_JIT}" = "y" ]; then
|
|
|
|
cloog_opts+=("--with-pic")
|
|
|
|
fi
|
|
|
|
|
2013-05-04 22:01:05 +00:00
|
|
|
CT_DoLog EXTRA "Configuring CLooG"
|
2010-04-10 22:47:23 +00:00
|
|
|
|
2015-11-23 03:13:53 +00:00
|
|
|
CT_DoExecLog CFG \
|
|
|
|
CFLAGS="${cflags}" \
|
|
|
|
LDFLAGS="${ldflags}" \
|
|
|
|
LIBS="-lm" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
2017-05-30 05:32:38 +00:00
|
|
|
"${CT_SRC_DIR}/cloog/configure" \
|
2015-12-08 17:09:49 +00:00
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${host} \
|
|
|
|
--prefix="${prefix}" \
|
|
|
|
--with-bits=gmp \
|
|
|
|
--with-host-libstdcxx='-lstdc++' \
|
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
2013-05-04 22:01:05 +00:00
|
|
|
"${cloog_opts[@]}"
|
2009-05-24 22:04:14 +00:00
|
|
|
|
2013-05-04 22:01:05 +00:00
|
|
|
CT_DoLog EXTRA "Building CLooG"
|
2019-04-04 23:47:50 +00:00
|
|
|
CT_DoExecLog ALL make ${CT_JOBSFLAGS}
|
2009-05-24 22:04:14 +00:00
|
|
|
|
2010-04-10 21:42:28 +00:00
|
|
|
if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
|
2017-02-11 20:49:48 +00:00
|
|
|
if [ "${host}" = "${CT_BUILD}" ]; then
|
|
|
|
CT_DoLog EXTRA "Checking CLooG"
|
2019-04-04 23:47:50 +00:00
|
|
|
CT_DoExecLog ALL make ${CT_JOBSFLAGS} -s check
|
2017-02-11 20:49:48 +00:00
|
|
|
else
|
|
|
|
# Cannot run host binaries on build in a canadian cross
|
|
|
|
CT_DoLog EXTRA "Skipping check for CLooG on the host"
|
|
|
|
fi
|
2009-05-24 22:04:14 +00:00
|
|
|
fi
|
|
|
|
|
2013-05-04 22:01:05 +00:00
|
|
|
CT_DoLog EXTRA "Installing CLooG"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make install
|
2009-05-24 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
2010-02-17 22:47:47 +00:00
|
|
|
fi # CT_CLOOG
|