Fix misspelling errors and typos reported by codespell
[oweals/openssl.git] / Configurations / 15-android.conf
index 10342ed5e3750d37161515604c22933a957dd5ed..b28689a4256fa7397d49a5eaef9ac2966d3d5afd 100644 (file)
                 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 (qw(ANDROID_NDK_HOME ANDROID_NDK)) {
+                $ndk_var = $_;
+                $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 +96,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;
                 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",
@@ -193,18 +199,22 @@ my %targets = (
         # -march and/or -mfloat-abi flags. NDK defaults to armv5te.
         # Newer NDK versions reportedly require additional -latomic.
         #
-        inherit_from     => [ "android", asm("armv4_asm") ],
+        inherit_from     => [ "android" ],
         bn_ops           => add("RC4_CHAR"),
+        asm_arch         => 'armv4',
+        perlasm_scheme   => "void",
     },
     "android-arm64" => {
-        inherit_from     => [ "android", asm("aarch64_asm") ],
+        inherit_from     => [ "android" ],
         bn_ops           => add("RC4_CHAR"),
+        asm_arch         => 'aarch64',
         perlasm_scheme   => "linux64",
     },
 
     "android-mips" => {
-        inherit_from     => [ "android", asm("mips32_asm") ],
+        inherit_from     => [ "android" ],
         bn_ops           => add("RC4_CHAR"),
+        asm_arch         => 'mips32',
         perlasm_scheme   => "o32",
     },
     "android-mips64" => {
@@ -217,25 +227,28 @@ my %targets = (
         # with previous MIPS ISA versions, in sense that unlike
         # prior versions original MIPS binary code will fail.
         #
-        inherit_from     => [ "android", asm("mips64_asm") ],
+        inherit_from     => [ "android" ],
         bn_ops           => add("RC4_CHAR"),
+        asm_arch         => 'mips64',
         perlasm_scheme   => "64",
     },
 
     "android-x86" => {
-        inherit_from     => [ "android", asm("x86_asm") ],
+        inherit_from     => [ "android" ],
         CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
         bn_ops           => add("RC4_INT"),
+        asm_arch         => 'x86',
         perlasm_scheme   => "android",
     },
     "android-x86_64" => {
-        inherit_from     => [ "android", asm("x86_64_asm") ],
+        inherit_from     => [ "android" ],
         bn_ops           => add("RC4_INT"),
+        asm_arch         => 'x86_64',
         perlasm_scheme   => "elf",
     },
 
     ####################################################################
-    # Backward compatible targets, (might) requre $CROSS_SYSROOT
+    # Backward compatible targets, (might) require $CROSS_SYSROOT
     #
     "android-armeabi" => {
         inherit_from     => [ "android-arm" ],