Allow leaving /etc as untouched as possible
[openadk.git] / package / boost / Makefile
blob4bd6b2c441202efe30ce4c35c7938062de0ddf46
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include ${TOPDIR}/rules.mk
6 PKG_NAME:= boost
7 PKG_VERSION:= 1_47_0
8 PKG_RELEASE:= 1
9 PKG_MD5SUM:= ff180a5276bec773a7625cac7e2288e8
10 PKG_DESCR:= boost C++ library
11 PKG_SECTION:= libs
12 PKG_URL:= http://www.boost.org/
13 PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=boost/}
15 DISTFILES:= boost_1_47_0.tar.gz
16 WRKDIST= ${WRKDIR}/${PKG_NAME}_${PKG_VERSION}
18 PKG_ARCH_DEPENDS:= !mips
20 PKG_SUBPKGS:= BOOST BOOST_DEV
21 PKGSD_BOOST_DEV:= boost header files
22 PKGSC_BOOST_DEV:= devel
24 PKG_CHOICES_BOOST:= STATIC SHARED BOTH
25 PKGCD_STATIC:= install static libs
26 PKGCD_SHARED:= install shared libs
27 PKGCD_BOTH:= install static and shared libs
29 PKG_FLAVOURS_BOOST:= date_time graph graph_parallel iostreams math program_options python regex serialization signals system test thread wave
31 PKGFD_date_time:= with date-time
32 PKGFD_python:= with Python
33 PKGFB_python:= python2
34 PKGFS_python:= python2
35 PKGFD_iostreams:= with iostreams
36 PKGFD_graph:= with graph
37 PKGFD_graph_parallel:= with graph_parallel
38 PKGFD_math:= with math
39 PKGFD_program_options:= with program_options
40 PKGFD_regex:= with regex
41 PKGFD_serialization:= with serialization
42 PKGFD_signals:= with signals
43 PKGFD_system:= with system
44 PKGFD_test:= with test
45 PKGFD_thread:= with thread
46 PKGFD_wave:= with wave
48 include ${TOPDIR}/mk/package.mk
50 $(eval $(call PKG_template,BOOST,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
51 $(eval $(call PKG_template,BOOST_DEV,boost-dev,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_BOOST_DEV},${PKGSC_BOOST_DEV}))
53 CONFIG_STYLE:= manual
54 BUILD_STYLE:= manual
55 INSTALL_STYLE:= manual
57 CONFIGURE_ARGS += \
58 --target=$(GNU_TARGET_NAME) \
59 --host=$(GNU_TARGET_NAME) \
60 --build=$(GNU_HOST_NAME) \
61 --prefix=${WRKINST}/usr \
63 ifneq (${ADK_PACKAGE_BOOST_IOSTREAMS},)
64 CONFIGURE_ARGS += -sNO_BZIP2=1 -sZLIB_INCLUDE=${STAGING_DIR}/usr/include -sZLIB_LIBPATH=${STAGING_DIR}/usr/lib
65 else
66 CONFIGURE_ARGS += --without-iostreams
67 endif
68 ifeq (${ADK_PACKAGE_BOOST_DATE_TIME},)
69 CONFIGURE_ARGS+=--without-date_time
70 endif
71 ifeq (${ADK_PACKAGE_BOOST_PYTHON},)
72 CONFIGURE_ARGS+=--without-python
73 endif
74 ifeq (${ADK_PACKAGE_BOOST_GRAPH},)
75 CONFIGURE_ARGS+=--without-graph
76 endif
77 ifeq (${ADK_PACKAGE_BOOST_math},)
78 CONFIGURE_ARGS+=--without-math
79 endif
80 ifeq (${ADK_PACKAGE_BOOST_PROGRAM_OPTIONS},)
81 CONFIGURE_ARGS+=--without-program_options
82 endif
83 ifeq (${ADK_PACKAGE_BOOST_REGEX},)
84 CONFIGURE_ARGS+=--without-regex
85 endif
86 ifeq (${ADK_PACKAGE_BOOST_SERIALIZATION},)
87 CONFIGURE_ARGS+=--without-serialization
88 endif
89 ifeq (${ADK_PACKAGE_BOOST_SIGNALS},)
90 CONFIGURE_ARGS+=--without-signals
91 endif
92 ifeq (${ADK_PACKAGE_BOOST_SYSTEM},)
93 CONFIGURE_ARGS+=--without-system
94 endif
95 ifeq (${ADK_PACKAGE_BOOST_TEST},)
96 CONFIGURE_ARGS+=--without-test
97 endif
98 ifeq (${ADK_PACKAGE_BOOST_THREAD},)
99 CONFIGURE_ARGS+=--without-thread
100 endif
101 ifeq (${ADK_PACKAGE_BOOST_WAVE},)
102 CONFIGURE_ARGS+=--without-wave
103 endif
105 # some variables for build
106 GPP_PATH:= ${STAGING_HOST_DIR}/bin/${GNU_TARGET_NAME}-g++
107 GPP_VERSION:= "`${GPP_PATH} -v 2>&1 | tail -1 | awk '{print $$3}'`"
108 BJAM_PATH:= "`find ${WRKBUILD} -type f -name "bjam"`"
109 PYTHON_PATH:= ${STAGING_TARGET_DIR}/usr/bin/python
110 PYTHON_INCLUDE:="`find ${STAGING_TARGET_DIR}/usr/include/ -maxdepth 1 -type d -name "python*" | head -1`"
111 PYTHON_LIB:= "`find ${STAGING_TARGET_DIR}/usr/lib/ -maxdepth 1 -type d -name "python*" | head -1`"
112 USER_JAM:= ${WRKBUILD}/tools/build/v2/user-config.jam
114 pre-build:
115 @echo "build bjam..."
116 cd $(WRKBUILD)/tools/build/v2/engine; ./build.sh gcc
118 do-build:
119 @echo "build boost library..."
120 # remove exisiting using gcc line from user.jam
121 ${SED} "/^using gcc/d" ${USER_JAM}
122 # add using gcc line with determined options to user.jam
123 echo "using gcc : ${GPP_VERSION} : ${GPP_PATH} ;" >> ${USER_JAM};
125 # remove exisiting using python line from user.jam
126 ${SED} "/^using python/d" ${USER_JAM}
127 ifneq (${ADK_PACKAGE_BOOST_PYTHON},)
128 # add using python line with determined options to user.jam
129 echo "using python : ${PYTHON_VERSION} : ${PYTHON_PATH} : ${PYTHON_INCLUDE} : ${PYTHON_LIB} ;" >> ${USER_JAM};
130 endif
132 # run bjam to build boost
133 ( cd ${WRKBUILD}; \
134 ${BJAM_PATH} \
135 -sBUILD=release \
136 --toolset=gcc-${GPP_VERSION} \
137 --build-type=minimal \
138 --layout=versioned \
139 --disable-long-double \
140 --without-mpi \
141 ${CONFIGURE_ARGS} \
142 install \
145 boost-install:
146 ${INSTALL_DIR} ${IDIR_BOOST}/usr/lib
147 ifneq (${ADK_PACKAGE_BOOST_SHARED},)
148 ${CP} ${WRKINST}/usr/lib/*.so* ${IDIR_BOOST}/usr/lib
149 endif
150 ifneq (${ADK_PACKAGE_BOOST_STATIC},)
151 ${CP} ${WRKINST}/usr/lib/*.a ${IDIR_BOOST}/usr/lib
152 endif
153 ifneq (${ADK_PACKAGE_BOOST_BOTH},)
154 ${CP} ${WRKINST}/usr/lib/*.a ${IDIR_BOOST}/usr/lib
155 ${CP} ${WRKINST}/usr/lib/*.so* ${IDIR_BOOST}/usr/lib
156 endif
158 boost-dev-install:
159 ${INSTALL_DIR} ${IDIR_BOOST_DEV}/usr/include
160 ${CP} ${WRKINST}/usr/include/* ${IDIR_BOOST_DEV}/usr/include
162 include ${TOPDIR}/mk/pkg-bottom.mk