Skip to content

Commit 7c4d84d

Browse files
committed
Fix build when using Android NDK >= r9
Android NDK tools places all generated libraries under $PROJECT/libs directory. Since android-ndk-r9, at least on Ubuntu, NDK Tools places generated *.so under libs/, while we expect them under $(EXTERNAL_DIR)/libs and $(JNI_DIR)/libs The solution is to specify libraries directory using NDK_LIBS_OUT. NDK docs: android-ndk-r9b/docs/OVERVIEW.html III.6/ Specifying custom output directories Reports about this bug: https://groups.google.com/d/msg/sqlcipher/cbt5ZOVMgEk/kiiWi4e8fIoJ https://groups.google.com/d/msg/sqlcipher/WqDDsH4nUtE/EYUcSJ8G2L0J
1 parent 22aa554 commit 7c4d84d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ all: build-external build-jni build-java copy-libs
2424
build-external:
2525
cd ${EXTERNAL_DIR} && \
2626
make -f Android.mk build-local-hack && \
27-
ndk-build && \
27+
ndk-build NDK_LIBS_OUT=$(EXTERNAL_DIR)/libs && \
2828
make -f Android.mk copy-libs-hack
2929

3030
build-jni:
3131
cd ${JNI_DIR} && \
32-
ndk-build
32+
ndk-build NDK_LIBS_OUT=$(JNI_DIR)/libs
3333

3434
build-java:
3535
ant release && \
@@ -51,9 +51,9 @@ release:
5151
clean:
5252
-rm SQLCipher\ for\ Android\*.zip
5353
-ant clean
54-
-cd ${EXTERNAL_DIR} && ndk-build clean
54+
-cd ${EXTERNAL_DIR} && ndk-build clean NDK_LIBS_OUT=$(EXTERNAL_DIR)/libs
5555
-cd ${SQLCIPHER_DIR} && make clean
56-
-cd ${JNI_DIR} && ndk-build clean
56+
-cd ${JNI_DIR} && ndk-build clean NDK_LIBS_OUT=$(JNI_DIR)/libs
5757
-rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so
5858
-rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so
5959
-rm ${LIBRARY_ROOT}/armeabi/libstlport_shared.so

0 commit comments

Comments
 (0)