scripts/build/companion_libs/130-cloog.sh
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Mon May 26 23:25:17 2014 +0200 (2014-05-26)
changeset 3324 1eea25c0bfe7
parent 3119 1c56c03b7ed5
permissions -rw-r--r--
complibs/cloog: remove old CLooG/PPL versions

Those versions are no longer available upstream. They have purely and
simply disapeared, without leaving any trace of their mere existences.

Just keep the latest cloog-ppl-0.15.11, which still exists on the gcc
infra mirror (but for how long?)

Reported-by: Guillaume FLORENCE-COURTAND <gflorenc@laposte.net>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
yann@1380
     1
# This file adds the functions to build the CLooG library
yann@1380
     2
# Copyright 2009 Yann E. MORIN
yann@1380
     3
# Licensed under the GPL v2. See COPYING in the root of this package
yann@1380
     4
yann@1380
     5
do_cloog_get() { :; }
yann@1380
     6
do_cloog_extract() { :; }
yann@2929
     7
do_cloog_for_build() { :; }
yann@2927
     8
do_cloog_for_host() { :; }
yann@1380
     9
yann@3218
    10
cloog_basename() {
yann@3218
    11
    printf "cloog"
yann@3218
    12
    if [ "${CT_PPL}" = "y" ]; then
yann@3218
    13
        printf -- "-ppl"
yann@3218
    14
    fi
yann@3218
    15
}
yann@3218
    16
cloog_basename_version() {
yann@3218
    17
    cloog_basename
yann@3218
    18
    printf -- "-${CT_CLOOG_VERSION}"
yann@3218
    19
}
yann@3218
    20
yann@1380
    21
# Overide functions depending on configuration
yann@1808
    22
if [ "${CT_CLOOG}" = "y" ]; then
yann@1380
    23
yann@1380
    24
# Download CLooG
yann@1380
    25
do_cloog_get() {
yann@3218
    26
    CT_GetFile "$(cloog_basename_version)"          \
yann@3218
    27
        http://www.bastoul.net/cloog/pages/download \
yann@1380
    28
        ftp://gcc.gnu.org/pub/gcc/infrastructure
yann@1380
    29
}
yann@1380
    30
yann@1380
    31
# Extract CLooG
yann@1380
    32
do_cloog_extract() {
yann@1530
    33
    local _t
yann@1530
    34
yann@1530
    35
    # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
yann@1530
    36
    # while versions 0.15.4 onward do have the version in the dirname.
yann@2757
    37
    # But, because the infrastructure properly creates the extracted
yann@2757
    38
    # directories (with tar's --strip-components), we can live safely...
yann@3218
    39
    CT_Extract "$(cloog_basename_version)"
yann@3218
    40
    CT_Patch "$(cloog_basename)" "${CT_CLOOG_VERSION}"
yann@2757
    41
yann@3018
    42
    # Help the autostuff in case it thinks there are things to regenerate...
yann@3218
    43
    CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/$(cloog_basename_version)/m4"
yann@3018
    44
yann@2758
    45
    if [ "${CT_CLOOG_NEEDS_AUTORECONF}" = "y" ]; then
yann@3218
    46
        CT_Pushd "${CT_SRC_DIR}/$(cloog_basename_version)"
yann@2704
    47
        CT_DoExecLog CFG ./autogen.sh
yann@2757
    48
        CT_Popd
yann@2262
    49
    fi
yann@1380
    50
}
yann@1380
    51
yann@3218
    52
# Build CLooG for running on build
yann@2929
    53
# - always build statically
yann@2929
    54
# - we do not have build-specific CFLAGS
yann@2929
    55
# - install in build-tools prefix
yann@2929
    56
do_cloog_for_build() {
yann@2929
    57
    local -a cloog_opts
yann@2929
    58
yann@2929
    59
    case "${CT_TOOLCHAIN_TYPE}" in
yann@2929
    60
        native|cross)   return 0;;
yann@2929
    61
    esac
yann@2929
    62
yann@3218
    63
    CT_DoStep INFO "Installing CLooG for build"
yann@3218
    64
    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-build-${CT_BUILD}"
yann@2929
    65
yann@2929
    66
    cloog_opts+=( "host=${CT_BUILD}" )
yann@2929
    67
    cloog_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
diorcet@3119
    68
    cloog_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
diorcet@3119
    69
    cloog_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
yann@2929
    70
    do_cloog_backend "${cloog_opts[@]}"
yann@2929
    71
yann@2929
    72
    CT_Popd
yann@2929
    73
    CT_EndStep
yann@2929
    74
}
yann@2929
    75
yann@3218
    76
# Build CLooG for running on host
yann@2927
    77
do_cloog_for_host() {
yann@2927
    78
    local -a cloog_opts
yann@2927
    79
yann@3218
    80
    CT_DoStep INFO "Installing CLooG for host"
yann@3218
    81
    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-host-${CT_HOST}"
yann@2927
    82
yann@2927
    83
    cloog_opts+=( "host=${CT_HOST}" )
yann@2931
    84
    cloog_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
yann@2927
    85
    cloog_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
diorcet@3119
    86
    cloog_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
yann@2927
    87
    do_cloog_backend "${cloog_opts[@]}"
yann@2927
    88
yann@2927
    89
    CT_Popd
yann@2927
    90
    CT_EndStep
yann@2927
    91
}
yann@2927
    92
yann@3218
    93
# Build CLooG
yann@2927
    94
#     Parameter     : description               : type      : default
yann@2927
    95
#     host          : machine to run on         : tuple     : (none)
yann@2927
    96
#     prefix        : prefix to install into    : dir       : (none)
diorcet@3119
    97
#     cflags        : cflags to use             : string    : (empty)
diorcet@3119
    98
#     ldflags       : ldflags to use            : string    : (empty)
yann@2927
    99
do_cloog_backend() {
yann@2927
   100
    local host
yann@2927
   101
    local prefix
yann@2927
   102
    local cflags
diorcet@3119
   103
    local ldflags
yann@3218
   104
    local cloog_src_dir="${CT_SRC_DIR}/$(cloog_basename_version)"
yann@2927
   105
    local arg
yann@3218
   106
    local -a cloog_opts
yann@3218
   107
    local -a cloog_targets
yann@3218
   108
    local -a cloog_install_targets
yann@1537
   109
yann@2927
   110
    for arg in "$@"; do
yann@2927
   111
        eval "${arg// /\\ }"
yann@2927
   112
    done
yann@1380
   113
yann@3218
   114
    if [ "${CT_CLOOG_0_18_or_later}" = y ]; then
yann@3218
   115
            cloog_opts+=( --with-gmp=system --with-gmp-prefix="${prefix}" )
yann@3218
   116
            cloog_opts+=( --with-isl=system --with-isl-prefix="${prefix}" )
yann@3218
   117
            cloog_opts+=( --without-osl )
yann@3218
   118
            cloog_targets=( all )
yann@3218
   119
            cloog_install_targets=( install )
yann@3218
   120
    else
yann@3218
   121
            cloog_opts+=( --with-gmp="${prefix}" )
yann@3218
   122
            cloog_opts+=( --with-ppl="${prefix}" )
yann@3218
   123
            cloog_targets=( libcloog.la )
yann@3218
   124
            cloog_install_targets=( install-libLTLIBRARIES install-pkgincludeHEADERS )
yann@3218
   125
    fi
yann@3218
   126
yann@3218
   127
    CT_DoLog EXTRA "Configuring CLooG"
yann@1892
   128
yann@2349
   129
    CT_DoExecLog CFG                            \
yann@2927
   130
    CFLAGS="${cflags}"                          \
diorcet@3119
   131
    LDFLAGS="${ldflags}"                        \
benoit@2854
   132
    LIBS="-lm"                                  \
yann@2757
   133
    "${cloog_src_dir}/configure"                \
yann@1537
   134
        --build=${CT_BUILD}                     \
yann@2927
   135
        --host=${host}                          \
yann@2927
   136
        --prefix="${prefix}"                    \
yann@1892
   137
        --with-bits=gmp                         \
yann@2381
   138
        --with-host-libstdcxx='-lstdc++'        \
yann@2381
   139
        --disable-shared                        \
yann@3218
   140
        --enable-static                         \
yann@3218
   141
        "${cloog_opts[@]}"
yann@1380
   142
yann@3218
   143
    CT_DoLog EXTRA "Building CLooG"
yann@3218
   144
    CT_DoExecLog ALL make ${JOBSFLAGS} "${cloog_targets[@]}"
yann@1380
   145
yann@1890
   146
    if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
yann@3218
   147
        CT_DoLog EXTRA "Checking CLooG"
yann@2275
   148
        CT_DoExecLog ALL make ${JOBSFLAGS} -s check
yann@1380
   149
    fi
yann@1380
   150
yann@3218
   151
    CT_DoLog EXTRA "Installing CLooG"
yann@3218
   152
    CT_DoExecLog ALL make "${cloog_install_targets[@]}"
yann@1380
   153
}
yann@1380
   154
yann@1808
   155
fi # CT_CLOOG