scripts/build/companion_libs/121-isl.sh
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Sun May 11 23:43:52 2014 +0200 (2014-05-11)
changeset 3320 78af1c99bc6d
parent 3216 bfad02f03c75
permissions -rw-r--r--
scripts/functions: add target_endian_le and target_endian_be

We currently define target_endian_el and target_endian_eb to be the
tuple extension depending on endianness, defined to be respectively
'el' or 'eb' according to the endianness.

Some architecture do not use 'el' or 'eb', but use 'le' or 'be'.

Provide that as well, as two new variables: target_endian_le and
target_endian_be.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Cody P Schafer <dev@codyps.com>
     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         http://mirrors.kernel.org/sources.redhat.com/gcc/infrastructure
    18 }
    19 
    20 # Extract ISL
    21 do_isl_extract() {
    22     CT_Extract "isl-${CT_ISL_VERSION}"
    23     CT_Patch "isl" "${CT_ISL_VERSION}"
    24 }
    25 
    26 # Build ISL for running on build
    27 # - always build statically
    28 # - we do not have build-specific CFLAGS
    29 # - install in build-tools prefix
    30 do_isl_for_build() {
    31     local -a isl_opts
    32     local isl_cflags
    33     local isl_cxxflags
    34 
    35     case "${CT_TOOLCHAIN_TYPE}" in
    36         native|cross)   return 0;;
    37     esac
    38 
    39     CT_DoStep INFO "Installing ISL for build"
    40     CT_mkdir_pushd "${CT_BUILD_DIR}/build-isl-build-${CT_BUILD}"
    41 
    42     isl_cflags="${CT_CFLAGS_FOR_BUILD}"
    43     isl_cxxflags="${CT_CFLAGS_FOR_BUILD}"
    44 
    45     isl_opts+=( "host=${CT_BUILD}" )
    46     isl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
    47     isl_opts+=( "cflags=${isl_cflags}" )
    48     isl_opts+=( "cxxflags=${isl_cxxflags}" )
    49     isl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
    50     do_isl_backend "${isl_opts[@]}"
    51 
    52     CT_Popd
    53     CT_EndStep
    54 }
    55 
    56 # Build ISL for running on host
    57 do_isl_for_host() {
    58     local -a isl_opts
    59     local isl_cflags
    60     local isl_cxxflags
    61 
    62     CT_DoStep INFO "Installing ISL for host"
    63     CT_mkdir_pushd "${CT_BUILD_DIR}/build-isl-host-${CT_HOST}"
    64 
    65     isl_cflags="${CT_CFLAGS_FOR_HOST}"
    66     isl_cxxflags="${CT_CFLAGS_FOR_HOST}"
    67 
    68     isl_opts+=( "host=${CT_HOST}" )
    69     isl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
    70     isl_opts+=( "cflags=${isl_cflags}" )
    71     isl_opts+=( "cxxflags=${isl_cxxflags}" )
    72     isl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
    73     do_isl_backend "${isl_opts[@]}"
    74 
    75     CT_Popd
    76     CT_EndStep
    77 }
    78 
    79 # Build ISL
    80 #     Parameter     : description               : type      : default
    81 #     host          : machine to run on         : tuple     : (none)
    82 #     prefix        : prefix to install into    : dir       : (none)
    83 #     cflags        : cflags to use             : string    : (empty)
    84 #     ldflags       : ldflags to use            : string    : (empty)
    85 do_isl_backend() {
    86     local host
    87     local prefix
    88     local cflags
    89     local cxxflags
    90     local ldflags
    91     local arg
    92 
    93     for arg in "$@"; do
    94         eval "${arg// /\\ }"
    95     done
    96 
    97     CT_DoLog EXTRA "Configuring ISL"
    98 
    99     CT_DoExecLog CFG                                \
   100     CFLAGS="${cflags}"                              \
   101     CXXFLAGS="${cxxflags}"                          \
   102     LDFLAGS="${ldflags}"                            \
   103     "${CT_SRC_DIR}/isl-${CT_ISL_VERSION}/configure" \
   104         --build=${CT_BUILD}                         \
   105         --host=${host}                              \
   106         --prefix="${prefix}"                        \
   107         --with-libgmp-prefix="${prefix}"            \
   108         --with-libgmpxx-prefix="${prefix}"          \
   109         --with-gmp-prefix="${prefix}"               \
   110         --disable-shared                            \
   111         --enable-static                             \
   112         --with-gmp=system                           \
   113         --with-gmp-prefix="${prefix}"               \
   114         --with-piplib=no                            \
   115         --with-clang=no
   116 
   117     CT_DoLog EXTRA "Building ISL"
   118     CT_DoExecLog ALL make ${JOBSFLAGS}
   119 
   120     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
   121         CT_DoLog EXTRA "Checking ISL"
   122         CT_DoExecLog ALL make ${JOBSFLAGS} -s check
   123     fi
   124 
   125     CT_DoLog EXTRA "Installing ISL"
   126     CT_DoExecLog ALL make install
   127 }
   128 
   129 fi # CT_ISL