Skip to content
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

Building for Android using NDK not supported on Windows hosts #763

Closed
chibicitiberiu opened this issue Dec 13, 2018 · 9 comments
Closed

Building for Android using NDK not supported on Windows hosts #763

chibicitiberiu opened this issue Dec 13, 2018 · 9 comments

Comments

@chibicitiberiu
Copy link

@chibicitiberiu chibicitiberiu commented Dec 13, 2018

I am trying to integrate Crypto++ in an Android project in Android Studio. The NDK component of my project is built using cmake, so I'm trying to integrate CryptoPP in the build process using CMake's ExternalProject_Add.

Our requirements are that we can build for Android using Windows as a host OS, and the current android setupenv-android.sh doesn't support Windows hosts.

I have built a python script which does most of the stuff in setupenv-android.sh here (some things are missing). The advantage with python is that it's cross platform, unlike bash.

@noloader
Copy link
Collaborator

@noloader noloader commented Dec 14, 2018

Thanks @chibicitiberiu.

Yeah, the setenv-android.sh script is at end-of-life. It was OK for earlier NDKs when working on Linux using GCC, but it is mostly obsolete now. Worse, if you try to use it for a modern NDK with Clang it is just about completely broken. And it is duct-taped together for GCC, which is barely clinging to life.

@mouse07410, @MarcelRaad, @denisbider, what do you guys think? Should we let the original setenv-android.sh die and take @chibicitiberiu's new one? I think the two core questions are (1) is the license agreeable with public domain code; and (2) should we make Python a requirement for this corner of the library? (The rest are implementation details which @chibicitiberiu has mostly solved).

@chibicitiberiu
Copy link
Author

@chibicitiberiu chibicitiberiu commented Dec 14, 2018

I know that you had some issues with CMake before, but that is another option for Android which might integrate better with Android's build system (in the last few NDK versions, they moved to cmake as well).

If you don't want to add a dependency to Python, another option would be to try to make the setenv script part of the makefile.

Regarding licensing, I didn't really understand what you meant. Are you referring to the python script I linked? I can add a 'license' header to put it in public domain, if needed.

@mouse07410
Copy link
Collaborator

@mouse07410 mouse07410 commented Dec 14, 2018

  1. Yes, the header should be added, explicitly placing the script in public domain.

  2. Making Python a requirement for the Android build should be ok. I personally don't mind requiring it for everything else (after all, that's what Botan does), but not sure what others would say.

@chibicitiberiu
Copy link
Author

@chibicitiberiu chibicitiberiu commented Dec 14, 2018

I added a license header to the gist, so anyone can use it freely.

@noloader
Copy link
Collaborator

@noloader noloader commented Dec 23, 2018

@mouse07410 ,

Making Python a requirement for the Android build should be ok. I personally don't mind requiring it for everything else (after all, that's what Botan does), but not sure what others would say.

Yeah, I like Botan's use of Python. As far as build systems go I think Jack is the only guy who got it right. His stuff "just works" everywhere. GNU Make is a close second, but I think it falls short of Botan and Python. Autotools and CMake are a mess and don't compare.

GCC sees similar suggestions on occasion (switch from shell to Python). Apparently there's a problem with early Python and some of the regex'ing they do for targets. I don't think it would materially affect us, however.

@noloader
Copy link
Collaborator

@noloader noloader commented Dec 23, 2018

@chibicitiberiu, @mouse07410, @MarcelRaad,

I think we can merge a PR if you guys OK it. I know the Android bits but I don't know Python. My lack of Python skills is why we have not used it in the past. (I'd like to cutover iOS, too).

@mouse07410
Copy link
Collaborator

@mouse07410 mouse07410 commented Dec 23, 2018

@noloader noloader changed the title Building for Android using SDK not supported on Windows hosts Building for Android using NDK not supported on Windows hosts Dec 26, 2018
@noloader
Copy link
Collaborator

@noloader noloader commented Feb 9, 2019

@chibicitiberiu,

I'd like to look over the script. Can you make a pull request? Drop it in TestScripts. Delete all of the previous setenv-android-xxx.sh scripts.

@noloader
Copy link
Collaborator

@noloader noloader commented Nov 16, 2019

I think we can close this. We have working Application.mk and Android.mk.

I like @mouse07410 idea of porting to Python. Python should support Linux and Windows (modulo things like broken I/O between Python2/Python3). But I don't have the time to do.

If someone can port some of these scripts from Bash to Python then we can add them here.

@noloader noloader closed this Nov 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants