Tuesday, October 7, 2008

Build Boost1.36 with MinGW

1. Download and install the 7-zip ;

2. Uncompress the boost archive to BUILD_DIR, then change directory to it;

3. Run "./configure --with-toolset=mingw --with-libraries=thread,signals", where the "Makefile" and "user-config.jam" should be generated in current directory.

4. Modify the "Makefile" according to your requirements. A sample command line show as below:

BJAM=./tools/jam/src/bin.ntx86/bjam
prefix=../install/boost_1_36_0_mingw3.4.5
builddir =bin-mingw3.4.5
LIBS= --with-thread --with-signals

install: .dummy
@echo "$(BJAM) --user-config=user-config.jam --prefix=$(prefix) --exec-prefix=$(exec_prefix) --libdir=$(libdir) --includedir=$(includedir) $(LIBS) install"
@$(BJAM) --toolset=gcc --build-dir=$(builddir) --prefix=$(prefix) --layout=system\
threading=multi link=static runtime-link=static release debug $(LIBS) install\
|| echo "Not all Boost libraries built properly."

clean: .dummy
rm -rf $(builddir)

distclean: clean
rm -rf Makefile config.log

check: .dummy
@cd status && ../$(BJAM) --user-config=../user-config.jam || echo "Some Boost regression tests failed. This is normal for many compilers."

.dummy:

5. Run "Make install", than boost is installed to your $(EPREFIX) directory.

No comments: