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
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_cflags="${CT_CFLAGS_FOR_BUILD}"
42 ppl_cxxflags="${CT_CFLAGS_FOR_BUILD}"
43 if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
44 ppl_cxxflags+=" -fpermissive"
47 ppl_opts+=( "host=${CT_BUILD}" )
48 ppl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
49 ppl_opts+=( "cflags=${ppl_cflags}" )
50 ppl_opts+=( "cxxflags=${ppl_cxxflags}" )
51 ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
52 do_ppl_backend "${ppl_opts[@]}"
58 # Build PPL for running on host
64 CT_DoStep INFO "Installing PPL for host"
65 CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}"
67 ppl_cflags="${CT_CFLAGS_FOR_HOST}"
68 ppl_cxxflags="${CT_CFLAGS_FOR_HOST}"
69 if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
70 ppl_cxxflags+=" -fpermissive"
73 ppl_opts+=( "host=${CT_HOST}" )
74 ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
75 ppl_opts+=( "cflags=${ppl_cflags}" )
76 ppl_opts+=( "cxxflags=${ppl_cxxflags}" )
77 ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
78 do_ppl_backend "${ppl_opts[@]}"
85 # Parameter : description : type : default
86 # host : machine to run on : tuple : (none)
87 # prefix : prefix to install into : dir : (none)
88 # cflags : cflags to use : string : (empty)
89 # ldflags : ldflags to use : string : (empty)
102 CT_DoLog EXTRA "Configuring PPL"
106 CXXFLAGS="${cxxflags}" \
107 LDFLAGS="${ldflags}" \
108 "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
109 --build=${CT_BUILD} \
111 --prefix="${prefix}" \
112 --with-libgmp-prefix="${prefix}" \
113 --with-libgmpxx-prefix="${prefix}" \
114 --with-gmp-prefix="${prefix}" \
116 --disable-debugging \
117 --disable-assertions \
119 --disable-ppl_lpsol \
121 --enable-interfaces='c c++' \
125 # --enable-optimization=speed or sspeed (yes, with 2 's')
127 CT_DoLog EXTRA "Building PPL"
128 CT_DoExecLog ALL make ${JOBSFLAGS}
130 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
131 CT_DoLog EXTRA "Checking PPL"
132 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
135 CT_DoLog EXTRA "Installing PPL"
136 CT_DoExecLog ALL make install
138 # Remove spuriously installed file
139 CT_DoExecLog ALL rm -f "${prefix}/bin/ppl-config"