1 # This file adds the functions to build the PPL library
2 # Copyright 2009 Yann E. MORIN
3 # Licensed under the GPL v2. See COPYING in the root of this package
6 do_ppl_extract() { :; }
7 do_ppl_for_build() { :; }
8 do_ppl_for_host() { :; }
10 # Overide functions depending on configuration
11 if [ "${CT_PPL}" = "y" ]; then
15 CT_GetFile "ppl-${CT_PPL_VERSION}" \
16 http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION} \
17 ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION} \
18 ftp://gcc.gnu.org/pub/gcc/infrastructure
23 CT_Extract "ppl-${CT_PPL_VERSION}"
24 CT_Patch "ppl" "${CT_PPL_VERSION}"
27 # Build PPL for running on build
28 # - always build statically
29 # - we do not have build-specific CFLAGS
30 # - install in build-tools prefix
34 case "${CT_TOOLCHAIN_TYPE}" in
35 native|cross) return 0;;
38 CT_DoStep INFO "Installing PPL for build"
39 CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-build-${CT_BUILD}"
41 ppl_opts+=( "host=${CT_BUILD}" )
42 ppl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
43 ppl_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
44 ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
45 do_ppl_backend "${ppl_opts[@]}"
51 # Build PPL for running on host
55 CT_DoStep INFO "Installing PPL for host"
56 CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}"
58 ppl_opts+=( "host=${CT_HOST}" )
59 ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
60 ppl_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
61 ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
62 do_ppl_backend "${ppl_opts[@]}"
69 # Parameter : description : type : default
70 # host : machine to run on : tuple : (none)
71 # prefix : prefix to install into : dir : (none)
72 # cflags : cflags to use : string : (empty)
73 # ldflags : ldflags to use : string : (empty)
85 CT_DoLog EXTRA "Configuring PPL"
89 CXXFLAGS="${cflags}" \
90 LDFLAGS="${ldflags}" \
91 "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
94 --prefix="${prefix}" \
95 --with-libgmp-prefix="${prefix}" \
96 --with-libgmpxx-prefix="${prefix}" \
97 --with-gmp-prefix="${prefix}" \
100 --disable-assertions \
102 --disable-ppl_lpsol \
104 --enable-interfaces='c c++' \
108 # --enable-optimization=speed or sspeed (yes, with 2 's')
110 CT_DoLog EXTRA "Building PPL"
111 CT_DoExecLog ALL make ${JOBSFLAGS}
113 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
114 CT_DoLog EXTRA "Checking PPL"
115 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
118 CT_DoLog EXTRA "Installing PPL"
119 CT_DoExecLog ALL make install
121 # Remove spuriously installed file
122 CT_DoExecLog ALL rm -f "${prefix}/bin/ppl-config"