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://bugseng.com/products/ppl/download/ftp/releases/${CT_PPL_VERSION}
21 CT_Extract "ppl-${CT_PPL_VERSION}"
22 CT_Patch "ppl" "${CT_PPL_VERSION}"
25 # Build PPL for running on build
26 # - always build statically
27 # - we do not have build-specific CFLAGS
28 # - install in build-tools prefix
33 case "${CT_TOOLCHAIN_TYPE}" in
34 native|cross) return 0;;
37 CT_DoStep INFO "Installing PPL for build"
38 CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-build-${CT_BUILD}"
40 ppl_cflags="${CT_CFLAGS_FOR_BUILD}"
41 if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
42 ppl_cflags+=" -fpermissive"
45 ppl_opts+=( "host=${CT_BUILD}" )
46 ppl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
47 ppl_opts+=( "cflags=${ppl_cflags}" )
48 ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
49 do_ppl_backend "${ppl_opts[@]}"
55 # Build PPL for running on host
60 CT_DoStep INFO "Installing PPL for host"
61 CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}"
63 ppl_cflags="${CT_CFLAGS_FOR_HOST}"
64 if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
65 ppl_cflags+=" -fpermissive"
68 ppl_opts+=( "host=${CT_HOST}" )
69 ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
70 ppl_opts+=( "cflags=${ppl_cflags}" )
71 ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
72 do_ppl_backend "${ppl_opts[@]}"
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)
95 CT_DoLog EXTRA "Configuring PPL"
99 CXXFLAGS="${cflags}" \
100 LDFLAGS="${ldflags}" \
101 "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
102 --build=${CT_BUILD} \
104 --prefix="${prefix}" \
105 --with-libgmp-prefix="${prefix}" \
106 --with-libgmpxx-prefix="${prefix}" \
107 --with-gmp-prefix="${prefix}" \
109 --disable-debugging \
110 --disable-assertions \
112 --disable-ppl_lpsol \
114 --enable-interfaces='c c++' \
118 # --enable-optimization=speed or sspeed (yes, with 2 's')
120 CT_DoLog EXTRA "Building PPL"
121 CT_DoExecLog ALL make ${JOBSFLAGS}
123 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
124 CT_DoLog EXTRA "Checking PPL"
125 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
128 CT_DoLog EXTRA "Installing PPL"
129 CT_DoExecLog ALL make install
131 # Remove spuriously installed file
132 CT_DoExecLog ALL rm -f "${prefix}/bin/ppl-config"