mobile: build contrib libs into app lib (important for dependencies)

This commit is contained in:
pls.153 2022-03-14 16:45:17 +01:00
parent b89234e257
commit 14b5eff7ea
6 changed files with 29 additions and 17 deletions

View file

@ -31,9 +31,14 @@ linux: LIBS += -L../../../platforms/linux/lib
macx: LIBS += -L../../../platforms/macos/lib macx: LIBS += -L../../../platforms/macos/lib
android { android {
DEFINES += INI_ECL_CONTRIB
QT += androidextras QT += androidextras
INCLUDEPATH = $$(ECL_ANDROID)/include INCLUDEPATH = $$(ECL_ANDROID)/include
ECL_VERSION = $$lower($$system($ECL_ANDROID/../ecl-android-host/bin/ecl -v))
ECL_VERSION = $$replace(ECL_VERSION, " ", "-")
LIBS = -L$$(ECL_ANDROID)/lib -lecl LIBS = -L$$(ECL_ANDROID)/lib -lecl
LIBS += -L$$(ECL_ANDROID)/lib/$$ECL_VERSION
LIBS += -lecl-help -ldeflate -lecl-cdb -lecl-curl -lql-minitar -lsockets
LIBS += -L../../../platforms/android/lib LIBS += -L../../../platforms/android/lib
ANDROID_ABIS = "arm64-v8a" ANDROID_ABIS = "arm64-v8a"

View file

@ -30,14 +30,15 @@
(let ((to (cc *assets* "quicklisp/local-projects/slime/"))) (let ((to (cc *assets* "quicklisp/local-projects/slime/")))
(ensure-directories-exist to) (ensure-directories-exist to)
(shell (cc "cp -r ../../../slime/src/* " to)))) (shell (cc "cp -r ../../../slime/src/* " to))))
(unless (probe-file (cc *assets* "encodings")) #+android
#+android (let ((lib (cc (ext:getenv "ECL_ANDROID") "/lib/ecl-*/")))
(let ((lib (cc (ext:getenv "ECL_ANDROID") "/lib/ecl-*/"))) (shell (cc "cp -f " lib "asdf.fas " *assets*))
(shell (cc "cp " lib "*.asd " *assets*)) (shell (cc (ext:getenv "ANDROID_NDK_TOOLCHAIN") "/bin/aarch64-linux-android-strip " (cc *assets* "asdf.fas")))
(shell (cc "cp " lib "*.fas " *assets*)) (unless (probe-file (cc *assets* "encodings"))
(shell (cc "cp " lib "*.doc " *assets*)) (shell (cc "cp " lib "*.doc " *assets*))
(shell (cc "cp -r " lib "encodings " *assets*))) (shell (cc "cp -r " lib "encodings " *assets*))))
#+ios #+ios
(unless (probe-file (cc *assets* "encodings"))
(let ((lib (cc (ext:getenv "ECL_IOS") "/lib/ecl-*/"))) (let ((lib (cc (ext:getenv "ECL_IOS") "/lib/ecl-*/")))
(shell (cc "cp " lib "*.doc " *assets*)) (shell (cc "cp " lib "*.doc " *assets*))
(shell (cc "cp -r " lib "encodings " *assets*))))) (shell (cc "cp -r " lib "encodings " *assets*)))))

View file

@ -1,3 +1,4 @@
;;; define here how to load eventual dependencies ;;; define here how to load eventual, not yet installed dependencies
;;; (for cross-compiling only)
;;; e.g. (ql:quickload :alexandria) ;;; e.g. (ql:quickload :alexandria)

View file

@ -31,9 +31,14 @@ linux: LIBS += -L../../../platforms/linux/lib
macx: LIBS += -L../../../platforms/macos/lib macx: LIBS += -L../../../platforms/macos/lib
android { android {
DEFINES += INI_ECL_CONTRIB
QT += androidextras QT += androidextras
INCLUDEPATH = $$(ECL_ANDROID)/include INCLUDEPATH = $$(ECL_ANDROID)/include
ECL_VERSION = $$lower($$system($ECL_ANDROID/../ecl-android-host/bin/ecl -v))
ECL_VERSION = $$replace(ECL_VERSION, " ", "-")
LIBS = -L$$(ECL_ANDROID)/lib -lecl LIBS = -L$$(ECL_ANDROID)/lib -lecl
LIBS += -L$$(ECL_ANDROID)/lib/$$ECL_VERSION
LIBS += -lecl-help -ldeflate -lecl-cdb -lecl-curl -lql-minitar -lsockets
LIBS += -L../../../platforms/android/lib LIBS += -L../../../platforms/android/lib
ANDROID_ABIS = "arm64-v8a" ANDROID_ABIS = "arm64-v8a"

View file

@ -30,14 +30,15 @@
(let ((to (cc *assets* "quicklisp/local-projects/slime/"))) (let ((to (cc *assets* "quicklisp/local-projects/slime/")))
(ensure-directories-exist to) (ensure-directories-exist to)
(shell (cc "cp -r ../../../slime/src/* " to)))) (shell (cc "cp -r ../../../slime/src/* " to))))
(unless (probe-file (cc *assets* "encodings")) #+android
#+android (let ((lib (cc (ext:getenv "ECL_ANDROID") "/lib/ecl-*/")))
(let ((lib (cc (ext:getenv "ECL_ANDROID") "/lib/ecl-*/"))) (shell (cc "cp -f " lib "asdf.fas " *assets*))
(shell (cc "cp " lib "*.asd " *assets*)) (shell (cc (ext:getenv "ANDROID_NDK_TOOLCHAIN") "/bin/aarch64-linux-android-strip " (cc *assets* "asdf.fas")))
(shell (cc "cp " lib "*.fas " *assets*)) (unless (probe-file (cc *assets* "encodings"))
(shell (cc "cp " lib "*.doc " *assets*)) (shell (cc "cp " lib "*.doc " *assets*))
(shell (cc "cp -r " lib "encodings " *assets*))) (shell (cc "cp -r " lib "encodings " *assets*))))
#+ios #+ios
(unless (probe-file (cc *assets* "encodings"))
(let ((lib (cc (ext:getenv "ECL_IOS") "/lib/ecl-*/"))) (let ((lib (cc (ext:getenv "ECL_IOS") "/lib/ecl-*/")))
(shell (cc "cp " lib "*.doc " *assets*)) (shell (cc "cp " lib "*.doc " *assets*))
(shell (cc "cp -r " lib "encodings " *assets*))))) (shell (cc "cp -r " lib "encodings " *assets*)))))

View file

@ -22,7 +22,6 @@
#endif #endif
#ifdef INI_ECL_CONTRIB #ifdef INI_ECL_CONTRIB
// for iOS (static lib)
extern "C" { extern "C" {
void init_lib_DEFLATE(cl_object); void init_lib_DEFLATE(cl_object);
void init_lib_ECL_CDB(cl_object); void init_lib_ECL_CDB(cl_object);
@ -119,7 +118,7 @@ int main(int argc, char* argv[]) {
} }
#ifdef INI_ECL_CONTRIB #ifdef INI_ECL_CONTRIB
// for iOS; ASDF is loaded on demand (slow) // ASDF is loaded on demand (slow)
ecl_init_module(NULL, init_lib_DEFLATE); ecl_init_module(NULL, init_lib_DEFLATE);
ecl_init_module(NULL, init_lib_ECL_CDB); ecl_init_module(NULL, init_lib_ECL_CDB);
ecl_init_module(NULL, init_lib_ECL_HELP); ecl_init_module(NULL, init_lib_ECL_HELP);