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
35 case "${CT_TOOLCHAIN_TYPE}" in
36 native|cross) return 0;;
39 CT_DoStep INFO "Installing PPL for build"
40 CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-build-${CT_BUILD}"
42 ppl_cflags="${CT_CFLAGS_FOR_BUILD}"
43 if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
44 ppl_cflags+=" -fpermissive"
47 ppl_opts+=( "host=${CT_BUILD}" )
48 ppl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
49 ppl_opts+=( "cflags=${ppl_cflags}" )
50 ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
51 do_ppl_backend "${ppl_opts[@]}"
57 # Build PPL for running on host
62 CT_DoStep INFO "Installing PPL for host"
63 CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}"
65 ppl_cflags="${CT_CFLAGS_FOR_HOST}"
66 if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
67 ppl_cflags+=" -fpermissive"
70 ppl_opts+=( "host=${CT_HOST}" )
71 ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
72 ppl_opts+=( "cflags=${ppl_cflags}" )
73 ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
74 do_ppl_backend "${ppl_opts[@]}"
81 # Parameter : description : type : default
82 # host : machine to run on : tuple : (none)
83 # prefix : prefix to install into : dir : (none)
84 # cflags : cflags to use : string : (empty)
85 # ldflags : ldflags to use : string : (empty)
97 CT_DoLog EXTRA "Configuring PPL"
101 CXXFLAGS="${cflags}" \
102 LDFLAGS="${ldflags}" \
103 "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
104 --build=${CT_BUILD} \
106 --prefix="${prefix}" \
107 --with-libgmp-prefix="${prefix}" \
108 --with-libgmpxx-prefix="${prefix}" \
109 --with-gmp-prefix="${prefix}" \
111 --disable-debugging \
112 --disable-assertions \
114 --disable-ppl_lpsol \
116 --enable-interfaces='c c++' \
120 # --enable-optimization=speed or sspeed (yes, with 2 's')
122 CT_DoLog EXTRA "Building PPL"
123 CT_DoExecLog ALL make ${JOBSFLAGS}
125 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
126 CT_DoLog EXTRA "Checking PPL"
127 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
130 CT_DoLog EXTRA "Installing PPL"
131 CT_DoExecLog ALL make install
133 # Remove spuriously installed file
134 CT_DoExecLog ALL rm -f "${prefix}/bin/ppl-config"