new build config to have debug on Android Studio JNI-26
authorHussein Kasem <huss@pep-project.org>
Tue, 10 Jan 2017 19:38:43 +0100
branchJNI-26
changeset 1528f0ed0f1f2b56
parent 1527 75d56a822caa
child 1529 35a3ea999345
new build config to have debug on Android Studio
build-android/build.sh
build-android/jni/Android.mk
build-android/jni/Application.mk
src/platform_unix.c
src/platform_unix.h
     1.1 --- a/build-android/build.sh	Fri Jan 06 10:23:51 2017 +0100
     1.2 +++ b/build-android/build.sh	Tue Jan 10 19:38:43 2017 +0100
     1.3 @@ -6,7 +6,7 @@
     1.4  set -e
     1.5  
     1.6  build_version=1
     1.7 -ANDROID_PLATFORM=android-21
     1.8 +ANDROID_PLATFORM=android-18
     1.9  libetpan_build_version=1
    1.10  archs="armeabi armeabi-v7a x86 x86_64"
    1.11  package_name=pEpEngine-android
     2.1 --- a/build-android/jni/Android.mk	Fri Jan 06 10:23:51 2017 +0100
     2.2 +++ b/build-android/jni/Android.mk	Tue Jan 10 19:38:43 2017 +0100
     2.3 @@ -2,9 +2,10 @@
     2.4  #
     2.5  # This file is under GNU General Public License 3.0
     2.6  # see LICENSE.txt
     2.7 +LOCAL_PATH := $(call my-dir)
     2.8  
     2.9 -LOCAL_PATH := $(call my-dir)
    2.10 -$(warning $(LOCAL_PATH))
    2.11 +LIBETPAN_PATH:=  $(LOCAL_PATH)/../../../pEpJNIAdapter/android/external/libetpan/build-android
    2.12 +GPGME_INCLUDE_PATH:=  $(LOCAL_PATH)/../../../pEpJNIAdapter/android/external/data/data/pep.android.k9/app_opt/include
    2.13  
    2.14  include $(CLEAR_VARS)
    2.15  
    2.16 @@ -19,10 +20,6 @@
    2.17  LOCAL_MODULE    := pEpEngine
    2.18  LOCAL_CFLAGS    += -std=c99
    2.19  
    2.20 -ifneq ($(NDEBUG),)
    2.21 -LOCAL_CFLAGS    += -DNDEBUG=1
    2.22 -endif
    2.23 -
    2.24  # from http://www.sqlite.org/android/finfo?name=jni/sqlite/Android.mk 
    2.25  #      http://www.sqlite.org/android/artifact/e8ed354b3e58c835
    2.26  
    2.27 @@ -32,13 +29,14 @@
    2.28  #
    2.29  LOCAL_CFLAGS    += -DSQLITE_TEMP_STORE=3
    2.30  
    2.31 -LOCAL_C_INCLUDES := ../../src \
    2.32 -                    ../../asn.1 \
    2.33 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../src \
    2.34 +                    $(LOCAL_PATH)/../../asn.1 \
    2.35                      $(GPGME_INCLUDE_PATH) \
    2.36                      $(LIBETPAN_PATH)/include
    2.37 -ENGINE_SRC_FILES := $(shell find ../../src/ ! -name "*netpgp*" -name "*.c")
    2.38 +LOCAL_C_INCLUDES += $(GPGBUILD)/include
    2.39 +
    2.40 +ENGINE_SRC_FILES := $(shell find $(LOCAL_PATH)/../../src/ ! -name "*netpgp*" -name "*.c")
    2.41  #ENGINE_SRC_FILES := $(wildcard $(LOCAL_PATH)/../../src/*.c)
    2.42 -$(warning $(ENGINE_SRC_FILES))
    2.43  ASN1_SRC_FILES := $(wildcard $(LOCAL_PATH)/../../asn.1/*.c)
    2.44  LOCAL_SRC_FILES := $(ENGINE_SRC_FILES:%=%)  $(ASN1_SRC_FILES:$(LOCAL_PATH)/%=%)
    2.45  
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/build-android/jni/Application.mk	Tue Jan 10 19:38:43 2017 +0100
     3.3 @@ -0,0 +1,4 @@
     3.4 +APP_OPTIM := debug
     3.5 +APP_PLATFORM=android-21
     3.6 +APP_ABI := armeabi-v7a
     3.7 +NDK_TOOLCHAIN_VERSION = 4.8
     4.1 --- a/src/platform_unix.c	Fri Jan 06 10:23:51 2017 +0100
     4.2 +++ b/src/platform_unix.c	Tue Jan 10 19:38:43 2017 +0100
     4.3 @@ -77,6 +77,7 @@
     4.4      return dst;
     4.5  }
     4.6  
     4.7 +/*
     4.8  long int random(void)
     4.9  {
    4.10      static bool seeded = false;
    4.11 @@ -91,7 +92,7 @@
    4.12      }
    4.13  
    4.14      return nrand48(xsubi);
    4.15 -}
    4.16 +} */
    4.17  
    4.18  const char *android_system_db(void)
    4.19  {
     5.1 --- a/src/platform_unix.h	Fri Jan 06 10:23:51 2017 +0100
     5.2 +++ b/src/platform_unix.h	Tue Jan 10 19:38:43 2017 +0100
     5.3 @@ -35,7 +35,7 @@
     5.4  
     5.5  // Beware: predictable pseudo random with static seed!
     5.6  // Only the lowest 31 bits are filled randomly.
     5.7 -long int random(void);
     5.8 +//long int random(void);
     5.9  
    5.10  const char *android_system_db(void);
    5.11  #define SYSTEM_DB android_system_db()