scripts/build/companion_libs/121-isl.sh
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Sat May 04 00:08:34 2013 +0200 (2013-05-04)
changeset 3216 bfad02f03c75
child 3230 86a8d1d467c8
permissions -rw-r--r--
complibs: add ISL

ISL is used by gcc-4.8 onward for GRAPHITE, so is also used as
backend for CLooG 0.18.0 onward.

Reported-by: "Plotnikov Dmitry" <leitz@ispras.ru>
[Dmitry did a preliminray patch to add ISL, which this one is inspired from]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
     1 # This file adds the functions to build the ISL library
     2 # Copyright 2009 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_isl_get() { :; }
     6 do_isl_extract() { :; }
     7 do_isl_for_build() { :; }
     8 do_isl_for_host() { :; }
     9 
    10 # Overide functions depending on configuration
    11 if [ "${CT_ISL}" = "y" ]; then
    12 
    13 # Download ISL
    14 do_isl_get() {
    15     CT_GetFile "isl-${CT_ISL_VERSION}"  \
    16         ftp://ftp.linux.student.kuleuven.be/pub/people/skimo/isl/
    17 }
    18 
    19 # Extract ISL
    20 do_isl_extract() {
    21     CT_Extract "isl-${CT_ISL_VERSION}"
    22     CT_Patch "isl" "${CT_ISL_VERSION}"
    23 }
    24 
    25 # Build ISL for running on build
    26 # - always build statically
    27 # - we do not have build-specific CFLAGS
    28 # - install in build-tools prefix
    29 do_isl_for_build() {
    30     local -a isl_opts
    31     local isl_cflags
    32     local isl_cxxflags
    33 
    34     case "${CT_TOOLCHAIN_TYPE}" in
    35         native|cross)   return 0;;
    36     esac
    37 
    38     CT_DoStep INFO "Installing ISL for build"
    39     CT_mkdir_pushd "${CT_BUILD_DIR}/build-isl-build-${CT_BUILD}"
    40 
    41     isl_cflags="${CT_CFLAGS_FOR_BUILD}"
    42     isl_cxxflags="${CT_CFLAGS_FOR_BUILD}"
    43 
    44     isl_opts+=( "host=${CT_BUILD}" )
    45     isl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
    46     isl_opts+=( "cflags=${isl_cflags}" )
    47     isl_opts+=( "cxxflags=${isl_cxxflags}" )
    48     isl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
    49     do_isl_backend "${isl_opts[@]}"
    50 
    51     CT_Popd
    52     CT_EndStep
    53 }
    54 
    55 # Build ISL for running on host
    56 do_isl_for_host() {
    57     local -a isl_opts
    58     local isl_cflags
    59     local isl_cxxflags
    60 
    61     CT_DoStep INFO "Installing ISL for host"
    62     CT_mkdir_pushd "${CT_BUILD_DIR}/build-isl-host-${CT_HOST}"
    63 
    64     isl_cflags="${CT_CFLAGS_FOR_HOST}"
    65     isl_cxxflags="${CT_CFLAGS_FOR_HOST}"
    66 
    67     isl_opts+=( "host=${CT_HOST}" )
    68     isl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
    69     isl_opts+=( "cflags=${isl_cflags}" )
    70     isl_opts+=( "cxxflags=${isl_cxxflags}" )
    71     isl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
    72     do_isl_backend "${isl_opts[@]}"
    73 
    74     CT_Popd
    75     CT_EndStep
    76 }
    77 
    78 # Build ISL
    79 #     Parameter     : description               : type      : default
    80 #     host          : machine to run on         : tuple     : (none)
    81 #     prefix        : prefix to install into    : dir       : (none)
    82 #     cflags        : cflags to use             : string    : (empty)
    83 #     ldflags       : ldflags to use            : string    : (empty)
    84 do_isl_backend() {
    85     local host
    86     local prefix
    87     local cflags
    88     local cxxflags
    89     local ldflags
    90     local arg
    91 
    92     for arg in "$@"; do
    93         eval "${arg// /\\ }"
    94     done
    95 
    96     CT_DoLog EXTRA "Configuring ISL"
    97 
    98     CT_DoExecLog CFG                                \
    99     CFLAGS="${cflags}"                              \
   100     CXXFLAGS="${cxxflags}"                          \
   101     LDFLAGS="${ldflags}"                            \
   102     "${CT_SRC_DIR}/isl-${CT_ISL_VERSION}/configure" \
   103         --build=${CT_BUILD}                         \
   104         --host=${host}                              \
   105         --prefix="${prefix}"                        \
   106         --with-libgmp-prefix="${prefix}"            \
   107         --with-libgmpxx-prefix="${prefix}"          \
   108         --with-gmp-prefix="${prefix}"               \
   109         --disable-shared                            \
   110         --enable-static                             \
   111         --with-gmp=system                           \
   112         --with-gmp-prefix="${prefix}"               \
   113         --with-piplib=no                            \
   114         --with-clang=no
   115 
   116     CT_DoLog EXTRA "Building ISL"
   117     CT_DoExecLog ALL make ${JOBSFLAGS}
   118 
   119     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
   120         CT_DoLog EXTRA "Checking ISL"
   121         CT_DoExecLog ALL make ${JOBSFLAGS} -s check
   122     fi
   123 
   124     CT_DoLog EXTRA "Installing ISL"
   125     CT_DoExecLog ALL make install
   126 }
   127 
   128 fi # CT_ISL