1、下载最新的libspatialite源码(http://www.gaia-gis.it/gaia-sins/libspatialite-sources/)
2、使用libtool的config.sub替换libspatialite里面的文件
3、修改configure对geos_c库的判断
将下面两句用“#”进行注释
else
as_fn_error $? "could not find libgeos_c (or obsolete 'libgeos_c' < v.3.3.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig" "$LINENO" 5
4、编译所需的必须库libiconv、sqlite、freexl、proj、geos、libxml2,将其依赖库的头文件和库拷贝到android-ndk/sysroot/usr的lib和include下
5、执行如下命令
(1)CFLAGS="-mthumb" CXXFLAGS="-mthumb" LIBS="-lstdc++ -lsqlite3 -lproj -liconv -lcharset -lfreexl -lxml2 -pthread -llog" ./configure --host=arm-linux-androideabi --prefix=/home/wanguangtong/wgis/install/spatialite --disable-knn --with-geosconfig=/home/wanguangtong/wgis/install/geos/bin/geos-config
(2)执行完成后,修改src下的Makefile文件,去掉所有-lpthread(android下pthread是编译在libc.so文件中)
(3)make
(4)make install