-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Detect NDK r19 or later. #1029
Comments
To detect the current version of NDK, you can read the file source.properties at |
Unfortunately the build system is using traditional ndk-build and not
CMake. Is there a way to parse that source.properties which works both in
Windows (non-MinGW env, let alone Cygwin) and Linux?
Pada tanggal Sen, 1 Jul 2019 14.26, Alex Cohn <notifications@github.com>
menulis:
… To detect the current version of NDK, you can read the file
*source.properties* at ${NDK_ROOT}. This is how the official Cmake
toolchain file sniffs the version. You can also check the version of your
*clang* (7.0.2 for NDK r18).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1029>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZHFFW7BY37JNMOSES3O3LP5GPQNANCNFSM4H4JQN3A>
.
|
Sure you can parse
gives me 19.1.5304403 |
Then how would I check if it's r19 or later? I was thinking of writing little Python script which checks for user-supplied NDK version and return output |
i don't think you should be trying to detect the NDK version at all... why not try to fix the real problem? here's what's in
and that hasn't changed since bionic SHA 50cda38 in 2017-09-14, so something doesn't make sense here. so it seems like your configure file is wrong, and is just looking for the function in libc.so, not the header? |
They're somehow defined later when using R19 (after looking, I think it's R17) by android_support which somehow implicitly added. |
okay. but why's that a problem? if you have a working log2f (and the the android_support one is the latest OS version), that's fine, right? |
No. It result in conflicting function. The Android.mk adds
Checking that file #if __ANDROID_API__ < __ANDROID_API_J_MR2__
double log2(double);
float log2f(float);
long double log2l(long double);
long double logbl(long double);
float tgammaf(float);
#endif Which tells it to define |
right, so the problem is in your "math_defs.h". luckily it looks like that's already been fixed upstream, so you just need to update to a newer version of openal: kcat/openal-soft@27fbccf#diff-f9f627f11d5acea65cc397aaff3fbc73 |
Sadly it doesn't make it into OpenAL-soft 1.19.1. Back again, does this solution foolproof? |
If you can't fix openal-soft, the right way to do it would be to set that define conditionally based on |
I would just plug that into the config.h. Thank you very much. |
(depending on how old of an NDK you need to support, you may want to be aware that |
The project minimum supported NDK is r16. According to #407, it should be available in r16 (also can confirm it exist in r16b). |
Yeah, not something you have to worry about then. |
I have an Android.mk which does work on NDK r18 and earlier but not when using NDK r19 due to conflicting functions.
Scenario: I have library that is compiled with
ndk-build
. The library itself is using autoconf/autotools/whatever you call it to generateconfig.h
but since it's simple enough, I can create dummyconfig.h
and define everything usingLOCAL_C_FLAGS
and write theAndroid.mk
. Now the problem with NDK r19 is that it defineslog2f
regardless of API level, but in previous version this is not the case, so I'm getting conflicting functions regardinglog2f
. If I made the changes to always add-DHAVE_LOG2F
(standard convention for autotools config.h) unconditionally, the library is uncompileable in older NDK version becauselog2f
is undefined. But if I didn't add it, it fails to build in r19 because conflictinglog2f
(let alone r20). The problematic arch is armeabi-v7a as this problem simply non-existent in x86 and arm64-v8a (log2f
always defined regardless).I'd like to make sure my Android.mk support older NDK version to support more older devices but at this point it's no longer possible? How would I detect for such case and what action is the best I can take?
The text was updated successfully, but these errors were encountered: