Added android/linux arm targets for boost.
authorDaniel G <giri@nwrk.biz>
Wed, 30 Jan 2019 01:24:16 +0000 (02:24 +0100)
committerDaniel G <giri@nwrk.biz>
Wed, 30 Jan 2019 01:24:16 +0000 (02:24 +0100)
_template/packages/boost/Makefile

index f48da82..fb27ba3 100644 (file)
@@ -6,33 +6,66 @@
 ############################################################################
 WORKDIR = $(shell pwd)
 
-all: unpack linux clean windows
+MODULES=--with-system --with-date_time --with-regex --with-thread
+
+# Avaiable Modules
+# atomic, chrono, container, context, contract, coroutine, date_time, exception, fiber, filesystem, graph, graph_parallel, iostreams, locale
+# log, math, mpi, program_options, python, random, regex, serialization, signals, stacktrace, system, test, thread, timer, type_erasure, wave
+
+# Add android ndk toolchain
+ANDROID_NDK_HOME=/usr/lib/android-ndk
+export PATH := $(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
+
+all: unpack linux32 linux_arm windows android_arm
 
 unpack:
        unzip -o boost_1_68_0.zip
 
-windows: unpack
+windows:
        echo "using gcc : mingw : i686-w64-mingw32-g++ : <rc>/usr/bin/x86_64-w64-mingw32-windres ;" > $(WORKDIR)/boost_1_68_0/user-config.jam
        cd $(WORKDIR)/boost_1_68_0; \
        ./bootstrap.sh; \
-       ./b2 --user-config="user-config.jam" cflags="-m32 -mwindows" cxxflags="-m32 -mwindows" linkflags="-m32 -static-libgcc -static-libstdc++"  address-model=32 toolset=gcc-mingw link=static target-os=windows runtime-link=static variant=release --with-system --with-date_time --with-regex --with-thread
+       ./b2 --clean; \
+       ./b2 --user-config="user-config.jam" cflags="-m32 -mwindows" cxxflags="-m32 -mwindows" linkflags="-m32 -static-libgcc -static-libstdc++"  address-model=32 toolset=gcc-mingw link=static target-os=windows runtime-link=static variant=release $(MODULES)
        mkdir -p $(WORKDIR)/../../include
        mkdir -p $(WORKDIR)/../../lib/mingw32
        cp -rf $(WORKDIR)/boost_1_68_0/boost $(WORKDIR)/../../include
        cp -r  $(WORKDIR)/boost_1_68_0/stage/lib/* ../../lib/mingw32/
 
-linux: unpack
+linux32:
        cd $(WORKDIR)/boost_1_68_0; \
        ./bootstrap.sh; \
-       ./b2 cflags="-m32" cxxflags="-m32" linkflags="-m32 -static-libgcc -static-libstdc++" address-model=32 link=static runtime-link=static variant=release --with-system --with-date_time --with-regex --with-thread
+       ./b2 --clean; \
+       ./b2 cflags="-m32" cxxflags="-m32" linkflags="-m32 -static-libgcc -static-libstdc++" address-model=32 link=static runtime-link=static variant=release $(MODULES)
        mkdir -p $(WORKDIR)/../../include
        mkdir -p $(WORKDIR)/../../lib/linux32
        cp -rf $(WORKDIR)/boost_1_68_0/boost $(WORKDIR)/../../include
        cp -r  $(WORKDIR)/boost_1_68_0/stage/lib/* ../../lib/linux32/
 
-clean:
+linux_arm:
+       echo "using gcc : arm : arm-linux-gnueabihf-g++ ;" > $(WORKDIR)/boost_1_68_0/user-config.jam
        cd $(WORKDIR)/boost_1_68_0; \
        ./bootstrap.sh; \
-       ./b2 --clean
-       rm -rf $(WORKDIR)/boost_1_68_0/user-config.jam
-       rm -rf $(WORKDIR)/boost_1_68_0/stage/lib
+       ./b2 --clean; \
+       ./b2 --user-config="user-config.jam" linkflags="-static-libgcc -static-libstdc++" address-model=32 toolset=gcc-arm link=static runtime-link=static variant=release $(MODULES)
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/linux_arm
+       cp -rf $(WORKDIR)/boost_1_68_0/boost $(WORKDIR)/../../include
+       cp -r  $(WORKDIR)/boost_1_68_0/stage/lib/* ../../lib/linux_arm/
+
+android_arm:
+       echo "using gcc : arm : arm-linux-androideabi-g++ ;" > $(WORKDIR)/boost_1_68_0/user-config.jam
+       cd $(WORKDIR)/boost_1_68_0; \
+       ./bootstrap.sh; \
+       ./b2 --clean; \
+       ./b2 --user-config="user-config.jam" cflags="--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -I$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libcxx/include" \
+       cxxflags="--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -I$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libcxx/include -I$(ANDROID_NDK_HOME)/sources/android/support/include" \
+       linkflags="--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -static-libgcc -static-libstdc++" \
+       address-model=32 toolset=gcc-arm link=static runtime-link=static variant=release $(MODULES)
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/boost_1_68_0/boost $(WORKDIR)/../../include
+       cp -r  $(WORKDIR)/boost_1_68_0/stage/lib/* ../../lib/android_arm/
+
+clean:
+       rm -rf $(WORKDIR)/boost_1_68_0