From 1d7ed34b6d4e2d354319e473adba4da74b9713ba Mon Sep 17 00:00:00 2001 From: jeremyfa Date: Fri, 15 Jun 2018 15:31:10 +0200 Subject: [PATCH 1/5] Update ignore list --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..daaea46 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +/lib +/obj From 2ca1b1bee1866904ce4f58a569743793cfb0dda4 Mon Sep 17 00:00:00 2001 From: jeremyfa Date: Fri, 15 Jun 2018 15:31:51 +0200 Subject: [PATCH 2/5] Expose symbols to build a dynamically linkable shared library --- Alc/alcandroid.c | 33 ++++++++++++++++----------------- build-shared.sh | 5 +++++ include/config.h | 2 ++ 3 files changed, 23 insertions(+), 17 deletions(-) create mode 100755 build-shared.sh diff --git a/Alc/alcandroid.c b/Alc/alcandroid.c index edfaeb3..1797850 100644 --- a/Alc/alcandroid.c +++ b/Alc/alcandroid.c @@ -12,6 +12,20 @@ JavaVM *alcGetJavaVM(void) { return javaVM; } +void alcandroid_OnLoad( JavaVM *vm ) { + BackendFuncs func_list; + if (apportableOpenALFuncs.alc_android_set_java_vm) { + apportableOpenALFuncs.alc_android_set_java_vm(vm); + } + javaVM = vm; +} + +void alcandroid_OnUnload( JavaVM *vm ) { + if (apportableOpenALFuncs.alc_android_set_java_vm) { + apportableOpenALFuncs.alc_android_set_java_vm(NULL); + } +} + //when called as a shared lib, this is automatic //but when embedding it that will be an error #ifdef NATIVE_TOOLKIT_OPENAL_ANDROID_SHARED @@ -27,29 +41,14 @@ JavaVM *alcGetJavaVM(void) { #endif //NATIVE_TOOLKIT_OPENAL_ANDROID_SHARED - -void alcandroid_OnLoad( JavaVM *vm ) { - BackendFuncs func_list; - if (apportableOpenALFuncs.alc_android_set_java_vm) { - apportableOpenALFuncs.alc_android_set_java_vm(vm); - } - javaVM = vm; -} - -void alcandroid_OnUnload( JavaVM *vm ) { - if (apportableOpenALFuncs.alc_android_set_java_vm) { - apportableOpenALFuncs.alc_android_set_java_vm(NULL); - } -} - -void alcandroid_Suspend() { +__attribute__((visibility("protected"))) void alcandroid_Suspend() { LOGV("openal suspend"); if (apportableOpenALFuncs.alc_android_suspend) { apportableOpenALFuncs.alc_android_suspend(); } } -void alcandroid_Resume() { +__attribute__((visibility("protected"))) void alcandroid_Resume() { LOGV("openal resume"); if (apportableOpenALFuncs.alc_android_resume) { apportableOpenALFuncs.alc_android_resume(); diff --git a/build-shared.sh b/build-shared.sh new file mode 100755 index 0000000..d63e789 --- /dev/null +++ b/build-shared.sh @@ -0,0 +1,5 @@ +rm -rf obj +haxelib run hxcpp library.xml -Dandroid +haxelib run hxcpp library.xml -Dandroid -DHXCPP_ARMV7 +haxelib run hxcpp library.xml -Dandroid -DHXCPP_ARM64 +haxelib run hxcpp library.xml -Dandroid -DHXCPP_X86 \ No newline at end of file diff --git a/include/config.h b/include/config.h index 7897bcc..676b495 100755 --- a/include/config.h +++ b/include/config.h @@ -5,6 +5,8 @@ #define ALSOFT_VERSION "1.12.854" #define AL_BUILD_LIBRARY +#define HAVE_GCC_VISIBILITY +#define NATIVE_TOOLKIT_OPENAL_ANDROID_SHARED /* Define if we have the Android backend */ #if defined(ANDROID) From 6d82ef1cca38a963626de23a3922aa8d5c08d2ae Mon Sep 17 00:00:00 2001 From: jeremyfa Date: Mon, 1 Oct 2018 16:39:11 +0200 Subject: [PATCH 3/5] Add missing SONAME entry in shared library --- library.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/library.xml b/library.xml index a0aaa9a..ee1b484 100644 --- a/library.xml +++ b/library.xml @@ -35,6 +35,7 @@ + From be0e3fc0d309a2aea9bfe6d02065af83d2a4db9d Mon Sep 17 00:00:00 2001 From: Jeremy Faivre Date: Sun, 15 Sep 2019 14:36:22 +0200 Subject: [PATCH 4/5] Patch config for 64bit architectures --- include/config.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/include/config.h b/include/config.h index 676b495..f4105c6 100755 --- a/include/config.h +++ b/include/config.h @@ -91,6 +91,27 @@ /* Define if we have the __int64 type */ /* #cmakedefine HAVE___INT64 */ +#ifdef HXCPP_ARM64 + + /* Define to the size of a void pointer type */ + #define SIZEOF_VOIDP 8 + +#else + + #ifdef HXCPP_X86_64 + + /* Define to the size of a void pointer type */ + #define SIZEOF_VOIDP 8 + + #else + + /* Define to the size of a void pointer type */ + #define SIZEOF_VOIDP 4 + + #endif + +#endif + /* Define to the size of a long int type */ #define SIZEOF_LONG 4 @@ -100,9 +121,6 @@ /* Define to the size of an unsigned int type */ #define SIZEOF_UINT 4 -/* Define to the size of a void pointer type */ -#define SIZEOF_VOIDP 4 - /* Define if we have GCC's destructor attribute */ #define HAVE_GCC_DESTRUCTOR 1 From d7d3c334c4299698b619b49f72af15758aaf57f7 Mon Sep 17 00:00:00 2001 From: Jeremy Faivre Date: Sun, 15 Sep 2019 16:09:01 +0200 Subject: [PATCH 5/5] Add NATIVE_TOOLKIT_OPENAL_ANDROID_SHARED flag only when building as dynamic library --- files.xml | 1 + include/config.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/files.xml b/files.xml index 449d020..073f9ca 100644 --- a/files.xml +++ b/files.xml @@ -9,6 +9,7 @@ + diff --git a/include/config.h b/include/config.h index f4105c6..0ba400d 100755 --- a/include/config.h +++ b/include/config.h @@ -6,7 +6,6 @@ #define AL_BUILD_LIBRARY #define HAVE_GCC_VISIBILITY -#define NATIVE_TOOLKIT_OPENAL_ANDROID_SHARED /* Define if we have the Android backend */ #if defined(ANDROID)