develooper Front page | perl.perl5.porters | Postings from July 2011

Patch for discussion - Cross-compiling (for Android)

Thread Next
From:
Jess Robinson
Date:
July 28, 2011 15:34
Subject:
Patch for discussion - Cross-compiling (for Android)
Message ID:
alpine.LNX.2.00.1107282330460.6356@insel
From a05909808875d06d4a995ca41c6fe0f49de21cd4 Mon Sep 17 00:00:00 2001
From: Jess Robinson <castaway@desert-island.me.uk>
Date: Tue, 26 Jul 2011 13:43:38 +0100
Subject: [PATCH 1/4] Make it work! With Android NDK

---
 Cross/Makefile-cross-SH                           |   61 +-
 Cross/build-arm-android-sh                        |  156 +++
 Cross/cflags-cross-arm                            |    8 +-
 Cross/config.sh-arm-linux-android                 | 1086 +++++++++++++++++++++
 Cross/package-android-sh                          |  216 ++++
 MANIFEST                                          |    5 +
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm   |   22 +-
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm |    9 +
 cpan/Time-HiRes/hints/linux.pl                    |    7 +-
 ext/Errno/Errno_pm.PL                             |   13 +
 10 files changed, 1549 insertions(+), 34 deletions(-)
 create mode 100755 Cross/build-arm-android-sh
 create mode 100644 Cross/config.sh-arm-linux-android
 create mode 100644 Cross/package-android-sh

diff --git a/Cross/Makefile-cross-SH b/Cross/Makefile-cross-SH
index 0ee2cb0..3245cfc 100644
--- a/Cross/Makefile-cross-SH
+++ b/Cross/Makefile-cross-SH
@@ -6,7 +6,7 @@
 # miniperl removed from here, as this is built on HOST
 
 Makefile=Makefile-cross-$CROSS_NAME
-
+CROSS_LIB=xlib/$CROSS_NAME
 . Cross/config-${CROSS_NAME}.sh
 
 # H.Merijn Brand [17 Feb 2004]
@@ -174,6 +174,13 @@ for f in $static_ext; do
 	static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
 done
 
+static_real=' '
+for f in $static_ext; do
+	base=`echo "$f" | sed 's/.*\///'`
+	static_real="$static_real ${CROSS_LIB}/auto/$f/$base\$(LIB_EXT)"
+done
+
+
 nonxs_list=' '
 for f in $nonxs_ext; do
     base=`echo "$f" | sed 's/.*\///'`
@@ -241,6 +248,7 @@ LDLIBPTH = $ldlibpth
 
 dynamic_ext = $dynamic_list
 static_ext = $static_list
+static_real = $static_real
 nonxs_ext = $nonxs_list
 ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
 DYNALOADER = DynaLoader\$(OBJ_EXT)
@@ -311,7 +319,7 @@ esac
 
 $spitshell >>$Makefile <<!GROK!THIS!
 CROSS_NAME = ${CROSS_NAME}
-CROSS_LIB = xlib/${CROSS_NAME}
+CROSS_LIB = ${CROSS_LIB}
 
 CCCMD    = \`sh \$(shellflags) cflags-cross-${CROSS_NAME} "optimize='\$(OPTIMIZE)'" \$@\`
 
@@ -354,7 +362,7 @@ c5 = $(madlysrc) $(mallocsrc)
 
 c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c perlmain.c opmini.c
 
-obj1 = $(madlyobj) $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro$(OBJ_EXT)
+obj1 = $(madlyobj) $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro$(OBJ_EXT) keywords$(OBJ_EXT)
 obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) perl$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
 obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT)
 
@@ -463,8 +471,9 @@ $spitshell >>$Makefile <<'!NO!SUBS!'
 miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
 	$(CCCMD) $(PLDLFLAGS) $*.c
 
-perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)
-	sh writemain $(DYNALOADER) $(static_ext) > perlmain.c
+perlmain.c: miniperlmain.c config.sh $(MAKEFILE) lib/ExtUtils/Miniperl.pm
+	./miniperl -Ilib -MExtUtils::Miniperl -e 'writemain(@ARGV)' DynaLoader $(static_ext) > perlmain.c
+
 
 !NO!SUBS!
 case "$osname" in
@@ -604,10 +613,14 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT)
 
 	$spitshell >>$Makefile <<'!NO!SUBS!'
 
+perl.$(CROSS_NAME): perl$(EXE_EXT)
+	mv perl$(EXE_EXT) perl.$(CROSS_NAME)
+	echo "[built perl$(CROSS_NAME)]"
+
 perl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT)
 	-@rm -f miniperl.xok
-	$(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX)dyn$(EXE_EXT) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-	$(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX)$(EXE_EXT) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
+	$(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX)dyn$(EXE_EXT) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_real) $(LLIBPERL) `cat ext.libs` $(libs)
+	$(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX)$(EXE_EXT) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) perlmain$(OBJ_EXT) $(static_real) $(LLIBPERL) `cat ext.libs` $(libs)
 
 # Purify/Quantify Perls.
 
@@ -717,16 +730,17 @@ fi
 $spitshell >>$Makefile <<'!NO!SUBS!'
 
 .PHONY: preplibrary
-preplibrary: miniperl $(CONFIGPM) lib/lib.pm $(PREPLIBRARY_LIBPERL)
+# preplibrary: miniperl $(CONFIGPM) lib/lib.pm $(PREPLIBRARY_LIBPERL)
+preplibrary: miniperl $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
 
-.PHONY: makeppport
-makeppport: miniperl$(EXE_EXT) $(CONFIGPM)
-	$(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib mkppport
+makeppport: miniperl$(EXE_EXT) $(CONFIGPM) $(nonxs_ext)
+	$(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib -MCross mkppport
 
 $(CROSS_LIB)/Config.pod: config.sh miniperl configpm Porting/Glossary
 	$(LDLIBPTH) ./miniperl -Ilib configpm --cross=$(CROSS_NAME)
 	cp *.h $(CROSS_LIB)/
-	cp ext/re/re.pm $(LIBDIR)/
+# JESS: LIBDIR isnt set here, copying to /re.pm not helpful
+#	cp ext/re/re.pm $(LIBDIR)/
 
 $(CONFIGPM): $(CROSS_LIB)/Config.pod xconfig.h
 
@@ -734,8 +748,11 @@ lib/re.pm: ext/re/re.pm
 	@-rm -f $@
 	cp ext/re/re.pm lib/re.pm
 
-lib/buildcustomize.pl: $(MINIPERL_EXE) write_buildcustomize.pl
-	$(MINIPERL) write_buildcustomize.pl >lib/buildcustomize.pl
+lib/ExtUtils/Miniperl.pm: miniperlmain.c $(MINIPERL_EXE) minimod.pl $(CONFIGPM)
+	./miniperl minimod.pl > lib/ExtUtils/Miniperl.pm
+
+lib/buildcustomize.pl: miniperl write_buildcustomize.pl
+	./miniperl -Ilib -MCross write_buildcustomize.pl >lib/buildcustomize.pl
 
 unidatafiles $(unidatafiles): uni.data
 
@@ -903,17 +920,17 @@ manicheck:	FORCE
 
 
 
-$(DYNALOADER): lib/buildcustomize.pl preplibrary FORCE
-	@$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
+$(DYNALOADER): lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
+	@$(LDLIBPTH) $(RUN) ./miniperl -Ilib -MCross make_ext.pl --cross $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) PERLRUN_CROSS=-MCross=$(CROSS_NAME)
 
-d_dummy $(dynamic_ext):	miniperl$(EXE_EXT) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
-	@$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
+d_dummy $(dynamic_ext):	miniperl lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
+	@$(LDLIBPTH) $(RUN) ./miniperl -Ilib -MCross make_ext.pl --cross $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic PERLRUN_CROSS=-MCross
 
-s_dummy $(static_ext):	miniperl$(EXE_EXT) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
-	@$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
+s_dummy $(static_ext):	miniperl lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
+	@$(LDLIBPTH) $(RUN) ./miniperl -Ilib -MCross make_ext.pl --cross $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) PERLRUN_CROSS=-MCross
 
-n_dummy $(nonxs_ext):	miniperl$(EXE_EXT) lib/buildcustomize.pl preplibrary $(DYNALOADER) FORCE
-	@$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+n_dummy $(nonxs_ext):	miniperl lib/buildcustomize.pl preplibrary $(DYNALOADER) FORCE
+	@$(LDLIBPTH) $(RUN) ./miniperl -Ilib -MCross make_ext.pl --cross $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) PERLRUN_CROSS=-MCross
 !NO!SUBS!
 
 $spitshell >>$Makefile <<EOF
diff --git a/Cross/build-arm-android-sh b/Cross/build-arm-android-sh
new file mode 100755
index 0000000..535a799
--- /dev/null
+++ b/Cross/build-arm-android-sh
@@ -0,0 +1,156 @@
+#!/bin/bash
+# this is a build script for ARM-linux cross-compiling.
+# it builds miniperl on HOST and then perl for TARGET
+# this approach is like Perl-CE cross-compiling, and allows
+# for full TARGET perl (as opposed to renamed miniperl)
+
+# to skip Configure/build for HOST miniperl, pass "noconf" argument to
+# this script
+
+# note how invoked Makefile.PL for cross-compilation:
+#   ./miniperl -Ilib -MCross Makefile.PL
+
+# steps are:
+# - run HOST configure
+# - build HOST miniperl
+# given freshly-created HOST makefile and existing miniperl fix makefile
+# to use the crosscompile settings.
+
+rm -rf android android.zip
+
+# -- Extensions --
+#
+# Building fine but left out for now: attributes Devel/Peek MIME/Base64 mro PerlIO/scalar PerlIO/via Safe Storable Time/Piece
+# Would be nice but do not build trivially: Time/HiRes
+# Big/complex: Compress* DB_File Encode Filter/Util/Call IO/Compress Math/BigInt/FastCalc PerlIO/encoding Time/HiRes Unicode/Normalize
+# Unlikely to be useful: ByteLoader GDBM_File NDBM_File Opcode SDBM_File XS/APItest XS/Typemap
+# Unlikely to ever build: I18N/Langinfo IPC/SysV Sys/Syslog threads threads/shared Win32*
+# Not really an ext: Attribute/Handlers
+
+static_ext='B Cwd Data/Dumper Devel/PPPort Digest/MD5 Digest/SHA Fcntl File/Glob IO List/Util POSIX Socket Sys/Hostname Time/HiRes'
+
+echo "[building for android]"
+
+cd ..
+
+cleanup () {
+  echo "[cleaning up]"
+  if test -f ../Configure -a -d ../Cross -a -d ../Porting
+  then
+     cd ..
+  fi
+  ### BUG, this also tries to remove files which are in the MANIFEST but don't exist on disc
+  perl Porting/manicheck | awk '{print $1}' | xargs rm
+}
+
+if [[ "x$1" == xcleanup* ]] ; then
+  cleanup
+  exit 0
+fi
+
+agcc_test () {
+  echo 'int main() { return 0; }' > tmp$$.c
+  success=0
+  if agcc -o tmp$$ tmp$$.c > /tmp/$$.out; then
+     success=1
+  else
+     cat /tmp/$$.out
+  fi
+  rm -f tmp$$.? tmp$$
+  echo $success
+}
+
+CROSS_NAME=arm
+CCPREF=arm-eabi-
+CROSSCC=agcc
+
+if [[ "x$1" != xnoconf* ]] ; then
+  echo "[configuring for host]"
+  echo "[testing for agcc]"
+  case "$(agcc_test)" in
+  1) ;;
+  *) echo "$0: agcc is not working right."
+     echo "$0: You need to have .../prebuilt/OS-CPU/toolchain/arm-eabi-X.Y.Z/bin/arm-eabi-agcc in your PATH."
+     echo "$0: Cannot continue, aborting."
+     cleanup
+     exit 1 ;;
+  esac
+  cleanup
+  # Configure on HOST
+  ./Configure -des -Dprefix=./dummy -Dusedevel || exit 1
+fi
+
+# miniperl on HOST
+cp -f Cross/config.sh-arm-linux-android Cross/config-${CROSS_NAME}.sh
+
+echo "[building for host]"
+make miniperl
+make uudmap.h
+make git_version.h
+
+# Config.pm etc for target arch?
+./miniperl -Ilib configpm --cross=arm
+
+# JESS: lib/re.pm, lib/lib.pm sorted elsewhere
+# make lib/re.pm lib/lib.pm
+
+# do the rest for TARGET
+
+echo "[building for target]"
+
+export CROSSCC
+export CROSS_NAME
+
+$CROSSCC --version
+
+# call make thusly so it will crosscompile...
+XCOREDIR=xlib/$CROSS_NAME/CORE
+PERL_CONFIG_SH=Cross/config-${CROSS_NAME}.sh
+
+cp -f $PERL_CONFIG_SH config.sh
+## JESS: Remove some old junk no longer present in 5.15
+# for sh in config_h Makefile Policy_sh cflags makeaperl makedepend makedir myconfig writemain
+for sh in config_h Makefile Policy_sh cflags makedepend myconfig
+do
+  sh $sh.SH
+done
+
+# make cflags do cross-compile work (now its hackish, will be improved!)
+rm -f cflags-cross-$CROSS_NAME
+cp Cross/cflags-cross-$CROSS_NAME .
+rm -f Makefile-cross-$CROSS_NAME
+CROSS_NAME=$CROSS_NAME sh Cross/Makefile-cross-SH
+cp -f Cross/Makefile-cross-$CROSS_NAME .
+cp -f Makefile-cross-$CROSS_NAME makefile
+
+mkdir -p ${XCOREDIR}
+
+cp -f *.h xlib/$CROSS_NAME
+
+mv -f Makefile Makefile.host
+rm -f GNUmakefile
+rm -f *.o
+
+# touch xlib/$CROSS_NAME/Config.pm
+
+AR=${CCPREF}ar
+
+MAKEFILE=Makefile-cross-$CROSS_NAME
+make -f ${MAKEFILE} xconfig.h || exit 1
+make -f ${MAKEFILE} libperl.a OBJ_EXT=.${CROSS_NAME}o LIB_EXT=.${CROSS_NAME}a AR=${AR} || exit 1
+# make -f ${MAKEFILE} libperl.a OBJ_EXT=.o EXE_EXT= LIB_EXT=.a AR=${AR} || exit 1
+# make -f ${MAKEFILE} libperl.a OBJ_EXT=.o EXE_EXT=.$CROSS_NAME LIB_EXT=.a AR=${AR} || exit 1
+# make -f ${MAKEFILE} miniperl.${CROSS_NAME} FIRSTMAKEFILE=${MAKEFILE} MAKEFILE=${MAKEFILE} AR=${AR} || exit 1
+echo "[building perl.${CROSS_NAME}]"
+make -f ${MAKEFILE} perl.${CROSS_NAME} MAKEFILE=${MAKEFILE} OBJ_EXT=.${CROSS_NAME}o LIB_EXT=.${CROSS_NAME}a AR=${AR} || exit 1
+# make -f ${MAKEFILE} ext/Errno/pm_to_blib || exit 1
+
+echo
+
+ls -l perl.${CROSS_NAME}
+
+echo
+echo "[android build done]"
+echo
+echo "[next you can try running package-android-sh]"
+echo
diff --git a/Cross/cflags-cross-arm b/Cross/cflags-cross-arm
index acec8cc..9a16946 100644
--- a/Cross/cflags-cross-arm
+++ b/Cross/cflags-cross-arm
@@ -1,9 +1,13 @@
 #!/bin/sh
 
 # Extra warnings, used e.g. for gcc.
-warn="-Wall -ansi   -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat"
+# JESS: remove -ansi, android ndk files have c++ style comments in
+# warn="-Wall -ansi  -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat"
+warn="-Wall   -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat"
 # Extra standardness.
-stdflags=" -std=c89"
+# JESS: remove -std=c89, android ndk files have c++ style comments in
+# stdflags=" -std=c89"
+stdflags=""
 # Extra extra.
 extra=""
 
diff --git a/Cross/config.sh-arm-linux-android b/Cross/config.sh-arm-linux-android
new file mode 100644
index 0000000..10f5340
--- /dev/null
+++ b/Cross/config.sh-arm-linux-android
@@ -0,0 +1,1086 @@
+#!/bin/sh
+#
+# This file was produced by running the Configure script. It holds all the
+# definitions figured out by Configure. Should you modify one of these values,
+# do not forget to propagate your changes by running "Configure -der". You may
+# instead choose to run each of the .SH files by yourself, or "Configure -S".
+#
+
+# Package name      : perl5
+# Source directory  : .
+# Configuration time: Fri Feb 29 00:00:00 EDT 2108
+# Configured by     : jhi
+# Target system     : linux android arm-eabi
+
+Author=''
+Date='$Date'
+Header=''
+Id='$Id'
+Locker=''
+Log='$Log'
+Mcc='Mcc'
+RCSfile='$RCSfile'
+Revision='$Revision'
+Source=''
+State=''
+_a='.a'
+_exe=''
+_o='.armo'
+afs='false'
+afsroot='/afs'
+alignbytes='4'
+ansi2knr=''
+aphostname='/bin/hostname'
+api_revision='5'
+api_subversion='0'
+api_version='15'
+api_versionstring='5.15.0'
+ar='ar'
+archlib='/data/data/com.googlecode.perlforandroid/files/perl/5.15.0/arm-eabi-linux'
+archlibexp='/data/data/com.googlecode.perlforandroid/files/perl/5.15.0/arm-eabi-linux'
+archname64=''
+archname='arm-eabi-linux'
+archobjs=''
+asctime_r_proto='0'
+awk='awk'
+baserev='5.0'
+bash=''
+bin='/usr/bin'
+binexp='/usr/bin'
+bison='bison'
+byacc='byacc'
+byteorder='1234'
+c=''
+castflags='0'
+cat='cat'
+cc='agcc'
+cccdlflags='-fpic'
+ccdlflags=''
+ccflags='-DANDROID -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
+ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
+ccname='agcc'
+ccsymbols='__APCS_32__=1 __ARM_ARCH_3__=1 __CHAR_UNSIGNED__=1 __GNUC_MINOR__=95 __arm__=1 __linux=1 __linux__=1 __unix=1 __unix__=1 cpu=arm machine=arm system=posix system=unix'
+ccversion=''
+cf_by='red'
+cf_email='none@nowhere'
+cf_time='Wed Jul  3 22:24:58 EDT 2010'
+chgrp=''
+chmod='chmod'
+chown=''
+clocktype='clock_t'
+comm='comm'
+compress=''
+contains='grep'
+cp='cp'
+cpio=''
+cpp='cpp'
+cpp_stuff='42'
+cppccsymbols='__ELF__=1 __GNUC__=2 linux=1 unix=1'
+cppflags=''
+cpplast='-'
+cppminus='-'
+cpprun='agcc -E'
+cppstdin='agcc -E'
+cppsymbols='_FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC_MINOR__=95 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506 _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 __linux=1 __linux__=1 __unix=1 __unix__=1'
+crypt_r_proto='0'
+cryptlib=''
+csh='csh'
+ctermid_r_proto='0'
+ctime_r_proto='0'
+d_Gconvert='sprintf((b),"%.*g",(n),(x))'
+d_PRIEUldbl='define'
+d_PRIFUldbl='define'
+d_PRIGUldbl='define'
+d_PRIXU64='define'
+d_PRId64='define'
+d_PRIeldbl='define'
+d_PRIfldbl='define'
+d_PRIgldbl='define'
+d_PRIi64='define'
+d_PRIo64='define'
+d_PRIu64='define'
+d_PRIx64='define'
+d_SCNfldbl='define'
+d__fwalk='undef'
+d_access='define'
+d_accessx='undef'
+d_aintl='undef'
+d_alarm='define'
+d_archlib='define'
+d_asctime64='undef'
+d_asctime_r='undef'
+d_atolf='undef'
+d_atoll='define'
+d_attribute_deprecated='undef'
+d_attribute_format='undef'
+d_attribute_malloc='undef'
+d_attribute_nonnull='undef'
+d_attribute_noreturn='undef'
+d_attribute_pure='undef'
+d_attribute_unused='undef'
+d_attribute_warn_unused_result='undef'
+d_bcmp='define'
+d_bcopy='define'
+d_bsd='undef'
+d_bsdgetpgrp='undef'
+d_bsdsetpgrp='undef'
+d_builtin_choose_expr='define'
+d_builtin_expect='define'
+d_bzero='define'
+d_c99_variadic_macros='undef'
+d_casti32='define'
+d_castneg='define'
+d_charvspr='undef'
+d_chown='define'
+d_chroot='define'
+d_chsize='undef'
+d_class='undef'
+d_clearenv='define'
+d_closedir='define'
+d_cmsghdr_s='define'
+d_const='define'
+d_copysignl='define'
+d_cplusplus='undef'
+d_crypt='undef'
+d_crypt_r='undef'
+d_csh='undef'
+d_ctermid='undef'
+d_ctermid_r='undef'
+d_ctime64='undef'
+d_ctime_r='undef'
+d_cuserid='undef'
+d_dbl_dig='define'
+d_dbminitproto='undef'
+d_difftime64='undef'
+d_difftime='define'
+d_dir_dd_fd='undef'
+d_dirfd='define'
+d_dirnamlen='undef'
+d_dlerror='define'
+d_dlopen='define'
+d_dlsymun='undef'
+d_dosuid='undef'
+d_drand48_r='undef'
+d_drand48proto='define'
+d_dup2='define'
+d_eaccess='undef'
+d_endgrent='undef'
+d_endgrent_r='undef'
+d_endhent='undef'
+d_endhostent_r='undef'
+d_endnent='undef'
+d_endnetent_r='undef'
+d_endpent='undef'
+d_endprotoent_r='undef'
+d_endpwent='undef'
+d_endpwent_r='undef'
+d_endsent='undef'
+d_endservent_r='undef'
+d_eofnblk='define'
+d_eunice='undef'
+d_faststdio='define'
+d_fchdir='define'
+d_fchmod='define'
+d_fchown='define'
+d_fcntl='define'
+d_fcntl_can_lock='define'
+d_fd_macros='define'
+d_fd_set='define'
+d_fds_bits='undef'
+d_fgetpos='define'
+d_finite='define'
+d_finitel='define'
+d_flexfnam='define'
+d_flock='define'
+d_flockproto='define'
+d_fork='define'
+d_fp_class='undef'
+d_fpathconf='define'
+d_fpclass='undef'
+d_fpclassify='undef'
+d_fpclassl='undef'
+d_fpos64_t='undef'
+d_frexpl='define'
+d_fs_data_s='undef'
+d_fseeko='define'
+d_fsetpos='define'
+d_fstatfs='define'
+d_fstatvfs='define'
+d_fsync='define'
+d_ftello='define'
+d_ftime='undef'
+d_futimes='undef'
+d_gdbm_ndbm_h_uses_prototypes='undef'
+d_gdbmndbm_h_uses_prototypes='undef'
+d_getaddrinfo='define'
+d_getcwd='define'
+d_getespwnam='undef'
+d_getfsstat='undef'
+d_getgrent='undef'
+d_getgrent_r='undef'
+d_getgrgid_r='undef'
+d_getgrnam_r='undef'
+d_getgrps='define'
+d_gethbyaddr='define'
+d_gethbyname='define'
+d_gethent='undef'
+d_gethname='define'
+d_gethostbyaddr_r='undef'
+d_gethostbyname_r='undef'
+d_gethostent_r='undef'
+d_gethostprotos='define'
+d_getitimer='define'
+d_getlogin='define'
+d_getlogin_r='undef'
+d_getmnt='undef'
+d_getmntent='define'
+d_getnameinfo='define'
+d_getnbyaddr='define'
+d_getnbyname='define'
+d_getnent='undef'
+d_getnetbyaddr_r='undef'
+d_getnetbyname_r='undef'
+d_getnetent_r='undef'
+d_getnetprotos='undef'
+d_getpagsz='define'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getpent='undef'
+d_getpgid='define'
+d_getpgrp2='undef'
+d_getpgrp='define'
+d_getppid='define'
+d_getprior='define'
+d_getprotobyname_r='undef'
+d_getprotobynumber_r='undef'
+d_getprotoent_r='undef'
+d_getprotoprotos='undef'
+d_getprpwnam='undef'
+d_getpwent='undef'
+d_getpwent_r='undef'
+d_getpwnam_r='undef'
+d_getpwuid_r='undef'
+d_getsbyname='define'
+d_getsbyport='define'
+d_getsent='define'
+d_getservbyname_r='undef'
+d_getservbyport_r='undef'
+d_getservent_r='undef'
+d_getservprotos='define'
+d_getspnam='undef'
+d_getspnam_r='undef'
+d_gettimeod='define'
+d_gmtime64='undef'
+d_gmtime_r='undef'
+d_gnulibc='define'
+d_grpasswd='define'
+d_hasmntopt='define'
+d_htonl='define'
+d_ilogbl='define'
+d_inc_version_list='define'
+d_index='undef'
+d_inetaton='define'
+d_inetntop='define'
+d_inetpton='define'
+d_int64_t='define'
+d_isascii='define'
+d_isfinite='undef'
+d_isinf='define'
+d_isnan='define'
+d_isnanl='define'
+d_killpg='undef'
+d_lchown='define'
+d_ldbl_dig='define'
+d_libm_lib_version='undef'
+d_link='define'
+d_localtime64='undef'
+d_localtime_r='undef'
+d_localtime_r_needs_tzset='undef'
+d_locconv='undef'
+d_lockf='define'
+d_longdbl='define'
+d_longlong='define'
+d_lseekproto='define'
+d_lstat='define'
+d_madvise='define'
+d_malloc_good_size='undef'
+d_malloc_size='undef'
+d_mblen='undef'
+d_mbstowcs='undef'
+d_mbtowc='undef'
+d_memchr='define'
+d_memcmp='define'
+d_memcpy='define'
+d_memmove='define'
+d_memset='define'
+d_mkdir='define'
+d_mkdtemp='define'
+d_mkfifo='define'
+d_mkstemp='define'
+d_mkstemps='undef'
+d_mktime64='undef'
+d_mktime='define'
+d_mmap='define'
+d_modfl='define'
+d_modfl_pow32_bug='undef'
+d_modflproto='undef'
+d_mprotect='define'
+d_msg='undef'
+d_msg_ctrunc='define'
+d_msg_dontroute='define'
+d_msg_oob='define'
+d_msg_peek='define'
+d_msg_proxy='undef'
+d_msgctl='undef'
+d_msgget='undef'
+d_msghdr_s='define'
+d_msgrcv='undef'
+d_msgsnd='undef'
+d_msync='define'
+d_munmap='define'
+d_mymalloc='undef'
+d_ndbm_h_uses_prototypes='undef'
+d_nice='define'
+d_nl_langinfo='define'
+d_nv_preserves_uv='define'
+d_nv_zero_is_allbits_zero='undef'
+d_off64_t='undef'
+d_old_pthread_create_joinable='undef'
+d_oldpthreads='undef'
+d_oldsock='undef'
+d_open3='define'
+d_pathconf='define'
+d_pause='define'
+d_perl_otherlibdirs='undef'
+d_phostname='undef'
+d_pipe='define'
+d_poll='define'
+d_portable='define'
+d_prctl='define'
+d_prctl_set_name='define'
+d_printf_format_null='undef'
+d_procselfexe='define'
+d_pseudofork='undef'
+d_pthread_atfork='undef'
+d_pthread_attr_setscope='define'
+d_pthread_yield='undef'
+d_pwage='undef'
+d_pwchange='undef'
+d_pwclass='undef'
+d_pwcomment='undef'
+d_pwexpire='undef'
+d_pwgecos='undef'
+d_pwpasswd='define'
+d_pwquota='undef'
+d_qgcvt='define'
+d_quad='define'
+d_random_r='undef'
+d_readdir64_r='undef'
+d_readdir='define'
+d_readdir_r='undef'
+d_readlink='define'
+d_readv='define'
+d_recvmsg='define'
+d_rename='define'
+d_rewinddir='define'
+d_rmdir='define'
+d_safebcpy='undef'
+d_safemcpy='undef'
+d_sanemcmp='define'
+d_sbrkproto='define'
+d_scalbnl='define'
+d_sched_yield='define'
+d_scm_rights='define'
+d_seekdir='undef'
+d_select='define'
+d_sem='undef'
+d_semctl='undef'
+d_semctl_semid_ds='undef'
+d_semctl_semun='undef'
+d_semget='undef'
+d_semop='undef'
+d_sendmsg='define'
+d_setegid='define'
+d_seteuid='define'
+d_setgrent='undef'
+d_setgrent_r='undef'
+d_setgrps='define'
+d_sethent='undef'
+d_sethostent_r='undef'
+d_setitimer='define'
+d_setlinebuf='define'
+d_setlocale='undef'
+d_setlocale_r='undef'
+d_setnent='undef'
+d_setnetent_r='undef'
+d_setpent='undef'
+d_setpgid='define'
+d_setpgrp2='undef'
+d_setpgrp='define'
+d_setprior='define'
+d_setproctitle='undef'
+d_setprotoent_r='undef'
+d_setpwent='undef'
+d_setpwent_r='undef'
+d_setregid='define'
+d_setresgid='define'
+d_setresuid='define'
+d_setreuid='define'
+d_setrgid='undef'
+d_setruid='undef'
+d_setsent='define'
+d_setservent_r='undef'
+d_setsid='define'
+d_setvbuf='define'
+d_sfio='undef'
+d_shm='undef'
+d_shmat='undef'
+d_shmatprototype='undef'
+d_shmctl='undef'
+d_shmdt='undef'
+d_shmget='undef'
+d_sigaction='define'
+d_signbit='define'
+d_sigprocmask='define'
+d_sigsetjmp='define'
+d_sin6_scope_id='define'
+d_sitearch='define'
+d_snprintf='undef'
+d_sockaddr_sa_len='undef'
+d_sockatmark='undef'
+d_sockatmarkproto='undef'
+d_socket='define'
+d_socklen_t='define'
+d_sockpair='define'
+d_socks5_init='undef'
+d_sprintf_returns_strlen='define'
+d_sqrtl='define'
+d_srand48_r='undef'
+d_srandom_r='undef'
+d_sresgproto='undef'
+d_sresuproto='undef'
+d_statblks='define'
+d_statfs_f_flags='undef'
+d_statfs_s='define'
+d_static_inline='define'
+d_statvfs='define'
+d_stdio_cnt_lval='undef'
+d_stdio_ptr_lval='undef'
+d_stdio_ptr_lval_nochange_cnt='undef'
+d_stdio_ptr_lval_sets_cnt='undef'
+d_stdio_stream_array='undef'
+d_stdiobase='undef'
+d_stdstdio='undef'
+d_strchr='define'
+d_strcoll='define'
+d_strctcpy='define'
+d_strerrm='strerror(e)'
+d_strerror='define'
+d_strerror_r='undef'
+d_strftime='define'
+d_strlcat='undef'
+d_strlcpy='undef'
+d_strtod='define'
+d_strtol='define'
+d_strtold='define'
+d_strtoll='define'
+d_strtoq='define'
+d_strtoul='define'
+d_strtoull='define'
+d_strtouq='define'
+d_strxfrm='define'
+d_suidsafe='undef'
+d_symlink='define'
+d_syscall='undef'
+d_syscallproto='undef'
+d_sysconf='define'
+d_sysernlst=''
+d_syserrlst='define'
+d_system='define'
+d_tcgetpgrp='define'
+d_tcsetpgrp='define'
+d_telldir='undef'
+d_telldirproto='define'
+d_time='define'
+d_timegm='undef'
+d_times='define'
+d_tm_tm_gmtoff='define'
+d_tm_tm_zone='define'
+d_tmpnam_r='undef'
+d_truncate='undef'
+d_ttyname_r='undef'
+d_tzname='define'
+d_u32align='undef'
+d_ualarm='define'
+d_umask='define'
+d_uname='define'
+d_union_semun='undef'
+d_unordered='undef'
+d_unsetenv='define'
+d_usleep='define'
+d_usleepproto='define'
+d_ustat='define'
+d_vendorarch='undef'
+d_vendorbin='undef'
+d_vendorlib='undef'
+d_vendorscript='undef'
+d_vfork='undef'
+d_void_closedir='undef'
+d_voidsig='define'
+d_voidtty=''
+d_volatile='define'
+d_vprintf='define'
+d_vsnprintf='define'
+d_wait4='define'
+d_waitpid='define'
+d_wcstombs='undef'
+d_wctomb='undef'
+d_writev='define'
+d_xenix='undef'
+date='date'
+db_hashtype='u_int32_t'
+db_prefixtype='size_t'
+db_version_major=''
+db_version_minor=''
+db_version_patch=''
+defvoidused='15'
+direntrytype='struct dirent'
+dlext='so'
+dlsrc='dl_dlopen.xs'
+doublesize='8'
+drand01='(random() / (double)((unsigned long)1 << 31))'
+drand48_r_proto='0'
+dynamic_ext=''
+eagain='EAGAIN'
+ebcdic='undef'
+echo='echo'
+egrep='egrep'
+emacs=''
+endgrent_r_proto='0'
+endhostent_r_proto='0'
+endnetent_r_proto='0'
+endprotoent_r_proto='0'
+endpwent_r_proto='0'
+endservent_r_proto='0'
+eunicefix=':'
+exe_ext=''
+expr='expr'
+extensions='Attribute/Handlers B ByteLoader Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Errno Fcntl File/Glob Filter/Util/Call GDBM_File I18N/Langinfo IO IO/Compress IPC/SysV List/Util MIME/Base64 Module/Pluggable NDBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via Safe SDBM_File Socket Storable Sys/Hostname Sys/Syslog Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attributes mro re threads threads/shared Errno'
+extras=''
+fflushNULL='define'
+fflushall='undef'
+find=''
+firstmakefile='makefile'
+flex=''
+fpossize='16'
+fpostype='fpos_t'
+freetype='void'
+from=':'
+full_ar='arm-eabi-ar'
+full_csh='/bin/csh'
+full_sed='/bin/sed'
+gccansipedantic=''
+gccosandvers=''
+gccversion='4.3.1'
+getgrent_r_proto='0'
+getgrgid_r_proto='0'
+getgrnam_r_proto='0'
+gethostbyaddr_r_proto='0'
+gethostbyname_r_proto='0'
+gethostent_r_proto='0'
+getlogin_r_proto='0'
+getnetbyaddr_r_proto='0'
+getnetbyname_r_proto='0'
+getnetent_r_proto='0'
+getprotobyname_r_proto='0'
+getprotobynumber_r_proto='0'
+getprotoent_r_proto='0'
+getpwent_r_proto='0'
+getpwnam_r_proto='0'
+getpwuid_r_proto='0'
+getservbyname_r_proto='0'
+getservbyport_r_proto='0'
+getservent_r_proto='0'
+getspnam_r_proto='0'
+gidformat='"lu"'
+gidsign='1'
+gidsize='4'
+gidtype='gid_t'
+glibpth='/usr/shlib  /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib '
+gmake='gmake'
+gmtime_r_proto='0'
+gnulibc_version='2.2.2'
+grep='grep'
+groupcat='cat /etc/group'
+groupstype='gid_t'
+gzip='gzip'
+h_fcntl='false'
+h_sysfile='true'
+hint='recommended'
+hostcat='cat /etc/hosts'
+html1dir=' '
+html1direxp=''
+html3dir=' '
+html3direxp=''
+i16size='2'
+i16type='short'
+i32size='4'
+i32type='long'
+i64size='8'
+i64type='long long'
+i8size='1'
+i8type='char'
+i_arpainet='define'
+i_assert='define'
+i_bsdioctl=''
+i_crypt='define'
+i_db='undef'
+i_dbm='undef'
+i_dirent='define'
+i_dld='undef'
+i_dlfcn='define'
+i_fcntl='undef'
+i_float='define'
+i_fp='undef'
+i_fp_class='undef'
+i_gdbm='undef'
+i_gdbm_ndbm='undef'
+i_gdbmndbm='undef'
+i_grp='define'
+i_ieeefp='undef'
+i_inttypes='define'
+i_langinfo='undef'
+i_libutil='undef'
+i_limits='define'
+i_locale='undef'
+i_machcthr='undef'
+i_malloc='define'
+i_mallocmalloc='undef'
+i_math='define'
+i_memory='undef'
+i_mntent='define'
+i_ndbm='undef'
+i_netdb='define'
+i_neterrno='undef'
+i_netinettcp='define'
+i_niin='define'
+i_poll='define'
+i_prot='undef'
+i_pthread='define'
+i_pwd='define'
+i_rpcsvcdbm='undef'
+i_sfio='undef'
+i_sgtty='undef'
+i_shadow='undef'
+i_socks='undef'
+i_stdarg='define'
+i_stddef='define'
+i_stdlib='define'
+i_string='define'
+i_sunmath='undef'
+i_sysaccess='undef'
+i_sysdir='define'
+i_sysfile='define'
+i_sysfilio='undef'
+i_sysin='undef'
+i_sysioctl='define'
+i_syslog='define'
+i_sysmman='define'
+i_sysmode='undef'
+i_sysmount='define'
+i_sysndir='undef'
+i_sysparam='define'
+i_syspoll='define'
+i_sysresrc='define'
+i_syssecrt='undef'
+i_sysselct='define'
+i_syssockio='undef'
+i_sysstat='define'
+i_sysstatfs='define'
+i_sysstatvfs='define'
+i_systime='undef'
+i_systimek='undef'
+i_systimes='define'
+i_systypes='define'
+i_sysuio='define'
+i_sysun='define'
+i_sysutsname='define'
+i_sysvfs='define'
+i_syswait='define'
+i_termio='undef'
+i_termios='undef'
+i_time='define'
+i_unistd='define'
+i_ustat='define'
+i_utime='define'
+i_values='define'
+i_varargs='undef'
+i_varhdr='stdarg.h'
+i_vfork='undef'
+ignore_versioned_solibs='y'
+inc_version_list=' '
+inc_version_list_init='0'
+incpath=''
+inews=''
+installarchlib='/data/data/com.googlecode.perlforandroid/files/perl/5.15.0/arm-eabi-linux'
+installbin='/data/data/com.googlecode.perlforandroid/files/perl'
+installhtml1dir=''
+installhtml3dir=''
+installman1dir='./install_me_here/usr/share/man/man1'
+installman3dir='./install_me_here/usr/share/man/man3'
+installprefix='/data/data/com.googlecode.perlforandroid/files/perl'
+installprefixexp='/data/data/com.googlecode.perlforandroid/files/perl'
+installprivlib='/data/data/com.googlecode.perlforandroid/files/perl/5.15.0'
+installscript='/data/data/com.googlecode.perlforandroid/files/perl'
+installsitearch='/data/data/com.googlecode.perlforandroid/files/perl/site_perl/5.15.0/arm-eabi-linux'
+installsitebin='/sdcard/com.googlecode.perlforandroid/extras/perl/site_perl/bin'
+installsitehtml1dir=''
+installsitehtml3dir=''
+installsitelib='/sdcard/com.googlecode.perlforandroid/extras/perl/site_perl/5.15.0'
+installsiteman1dir='./install_me_here/usr/share/man/man1'
+installsiteman3dir='./install_me_here/usr/share/man/man3'
+installsitescript='/sdcard/sl4a/scripts'
+installstyle='./install_me_herelib/perl5'
+installusrbinperl='undef'
+installvendorarch=''
+installvendorbin=''
+installvendorhtml1dir=''
+installvendorhtml3dir=''
+installvendorlib=''
+installvendorman1dir=''
+installvendorman3dir=''
+installvendorscript=''
+intsize='4'
+issymlink='/usr/bin/test -h'
+ivdformat='"ld"'
+ivsize='4'
+ivtype='long'
+known_extensions='Attribute/Handlers B ByteLoader Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Errno Fcntl File/Glob Filter/Util/Call GDBM_File I18N/Langinfo IO IO/Compress IPC/SysV List/Util MIME/Base64 Module/Pluggable NDBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via Safe SDBM_File Socket Storable Sys/Hostname Sys/Syslog Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/Typemap attributes mro re threads threads/shared Errno'
+ld='agcc'
+lddlflags='-shared'
+ldflags=''
+ldflags_uselargefiles=''
+ldlibpthname='LD_LIBRARY_PATH'
+less='less'
+lib_ext='.a'
+libc='/lib/libc-2.2.2.so'
+libperl='libperl.a'
+libpth='/usr/local/lib /lib /usr/lib'
+libs='-ldl -lm -lc'
+libsdirs=' /usr/lib'
+libsfiles=' libdl.so libm.so libc.so'
+libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libc.so'
+libspath=' /usr/local/lib /lib /usr/lib'
+libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted_uselargefiles=''
+line=''
+lint=''
+lkflags=''
+ln='ln'
+lns='/bin/ln -s'
+localtime_r_proto='0'
+locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include'
+loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'
+longdblsize='8'
+longlongsize='8'
+longsize='4'
+lp=''
+lpr=''
+ls='ls'
+lseeksize='8'
+lseektype='off_t'
+mad='undef'
+mail=''
+mailx=''
+make='make'
+make_set_make='#'
+mallocobj=''
+mallocsrc=''
+malloctype='void *'
+man1dir='/usr/share/man/man1'
+man1direxp='/usr/share/man/man1'
+man1ext='1'
+man3dir='/usr/share/man/man3'
+man3direxp='/usr/share/man/man3'
+man3ext='3'
+mips_type=''
+mistrustnm=''
+mkdir='mkdir'
+mmaptype='void *'
+modetype='mode_t'
+more='more'
+multiarch='undef'
+mv=''
+myarchname='arm-eabi-linux'
+mydomain='.none'
+myhostname='android'
+myuname='android'
+n='-n'
+need_va_copy='undef'
+netdb_hlen_type='size_t'
+netdb_host_type='const void *'
+netdb_name_type='const char *'
+netdb_net_type='in_addr_t'
+nm='nm'
+nm_opt=''
+nm_so_opt=''
+nonxs_ext='Archive-Extract Archive-Tar Attribute-Handlers autodie AutoLoader autouse base B-Debug B-Deparse bignum B-Lint CGI constant CPAN CPAN-Meta CPAN-Meta-YAML CPANPLUS CPANPLUS-Dist-Build Devel-SelfStubber Digest Dumpvalue encoding-warnings Env Errno ExtUtils-CBuilder ExtUtils-Command ExtUtils-Constant ExtUtils-Install ExtUtils-MakeMaker ExtUtils-Manifest ExtUtils-ParseXS FileCache File-CheckTree File-Fetch File-Path File-Temp Filter-Simple Getopt-Long HTTP-Tiny I18N-Collate I18N-LangTags if IO-Compress IO-Zlib IPC-Cmd IPC-Open3 JSON-PP lib libnet Locale-Codes Locale-Maketext Locale-Maketext-Simple Log-Message Log-Message-Simple Math-BigInt Math-BigRat Math-Complex Memoize Module-Build Module-CoreList Module-Load Module-Load-Conditional Module-Loaded Module-Metadata Module-Pluggable Net-Ping NEXT Object-Accessor Package-Constants Params-Check parent Parse-CPAN-Meta PerlIO-via-QuotedPrint Perl-OSType Pod-Escapes Pod-Html Pod-LaTeX podlators Pod-Parser Pod-Perldoc Pod-Simple Safe SelfLoader Term-ANSIColor Term-Cap Term-UI Test Test-Harness Test-Simple Text-Balanced Text-ParseWords Text-Tabs Thread-Queue Thread-Semaphore Tie-File Tie-Memoize Tie-RefHash Time-Local Version-Requirements XSLoader'
+# nonxs_ext='Errno'
+nroff='nroff'
+nvEUformat='"E"'
+nvFUformat='"F"'
+nvGUformat='"G"'
+nv_preserves_uv_bits='32'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
+nveformat='"e"'
+nvfformat='"f"'
+nvgformat='"g"'
+nvsize='8'
+nvtype='double'
+o_nonblock='O_NONBLOCK'
+obj_ext='.armo'
+old_pthread_create_joinable=''
+optimize='-O2'
+orderlib='false'
+osname='android'
+osvers='2.6'
+otherlibdirs=' '
+package='perl5'
+pager='/usr/bin/less'
+passcat='cat /etc/passwd'
+patchlevel=''
+path_sep=':'
+perl5='/usr/bin/perl'
+perl=''
+perl_patchlevel=''
+perl_static_inline='static __inline__'
+perladmin='castaway@desert-island.me.uk'
+perllibs='-ldl -lm -lc'
+perlpath='/usr/bin/perl'
+pg='pg'
+phostname='hostname'
+pidtype='pid_t'
+plibpth=''
+pmake=''
+pr=''
+prefix='/data/data/com.googlecode.perlforandroid/files/perl'
+prefixexp='/data/data/com.googlecode.perlforandroid/files/perl'
+privlib='/data/data/com.googlecode.perlforandroid/files/perl/5.15.0'
+privlibexp='/data/data/com.googlecode.perlforandroid/files/perl/5.15.0'
+procselfexe='"/proc/self/exe"'
+prototype='define'
+ptrsize='4'
+quadkind='3'
+quadtype='long long'
+randbits='31'
+randfunc='random'
+random_r_proto='0'
+randseedtype='long'
+ranlib=':'
+rd_nodata='-1'
+readdir64_r_proto='0'
+readdir_r_proto='0'
+revision='5'
+rm='rm'
+rmail=''
+run=''
+runnm='false'
+sPRIEUldbl='"E"'
+sPRIFUldbl='"F"'
+sPRIGUldbl='"G"'
+sPRIXU64='"LX"'
+sPRId64='"Ld"'
+sPRIeldbl='"e"'
+sPRIfldbl='"f"'
+sPRIgldbl='"g"'
+sPRIi64='"Li"'
+sPRIo64='"Lo"'
+sPRIu64='"Lu"'
+sPRIx64='"Lx"'
+sSCNfldbl='"f"'
+sched_yield='sched_yield()'
+scriptdir='/usr/bin'
+scriptdirexp='/usr/bin'
+sed='sed'
+seedfunc='srand48'
+selectminbits='32'
+selecttype='fd_set *'
+sendmail=''
+setgrent_r_proto='0'
+sethostent_r_proto='0'
+setlocale_r_proto='0'
+setnetent_r_proto='0'
+setprotoent_r_proto='0'
+setpwent_r_proto='0'
+setservent_r_proto='0'
+sh='/bin/sh'
+shar=''
+sharpbang='#!'
+shmattype='void *'
+shortsize='2'
+shrpenv=''
+shsharp='true'
+sig_count='64'
+sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED '
+sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
+sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 '
+sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0'
+sig_size='68'
+signal_t='void'
+sitearch='/data/data/com.googlecode.perlforandroid/files/perl/site_perl/5.15.0/arm-eabi-linux'
+sitearchexp='/data/data/com.googlecode.perlforandroid/files/perl/site_perl/5.15.0/arm-eabi-linux'
+sitebin='/sdcard/sl4a/scripts'
+sitebinexp='/sdcard/sl4a/scripts'
+sitehtml1dir=''
+sitehtml1direxp=''
+sitehtml3dir=''
+sitehtml3direxp=''
+sitelib='/sdcard/com.googlecode.perlforandroid/extras/perl/site_perl/5.15.0'
+sitelib_stem='/sdcard/com.googlecode.perlforandroid/extras/perl/site_perl'
+sitelibexp='/sdcard/com.googlecode.perlforandroid/extras/perl/site_perl/5.15.0'
+siteman1dir='/usr/share/man/man1'
+siteman1direxp='/usr/share/man/man1'
+siteman3dir='/usr/share/man/man3'
+siteman3direxp='/usr/share/man/man3'
+siteprefix='/sdcard/com.googlecode.perlforandroid/extras/perl'
+siteprefixexp='/sdcard/com.googlecode.perlforandroid/extras/perl'
+sitescript='/sdcard/sl4a/scripts'
+sitescriptexp='/sdcard/sl4a/scripts'
+sizesize='4'
+sizetype='size_t'
+sleep=''
+smail=''
+so='so'
+sockethdr=''
+socketlib=''
+socksizetype='socklen_t'
+sort='sort'
+spackage='Perl5'
+spitshell='cat'
+srand48_r_proto='0'
+srandom_r_proto='0'
+src='.'
+ssizetype='ssize_t'
+startperl='#!/usr/bin/perl'
+startsh='#!/bin/sh'
+static_ext='B Cwd Data/Dumper Devel/PPPort Digest/MD5 Digest/SHA Fcntl File/Glob IO List/Util POSIX Socket Sys/Hostname Time/HiRes'
+stdchar='char'
+stdio_base='((fp)->_IO_read_base)'
+stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)'
+stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
+stdio_filbuf=''
+stdio_ptr='((fp)->_IO_read_ptr)'
+stdio_stream_array=''
+strerror_r_proto='0'
+strings='/usr/include/string.h'
+submit=''
+subversion='1'
+sysman='/usr/share/man/man1'
+tail=''
+tar=''
+targetarch=''
+tbl=''
+tee=''
+test='test'
+timeincl='/usr/include/sys/time.h /usr/include/time.h '
+timetype='time_t'
+tmpnam_r_proto='0'
+to=':'
+touch='touch'
+tr='tr'
+trnl='\n'
+troff=''
+ttyname_r_proto='0'
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u32type='unsigned long'
+u64size='8'
+u64type='unsigned long long'
+u8size='1'
+u8type='unsigned char'
+uidformat='"lu"'
+uidsign='1'
+uidsize='4'
+uidtype='uid_t'
+uname='uname'
+uniq='uniq'
+uquadtype='unsigned long long'
+use5005threads='undef'
+use64bitall='undef'
+use64bitint='undef'
+usecrosscompile='define'
+usedevel='define'
+usedl='undef'
+usedtrace='undef'
+usefaststdio='define'
+useithreads='undef'
+uselargefiles='define'
+uselongdouble='undef'
+usemallocwrap='define'
+usemorebits='undef'
+usemultiplicity='undef'
+usemymalloc='n'
+usenm='false'
+useopcode='true'
+useperlio='define'
+useposix='true'
+usereentrant='undef'
+userelocatableinc='undef'
+usesfio='false'
+useshrplib='false'
+usesitecustomize='undef'
+usesocks='undef'
+usethreads='undef'
+usevendorprefix='undef'
+usevfork='false'
+usrinc='/usr/include'
+uuname=''
+uvXUformat='"lX"'
+uvoformat='"lo"'
+uvsize='4'
+uvtype='unsigned long'
+uvuformat='"lu"'
+uvxformat='"lx"'
+vaproto='define'
+vendorarch=''
+vendorarchexp=''
+vendorbin=''
+vendorbinexp=''
+vendorhtml1dir=' '
+vendorhtml1direxp=''
+vendorhtml3dir=' '
+vendorhtml3direxp=''
+vendorlib=''
+vendorlib_stem=''
+vendorlibexp=''
+vendorman1dir=' '
+vendorman1direxp=''
+vendorman3dir=' '
+vendorman3direxp=''
+vendorprefix=''
+vendorprefixexp=''
+vendorscript=''
+vendorscriptexp=''
+version='5.15.0'
+version_patchlevel_string='version 15 subversion 1'
+versiononly='undef'
+vi=''
+voidflags='15'
+xlibpth='/usr/lib/386 /lib/386'
+yacc='yacc'
+yaccflags=''
+zcat=''
+zip='zip'
+# Configure command line arguments.
+config_arg0='Configure'
+config_args=''
+config_argc=0
+PERL_REVISION=5
+PERL_VERSION=10
+PERL_SUBVERSION=1
+PERL_API_REVISION=5
+PERL_API_VERSION=10
+PERL_API_SUBVERSION=0
+PERL_PATCHLEVEL=
+PERL_CONFIG_SH=true
diff --git a/Cross/package-android-sh b/Cross/package-android-sh
new file mode 100644
index 0000000..628107c
--- /dev/null
+++ b/Cross/package-android-sh
@@ -0,0 +1,216 @@
+#!/bin/sh
+
+#
+# package-android-sh
+#
+# Package the built Perl for the android platform.
+#
+
+perl_exe=../perl.arm
+arm_lib=../xlib/arm
+
+Config_pm=$arm_lib/Config.pm
+JSON_tgz=JSON.tar.gz
+
+echo "[sanity checks...]"
+if test ! -f "$perl_exe"
+then
+  echo "$0: Cannot find the ARM perl executable '$perl_exe', aborting."
+  exit 1
+fi
+if test ! -d "$arm_lib"
+then
+  echo "$0: Cannot find the ARM library directory '$arm_lib', aborting."
+  exit 1
+fi
+if test ! -f "$Config_pm"
+then
+  echo "$0: Cannot find the configuration file '$Config_pm', aborting."
+  exit 1
+fi
+if test ! -f "$JSON_tgz"
+then
+  echo "$0: Cannot find the JSON library '$JSON_tgz', aborting."
+  exit 1
+fi
+echo "[sanity checks passed]"
+
+echo "[packaging...]"
+rm -rf android
+
+# These are almost like from config.sh but they are withOUT the
+# /data/data/com.google.com prefix.
+installlib=perl/5.10.0
+installarchlib=perl/5.10.0/arm-eabi-linux
+mkdir -p android/$installarchlib
+
+sitelib=android/sdcard/ase/extras/perl/site_perl
+
+stage () {
+  if test $# = 2
+  then
+    if test -f "$1"
+    then
+      case "$2" in
+      android/*)
+        echo "  $1 -> $2"
+        mkdir -p $(dirname $2)
+        cp -f $1 $2
+        ;;
+      *) echo "$0: stage: second argument needs to begin with android, got $2"
+         exit 1
+         ;;
+      esac
+    else
+      echo "$0: stage: first argument needs to be an existing file"
+      exit 1
+    fi
+  else
+    echo "$0: stage: needs two arguments, got: $@"
+    exit 1
+  fi
+}
+
+echo "[copying perl executable]"
+stage $perl_exe android/perl/perl
+
+# TODO: lib.pm?
+echo "[copying basic libraries]"
+for lib in Config.pm Config_*.pl
+do
+  for l in $(ls $arm_lib/$lib)
+  do
+    dst=android/$installlib/$(echo $l | sed 's:^'$arm_lib'/::')
+    stage $l $dst
+  done
+done
+for lib in AutoLoader.pm base.pm bytes.pm Carp.pm Carp/*.pm Config_*.pl constant.pm CPAN.pm CPAN/*.pm Cwd.pm Exporter.pm Exporter/*.pm File/*.pm Getopt/*.pm IPC/*.pm lib.pm overload.pm perl5db.pl re.pm SelectSaver.pm strict.pm Symbol.pm Term/ReadLine.pm Text/*.pm Tie/*.pm vars.pm utf8.pm utf8_heavy.pl warnings.pm warnings/*.pm
+do
+  lib=$(ls ../lib/$lib)
+  for l in $lib
+  do
+    dst=android/$installlib/$(echo $l | sed 's:^\.\./lib/::')
+    stage $l $dst
+  done
+done
+
+echo "[copying AutoLoader files]"
+for al in $(find ../xlib '(' -name '*.al' -o -name '*.ix' ')' -print)
+do
+  case "$al" in
+  */Storable/*) ;; # Not yet.
+  *) dst=android/$installlib/$(echo $al | sed 's:^'$arm_lib'/::')
+     stage $al $dst
+     ;;
+  esac
+done
+
+echo "[copying extension libraries]"
+for pm in $(find $arm_lib -name '*.pm' -print)
+do
+  src=$pm
+  dst=$(echo $src | sed -e "s:^$arm_lib/::" -e 's:^lib/::')
+  stage $src android/$installlib/$dst
+done
+
+echo "[copying extra libraries]"
+
+tar zxf $JSON_tgz
+json_dir=$(ls -d JSON-*.*/)
+case "$json_dir" in
+'') echo "$0: Failed to extract a JSON directory, aborting."
+    exit 1 ;;
+*" "*) echo "$0: Too many JSON directories ($json_dir), aborting."
+       exit 1 ;;
+esac
+json_dir=$(echo $json_dir | sed 's:/$::')
+json_pm=$(ls $json_dir/lib/JSON.pm)
+if test ! -f "$json_pm"
+then
+  echo "$0: Could not find a JSON.pm inside the $JSON_tgz, aborting."
+  rm -rf JSON-*.*/
+  exit 1
+fi
+for lib in $(find $json_dir/lib -type f -name '*.pm' -print)
+do
+  dst=$sitelib/$(echo $lib | sed "s:^$json_dir/lib/::")
+  stage $lib $dst
+done
+rm -rf JSON-*.*/
+
+stage Android.pm $sitelib/Android.pm
+
+echo "[generating installer]"
+cd android
+EMULATOR_INSTALLER=install-android-emulator-sh
+ASEROOT=/data/data/com.google.ase
+rm -f $EMULATOR_INSTALLER
+
+cat >$EMULATOR_INSTALLER <<__EOF__
+#!/bin/sh
+
+echo
+echo "[installing perl]"
+echo
+
+__EOF__
+
+echo "adb shell mkdir $ASEROOT" >> $EMULATOR_INSTALLER
+for d in $(find . -type d -print | sed 's:^\./::')
+do
+  case "$d" in
+  '.') ;;
+  *) case "$d" in
+     sdcard/*) echo "adb shell mkdir /$d" >> $EMULATOR_INSTALLER ;;
+     *) echo "adb shell mkdir $ASEROOT/$d" >> $EMULATOR_INSTALLER ;;
+     esac
+  esac 
+done
+for f in $(find . -type f -print | sed 's:^\./::')
+do
+  case "$f" in
+  *install-android-sh) ;;
+  *) d=$(dirname $f)
+     r=$ASEROOT
+     case "$d" in
+     sdcard/*) echo "adb push $f /$d" >> $EMULATOR_INSTALLER ;;
+     *) echo "adb push $f $ASEROOT/$d" >> $EMULATOR_INSTALLER ;;
+     esac
+     ;;
+  esac
+done
+
+cat >>$EMULATOR_INSTALLER <<__EOF__
+echo
+echo "[perl installed]"
+echo
+__EOF__
+
+EMULATOR_UNINSTALLER=uninstall-android-emulator-sh
+cat >$EMULATOR_UNINSTALLER <<__EOF__
+#!/bin/sh
+
+echo
+echo "[uninstalling perl]"
+echo
+
+# TODO: sanity check: "did you really mean to do this?"
+
+sh -x -c "adb shell rm -r /data/data/com.google.ase/perl /sdcard/ase/extras/perl"
+
+echo
+echo "[perl uninstalled]"
+echo
+__EOF__
+ls -l $EMULATOR_INSTALLER
+ls -l $EMULATOR_UNINSTALLER
+
+cd ..
+
+rm -f android.zip
+zip -q -r android.zip android
+
+echo "[packaging done]"
+ls -lsk android.zip
+
+exit 0
diff --git a/MANIFEST b/MANIFEST
index d3e5632..0783044 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -2803,16 +2803,21 @@ cpan/Win32/t/Names.t			See if Win32 extension works
 cpan/Win32/t/Unicode.t			See if Win32 extension works
 cpan/Win32/Win32.pm			Win32 extension Perl module
 cpan/Win32/Win32.xs			Win32 extension external subroutines
+Cross/Android.pm            Cross-compilation
 Cross/build-arm-n770-sh		Cross-compilation
+Cross/build-arm-android-sh		Cross-compilation
 Cross/cflags-cross-arm		Cross-compilation
 Cross/config			Cross-compilation
 Cross/config.sh-arm-linux	Cross-compilation
+Cross/config.sh-arm-linux-android	Cross-compilation
 Cross/config.sh-arm-linux-n770	Cross-compilation
 Cross/generate_config_sh	Cross-compilation
 Cross/installperl.patch		Cross-compilation
+Cross/JSON.tar.gz           Android port
 Cross/Makefile			Cross-compilation
 Cross/Makefile-cross-SH		Cross-compilation
 Cross/Makefile.SH.patch		Cross-compilation
+Cross/package-android-sh    Cross-compilation
 Cross/README			Cross-compilation
 Cross/README.new		Cross-compilation
 Cross/TODO			Cross-compilation
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
index b854887..d849e40 100644
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
@@ -147,21 +147,21 @@ sub c_o {
 	$command -S $flags \$*.c
 
 .c\$(OBJ_EXT):
-	$command $flags \$*.c
+	$command $flags \$*.c -o \$*\$(OBJ_EXT)
 
 .cpp\$(OBJ_EXT):
-	$command $flags \$*.cpp
+	$command $flags \$*.cpp -o \$*\$(OBJ_EXT)
 
 .cxx\$(OBJ_EXT):
-	$command $flags \$*.cxx
+	$command $flags \$*.cxx -o \$*\$(OBJ_EXT)
 
 .cc\$(OBJ_EXT):
-	$command $flags \$*.cc
+	$command $flags \$*.cc -o \$*\$(OBJ_EXT)
 };
 
     push @m, qq{
 .C\$(OBJ_EXT):
-	$command $flags \$*.C
+	$command $flags \$*.C -o \$*\$(OBJ_EXT)
 } if !$Is{OS2} and !$Is{Win32} and !$Is{Dos}; #Case-specific
 
     return join "", @m;
@@ -393,6 +393,7 @@ sub constants {
               PERL            FULLPERL          ABSPERL
               PERLRUN         FULLPERLRUN       ABSPERLRUN
               PERLRUNINST     FULLPERLRUNINST   ABSPERLRUNINST
+              PERLRUN_CROSS
               PERL_CORE
               PERM_DIR PERM_RW PERM_RWX
 
@@ -1930,9 +1931,12 @@ sub init_PERL {
         $self->{$run}  = "\$($perl)";
 
         # Make sure perl can find itself before it's installed.
-        $self->{$run} .= q{ "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)"} 
-          if $self->{UNINSTALLED_PERL} || $self->{PERL_CORE};
-
+        if ($self->{UNINSTALLED_PERL} || $self->{PERL_CORE}) {
+            $self->{$run} .= q{ "-I$(PERL_LIB)" };
+            $self->{$run} .= q{ "$(PERLRUN_CROSS)" } if($self->{PERLRUN_CROSS});
+            $self->{$run} .= q{ "-I$(PERL_ARCHLIB)" }; 
+        }
+        
         $self->{$perl.'RUNINST'} = 
           sprintf q{$(%sRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"}, $perl;
     }
@@ -3623,7 +3627,7 @@ sub xs_o {	# many makes are too dumb to use xs_c then c_o
     '
 .xs$(OBJ_EXT):
 	$(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c
-	$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c
+	$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c -o $*$(OBJ_EXT)
 ';
 }
 
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
index 6173b6b..98d7424 100644
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
@@ -283,6 +283,8 @@ sub full_setup {
     XS_VERSION clean depend dist dynamic_lib linkext macro realclean
     tool_autosplit
 
+    PERLRUN_CROSS
+
     MACPERL_SRC MACPERL_LIB MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC
     MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED
         /;
@@ -2143,6 +2145,13 @@ Overridden by PREFIX.
 Use this instead of $(PERL) when you wish to run perl.  It will set up
 extra necessary flags for you.
 
+=item PERLRUN_CROSS
+
+If cross-compiling, set this to the perl command line parameters
+needed to configure cross-compilation.  These parameters are placed
+in the perl command line after the first parameter, C<"-I$(PERL_LIB)">.
+Common values for this parameter are C<-MCross> and C<-MCross=architecture>.
+    
 =item PERLRUNINST
 
 Use this instead of $(PERL) when you wish to run perl to work with
diff --git a/cpan/Time-HiRes/hints/linux.pl b/cpan/Time-HiRes/hints/linux.pl
index 84ce522..a614cc3 100644
--- a/cpan/Time-HiRes/hints/linux.pl
+++ b/cpan/Time-HiRes/hints/linux.pl
@@ -1,2 +1,7 @@
 # needs to explicitly link against librt to pull in clock_nanosleep
-$self->{LIBS} = ['-lrt'];
+use Config;
+#print STDERR join ("\n", %Config);
+## This insanity is because: $^O is being used to determine which hints file is being run, I'm cross-compiling on linux, so hints/linux.pl is run. However I'm compiling for android, so osname (in config.sh-arm-linux-android) is set to android, which does not have -lrt.
+if($Config{osname} eq 'linux') {
+    $self->{LIBS} = ['-lrt'];
+}
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index 56bc815..df595e1 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -142,6 +142,19 @@ sub get_files {
 	      $Config{gccversion} !~ /intel/i
 	      # might be using, say, Intel's icc
 	     ) {
+#        print STDERR "CC: $Config{cc} CCNAME: $Config{ccname}\n";
+        if ($Config{cc} eq 'agcc') {
+
+            ## Added by Jess for Android NDK
+            ## $ENV{DROID} is laziness, how else should we find it?
+            if(exists $ENV{DROID}) {
+#                print STDERR "Found DROID: $ENV{DROID}\n";
+                my $android_errno_h = "$ENV{DROID}/platforms/android-9/arch-arm/usr/include/errno.h";
+                if(-e $android_errno_h ) {
+                    $file{$android_errno_h} = 1;
+                }
+            }
+        }
 	# Some Linuxes have weird errno.hs which generate
 	# no #file or #line directives
 	my $linux_errno_h = -e '/usr/include/errno.h' ?
-- 
1.7.3.1


From 718d8400d5857a297c10caacdeef3b6a057c2f32 Mon Sep 17 00:00:00 2001
From: Jess Robinson <castaway@desert-island.me.uk>
Date: Tue, 26 Jul 2011 14:35:02 +0100
Subject: [PATCH 2/4] Added simple Android building readme
 Removed some extraneous bits of README.new (there is no ext/util/make_ext_cross)

---
 Cross/README.android |   39 +++++++++++++++++++++++++++++++++++++++
 Cross/README.new     |    5 +----
 2 files changed, 40 insertions(+), 4 deletions(-)
 create mode 100644 Cross/README.android

diff --git a/Cross/README.android b/Cross/README.android
new file mode 100644
index 0000000..96dadbd
--- /dev/null
+++ b/Cross/README.android
@@ -0,0 +1,39 @@
+=head1 NAME
+
+README.android - notes on how to cross-compile perl for Android OS
+
+=head1 DESCRIPTION
+
+This file describes how to cross-compile a copy of perl for Android, using the Android NDK.
+
+=head2 You will need
+
+=over
+
+=item Android NDK, tested using: 
+
+L<http://dl.google.com/android/ndk/android-ndk-r5c-linux-x86.tar.bz2>
+
+=item Android SDK, tested using:
+
+L<http://dl.google.com/android/android-sdk_r11-linux_x86.tgz>
+
+=item agcc, script to simplfy calling the arm-gcc
+
+There is a copy modified for NDK v5c and SDK r11 in the Cross/ directory. 
+
+=item Environment variables:
+
+export DROID=<path_to_ndk>
+export PATH=$PATH:<path_to_agcc>:<path_to_sdk>/ase_src/tools:<path_to_ndk>/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
+
+eg:
+
+    export DROID=/usr/src/android/android-ndk-r5c
+    export PATH=$PATH:/home/castaway/bin:/usr/src/android/android-sdk-linux_x86/ase_src/tools:/usr/src/android/android-ndk-r5c/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
+
+=back
+
+=head2 Running
+
+    sh build-arm-android-sh
diff --git a/Cross/README.new b/Cross/README.new
index bcfa3b3..ba40b35 100644
--- a/Cross/README.new
+++ b/Cross/README.new
@@ -66,9 +66,6 @@ is substituted, and resulting binaries will be a mess.
 C<miniperl -MCross -MConfig -we 1> should run okay, and it will provide a
 correct C<Config.pm> for further compilations.
 
-During extensions build phase, the script C<./ext/util/make_ext_cross> is
-invoked.
-
 All invocations of C<Makefile.PL> are provided with C<-MCross> so to enable
 cross-compilation.
 
@@ -76,7 +73,7 @@ cross-compilation.
 
 =head3 Tools & SDK
 
-To compile, you need the following:
+See the README.xyz files in the Cross/ directory for instructions on cross-compiling for various TARGET platforms.
 
 =over 4
 
-- 
1.7.3.1


From 24d55a9a929b20b930f77d5d3f1adac9844e62b2 Mon Sep 17 00:00:00 2001
From: Jess Robinson <castaway@desert-island.me.uk>
Date: Thu, 28 Jul 2011 22:08:15 +0100
Subject: [PATCH 3/4] Committing handy copy of agcc.
 A script to make building with the android groxx compiling gcc easier.
 It's possible this should be in an android specific subdir

---
 Cross/agcc |  199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 199 insertions(+), 0 deletions(-)
 create mode 100755 Cross/agcc

diff --git a/Cross/agcc b/Cross/agcc
new file mode 100755
index 0000000..3479985
--- /dev/null
+++ b/Cross/agcc
@@ -0,0 +1,199 @@
+#!/usr/bin/perl -w
+use strict;
+
+# Copyright 2008, Andrew Ross andy@plausible.org
+# Distributable under the terms of the GNU GPL, see COPYING for details
+
+# The Android toolchain is ... rough.  Rather than try to manage the
+# complexity directly, this script wraps the tools into an "agcc" that
+# works a lot like a gcc command line does for a native platform or a
+# properly integrated cross-compiler.  It accepts arbitrary arguments,
+# but interprets the following specially:
+#
+# -E/-S/-c/-shared - Enable needed arguments (linker flags, include
+#                    directories, runtime startup objects...) for the
+#                    specified compilation mode when building under
+#                    android.
+#
+# -O<any> - Turn on the optimizer flags used by the Dalvik build.  No
+#           control is provided over low-level optimizer flags.
+#
+# -W<any> - Turn on the warning flags used by the Dalvik build.  No
+#           control is provided over specific gcc warning flags.
+#
+# Notes:
+# + The prebuilt arm-eabi-gcc from a built (!) android source
+#   directory must be on your PATH.
+# + All files are compiled with -fPIC to an ARMv5TE target.  No
+#   support is provided for thumb.
+# + No need to pass a "-Wl,-soname" argument when linking with
+#   -shared, it uses the file name always (so don't pass a directory in
+#   the output path for a shared library!)
+
+# Dance around to find the actual android toolchain path (it's very
+# deep, so links on $PATH are going to be common.
+my $GCC = `which arm-eabi-gcc`;
+$GCC = qx(cd `dirname $GCC`; /bin/pwd);
+chomp $GCC;
+die "bad arm-eabi-gcc path" if $GCC !~ /(.*)\/prebuilt\//;
+my $DROID = $ENV{DROID} || $1;
+
+my $CURRENT = "$DROID/platforms/android-9"; 
+my $ALIB = "$CURRENT/arch-arm/usr/lib";
+my $TOOLCHAIN = "$DROID/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86";
+
+my @include_paths = (
+    "-I$TOOLCHAIN/lib/gcc/arm-eabi/4.4.0/iclude",
+    "-I$TOOLCHAIN/include",
+    "-I$CURRENT/arch-arm/usr/include",
+    "-I$DROID/sources/cxx-stl/gnu-libstdc++/libs/armeabiv-7a/include",
+    "-I$DROID/sources/cxx-stl/gnu-libstdc++/libs/armeabiv/include",
+    "-I$DROID/sources/cxx-stl/gnu-libstdc++/include",
+    "-I$DROID/sources/cxx-stl/gnu-libstdc++/system/include",
+    "-I$DROID/system/core/include",
+    "-I$DROID/hardware/libhardware/include",
+    "-I$DROID/hardware/ril/include",
+    "-I$DROID/dalvik/libnativehelper/include",
+    "-I$DROID/frameworks/base/include",
+    "-I$DROID/external/skia/include",
+    "-I$DROID/out/target/product/generic/obj/include",
+    "-I$DROID/bionic/libc/arch-arm/include",
+    "-I$DROID/bionic/libc/include",
+    "-I$DROID/bionic/libstdc++/include",
+    "-I$DROID/bionic/libc/kernel/common",
+    "-I$DROID/bionic/libc/kernel/arch-arm",
+    "-I$DROID/bionic/libm/include",
+    "-I$DROID/bionic/libm/include/arch/arm",
+    "-I$DROID/bionic/libthread_db/include",
+    "-I$DROID/bionic/libm/arm",
+    "-I$DROID/bionic/libm",
+    "-I$DROID/out/target/product/generic/obj/SHARED_LIBRARIES/libm_intermediates");
+
+my @preprocess_args = (
+    "-D__ARM_ARCH_5__",
+    "-D__ARM_ARCH_5T__",
+    "-D__ARM_ARCH_5E__",
+    "-D__ARM_ARCH_5TE__", # Already defined by toolchain
+    "-DANDROID",
+    "-DSK_RELEASE",
+    "-DNDEBUG",
+#    "-include", "$DROID/system/core/include/arch/linux-arm/AndroidConfig.h",
+    "-UDEBUG");
+
+my @warn_args = (
+    "-Wall",
+    "-Wno-unused", # why?
+    "-Wno-multichar", # why?
+    "-Wstrict-aliasing=2"); # Implicit in -Wall per texinfo
+
+my @compile_args = (
+    "-march=armv5te",
+    "-mtune=xscale",
+    "-msoft-float",
+    "-mthumb-interwork",
+    "-fpic",
+    "-fno-exceptions",
+    "-ffunction-sections",
+    "-funwind-tables", # static exception-like tables
+    "-fstack-protector", # check guard variable before return
+    "-fmessage-length=0"); # No line length limit to error messages
+
+my @optimize_args = (
+    "-O2",
+    "-finline-functions",
+    "-finline-limit=300",
+    "-fno-inline-functions-called-once",
+    "-fgcse-after-reload",
+    "-frerun-cse-after-loop", # Implicit in -O2 per texinfo
+    "-frename-registers",
+    "-fomit-frame-pointer",
+    "-fstrict-aliasing", # Implicit in -O2 per texinfo
+    "-funswitch-loops");
+
+my @link_args = (
+    "-Bdynamic",
+    "-Wl,-T,$TOOLCHAIN/arm-eabi/lib/ldscripts/armelf.x",
+    "-Wl,-dynamic-linker,/system/bin/linker",
+    "-Wl,--gc-sections",
+    "-Wl,-z,nocopyreloc",
+    "-Wl,--no-undefined",
+    "-Wl,-rpath-link=$ALIB",
+    "-L$ALIB",
+    "-nostdlib",
+    "$ALIB/crtend_android.o",
+    "$ALIB/crtbegin_dynamic.o",
+    "$TOOLCHAIN/lib/gcc/arm-eabi/4.4.0/libgcc.a",
+    "-lc",
+    "-lm");
+    
+# Also need: -Wl,-soname,libXXXX.so
+my @shared_args = (
+    "-nostdlib",
+    "-Wl,-T,$TOOLCHAIN/arm-eabi/lib/ldscripts/armelf.xsc",
+    "-Wl,--gc-sections",
+    "-Wl,-shared,-Bsymbolic",
+    "-L$ALIB",
+    "-Wl,--no-whole-archive",
+    "-lc",
+    "-lm",
+    "-Wl,--no-undefined",
+    "$TOOLCHAIN/lib/gcc/arm-eabi/4.4.0k/libgcc.a",
+    "-Wl,--whole-archive"); # .a, .o input files go *after* here
+
+# Now implement a quick parser for a gcc-like command line
+
+my %MODES = ("-E"=>1, "-c"=>1, "-S"=>1, "-shared"=>1);
+
+my $mode = "DEFAULT";
+my $out;
+my $warn = 0;
+my $opt = 0;
+my @args = ();
+my $have_src = 0;
+while(@ARGV) {
+    my $a = shift;
+    if(defined $MODES{$a}) {
+	die "Can't specify $a and $mode" if $mode ne "DEFAULT";
+	$mode = $a;
+    } elsif($a eq "-o") {
+	die "Missing -o argument" if !@ARGV;
+	die "Duplicate -o argument" if defined $out;
+	$out = shift;
+    } elsif($a =~ /^-W.*/) {
+	$warn = 1;
+    } elsif($a =~ /^-O.*/) {
+	$opt = 1;
+    } else {
+	if($a =~ /\.(c|cpp|cxx)$/i) { $have_src = 1; }
+	push @args, $a;
+    }
+}
+
+my $need_cpp = 0;
+my $need_compile = 0;
+my $need_link = 0;
+my $need_shlink = 0;
+if($mode eq "DEFAULT") { $need_cpp = $need_compile = $need_link = 1; }
+if($mode eq "-E") { $need_cpp = 1; }
+if($mode eq "-c") { $need_cpp = $need_compile = 1; }
+if($mode eq "-S") { $need_cpp = $need_compile = 1; }
+if($mode eq "-shared") { $need_shlink = 1; }
+
+if($have_src and $mode ne "-E") { $need_cpp = $need_compile = 1; }
+
+# Assemble the command:
+my @cmd = ("arm-eabi-gcc");
+if($mode ne "DEFAULT") { @cmd = (@cmd, $mode); }
+if(defined $out) { @cmd = (@cmd, "-o", $out); }
+if($need_cpp) { @cmd = (@cmd, @include_paths, @preprocess_args); }
+if($need_compile){
+    @cmd = (@cmd, @compile_args);
+    if($warn) { @cmd = (@cmd, @warn_args); }
+    if($opt) { @cmd = (@cmd, @optimize_args); }
+}
+if($need_link) { @cmd = (@cmd, @link_args); }
+if($need_shlink) { @cmd = (@cmd, @shared_args); }
+@cmd = (@cmd, @args);
+
+print join(" ", @cmd), "\n"; # Spit it out if you're curious
+exec(@cmd);
-- 
1.7.3.1


From 9e7fec59b2a0226972cecd7a218ffbff4e286d3b Mon Sep 17 00:00:00 2001
From: Jess Robinson <castaway@desert-island.me.uk>
Date: Thu, 28 Jul 2011 22:10:03 +0100
Subject: [PATCH 4/4] Android.pm file, for communicating with SL4A
 This should likely be in an android-specific dir, it communicates to the SL4A (Scripting Language 4 Android) RPC

---
 Cross/Android.pm |  237 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 237 insertions(+), 0 deletions(-)
 create mode 100644 Cross/Android.pm

diff --git a/Cross/Android.pm b/Cross/Android.pm
new file mode 100644
index 0000000..5417255
--- /dev/null
+++ b/Cross/Android.pm
@@ -0,0 +1,237 @@
+# Copyright (C) 2009-2010 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+#
+# Author: Jarkko Hietaniemi <jhi@google.com>
+# Sawyer X <xsawyerx@gmail.com>
+#
+
+package Android;
+
+use strict;
+
+use vars qw($VERSION $AUTOLOAD);
+
+$VERSION = 0.003;
+
+use IO::Socket;
+use JSON;
+use Getopt::Long;
+use Data::Dumper;
+
+my %Opt;
+
+# You can specify the server port number to contact either via the
+# $ENV{AP_PORT} (the default behaviour) or via --port=n (when debugging
+# Android.pm and/or running in server mode, the default being client mode).
+# Running a test server:
+# perl -w Android.pm --port=4321 --trace --server
+# Running a test client:
+# perl -w Android.pm --port=4321 --trace --request Bar 1 2 foo 3.4
+
+# This BEGIN parses options, if any.
+BEGIN {
+    %Opt = (port => $ENV{AP_PORT} ? $ENV{AP_PORT} : 4321, 
+            host => $ENV{AP_HOST} ? $ENV{AP_HOST} : 'localhost', 
+            handshake => $ENV{AP_HANDSHAKE} ? $ENV{AP_HANDSHAKE} : '');
+    GetOptions('port=i' => \$Opt{port},
+               'server' => \$Opt{server},
+               'request' => \$Opt{request},
+               'trace' => \$Opt{trace}) or
+                 die "$0: Usage: $0 [--port=n] [--server] [--request method ...]\n";
+    (defined $Opt{port} && $Opt{port} =~ /^\d+$/)
+      or die "$0: AP_PORT '$Opt{port}' undefined or illegal\n";
+}
+
+# server() is run if --server is given to Android.pm.
+sub server {
+  # getprotobyname() is still a fatally unimplemented stub in Android 2.0.1.
+  my $proto = eval { getprotobyname('tcp') } || 6;
+  my $server = IO::Socket::INET->new(Proto     => 'tcp',
+                                     LocalPort => $Opt{port},
+                                     Listen    => SOMAXCONN,
+                                     Reuse     => 1);
+  die "$0: Cannot start server: $!\n" unless defined $server;
+  if ($Opt{trace}) {
+      show_trace(qq[$0: server: accepting in port $Opt{port}]);
+  }
+  while (defined(my $client = $server->accept())) {
+      show_trace(qq[$0: server: client $client]) if $Opt{trace};
+      $client->autoflush(1);
+      my $json = readline($client);
+      chomp($json);
+      show_trace(qq[server: rcvd: "$json"]) if $Opt{trace};
+      print $client $json, "\n";  # We just echo back what they said to us.
+      show_trace(qq[server: sent: "$json"]) if $Opt{trace};
+      close($client);
+  }
+}
+
+sub new {
+    my $class = shift;
+    if (@_) {
+        print STDERR "$0: client: new() expected no arguments, got @_\n";
+    }
+    my $fh = IO::Socket::INET->new(Proto    => 'tcp',
+                                   PeerAddr => $Opt{host},
+                                   PeerPort => $Opt{port})
+        or die "$0: Cannot connect to server port $Opt{port} on localhost\n";
+    $fh->autoflush(1);
+    if ($Opt{trace}) {
+        show_trace(qq[Android: server in port $Opt{port}]);
+    }
+    my $self = bless {
+        conn => $fh,
+        id   => 0,
+    }, $class;
+    $self->_authenticate($Opt{handshake});
+    return $self;
+}
+
+# One can use this to set the proxy object to display what's being
+# sent down and up the wire (as JSON), or query the state of tracing.
+# If tracing is on, the client library will also dump the Perl result
+# that was decoded from JSON.
+sub trace {
+    if (@_ == 2) {
+        $_[0]->{trace} = $_[1];
+    } else {
+        return $_[0]->{trace};
+    }
+}
+
+# Utility function for showing traces.
+sub show_trace {
+  print STDERR "<<@_>>\n";
+}
+
+# The connection is implicitly closed when the proxy object goes out
+# of scope, but one can use the close() method to explicitly terminate
+# the connection.  This is also used internally by the do_rpc() in
+# case the server end looks to have gone away.  The _close() closes
+# the connection quietly, close() closes the connection noisily.
+sub _close {
+    if (defined $_[0]->{conn}) {
+        close($_[0]->{conn});
+        undef $_[0]->{conn};
+    }
+}
+sub close {
+    my $self = shift;
+    $self->_close();
+    print STDERR "$0: client: connection closed\n";
+}
+
+# Given a method and parameters, call the server with JSON,
+# and return the parsed the response JSON.  If the server side
+# looks to be dead, close the connection and return undef.
+sub do_rpc {
+    my $self = shift;
+    if ($self->trace) {
+        show_trace(qq[do_rpc: $self: @_]);
+    }
+    my $method = pop;
+    my $request = to_json({ id => $self->{id},
+                            method => $method,
+                            params => [ @_ ] });
+    if (defined $self->{conn}) {
+        print { $self->{conn} } $request, "\n";
+        if ($self->trace) {
+            show_trace(qq[client: sent: "$request"]);
+        }
+        $self->{id}++;
+        my $response = readline($self->{conn});
+        chomp $response;
+        if ($self->trace) {
+            show_trace(qq[client: rcvd: "$response"]);
+        }
+        if (defined $response && length $response) {
+            my $result = from_json($response);
+            my $success = 0;
+            my $error;
+            if (defined $result) {
+                if (ref $result eq 'HASH') {
+                    if (defined $result->{error}) {
+                        $error = to_json( { error => $result->{error} } );
+                    } else {
+                        $success = 1;
+                    }
+                } else {
+                    $error = "illegal JSON reply: $result";
+                }
+            }
+            unless ($success || defined $error) {
+                $error = "unknown JSON error";
+            }
+            if (defined $error) {
+                printf STDERR "$0: client: error: %s\n", $error;
+            }
+            if ($Opt{trace}) {
+                print STDERR Data::Dumper->Dump([$result], [qw(result)]);
+            }
+            return $result;
+        }
+    }
+    $self->close;
+    return;
+}
+
+# Return stubs that call do_rpc() with the method name smuggled in.
+sub rpc_maker {
+    if ($Opt{trace}) {
+        show_trace(qq[rpc_maker: @_]);
+    }
+    my $method = shift;
+    sub {
+        push @_, $method;
+        goto &do_rpc;  # Knock the stub out of the call stack.
+    }
+}
+
+# AUTOLOAD installs RPC proxies for all unknown methods.
+sub AUTOLOAD {
+    if ($Opt{trace}) {
+        show_trace(qq[AUTOLOAD=$AUTOLOAD, @_]);
+    }
+    my ($method) = ($AUTOLOAD =~ /::(\w+)$/);
+    return if $method eq 'DESTROY';
+    my $rpc = rpc_maker($method);
+    {
+        # Install the RPC proxy method, we will not came here
+        # any more for the same method name.
+        no strict 'refs';
+        *$method = $rpc;
+    }
+    goto &$rpc;  # Call the RPC now.
+}
+
+sub DESTROY {
+    $_[0]->_close();
+}
+
+# This BEGIN block either invokes server() or sends a client request,
+# or does nothing (the case of using Android.pm as a client library).
+sub BEGIN {
+    if (defined $Opt{server}) {
+        &server;
+    } elsif (defined $Opt{request}) {
+        my $android = Android->new();
+        $android->trace(1) if $Opt{trace};
+        my $method = shift @ARGV;
+        $android->$method(@ARGV);
+        exit(0);
+    }
+}
+
+1;
-- 
1.7.3.1


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About