-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure out how to build Geos on NDK. (C++/STL support) #1
Comments
When I was poking around with it this past weekend I was able to get GEOS to compile by specifying some C++-specific stuff in the Android.mk file. Here's what my makefile looked like: LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libgeos LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/include \ $(LOCAL_PATH)/source/headers LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl LOCAL_STL := gnustl_static LOCAL_CPPFLAGS += -fexceptions LOCAL_CPPFLAGS += -frtti LOCAL_SRC_FILES := \ source/inlines.cpp \ source/operation/buffer/SubgraphDepthLocater.cpp \ source/operation/buffer/RightmostEdgeFinder.cpp \ source/operation/buffer/BufferSubgraph.cpp \ source/operation/buffer/OffsetCurveSetBuilder.cpp \ .... source/util/GeometricShapeFactory.cpp \ source/util/math.cpp include $(BUILD_SHARED_LIBRARY) |
Hi iandees, I'm new at all this, I'm trying to crosscompile geos to Android, I've two questions, is the make file read automatically when building or how do I use it? as well what are the ... for? #SET compile flags
CXX=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ \
CXXFLAGS="-nostdlib -I$NDK_PLATFORM/usr/include -I$NDK/sources/cxx-stl/gnu-libstdc++/include -I$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include -DHAVE_ISNAN" \
CC=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc \
CFLAGS=" -nostdlib -I$NDK_PLATFORM/usr/include -I$NDK/sources/cxx-stl/gnu-libstdc++/include -I$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include" \
LDFLAGS="-L$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi -L$NDK_PLATFORM/usr/lib --sysroot=$NDK_PLATFORM -Wl,-rpath-link=$NDK_PLATFORM/usr/lib -lc" \
./configure --prefix=$INSTALL_DIR --host=arm-linux-androideabi
#COMPILE LIB
make -j$CORES 2>&1 | tee make.out Thanks a lot |
The .... is me cutting out the listing of all the cpp files in the GEOS distribution. |
I immagined that. the other issue was the more important one ;) |
You don't run Make when building NDK projects. Read the readme for the project or the NDK docs. Basically, you run ndk_build in the parent directory. |
Did we ever get this all to work reliably? The project I initially wanted this for has come and gone, and I ended On Thu, Jun 9, 2011 at 7:29 AM, iandees
|
Yea, we're actually using it in a yet-to-be-released product. There are some Depending on the timing we might end up switching to a K-D tree as well... On Thu, Jun 9, 2011 at 7:57 AM, mrenouf <
|
Hi, i compiled geos using the standalone toolchain of r5c with less issues than using mk files. Thanks for the hints anyway |
Geos is not supported because the Android NDK apparently lacks the most basic of C++ library support (no STL!). Right now it fails with missing headers for most of the stuff in /usr/include/c++. So right now, I've removed it from the build (-DOMIT_GEOS=1).
The text was updated successfully, but these errors were encountered: