scripts/build/companion_libs/130-cloog.sh
changeset 3218 3709e61ad85b
parent 3119 1c56c03b7ed5
     1.1 --- a/scripts/build/companion_libs/130-cloog.sh	Fri Nov 16 15:25:57 2012 +0100
     1.2 +++ b/scripts/build/companion_libs/130-cloog.sh	Sun May 05 00:01:05 2013 +0200
     1.3 @@ -7,12 +7,24 @@
     1.4  do_cloog_for_build() { :; }
     1.5  do_cloog_for_host() { :; }
     1.6  
     1.7 +cloog_basename() {
     1.8 +    printf "cloog"
     1.9 +    if [ "${CT_PPL}" = "y" ]; then
    1.10 +        printf -- "-ppl"
    1.11 +    fi
    1.12 +}
    1.13 +cloog_basename_version() {
    1.14 +    cloog_basename
    1.15 +    printf -- "-${CT_CLOOG_VERSION}"
    1.16 +}
    1.17 +
    1.18  # Overide functions depending on configuration
    1.19  if [ "${CT_CLOOG}" = "y" ]; then
    1.20  
    1.21  # Download CLooG
    1.22  do_cloog_get() {
    1.23 -    CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}"  \
    1.24 +    CT_GetFile "$(cloog_basename_version)"          \
    1.25 +        http://www.bastoul.net/cloog/pages/download \
    1.26          ftp://gcc.gnu.org/pub/gcc/infrastructure
    1.27  }
    1.28  
    1.29 @@ -24,20 +36,20 @@
    1.30      # while versions 0.15.4 onward do have the version in the dirname.
    1.31      # But, because the infrastructure properly creates the extracted
    1.32      # directories (with tar's --strip-components), we can live safely...
    1.33 -    CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
    1.34 -    CT_Patch "cloog-ppl" "${CT_CLOOG_VERSION}"
    1.35 +    CT_Extract "$(cloog_basename_version)"
    1.36 +    CT_Patch "$(cloog_basename)" "${CT_CLOOG_VERSION}"
    1.37  
    1.38      # Help the autostuff in case it thinks there are things to regenerate...
    1.39 -    CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}/m4"
    1.40 +    CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/$(cloog_basename_version)/m4"
    1.41  
    1.42      if [ "${CT_CLOOG_NEEDS_AUTORECONF}" = "y" ]; then
    1.43 -        CT_Pushd "${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
    1.44 +        CT_Pushd "${CT_SRC_DIR}/$(cloog_basename_version)"
    1.45          CT_DoExecLog CFG ./autogen.sh
    1.46          CT_Popd
    1.47      fi
    1.48  }
    1.49  
    1.50 -# Build CLooG/PPL for running on build
    1.51 +# Build CLooG for running on build
    1.52  # - always build statically
    1.53  # - we do not have build-specific CFLAGS
    1.54  # - install in build-tools prefix
    1.55 @@ -48,8 +60,8 @@
    1.56          native|cross)   return 0;;
    1.57      esac
    1.58  
    1.59 -    CT_DoStep INFO "Installing CLooG/PPL for build"
    1.60 -    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-ppl-build-${CT_BUILD}"
    1.61 +    CT_DoStep INFO "Installing CLooG for build"
    1.62 +    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-build-${CT_BUILD}"
    1.63  
    1.64      cloog_opts+=( "host=${CT_BUILD}" )
    1.65      cloog_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
    1.66 @@ -61,12 +73,12 @@
    1.67      CT_EndStep
    1.68  }
    1.69  
    1.70 -# Build CLooG/PPL for running on host
    1.71 +# Build CLooG for running on host
    1.72  do_cloog_for_host() {
    1.73      local -a cloog_opts
    1.74  
    1.75 -    CT_DoStep INFO "Installing CLooG/PPL for host"
    1.76 -    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-ppl-host-${CT_HOST}"
    1.77 +    CT_DoStep INFO "Installing CLooG for host"
    1.78 +    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-host-${CT_HOST}"
    1.79  
    1.80      cloog_opts+=( "host=${CT_HOST}" )
    1.81      cloog_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
    1.82 @@ -78,7 +90,7 @@
    1.83      CT_EndStep
    1.84  }
    1.85  
    1.86 -# Build ClooG/PPL
    1.87 +# Build CLooG
    1.88  #     Parameter     : description               : type      : default
    1.89  #     host          : machine to run on         : tuple     : (none)
    1.90  #     prefix        : prefix to install into    : dir       : (none)
    1.91 @@ -89,14 +101,30 @@
    1.92      local prefix
    1.93      local cflags
    1.94      local ldflags
    1.95 -    local cloog_src_dir="${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
    1.96 +    local cloog_src_dir="${CT_SRC_DIR}/$(cloog_basename_version)"
    1.97      local arg
    1.98 +    local -a cloog_opts
    1.99 +    local -a cloog_targets
   1.100 +    local -a cloog_install_targets
   1.101  
   1.102      for arg in "$@"; do
   1.103          eval "${arg// /\\ }"
   1.104      done
   1.105  
   1.106 -    CT_DoLog EXTRA "Configuring CLooG/ppl"
   1.107 +    if [ "${CT_CLOOG_0_18_or_later}" = y ]; then
   1.108 +            cloog_opts+=( --with-gmp=system --with-gmp-prefix="${prefix}" )
   1.109 +            cloog_opts+=( --with-isl=system --with-isl-prefix="${prefix}" )
   1.110 +            cloog_opts+=( --without-osl )
   1.111 +            cloog_targets=( all )
   1.112 +            cloog_install_targets=( install )
   1.113 +    else
   1.114 +            cloog_opts+=( --with-gmp="${prefix}" )
   1.115 +            cloog_opts+=( --with-ppl="${prefix}" )
   1.116 +            cloog_targets=( libcloog.la )
   1.117 +            cloog_install_targets=( install-libLTLIBRARIES install-pkgincludeHEADERS )
   1.118 +    fi
   1.119 +
   1.120 +    CT_DoLog EXTRA "Configuring CLooG"
   1.121  
   1.122      CT_DoExecLog CFG                            \
   1.123      CFLAGS="${cflags}"                          \
   1.124 @@ -106,23 +134,22 @@
   1.125          --build=${CT_BUILD}                     \
   1.126          --host=${host}                          \
   1.127          --prefix="${prefix}"                    \
   1.128 -        --with-gmp="${prefix}"                  \
   1.129 -        --with-ppl="${prefix}"                  \
   1.130          --with-bits=gmp                         \
   1.131          --with-host-libstdcxx='-lstdc++'        \
   1.132          --disable-shared                        \
   1.133 -        --enable-static
   1.134 +        --enable-static                         \
   1.135 +        "${cloog_opts[@]}"
   1.136  
   1.137 -    CT_DoLog EXTRA "Building CLooG/ppl"
   1.138 -    CT_DoExecLog ALL make ${JOBSFLAGS} libcloog.la
   1.139 +    CT_DoLog EXTRA "Building CLooG"
   1.140 +    CT_DoExecLog ALL make ${JOBSFLAGS} "${cloog_targets[@]}"
   1.141  
   1.142      if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
   1.143 -        CT_DoLog EXTRA "Checking CLooG/ppl"
   1.144 +        CT_DoLog EXTRA "Checking CLooG"
   1.145          CT_DoExecLog ALL make ${JOBSFLAGS} -s check
   1.146      fi
   1.147  
   1.148 -    CT_DoLog EXTRA "Installing CLooG/ppl"
   1.149 -    CT_DoExecLog ALL make install-libLTLIBRARIES install-pkgincludeHEADERS
   1.150 +    CT_DoLog EXTRA "Installing CLooG"
   1.151 +    CT_DoExecLog ALL make "${cloog_install_targets[@]}"
   1.152  }
   1.153  
   1.154  fi # CT_CLOOG