Android: added make files
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -56,3 +56,6 @@ tests/test_snprintf
|
|||||||
tests/test_sock
|
tests/test_sock
|
||||||
m4/
|
m4/
|
||||||
libstrophe.project
|
libstrophe.project
|
||||||
|
libs/
|
||||||
|
obj/
|
||||||
|
expat/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
0.9.0
|
0.9.0
|
||||||
- IPv6 support
|
- IPv6 support
|
||||||
- Legacy SSL support
|
- Legacy SSL support
|
||||||
|
- Initial Android support
|
||||||
- New API:
|
- New API:
|
||||||
- xmpp_uuid_gen()
|
- xmpp_uuid_gen()
|
||||||
- xmpp_conn_get_flags()
|
- xmpp_conn_get_flags()
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ another path use the `--prefix` option during configure, e.g.:
|
|||||||
|
|
||||||
./configure --prefix=/usr
|
./configure --prefix=/usr
|
||||||
|
|
||||||
|
### Android
|
||||||
|
|
||||||
|
Run script `build-android.sh` and follow the instructions. You will
|
||||||
|
need expat sources and android-ndk.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
|||||||
31
build-android.sh
Executable file
31
build-android.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
DIR=`dirname $0`
|
||||||
|
EXPAT_PATH="$DIR/expat"
|
||||||
|
EXPAT_FILE='lib/expat.h'
|
||||||
|
|
||||||
|
if [ ! -d $EXPAT_PATH ]; then
|
||||||
|
mkdir $EXPAT_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
# TODO Accept expat tarball as argument and extract it to the right place.
|
||||||
|
|
||||||
|
if [ ! -d $EXPAT_PATH/lib -o ! -f "$EXPAT_PATH/$EXPAT_FILE" ]; then
|
||||||
|
cat <<EOT
|
||||||
|
Error: expat sources not found.
|
||||||
|
|
||||||
|
Extract expat sources to $EXPAT_PATH. Make sure $EXPAT_PATH/$EXPAT_FILE and
|
||||||
|
other source files exist.
|
||||||
|
EOT
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ndk-build -C "$DIR" clean || exit 1
|
||||||
|
ndk-build -C "$DIR" || exit 1
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "basic example:"
|
||||||
|
ls -l "$DIR"/libs/*/basic
|
||||||
|
echo
|
||||||
|
echo "libstrophe.a:"
|
||||||
|
ls -l "$DIR"/obj/local/*/libstrophe.a
|
||||||
78
jni/Android.mk
Normal file
78
jni/Android.mk
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
LOCAL_PATH:= $(call my-dir)
|
||||||
|
|
||||||
|
#
|
||||||
|
# examples/basic
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := basic
|
||||||
|
LOCAL_CFLAGS :=
|
||||||
|
LOCAL_C_INCLUDES := \
|
||||||
|
$(LOCAL_PATH)/..
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
../examples/basic.c
|
||||||
|
|
||||||
|
LOCAL_STATIC_LIBRARIES := libstrophe libexpat
|
||||||
|
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
|
#
|
||||||
|
# libstrohe (static library)
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libstrophe
|
||||||
|
LOCAL_CFLAGS :=
|
||||||
|
LOCAL_C_INCLUDES := \
|
||||||
|
$(LOCAL_PATH)/.. \
|
||||||
|
$(LOCAL_PATH)/../src \
|
||||||
|
$(LOCAL_PATH)/../expat/lib
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
../src/auth.c \
|
||||||
|
../src/conn.c \
|
||||||
|
../src/crypto.c \
|
||||||
|
../src/ctx.c \
|
||||||
|
../src/event.c \
|
||||||
|
../src/handler.c \
|
||||||
|
../src/hash.c \
|
||||||
|
../src/jid.c \
|
||||||
|
../src/md5.c \
|
||||||
|
../src/parser_expat.c \
|
||||||
|
../src/rand.c \
|
||||||
|
../src/resolver.c \
|
||||||
|
../src/sasl.c \
|
||||||
|
../src/scram.c \
|
||||||
|
../src/sha1.c \
|
||||||
|
../src/snprintf.c \
|
||||||
|
../src/sock.c \
|
||||||
|
../src/stanza.c \
|
||||||
|
../src/tls_dummy.c \
|
||||||
|
../src/util.c \
|
||||||
|
../src/uuid.c
|
||||||
|
|
||||||
|
LOCAL_STATIC_LIBRARIES := libstrophe
|
||||||
|
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
#
|
||||||
|
# expat
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libexpat
|
||||||
|
LOCAL_CFLAGS := -DHAVE_MEMMOVE
|
||||||
|
#LOCAL_C_INCLUDES := \
|
||||||
|
# $(LOCAL_PATH)/expat
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
../expat/lib/xmlparse.c \
|
||||||
|
../expat/lib/xmlrole.c \
|
||||||
|
../expat/lib/xmltok.c \
|
||||||
|
../expat/lib/xmltok_impl.c \
|
||||||
|
../expat/lib/xmltok_ns.c
|
||||||
|
|
||||||
|
LOCAL_STATIC_LIBRARIES := libexpat
|
||||||
|
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
2
jni/Application.mk
Normal file
2
jni/Application.mk
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
APP_ABI := armeabi armeabi-v7a mips x86
|
||||||
|
APP_PLATFORM := android-19
|
||||||
Reference in New Issue
Block a user