Fall back to ANDROID_NDK if NDK not set#3064
Merged
Frenzie merged 3 commits intokoreader:masterfrom Aug 11, 2017
Merged
Conversation
Frenzie
reviewed
Aug 9, 2017
kodev
Outdated
| ;; | ||
| android) | ||
| if [ "$NDK" == "" ]; then | ||
| # Some distributions use `ANDROID_NDK` instead, fall back to it |
Member
There was a problem hiding this comment.
How about something like this instead?
if [ -z "$NDK" ]; then
if [ -z "$ANDROID_NDK" ]; then
# some distributions use `ANDROID_NDK` instead, fall back to it
export NDK=$ANDROID_NDK
else
export NDK="${CURDIR}/base/toolchain/android-ndk-r12b"
fi
fi
Contributor
Author
There was a problem hiding this comment.
You mean
if [ -z "$NDK" ]; then
if [ -z "$ANDROID_NDK" ]; then
export NDK="${CURDIR}/base/toolchain/android-ndk-r12b"
else
# some distributions use `ANDROID_NDK` instead, fall back to it
export NDK=$ANDROID_NDK
fi
fi
Member
There was a problem hiding this comment.
I meant [ -n ${ANDROID_NDK+x} ] (no -z, sorry for the typo) but it doesn't matter either way. It just feels inelegant to do the same check twice.
Edit: whoops, typod again and forgot the -n.
Contributor
Author
There was a problem hiding this comment.
So,
if [ ${NDK+x} ]; then
if [ ${ANDROID_NDK+x} ]; then
# some distributions use `ANDROID_NDK` instead, fall back to it
export NDK=$ANDROID_NDK
else
export NDK="${CURDIR}/base/toolchain/android-ndk-r12b"
fi
fiShouldn't it be if [ -z ${NDK+x} ]? https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash
Member
There was a problem hiding this comment.
Yes, it should.
-z ${NDK+x}(unset or empty)-n ${ANDROID_NDK+x}(set and non-empty)
Member
|
Thanks! I hope you don't mind I went ahead and merged the discussed changes. :-) |
Contributor
Author
|
Yeah, that's ok, I was a little busy back then :) |
Frenzie
added a commit
to Frenzie/android-luajit-launcher
that referenced
this pull request
Sep 16, 2017
There are different numbers all over the place, but I *think* the code points toward Android 4 (platform-14) as an intended target.
Also, by using `NDKABI=${NDKABI:-14}` we allow for environment variable overrides. It only sets the default of 14 if $NDKABI isn't set. This is in the same spirit as koreader/koreader#3064
Frenzie
added a commit
to Frenzie/android-luajit-launcher
that referenced
this pull request
Sep 16, 2017
There are different numbers all over the place, but I *think* the code points toward Android 4 (platform-14) as an intended target.
Also, by using `NDKABI=${NDKABI:-14}` we allow for environment variable overrides. It only sets the default of 14 if $NDKABI isn't set. This is in the same spirit as koreader/koreader#3064
Frenzie
added a commit
to koreader/android-luajit-launcher
that referenced
this pull request
Sep 16, 2017
There are different numbers all over the place, but I *think* the code points toward Android 4 (platform-14) as an intended target.
Also, by using `NDKABI=${NDKABI:-14}` we allow for environment variable overrides. It only sets the default of 14 if $NDKABI isn't set. This is in the same spirit as koreader/koreader#3064
Frenzie
added a commit
to Frenzie/koreader
that referenced
this pull request
Sep 16, 2017
Part of the spirit of koreader#3064. Making it easier to test different things.
Frenzie
added a commit
that referenced
this pull request
Sep 16, 2017
Part of the spirit of #3064. Making it easier to test different things.
Frenzie
added a commit
to Frenzie/koreader
that referenced
this pull request
Sep 17, 2017
Also improve SDK installation for ease of setting up development system. This also puts in place most of the missing pieces to finish the intent in koreader#3064.
Frenzie
added a commit
that referenced
this pull request
Sep 17, 2017
Also improve SDK installation for ease of setting up development system. This also puts in place most of the missing pieces to finish the intent in #3064.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.