From 7d57b320ade1ebaf6f564419c71bd4774128cded Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine@gmail.com" Date: Tue, 6 Mar 2012 08:50:21 +0000 Subject: Android build support git-svn-id: http://pugixml.googlecode.com/svn/trunk@847 99668b35-9821-0410-8761-19e4c4f06640 --- Jamrules.jam | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/Jamrules.jam b/Jamrules.jam index 5532181..96e6367 100644 --- a/Jamrules.jam +++ b/Jamrules.jam @@ -6,6 +6,10 @@ if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) || $(toolset:I=^bada) || $(toolset { GCCPATH = "" ; } + else if ( $(toolset:I=^android) ) + { + GCCPATH = "%$(toolset)_PATH%\\toolchains\\arm-linux-androideabi-4.4.3\\prebuilt\\windows\\bin\\arm-linux-androideabi-" ; + } else if ( $(toolset:I=^bada) ) { GCCPATH = "%$(toolset)_PATH%\\Tools\\Toolchains\\ARM\\bin\\arm-bada-eabi-" ; @@ -13,10 +17,6 @@ if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) || $(toolset:I=^bada) || $(toolset else if ( $(toolset:I=^blackberry) ) { GCCPATH = "%$(toolset)_PATH%\\host\\win32\\x86\\usr\\bin\\ntoarmv7-" ; - } - else if ( $(toolset:I=^android) ) - { - GCCPATH = "%$(toolset)_PATH%\\bin\\arm-linux-androideabi-" ; } else { @@ -31,6 +31,25 @@ if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) || $(toolset:I=^bada) || $(toolset { LDFLAGS += -lstdc++ -lsupc++-xnew -lc ; } + else if ( $(toolset:I=^android) ) + { + LDFLAGS += -nostdlib ; + LDFLAGS += -L"%$(toolset)_PATH%\\platforms\\android-5\\arch-arm\\usr\\lib" ; + + if ( $(toolset:I=stlport) ) + { + LDFLAGS += -L"%$(toolset)_PATH%\\sources\\cxx-stl\\stlport\\libs\\armeabi-v7a" ; + LDFLAGS += -lstlport_static ; + } + else + { + LDFLAGS += -L"%$(toolset)_PATH%\\sources\\cxx-stl\\gnu-libstdc++\\libs\\armeabi-v7a" ; + LDFLAGS += -lgnustl_static -lsupc++ ; + } + + LDFLAGS += "%$(toolset)_PATH%\\platforms\\android-5\\arch-arm\\usr\\lib\\crtbegin_dynamic.o" ; + LDFLAGS += -lstdc++ -lc -lm -lgcc ; + } else if ( $(OS) = NT || $(OS) = FREEBSD ) { LDFLAGS += -static-libgcc -static ; @@ -99,6 +118,25 @@ if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) || $(toolset:I=^bada) || $(toolset RESULT += -fno-exceptions ; } + if ( $(toolset:I=^android) ) + { + RESULT += -DANDROID ; + RESULT += -mfloat-abi=softfp ; + + if ( $(toolset:I=stlport) ) + { + RESULT += -isystem"%$(toolset)_path%/sources/cxx-stl/stlport/stlport" ; + RESULT += -isystem"%$(toolset)_path%/sources/cxx-stl/system/include" ; + } + else + { + RESULT += -isystem"%$(toolset)_path%/sources/cxx-stl/gnu-libstdc++/include" ; + RESULT += -isystem"%$(toolset)_path%/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include" ; + } + + RESULT += -isystem"%$(toolset)_path%/platforms/android-5/arch-arm/usr/include" ; + } + RESULT += $(ARCH) ; return $(RESULT) ; @@ -721,7 +759,7 @@ if ( $(UNIX) ) } else { - if ( $(toolset:I=(^xbox360|^ps3|wince|^bada|^blackberry$)) ) + if ( $(toolset:I=(^xbox360|^ps3|wince|^android|^bada|^blackberry$)) ) { RUNRESULT = "skiprun" ; -- cgit v1.2.3