mxe/src/boost.mk

85 lines
2.8 KiB
Makefile
Raw Normal View History

2012-03-28 14:46:58 +01:00
# This file is part of MXE.
2012-03-29 11:14:15 +01:00
# See index.html for further information.
2009-01-31 05:52:28 +00:00
PKG := boost
$(PKG)_IGNORE :=
$(PKG)_VERSION := 1.60.0
$(PKG)_CHECKSUM := 686affff989ac2488f79a97b9479efb9f2abae035b5ed4d8226de6857933fd3b
$(PKG)_SUBDIR := boost_$(subst .,_,$($(PKG)_VERSION))
$(PKG)_FILE := boost_$(subst .,_,$($(PKG)_VERSION)).tar.bz2
$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/boost/boost/$($(PKG)_VERSION)/$($(PKG)_FILE)
2015-09-23 08:41:16 +01:00
$(PKG)_DEPS := gcc bzip2 expat zlib
2009-01-31 05:52:28 +00:00
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://www.boost.org/users/download/' | \
$(SED) -n 's,.*/boost/\([0-9][^"/]*\)/".*,\1,p' | \
2009-11-09 04:00:39 +00:00
grep -v beta | \
head -1
2009-01-31 05:52:28 +00:00
endef
define $(PKG)_BUILD
2012-07-01 19:19:16 +01:00
# old version appears to interfere
rm -rf '$(PREFIX)/$(TARGET)/include/boost/'
rm -f "$(PREFIX)/$(TARGET)/lib/libboost"*
2014-12-05 10:48:18 +00:00
# create user-config
echo 'using gcc : mxe : $(TARGET)-g++ : <rc>$(TARGET)-windres <archiver>$(TARGET)-ar <ranlib>$(TARGET)-ranlib ;' > '$(1)/user-config.jam'
# compile boost build (b2)
cd '$(1)/tools/build/' && ./bootstrap.sh
2014-12-05 10:48:18 +00:00
# cross-build, see b2 options at:
# http://www.boost.org/build/doc/html/bbv2/overview/invocation.html
cd '$(1)' && ./tools/build/b2 \
2014-12-05 10:48:18 +00:00
-a \
-q \
2009-01-31 05:52:28 +00:00
-j '$(JOBS)' \
--ignore-site-config \
2009-01-31 05:52:28 +00:00
--user-config=user-config.jam \
abi=ms \
2014-12-05 10:48:18 +00:00
address-model=$(BITS) \
architecture=x86 \
binary-format=pe \
link=$(if $(BUILD_STATIC),static,shared) \
2014-12-05 10:48:18 +00:00
target-os=windows \
2009-01-31 05:52:28 +00:00
threadapi=win32 \
2014-12-05 10:48:18 +00:00
threading=multi \
2015-06-09 02:43:35 +01:00
variant=release \
2014-12-05 10:48:18 +00:00
toolset=gcc-mxe \
cxxflags=$(if $(findstring posix,$(MXE_GCC_THREADS)),-std=gnu++11,-std=gnu++98) \
2009-09-02 13:08:54 +01:00
--layout=tagged \
2014-04-05 09:31:09 +01:00
--disable-icu \
2009-01-31 05:52:28 +00:00
--without-mpi \
--without-python \
--prefix='$(PREFIX)/$(TARGET)' \
--exec-prefix='$(PREFIX)/$(TARGET)/bin' \
--libdir='$(PREFIX)/$(TARGET)/lib' \
--includedir='$(PREFIX)/$(TARGET)/include' \
-sEXPAT_INCLUDE='$(PREFIX)/$(TARGET)/include' \
-sEXPAT_LIBPATH='$(PREFIX)/$(TARGET)/lib' \
2014-12-05 10:48:18 +00:00
install
2010-04-25 12:22:44 +01:00
$(if $(BUILD_SHARED), \
mv -fv '$(PREFIX)/$(TARGET)/lib/'libboost_*.dll '$(PREFIX)/$(TARGET)/bin/')
# setup cmake toolchain
echo 'set(Boost_THREADAPI "win32")' > '$(CMAKE_TOOLCHAIN_DIR)/$(PKG).cmake'
2010-04-25 12:22:44 +01:00
'$(TARGET)-g++' \
2010-05-14 18:53:19 +01:00
-W -Wall -Werror -ansi -U__STRICT_ANSI__ -pedantic \
2010-04-25 12:22:44 +01:00
'$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-boost.exe' \
-DBOOST_THREAD_USE_LIB \
-lboost_serialization-mt \
-lboost_thread_win32-mt \
-lboost_system-mt \
-lboost_chrono-mt
2015-10-02 13:53:29 +01:00
# test cmake
mkdir '$(1).test-cmake'
cd '$(1).test-cmake' && '$(TARGET)-cmake' \
-DPKG=$(PKG) \
-DPKG_VERSION=$($(PKG)_VERSION) \
'$(PWD)/src/cmake/test'
$(MAKE) -C '$(1).test-cmake' -j 1 install
2009-01-31 05:52:28 +00:00
endef