diff options
author | Richard Levitte <levitte@openssl.org> | 2019-01-28 14:53:19 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-01-29 00:40:20 +0100 |
commit | 6e826c471b7f0431391a4e9f9484f6ea2833774a (patch) | |
tree | c90a93bc14bc4f0af786efc7a5f1d6156393f556 /Configurations | |
parent | crypto/cms: Add support for CAdES Basic Electronic Signatures (CAdES-BES) (diff) | |
download | openssl-6e826c471b7f0431391a4e9f9484f6ea2833774a.tar.xz openssl-6e826c471b7f0431391a4e9f9484f6ea2833774a.zip |
Android build: use ANDROID_NDK_HOME rather than ANDROID_NDK
It apepars that ANDROID_NDK_HOME is the recommended standard
environment variable for the NDK.
We retain ANDROID_NDK as a fallback.
Fixes #8101
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8103)
Diffstat (limited to 'Configurations')
-rw-r--r-- | Configurations/15-android.conf | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Configurations/15-android.conf b/Configurations/15-android.conf index 10342ed5e3..c94da41231 100644 --- a/Configurations/15-android.conf +++ b/Configurations/15-android.conf @@ -22,13 +22,18 @@ return $android_ndk = { bn_ops => "BN_AUTO" }; } - my $ndk = $ENV{ANDROID_NDK}; - die "\$ANDROID_NDK is not defined" if (!$ndk); + my $ndk_var; + my $ndk; + foreach $ndk_var (qw(ANDROID_NDK_HOME ANDROID_NDK)) { + $ndk = $ENV{$ndk_var}; + last if defined $ndk; + } + die "\$ANDROID_NDK_HOME is not defined" if (!$ndk); if (!-d "$ndk/platforms" && !-f "$ndk/AndroidVersion.txt") { # $ndk/platforms is traditional "all-inclusive" NDK, while # $ndk/AndroidVersion.txt is so-called standalone toolchain # tailored for specific target down to API level. - die "\$ANDROID_NDK=$ndk is invalid"; + die "\$ANDROID_NDK_HOME=$ndk is invalid"; } $ndk = canonpath($ndk); @@ -90,7 +95,7 @@ (my $tridefault = $triarch) =~ s/^arm-/$arm-/; (my $tritools = $triarch) =~ s/(?:x|i6)86(_64)?-.*/x86$1/; $cflags .= " -target $tridefault " - . "-gcc-toolchain \$(ANDROID_NDK)/toolchains" + . "-gcc-toolchain \$($ndk_var)/toolchains" . "/$tritools-4.9/prebuilt/$host"; $user{CC} = "clang" if ($user{CC} !~ m|clang|); $user{CROSS_COMPILE} = undef; @@ -127,13 +132,13 @@ die "no $incroot/$triarch" if (!-d "$incroot/$triarch"); $incroot =~ s|^$ndk/||; $cppflags = "-D__ANDROID_API__=$api"; - $cppflags .= " -isystem \$(ANDROID_NDK)/$incroot/$triarch"; - $cppflags .= " -isystem \$(ANDROID_NDK)/$incroot"; + $cppflags .= " -isystem \$($ndk_var)/$incroot/$triarch"; + $cppflags .= " -isystem \$($ndk_var)/$incroot"; } $sysroot =~ s|^$ndk/||; $android_ndk = { - cflags => "$cflags --sysroot=\$(ANDROID_NDK)/$sysroot", + cflags => "$cflags --sysroot=\$($ndk_var)/$sysroot", cppflags => $cppflags, bn_ops => $arch =~ m/64$/ ? "SIXTY_FOUR_BIT_LONG" : "BN_LLONG", |