I'm trying to compile python 3.7 (for no particular reason) and keep running into an error running ./configure,
Fatal: you must define __ANDROID_API__
Where do I go about doing this? Got round it by editing the configure script but surly there's a better way?
You can define it by adding something like 藡-D__ANDROID_API__=21藡 to $CFLAGS (or another suitable compiler flag). The -D here stands for "define"
Related: #2469
Closing this since we now have python3.7 in the repo
There is no longer python3.7 in the repo
@Grimler91 your latest fix 1f572a7 seems compelling. Can I integrate it in my Termux setup right now and how?
Cannot proceed with pyenv because of problem reflected in this issue.
Can I integrate it in my Termux setup right now and how?
This fix will work only within the scope of termux-packages build environment. It doesn't affect any out-of-tree Python builds.
It won't fix the pyenv.
This fix will work only within the scope of termux-packages build environment. It doesn't affect any out-of-tree Python builds.
Seems like symptomatic of #2469. So, no way I could define __ANDROID_API___ externally, right?
You can define __ANDROID_API___ by passing compiler flag (-D__ANDROID_API___=24) through CFLAGS, but I'm not sure whether pyenv looks this environment variable when compiling specific python version. Even if you manage to pass CFLAGS into process, there would be other problems like missing Termux compatibility patches.