LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile
User Name
Password
Linux - Mobile This forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.

Notices


Reply
  Search this Thread
Old 09-07-2016, 01:13 AM   #1
dgplinux
LQ Newbie
 
Registered: Aug 2016
Posts: 2

Rep: Reputation: Disabled
ndk-build how to with multiple share object files


My objective is to build libspatialite-4.4 for Android from source.The source is avaulable at https://www.gaia-gis.it/fossil/libspatialite/index. All the dependencies are built from the source on linux with below commands.

Code:
PROJ4
./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi 

GEOS

./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi 
with below in all Makefiles
CXXFLAGS = -g -O2 -std=gnu++11 -c -Wall

SQLITE3
 ./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi --disable-static --enable-shared   CFLAGS="-g -O2  -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_DBSTAT_VTAB=1"

FREEXL
 ./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi 

LIBSPATIALITE

 CPPFLAGS="-I/c/MingW/include" LDFLAGS="-L/c/MingW//lib" ./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi

My objective is to build libspatialite-4.4 for Android from source.The source is avaulable at https://www.gaia-gis.it/fossil/libspatialite/index. All the dependencies are built from the source on linux with below commands.

PROJ4
./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi

GEOS

./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
with below in all Makefiles
CXXFLAGS = -g -O2 -std=gnu++11 -c -Wall

SQLITE3
./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi --disable-static --enable-shared CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_DBSTAT_VTAB=1"

FREEXL
./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi

LIBSPATIALITE

CPPFLAGS="-I/c/MingW/include" LDFLAGS="-L/c/MingW//lib" ./configure --prefix=/c/MinGW --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
which means I have libproj.so,libgeos.so,libsqlite3.so and libspatialite.so

I have some exposure to Android Studio with basic android applications but completely new to NDK.At this point of time, my little reading says that I need to make use of all these .so files ,create jni folder add some code in java glue to make calls to libjsqlite.so.

In a prebuild version,there are three folders armeabi,armeabi-v7a,x86 all of which have libjsqlite.so.How does this libjsqlite.so gets generated ?
What is the role of ndk-build ?
Is Android.mk file specific for ndk and may be similar to Makefile for a gcc?
Note:-I have seen the explanation on hello-jni sample in Android site.But I would like to know how to accomplish this for a group of libraries.

Am I in the right path so far or the entire process can be bypassed?I mean would it be possible to add all the source code of these c/C++ libraries into a single AndroidStudio worksapce and it generates libjsqlite.so -(Assuming Java API to .so is added)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Build an Android Twitter app using XML and JavaScript Object Notation LXer Syndicated Linux News 0 07-21-2010 09:00 AM
custom gcc build wont work (libmpfr.so.1: cannot open shared object file) furryfreak Linux - Software 2 04-03-2009 03:39 AM
How to build object code from c++ file in ns-2.33? shyan Linux - Newbie 1 12-15-2008 06:23 AM
[SOLVED] How to build a shared object from other libraries (linking statically)? eantoranz Programming 4 10-26-2007 12:19 PM
How to build a network/share files with and XP Computer??? aktiwers Linux - Networking 1 06-03-2004 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile

All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration