perl

 view release on metacpan or  search on metacpan

hints/linux-android.sh  view on Meta::CPAN

# set -x

# Install the perl and its libraries anywhere:
case "$userelocatableinc" in
'') userelocatableinc='define' ;;
esac

# The Android linker has some unusual behavior: No matter what
# path is passed in to dlopen(), it'll only use the path's
# basename when trying to find a cached library.
# Unfortunately, this is quite problematic for us, since for example,
# Hash::Util and List::Util both end up creating a Util.so --
# So if you load List::Util and then Hash::Util, the dlopen() for
# the latter will return the handle for the former.
# See the implementation for details:
# https://code.google.com/p/android-source-browsing/source/browse/linker/linker.c?repo=platform--bionic&r=9ec0f03a0d0b17bbb94ac0b9fef6add28a133c3a#1231
# What d_libname_unique does is inform MakeMaker that, rather than
# creating Hash/Util/Util.so, it needs to make Hash/Util/Perl_Hash_Util.so
d_libname_unique='define'

# On Android the shell is /system/bin/sh:
targetsh='/system/bin/sh'
case "$usecrosscompile" in
define) ;;
   # If we aren't cross-compiling, then sh should also point
   # to /system/bin/sh.
*) sh=$targetsh ;;
esac

# Make sure that we look for libm
libswanted="$libswanted m log"

# Older Androids lack locale support and may need the following undefs
# uncommenting. This isn't necessary from at least Android 8.1 (Oreo)
# https://github.com/android/platform_bionic/blob/master/libc/CAVEATS
#d_locconv='undef'
#d_setlocale='undef'
#d_setlocale_r='undef'
#d_lc_monetary_2008='undef'
#i_locale='undef'
#d_newlocale='undef'

# https://code.google.com/p/android-source-browsing/source/browse/libc/netbsd/net/getservent_r.c?repo=platform--bionic&r=ca6fe7bebe3cc6ed7e2db5a3ede2de0fcddf411d#95
d_getservent_r='undef'

# Bionic defines several stubs that warn (in older releases) and return NULL
# https://gitorious.org/0xdroid/bionic/blobs/70b2ef0ec89a9c9d4c2d4bcab728a0e72bafb18e/libc/bionic/stubs.c
# https://android.googlesource.com/platform/bionic/+/master/libc/bionic/stubs.cpp

# These tests originally looked for 'FIX' or 'Android' warnings, as they
# indicated stubs to avoid. At some point, Android stopped emitting
# those warnings; the tests were adapted to check function return values
# and hopefully now detect stubs on both older and newer Androids.

# These are all stubs as well, but the core doesn't use them:
# getusershell setusershell endusershell

# This script UU/archname.cbu will get 'called-back' by Configure.
$cat > UU/archname.cbu <<'EOCBU'
# original egrep pattern to detect a stub warning on Android.
# Right now we're checking for:
# Android 2.x: FIX ME! implement FUNC
# Android 4.x: FUNC is not implemented on Android
# Android 8.x: <no warnings; tests now printf a compatible warning>
android_stub='FIX|Android'



( run in 0.368 second using v1.01-cache-2.11-cpan-5511b514fd6 )