+ Android/JVM target, including a translation of the Android r14 SDK

(= Android 4.0) java headers: java.*, javax.*, org.*, junit.*, android.*).
    The RTL can also be used to target earlier versions of the Android
    platform, but you manually have to take care of not using APIs that
    weren't available yet. Adding separate units for separate platform
    versions would only partly solve the problem, because some of the
    classes used inside the system unit have also changed across
    versions.

    Use -Tandroid while compiling to select the Android OS as target
    platform.

git-svn-id: branches/jvmbackend@19830 -
This commit is contained in:
Jonas Maebe 2011-12-12 02:34:34 +00:00
parent 676ca4c891
commit 0d5b2b84a8
36 changed files with 74607 additions and 354 deletions

7
.gitattributes vendored
View File

@ -6948,6 +6948,13 @@ rtl/amiga/sysutils.pp svneol=native#text/plain
rtl/amiga/timerd.inc svneol=native#text/plain
rtl/amiga/tthread.inc svneol=native#text/plain
rtl/amiga/varutils.pp svneol=native#text/plain
rtl/android/jvm/Makefile svneol=native#text/plain
rtl/android/jvm/Makefile.fpc svneol=native#text/plain
rtl/android/jvm/androidr14.inc svneol=native#text/plain
rtl/android/jvm/androidr14.pas svneol=native#text/plain
rtl/android/jvm/java_sys_android.inc svneol=native#text/plain
rtl/android/jvm/java_sysh_android.inc svneol=native#text/plain
rtl/android/jvm/rtl.cfg svneol=native#text/plain
rtl/arm/arm.inc svneol=native#text/plain
rtl/arm/divide.inc svneol=native#text/plain
rtl/arm/int64p.inc svneol=native#text/plain

View File

@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/12/04]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/12/12]
#
default: help
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux jvm-java
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux jvm-java jvm-android
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx haiku
LIMIT83fs = go32v2 os2 emx watcom
@ -601,6 +601,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),jvm-android)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
override INSTALL_FPCPACKAGE=y
ifdef REQUIRE_UNITSDIR
override UNITSDIR+=$(REQUIRE_UNITSDIR)
@ -959,6 +962,12 @@ ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=java
endif
ifeq ($(OS_TARGET),android)
OEXT=.class
ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=android
endif
else
ifeq ($(OS_TARGET),go32v1)
PPUEXT=.pp1
@ -2388,6 +2397,14 @@ TARGET_DIRS_PACKAGES=1
TARGET_DIRS_IDE=1
TARGET_DIRS_INSTALLER=1
endif
ifeq ($(FULL_TARGET),jvm-android)
TARGET_DIRS_COMPILER=1
TARGET_DIRS_RTL=1
TARGET_DIRS_UTILS=1
TARGET_DIRS_PACKAGES=1
TARGET_DIRS_IDE=1
TARGET_DIRS_INSTALLER=1
endif
ifdef TARGET_DIRS_COMPILER
compiler_all:
$(MAKE) -C compiler all

View File

@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/12/04]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/12/12]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux jvm-java
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux jvm-java jvm-android
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx haiku
LIMIT83fs = go32v2 os2 emx watcom
@ -653,6 +653,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override TARGET_DIRS+=utils
endif
ifeq ($(FULL_TARGET),jvm-android)
override TARGET_DIRS+=utils
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_PROGRAMS+=pp
endif
@ -845,6 +848,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override TARGET_PROGRAMS+=pp
endif
ifeq ($(FULL_TARGET),jvm-android)
override TARGET_PROGRAMS+=pp
endif
override INSTALL_FPCPACKAGE=y
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
@ -1038,6 +1044,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
endif
ifeq ($(FULL_TARGET),jvm-android)
override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
endif
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
endif
@ -1230,6 +1239,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
endif
ifeq ($(FULL_TARGET),jvm-android)
override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
endif
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_TARGETDIR+=.
endif
@ -1422,6 +1434,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override COMPILER_TARGETDIR+=.
endif
ifeq ($(FULL_TARGET),jvm-android)
override COMPILER_TARGETDIR+=.
endif
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
endif
@ -1614,6 +1629,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
endif
ifeq ($(FULL_TARGET),jvm-android)
override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
endif
ifdef REQUIRE_UNITSDIR
override UNITSDIR+=$(REQUIRE_UNITSDIR)
endif
@ -1971,6 +1989,12 @@ ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=java
endif
ifeq ($(OS_TARGET),android)
OEXT=.class
ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=android
endif
else
ifeq ($(OS_TARGET),go32v1)
PPUEXT=.pp1
@ -2588,6 +2612,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
REQUIRE_PACKAGES_RTL=1
endif
ifeq ($(FULL_TARGET),jvm-android)
REQUIRE_PACKAGES_RTL=1
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_RTL),)
@ -3402,6 +3429,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
TARGET_DIRS_UTILS=1
endif
ifeq ($(FULL_TARGET),jvm-android)
TARGET_DIRS_UTILS=1
endif
ifdef TARGET_DIRS_UTILS
utils_all:
$(MAKE) -C utils all

View File

@ -1226,7 +1226,7 @@ implementation
idtxt : 'Jasmin';
asmbin : 'java';
asmcmd : '-jar $JASMINJAR $ASM -d $OBJDIR';
supported_targets : [system_jvm_java32];
supported_targets : [system_jvm_java32,system_jvm_android32];
flags : [];
labelprefix : 'L';
comment : ' ; ';

View File

@ -665,7 +665,7 @@ implementation
{ ugly, but delphi allows it }
if cdo_explicit in cdoptions then
begin
if target_info.system in [system_jvm_java32] then
if target_info.system in systems_jvm then
begin
doconv:=tc_equal;
eq:=te_convert_l1;
@ -687,7 +687,7 @@ implementation
typecasts must not be treated as integer-like
conversions
}
if target_info.system in [system_jvm_java32] then
if target_info.system in systems_jvm then
begin
doconv:=tc_equal;
eq:=te_convert_l1;
@ -1049,7 +1049,7 @@ implementation
}
if (((cdo_explicit in cdoptions) and
((m_delphi in current_settings.modeswitches) or
(target_info.system in [system_jvm_java32])
(target_info.system in systems_jvm)
)
) or
(cdo_internal in cdoptions)
@ -1059,7 +1059,7 @@ implementation
typecasts must not be treated as integer-like
conversions
}
if target_info.system in [system_jvm_java32] then
if target_info.system in systems_jvm then
begin
doconv:=tc_equal;
eq:=te_convert_l1;
@ -1435,7 +1435,7 @@ implementation
{ in Java enums /are/ class instances, and hence such
typecasts must not be treated as integer-like conversions
}
else if ((not(target_info.system in [system_jvm_java32]) and
else if ((not(target_info.system in systems_jvm) and
(def_from.typ=enumdef)) or
(def_from.typ=orddef)) and
(m_delphi in current_settings.modeswitches) and

View File

@ -1253,7 +1253,7 @@ implementation
{ typeconversions on the assignment side must keep
left.location the same }
if not(gotderef or
((target_info.system=system_jvm_java32) and
((target_info.system in systems_jvm) and
(gotsubscript or gotvec))) then
begin
ttypeconvnode(hp).assignment_side:=true;

View File

@ -1796,7 +1796,7 @@ implementation
selfdef:=tprocdef(procdefinition).struct;
if (oo_has_vmt in tprocdef(procdefinition).struct.objectoptions) or
{ all Java classes have a "VMT" }
(target_info.system in [system_jvm_java32]) then
(target_info.system in systems_jvm) then
begin
{ we only need the vmt, loading self is not required and there is no
need to check for typen, because that will always get the

View File

@ -456,7 +456,7 @@ implementation
location.reference.alignment:=vs.vardef.alignment;
end
else if is_java_class_or_interface(left.resultdef) or
((target_info.system=system_jvm_java32) and
((target_info.system in systems_jvm) and
(left.resultdef.typ=recorddef)) then
begin
if (location.loc<>LOC_REFERENCE) or

View File

@ -768,7 +768,7 @@ begin
break;
end;
'v' :
If target_info.system=system_jvm_java32 then
If target_info.system in systems_jvm then
If UnsetBool(More, j) then
exclude(init_settings.localswitches,cs_check_var_copyout)
Else
@ -2313,7 +2313,8 @@ begin
system_i386_nativent:
// until these features are implemented, they are disabled in the compiler
target_unsup_features:=[f_stackcheck];
system_jvm_java32:
system_jvm_java32,
system_jvm_android32:
target_unsup_features:=[f_heap,f_textio,f_consoleio,f_fileio,
f_variants,f_objects,f_threading,f_commandargs,
f_processes,f_stackcheck,f_dynlibs,f_softfpu,f_objectivec1,f_resources];
@ -2863,6 +2864,15 @@ if (target_info.system=system_arm_darwin) then
end;
{$endif arm}
{$ifdef jvm}
{ set default CPU type to Dalvik when targeting Android }
if target_info.system=system_jvm_android32 then
begin
if not option.CPUSetExplicitly then
init_settings.cputype:=cpu_dalvik;
end;
{$endif jvm}
{ now we can define cpu and fpu type }
def_system_macro('CPU'+Cputypestr[init_settings.cputype]);

View File

@ -421,7 +421,7 @@ implementation
if hs<>'' then
begin
{ the JVM expects java/lang/Object rather than java.lang.Object }
if target_info.system=system_jvm_java32 then
if target_info.system in systems_jvm then
Replace(hs,'.','/');
stringdispose(od.import_lib);
od.import_lib:=stringdup(hs);

View File

@ -1800,7 +1800,7 @@ begin
if Copy(hs,1,length(target_info.sharedlibprefix))<>target_info.sharedlibprefix then
hs:=target_info.sharedlibprefix+hs;
{ the JVM expects java/lang/Object rather than java.lang.Object }
if target_info.system=system_jvm_java32 then
if target_info.system in systems_jvm then
Replace(hs,'.','/');
import_dll:=stringdup(hs);
include(procoptions,po_has_importdll);

View File

@ -2358,7 +2358,7 @@ implementation
if assigned(current_procinfo) and
assigned(current_structdef) and
((current_structdef.typ=objectdef) or
((target_info.system=system_jvm_java32) and
((target_info.system in systems_jvm) and
(current_structdef.typ=recorddef)))then
begin
{ for record helpers in mode Delphi "inherited" is not

View File

@ -978,7 +978,7 @@ implementation
current_specializedef:=nil;
{ create recdef }
if (n<>'') or
(target_info.system<>system_jvm_java32) then
not(target_info.system in systems_jvm) then
begin
recst:=trecordsymtable.create(n,current_settings.packrecords);
{ can't use recst.realname^ instead of n, because recst.realname is

View File

@ -1144,7 +1144,7 @@ unit scandir;
procedure dir_varparacopyoutcheck;
begin
if target_info.system<>system_jvm_java32 then
if not(target_info.system in systems_jvm) then
begin
Message1(scan_w_illegal_switch,pattern);
exit;

View File

@ -922,7 +922,7 @@ implementation
sstate: tscannerstate;
begin
{ only necessary for the JVM target currently }
if not (target_info.system in [system_jvm_java32]) then
if not (target_info.system in systems_jvm) then
exit;
replace_scanner('synthetic_impl',sstate);
add_synthetic_method_implementations_for_st(st);
@ -1163,7 +1163,7 @@ implementation
begin
{ create a dummy typesym for the JVM target, because the record
has to be wrapped by a class }
if (target_info.system=system_jvm_java32) and
if (target_info.system in systems_jvm) and
(def.typ=recorddef) and
not assigned(def.typesym) then
begin

View File

@ -1697,7 +1697,7 @@ implementation
function tstringdef.is_related(d: tdef): boolean;
begin
result:=
(target_info.system=system_jvm_java32) and
(target_info.system in systems_jvm) and
(((stringtype in [st_unicodestring,st_widestring]) and
((d=java_jlobject) or
(d=java_jlstring))) or
@ -3312,7 +3312,7 @@ implementation
{ records are implemented via classes in the JVM target, and are
all descendents of the java_fpcbaserecordtype class }
is_related:=false;
if (target_info.system=system_jvm_java32) then
if (target_info.system in systems_jvm) then
begin
if d.typ=objectdef then
begin
@ -6537,7 +6537,7 @@ implementation
assigned(def) and
(((def.typ=objectdef) and
(tobjectdef(def).objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcclass,odt_objcprotocol,odt_helper,odt_javaclass,odt_interfacejava])) or
((target_info.system=system_jvm_java32) and
((target_info.system in systems_jvm) and
(def.typ=recorddef)));
end;

View File

@ -148,7 +148,8 @@
system_i386_nativent, { 68 }
system_i386_iphonesim, { 69 }
system_powerpc_wii, { 70 }
system_jvm_java32 { 71 }
system_jvm_java32, { 71 }
system_jvm_android32 { 72 }
);
type

View File

@ -303,26 +303,36 @@ interface
{ all systems that use garbage collection for reference-counted types }
systems_garbage_collected_managed_types = [
system_jvm_java32
system_jvm_java32,
system_jvm_android32
];
{ all systems that use a managed vm (-> no real pointers, internal VMT
format, ...) }
systems_managed_vm = [
system_jvm_java32
system_jvm_java32,
system_jvm_android32
];
{ all systems based on the JVM }
systems_jvm = [
system_jvm_java32,
system_jvm_android32
];
{ all systems where typed constants have to be translated into node
trees that initialise the data instead of into data sections }
systems_typed_constants_node_init = [
system_jvm_java32
system_jvm_java32,
system_jvm_android32
];
{ all systems that don't use a built-in framepointer for accessing nested
variables, but emulate it by wrapping nested variables in records
whose address is passed around }
systems_fpnestedstruct = [
system_jvm_java32
system_jvm_java32,
system_jvm_android32
];
cpu2str : array[TSystemCpu] of string[10] =

View File

@ -108,6 +108,71 @@ unit i_jvm;
abi : abi_default;
);
system_jvm_android32_info : tsysteminfo =
(
system : system_jvm_android32;
name : 'Android via JVM';
shortname : 'android';
flags : [tf_files_case_sensitive,tf_no_generic_stackcheck,
{ avoid the creation of threadvar tables }
tf_section_threadvars];
cpu : cpu_jvm;
unit_env : '';
extradefines : '';
exeext : '';
defext : '.def';
scriptext : '.sh';
smartext : '.sl';
unitext : '.ppu';
unitlibext : '.ppl';
asmext : '.j';
objext : '.class';
resext : '';
resobjext : '.jar';
sharedlibext : '.jar';
staticlibext : '.jar';
staticlibprefix : '';
sharedlibprefix : '';
sharedClibext : '.jar';
staticClibext : '.jar';
staticClibprefix : '';
sharedClibprefix : '';
importlibprefix : '';
importlibext : '.jar';
Cprefix : '';
newline : #10;
dirsep : '/';
assem : as_jvm_jasmin;
assemextern : as_jvm_jasmin;
link : nil;
linkextern : nil;
ar : ar_none;
res : res_jvm_raw;
dbg : dbg_jasmin;
script : script_unix;
endian : endian_big;
alignment :
(
procalign : 4;
loopalign : 4;
jumpalign : 0;
constalignmin : 0;
constalignmax : 4;
varalignmin : 4;
varalignmax : 4;
localalignmin : 4;
localalignmax : 4;
recordalignmin : 0;
recordalignmax : 2;
maxCrecordalign : 4
);
first_parm_offset : 0;
stacksize : 262144;
abi : abi_default;
);
implementation
end.

View File

@ -99,5 +99,11 @@ initialization
RegisterExport(system_jvm_java32,texportlibjvm);
RegisterTarget(system_jvm_java32_info);
RegisterExternalLinker(system_jvm_android32_info, tlinkerjvm);
RegisterImport(system_jvm_android32,timportlibjvm);
RegisterExport(system_jvm_android32,texportlibjvm);
RegisterTarget(system_jvm_android32_info);
RegisterRes(res_jvmraw_info,TJVMRawResourceFile);
end.

View File

@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/12/04]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/12/12]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux jvm-java
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux jvm-java jvm-android
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx haiku
LIMIT83fs = go32v2 os2 emx watcom
@ -486,6 +486,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins
endif
ifeq ($(FULL_TARGET),jvm-android)
override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins
endif
ifeq ($(FULL_TARGET),i386-linux)
override CLEAN_UNITS+=ppu crc usubst
endif
@ -678,6 +681,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override CLEAN_UNITS+=ppu crc usubst
endif
ifeq ($(FULL_TARGET),jvm-android)
override CLEAN_UNITS+=ppu crc usubst
endif
override INSTALL_FPCPACKAGE=y
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_UNITDIR+=..
@ -871,6 +877,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override COMPILER_UNITDIR+=..
endif
ifeq ($(FULL_TARGET),jvm-android)
override COMPILER_UNITDIR+=..
endif
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_SOURCEDIR+=..
endif
@ -1063,6 +1072,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override COMPILER_SOURCEDIR+=..
endif
ifeq ($(FULL_TARGET),jvm-android)
override COMPILER_SOURCEDIR+=..
endif
override SHARED_BUILD=n
override SHARED_BUILD=n
ifdef REQUIRE_UNITSDIR
@ -1422,6 +1434,12 @@ ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=java
endif
ifeq ($(OS_TARGET),android)
OEXT=.class
ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=android
endif
else
ifeq ($(OS_TARGET),go32v1)
PPUEXT=.pp1
@ -2039,6 +2057,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
REQUIRE_PACKAGES_RTL=1
endif
ifeq ($(FULL_TARGET),jvm-android)
REQUIRE_PACKAGES_RTL=1
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_RTL),)

View File

@ -148,7 +148,8 @@ const
{ 68 } 'NativeNT-i386',
{ 69 } 'iPhoneSim-i386',
{ 70 } 'Wii-powerpc',
{ 71 } 'Java-JVM'
{ 71 } 'Java-JVM',
{ 72 } 'Android-JVM'
);
const

View File

@ -69,7 +69,8 @@ Type
linux,go32v2,win32,os2,freebsd,beos,netbsd,
amiga,atari, solaris, qnx, netware, openbsd,wdosx,
palmos,macos,darwin,emx,watcom,morphos,netwlibc,
win64,wince,gba,nds,embedded,symbian,haiku,iphonesim,java
win64,wince,gba,nds,embedded,symbian,haiku,iphonesim,
java,android
);
TOSes = Set of TOS;
@ -155,7 +156,8 @@ Const
{ symbian } ( false, true, false, false, false, false, true, false, false, false, false),
{ haiku } ( false, true, false, false, false, false, false, false, false, false, false),
{ iphonesim}( false, true, false, false, false, false, false, false, false, false, false),
{ java } ( false, false, false, false, false, false, false, false, false, false, true )
{ java } ( false, false, false, false, false, false, false, false, false, false, true ),
{ android } ( false, false, false, false, false, false, false, false, false, false, true )
);

View File

@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/12/04]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/12/12]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux jvm-java
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux jvm-java jvm-android
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx haiku
LIMIT83fs = go32v2 os2 emx watcom
@ -470,6 +470,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
override TARGET_DIRS+=java
endif
ifeq ($(FULL_TARGET),jvm-android)
override TARGET_DIRS+=android/jvm
endif
override INSTALL_FPCPACKAGE=y
override INSTALL_CREATEPACKAGEFPC=y
ifdef REQUIRE_UNITSDIR
@ -829,6 +832,12 @@ ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=java
endif
ifeq ($(OS_TARGET),android)
OEXT=.class
ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=android
endif
else
ifeq ($(OS_TARGET),go32v1)
PPUEXT=.pp1
@ -1920,6 +1929,9 @@ endif
ifeq ($(FULL_TARGET),jvm-java)
TARGET_DIRS_JAVA=1
endif
ifeq ($(FULL_TARGET),jvm-android)
TARGET_DIRS_ANDROID/JVM=1
endif
ifdef TARGET_DIRS_LINUX
linux_all:
$(MAKE) -C linux all
@ -3090,6 +3102,51 @@ java:
$(MAKE) -C java all
.PHONY: java_all java_debug java_smart java_release java_units java_examples java_shared java_install java_sourceinstall java_exampleinstall java_distinstall java_zipinstall java_zipsourceinstall java_zipexampleinstall java_zipdistinstall java_clean java_distclean java_cleanall java_info java_makefiles java
endif
ifdef TARGET_DIRS_ANDROID/JVM
android/jvm_all:
$(MAKE) -C android/jvm all
android/jvm_debug:
$(MAKE) -C android/jvm debug
android/jvm_smart:
$(MAKE) -C android/jvm smart
android/jvm_release:
$(MAKE) -C android/jvm release
android/jvm_units:
$(MAKE) -C android/jvm units
android/jvm_examples:
$(MAKE) -C android/jvm examples
android/jvm_shared:
$(MAKE) -C android/jvm shared
android/jvm_install:
$(MAKE) -C android/jvm install
android/jvm_sourceinstall:
$(MAKE) -C android/jvm sourceinstall
android/jvm_exampleinstall:
$(MAKE) -C android/jvm exampleinstall
android/jvm_distinstall:
$(MAKE) -C android/jvm distinstall
android/jvm_zipinstall:
$(MAKE) -C android/jvm zipinstall
android/jvm_zipsourceinstall:
$(MAKE) -C android/jvm zipsourceinstall
android/jvm_zipexampleinstall:
$(MAKE) -C android/jvm zipexampleinstall
android/jvm_zipdistinstall:
$(MAKE) -C android/jvm zipdistinstall
android/jvm_clean:
$(MAKE) -C android/jvm clean
android/jvm_distclean:
$(MAKE) -C android/jvm distclean
android/jvm_cleanall:
$(MAKE) -C android/jvm cleanall
android/jvm_info:
$(MAKE) -C android/jvm info
android/jvm_makefiles:
$(MAKE) -C android/jvm makefiles
android/jvm:
$(MAKE) -C android/jvm all
.PHONY: android/jvm_all android/jvm_debug android/jvm_smart android/jvm_release android/jvm_units android/jvm_examples android/jvm_shared android/jvm_install android/jvm_sourceinstall android/jvm_exampleinstall android/jvm_distinstall android/jvm_zipinstall android/jvm_zipsourceinstall android/jvm_zipexampleinstall android/jvm_zipdistinstall android/jvm_clean android/jvm_distclean android/jvm_cleanall android/jvm_info android/jvm_makefiles android/jvm
endif
all: $(addsuffix _all,$(TARGET_DIRS))
debug: $(addsuffix _debug,$(TARGET_DIRS))
smart: $(addsuffix _smart,$(TARGET_DIRS))

View File

@ -35,6 +35,7 @@ dirs_embedded=embedded
dirs_nativent=nativent
dirs_wii=wii
dirs_java=java
dirs_jvm_android=android/jvm
[install]
fpcpackage=y

2246
rtl/android/jvm/Makefile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,160 @@
#
# Makefile.fpc for Free Pascal Android/JVM (Dalvik) RTL
#
[package]
main=rtl
[target]
loaders=
units=$(SYSTEMUNIT) uuchar objpas androidr14
[require]
nortl=y
[install]
fpcpackage=y
[default]
fpcdir=../../..
target=android
[compiler]
includedir=$(INC) $(PROCINC)
includedir_jvm=../../java
sourcedir=$(INC) $(PROCINC) $(COMMON) $(ARCH)
sourcedir_jvm=../../java
[prerules]
RTL=../..
INC=$(RTL)/inc
COMMON=$(RTL)/common
PROCINC=$(RTL)/$(CPU_TARGET)
UNITPREFIX=rtl
SYSTEMUNIT=system
override FPCOPT+=@rtl.cfg
ifdef RELEASE
override FPCOPT+=-Ur
endif
CPU_UNITS=
SYSINIT_UNITS=
[rules]
.NOTPARALLEL:
# Get the system independent include file names.
# This will set the following variables :
# SYSINCNAMES
include $(INC)/makefile.inc
SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
# Get the processor dependent include file names.
# This will set the following variables :
# CPUINCNAMES
include $(PROCINC)/makefile.cpu
SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
# Put system unit dependencies together.
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
#
# Base Units (System, strings, os-dependent-base-unit)
#
$(SYSTEMUNIT)$(PPUEXT) : $(RTL)/java/$(SYSTEMUNIT).pp $(SYSDEPS)
$(COMPILER) -Us -Sg $(RTL)/java/$(SYSTEMUNIT).pp $(REDIR)
uuchar$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) $(INC)/uuchar.pp
objpas$(PPUEXT): $(RTL)/java/objpas.pp
$(COMPILER) $(RTL)/java/objpas.pp $(REDIR)
strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
$(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
$(SYSTEMUNIT)$(PPUEXT)
androidr14$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) androidr14.pas androidr14.inc
#
# System Dependent Units
#
#ports$(PPUEXT) : ports.pas objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
#doscalls$(PPUEXT) : doscalls.pas strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
#
# TP7 Compatible RTL Units
#
dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
$(SYSTEMUNIT)$(PPUEXT)
#crt$(PPUEXT) : crt.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
objects$(PPUEXT) : $(INC)/objects.pp dos$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
#printer$(PPUEXT) : printer.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
#graph$(PPUEXT) : graph.pp
#
# Delphi Compatible Units
#
sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
objpas$(PPUEXT) dos$(PPUEXT) sysconst$(PPUEXT)
$(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) types$(PPUEXT)
$(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
$(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
$(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
$(OBJPASDIR)/varutilh.inc varutils.pp
$(COMPILER) -I$(OBJPASDIR) varutils.pp $(REDIR)
fmtbcd$(PPUEXT) : $(OBJPASDIR)/fmtbcd.pp objpas$(PPUEXT) sysutils$(PPUEXT) variants$(PPUEXT) classes$(PPUEXT) system$(PPUEXT)
$(COMPILER) $(OBJPASDIR)/fmtbcd.pp
types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $(OBJPASDIR)/types.pp
rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
$(COMPILER) $(OBJPASDIR)/rtlconsts.pp
sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $(OBJPASDIR)/sysconst.pp
dateutil$(PPUEXT) : $(OBJPASDIR)/dateutil.pp
$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutil.pp
#
# Mac Pascal Model
#
macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
$(COMPILER) $(INC)/macpas.pp $(REDIR)
#
# Other system-independent RTL Units
#
ucomplex$(PPUEXT): $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
#lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)

56594
rtl/android/jvm/androidr14.inc Normal file

File diff suppressed because it is too large Load Diff

12062
rtl/android/jvm/androidr14.pas Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,548 @@
{ Imports for Java packages/classes: java.io.IIOException, java.io.IOException, java.io.Serializable, java.lang.AbstractStringBuilder, java.lang.Appendable, java.lang.Boolean, java.lang.Byte, java.lang.CharSequence, java.lang.Character, java.lang.Class, java.lang.Cloneable, java.lang.Comparable, java.lang.Double, java.lang.Enum, java.lang.Error, java.lang.Exception, java.lang.Float, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.IndexOutOfBoundsException, java.lang.Integer, java.lang.Iterable, java.lang.LinkageError, java.lang.Long, java.lang.Math, java.lang.NoSuchMethodException, java.lang.Number, java.lang.Object, java.lang.Readable, java.lang.Runtime, java.lang.RuntimeException, java.lang.Short, java.lang.String, java.lang.StringBuffer, java.lang.StringBuilder, java.lang.System, java.lang.ThreadLocal, java.lang.Throwable, java.lang.UnsupportedOperationException, java.lang.reflect.AccessibleObject, java.lang.reflect.AnnotatedElement, java.lang.reflect.Array, java.lang.reflect.Field, java.lang.reflect.GenericDeclaration, java.lang.reflect.InvocationTargetException, java.lang.reflect.Member, java.lang.reflect.Method, java.lang.reflect.Type, java.math.BigInteger, java.nio.Buffer, java.nio.ByteBuffer, java.nio.CharBuffer, java.nio.charset., java.text.Collator, java.util.AbstractCollection, java.util.AbstractMap, java.util.AbstractSet, java.util.Arrays, java.util.BitSet, java.util.Calendar, java.util.Collection, java.util.Comparator, java.util.EnumSet, java.util.HashMap, java.util.Iterator, java.util.Map, java.util.Set }
type
JLNoSuchMethodException = class;
Arr1JLNoSuchMethodException = array of JLNoSuchMethodException;
Arr2JLNoSuchMethodException = array of Arr1JLNoSuchMethodException;
Arr3JLNoSuchMethodException = array of Arr2JLNoSuchMethodException;
JLObject = class;
Arr1JLObject = array of JLObject;
Arr2JLObject = array of Arr1JLObject;
Arr3JLObject = array of Arr2JLObject;
JLStringBuilder = class;
Arr1JLStringBuilder = array of JLStringBuilder;
Arr2JLStringBuilder = array of Arr1JLStringBuilder;
Arr3JLStringBuilder = array of Arr2JLStringBuilder;
JLAbstractStringBuilder = class;
Arr1JLAbstractStringBuilder = array of JLAbstractStringBuilder;
Arr2JLAbstractStringBuilder = array of Arr1JLAbstractStringBuilder;
Arr3JLAbstractStringBuilder = array of Arr2JLAbstractStringBuilder;
JLRInvocationTargetException = class;
Arr1JLRInvocationTargetException = array of JLRInvocationTargetException;
Arr2JLRInvocationTargetException = array of Arr1JLRInvocationTargetException;
Arr3JLRInvocationTargetException = array of Arr2JLRInvocationTargetException;
JLError = class;
Arr1JLError = array of JLError;
Arr2JLError = array of Arr1JLError;
Arr3JLError = array of Arr2JLError;
JLRField = class;
Arr1JLRField = array of JLRField;
Arr2JLRField = array of Arr1JLRField;
Arr3JLRField = array of Arr2JLRField;
JNBuffer = class;
Arr1JNBuffer = array of JNBuffer;
Arr2JNBuffer = array of Arr1JNBuffer;
Arr3JNBuffer = array of Arr2JNBuffer;
JUArrays = class;
Arr1JUArrays = array of JUArrays;
Arr2JUArrays = array of Arr1JUArrays;
Arr3JUArrays = array of Arr2JUArrays;
JLRuntime = class;
Arr1JLRuntime = array of JLRuntime;
Arr2JLRuntime = array of Arr1JLRuntime;
Arr3JLRuntime = array of Arr2JLRuntime;
JLLong = class;
Arr1JLLong = array of JLLong;
Arr2JLLong = array of Arr1JLLong;
Arr3JLLong = array of Arr2JLLong;
JLMath = class;
Arr1JLMath = array of JLMath;
Arr2JLMath = array of Arr1JLMath;
Arr3JLMath = array of Arr2JLMath;
JNCharBuffer = class;
Arr1JNCharBuffer = array of JNCharBuffer;
Arr2JNCharBuffer = array of Arr1JNCharBuffer;
Arr3JNCharBuffer = array of Arr2JNCharBuffer;
JLLinkageError = class;
Arr1JLLinkageError = array of JLLinkageError;
Arr2JLLinkageError = array of Arr1JLLinkageError;
Arr3JLLinkageError = array of Arr2JLLinkageError;
JNCCharsetEncoder = class;
Arr1JNCCharsetEncoder = array of JNCCharsetEncoder;
Arr2JNCCharsetEncoder = array of Arr1JNCCharsetEncoder;
Arr3JNCCharsetEncoder = array of Arr2JNCCharsetEncoder;
JUAbstractCollection = class;
Arr1JUAbstractCollection = array of JUAbstractCollection;
Arr2JUAbstractCollection = array of Arr1JUAbstractCollection;
Arr3JUAbstractCollection = array of Arr2JUAbstractCollection;
JNCCoderResult = class;
Arr1JNCCoderResult = array of JNCCoderResult;
Arr2JNCCoderResult = array of Arr1JNCCoderResult;
Arr3JNCCoderResult = array of Arr2JNCCoderResult;
JLThreadLocal = class;
Arr1JLThreadLocal = array of JLThreadLocal;
Arr2JLThreadLocal = array of Arr1JLThreadLocal;
Arr3JLThreadLocal = array of Arr2JLThreadLocal;
JUAbstractMap = class;
Arr1JUAbstractMap = array of JUAbstractMap;
Arr2JUAbstractMap = array of Arr1JUAbstractMap;
Arr3JUAbstractMap = array of Arr2JUAbstractMap;
JNCCoderMalfunctionError = class;
Arr1JNCCoderMalfunctionError = array of JNCCoderMalfunctionError;
Arr2JNCCoderMalfunctionError = array of Arr1JNCCoderMalfunctionError;
Arr3JNCCoderMalfunctionError = array of Arr2JNCCoderMalfunctionError;
JUEnumSet = class;
Arr1JUEnumSet = array of JUEnumSet;
Arr2JUEnumSet = array of Arr1JUEnumSet;
Arr3JUEnumSet = array of Arr2JUEnumSet;
JNCCharacterCodingException = class;
Arr1JNCCharacterCodingException = array of JNCCharacterCodingException;
Arr2JNCCharacterCodingException = array of Arr1JNCCharacterCodingException;
Arr3JNCCharacterCodingException = array of Arr2JNCCharacterCodingException;
JLIndexOutOfBoundsException = class;
Arr1JLIndexOutOfBoundsException = array of JLIndexOutOfBoundsException;
Arr2JLIndexOutOfBoundsException = array of Arr1JLIndexOutOfBoundsException;
Arr3JLIndexOutOfBoundsException = array of Arr2JLIndexOutOfBoundsException;
JUHashMap = class;
Arr1JUHashMap = array of JUHashMap;
Arr2JUHashMap = array of Arr1JUHashMap;
Arr3JUHashMap = array of Arr2JUHashMap;
JUCalendar = class;
Arr1JUCalendar = array of JUCalendar;
Arr2JUCalendar = array of Arr1JUCalendar;
Arr3JUCalendar = array of Arr2JUCalendar;
JLDouble = class;
Arr1JLDouble = array of JLDouble;
Arr2JLDouble = array of Arr1JLDouble;
Arr3JLDouble = array of Arr2JLDouble;
JUBitSet = class;
Arr1JUBitSet = array of JUBitSet;
Arr2JUBitSet = array of Arr1JUBitSet;
Arr3JUBitSet = array of Arr2JUBitSet;
JLString = class;
Arr1JLString = array of JLString;
Arr2JLString = array of Arr1JLString;
Arr3JLString = array of Arr2JLString;
JUAbstractSet = class;
Arr1JUAbstractSet = array of JUAbstractSet;
Arr2JUAbstractSet = array of Arr1JUAbstractSet;
Arr3JUAbstractSet = array of Arr2JUAbstractSet;
JLFloat = class;
Arr1JLFloat = array of JLFloat;
Arr2JLFloat = array of Arr1JLFloat;
Arr3JLFloat = array of Arr2JLFloat;
JLRuntimeException = class;
Arr1JLRuntimeException = array of JLRuntimeException;
Arr2JLRuntimeException = array of Arr1JLRuntimeException;
Arr3JLRuntimeException = array of Arr2JLRuntimeException;
JLIllegalStateException = class;
Arr1JLIllegalStateException = array of JLIllegalStateException;
Arr2JLIllegalStateException = array of Arr1JLIllegalStateException;
Arr3JLIllegalStateException = array of Arr2JLIllegalStateException;
JLRAccessibleObject = class;
Arr1JLRAccessibleObject = array of JLRAccessibleObject;
Arr2JLRAccessibleObject = array of Arr1JLRAccessibleObject;
Arr3JLRAccessibleObject = array of Arr2JLRAccessibleObject;
JLStringBuffer = class;
Arr1JLStringBuffer = array of JLStringBuffer;
Arr2JLStringBuffer = array of Arr1JLStringBuffer;
Arr3JLStringBuffer = array of Arr2JLStringBuffer;
JNByteBuffer = class;
Arr1JNByteBuffer = array of JNByteBuffer;
Arr2JNByteBuffer = array of Arr1JNByteBuffer;
Arr3JNByteBuffer = array of Arr2JNByteBuffer;
JLEnum = class;
Arr1JLEnum = array of JLEnum;
Arr2JLEnum = array of Arr1JLEnum;
Arr3JLEnum = array of Arr2JLEnum;
JNCSCharsetProvider = class;
Arr1JNCSCharsetProvider = array of JNCSCharsetProvider;
Arr2JNCSCharsetProvider = array of Arr1JNCSCharsetProvider;
Arr3JNCSCharsetProvider = array of Arr2JNCSCharsetProvider;
JLNumber = class;
Arr1JLNumber = array of JLNumber;
Arr2JLNumber = array of Arr1JLNumber;
Arr3JLNumber = array of Arr2JLNumber;
JIIOException = class;
Arr1JIIOException = array of JIIOException;
Arr2JIIOException = array of Arr1JIIOException;
Arr3JIIOException = array of Arr2JIIOException;
JLRMethod = class;
Arr1JLRMethod = array of JLRMethod;
Arr2JLRMethod = array of Arr1JLRMethod;
Arr3JLRMethod = array of Arr2JLRMethod;
JLCharacter = class;
Arr1JLCharacter = array of JLCharacter;
Arr2JLCharacter = array of Arr1JLCharacter;
Arr3JLCharacter = array of Arr2JLCharacter;
JNCCodingErrorAction = class;
Arr1JNCCodingErrorAction = array of JNCCodingErrorAction;
Arr2JNCCodingErrorAction = array of Arr1JNCCodingErrorAction;
Arr3JNCCodingErrorAction = array of Arr2JNCCodingErrorAction;
JMBigInteger = class;
Arr1JMBigInteger = array of JMBigInteger;
Arr2JMBigInteger = array of Arr1JMBigInteger;
Arr3JMBigInteger = array of Arr2JMBigInteger;
JNCCharsetDecoder = class;
Arr1JNCCharsetDecoder = array of JNCCharsetDecoder;
Arr2JNCCharsetDecoder = array of Arr1JNCCharsetDecoder;
Arr3JNCCharsetDecoder = array of Arr2JNCCharsetDecoder;
JLBoolean = class;
Arr1JLBoolean = array of JLBoolean;
Arr2JLBoolean = array of Arr1JLBoolean;
Arr3JLBoolean = array of Arr2JLBoolean;
JNCCharset = class;
Arr1JNCCharset = array of JNCCharset;
Arr2JNCCharset = array of Arr1JNCCharset;
Arr3JNCCharset = array of Arr2JNCCharset;
JLShort = class;
Arr1JLShort = array of JLShort;
Arr2JLShort = array of Arr1JLShort;
Arr3JLShort = array of Arr2JLShort;
JLThrowable = class;
Arr1JLThrowable = array of JLThrowable;
Arr2JLThrowable = array of Arr1JLThrowable;
Arr3JLThrowable = array of Arr2JLThrowable;
JLInteger = class;
Arr1JLInteger = array of JLInteger;
Arr2JLInteger = array of Arr1JLInteger;
Arr3JLInteger = array of Arr2JLInteger;
JNCUnmappableCharacterException = class;
Arr1JNCUnmappableCharacterException = array of JNCUnmappableCharacterException;
Arr2JNCUnmappableCharacterException = array of Arr1JNCUnmappableCharacterException;
Arr3JNCUnmappableCharacterException = array of Arr2JNCUnmappableCharacterException;
JNCMalformedInputException = class;
Arr1JNCMalformedInputException = array of JNCMalformedInputException;
Arr2JNCMalformedInputException = array of Arr1JNCMalformedInputException;
Arr3JNCMalformedInputException = array of Arr2JNCMalformedInputException;
JNCIllegalCharsetNameException = class;
Arr1JNCIllegalCharsetNameException = array of JNCIllegalCharsetNameException;
Arr2JNCIllegalCharsetNameException = array of Arr1JNCIllegalCharsetNameException;
Arr3JNCIllegalCharsetNameException = array of Arr2JNCIllegalCharsetNameException;
JLByte = class;
Arr1JLByte = array of JLByte;
Arr2JLByte = array of Arr1JLByte;
Arr3JLByte = array of Arr2JLByte;
JNCUnsupportedCharsetException = class;
Arr1JNCUnsupportedCharsetException = array of JNCUnsupportedCharsetException;
Arr2JNCUnsupportedCharsetException = array of Arr1JNCUnsupportedCharsetException;
Arr3JNCUnsupportedCharsetException = array of Arr2JNCUnsupportedCharsetException;
JLRArray = class;
Arr1JLRArray = array of JLRArray;
Arr2JLRArray = array of Arr1JLRArray;
Arr3JLRArray = array of Arr2JLRArray;
JLUnsupportedOperationException = class;
Arr1JLUnsupportedOperationException = array of JLUnsupportedOperationException;
Arr2JLUnsupportedOperationException = array of Arr1JLUnsupportedOperationException;
Arr3JLUnsupportedOperationException = array of Arr2JLUnsupportedOperationException;
JLException = class;
Arr1JLException = array of JLException;
Arr2JLException = array of Arr1JLException;
Arr3JLException = array of Arr2JLException;
JTCollator = class;
Arr1JTCollator = array of JTCollator;
Arr2JTCollator = array of Arr1JTCollator;
Arr3JTCollator = array of Arr2JTCollator;
JLClass = class;
Arr1JLClass = array of JLClass;
Arr2JLClass = array of Arr1JLClass;
Arr3JLClass = array of Arr2JLClass;
JLIllegalArgumentException = class;
Arr1JLIllegalArgumentException = array of JLIllegalArgumentException;
Arr2JLIllegalArgumentException = array of Arr1JLIllegalArgumentException;
Arr3JLIllegalArgumentException = array of Arr2JLIllegalArgumentException;
JLSystem = class;
Arr1JLSystem = array of JLSystem;
Arr2JLSystem = array of Arr1JLSystem;
Arr3JLSystem = array of Arr2JLSystem;
JLIterable = interface;
Arr1JLIterable = array of JLIterable;
Arr2JLIterable = array of Arr1JLIterable;
Arr3JLIterable = array of Arr2JLIterable;
JUIterator = interface;
Arr1JUIterator = array of JUIterator;
Arr2JUIterator = array of Arr1JUIterator;
Arr3JUIterator = array of Arr2JUIterator;
JLCloneable = interface;
Arr1JLCloneable = array of JLCloneable;
Arr2JLCloneable = array of Arr1JLCloneable;
Arr3JLCloneable = array of Arr2JLCloneable;
JLAppendable = interface;
Arr1JLAppendable = array of JLAppendable;
Arr2JLAppendable = array of Arr1JLAppendable;
Arr3JLAppendable = array of Arr2JLAppendable;
JUCollection = interface;
Arr1JUCollection = array of JUCollection;
Arr2JUCollection = array of Arr1JUCollection;
Arr3JUCollection = array of Arr2JUCollection;
JUMap = interface;
Arr1JUMap = array of JUMap;
Arr2JUMap = array of Arr1JUMap;
Arr3JUMap = array of Arr2JUMap;
JUSet = interface;
Arr1JUSet = array of JUSet;
Arr2JUSet = array of Arr1JUSet;
Arr3JUSet = array of Arr2JUSet;
JLRType = interface;
Arr1JLRType = array of JLRType;
Arr2JLRType = array of Arr1JLRType;
Arr3JLRType = array of Arr2JLRType;
JLComparable = interface;
Arr1JLComparable = array of JLComparable;
Arr2JLComparable = array of Arr1JLComparable;
Arr3JLComparable = array of Arr2JLComparable;
JLRMember = interface;
Arr1JLRMember = array of JLRMember;
Arr2JLRMember = array of Arr1JLRMember;
Arr3JLRMember = array of Arr2JLRMember;
JLCharSequence = interface;
Arr1JLCharSequence = array of JLCharSequence;
Arr2JLCharSequence = array of Arr1JLCharSequence;
Arr3JLCharSequence = array of Arr2JLCharSequence;
JLRGenericDeclaration = interface;
Arr1JLRGenericDeclaration = array of JLRGenericDeclaration;
Arr2JLRGenericDeclaration = array of Arr1JLRGenericDeclaration;
Arr3JLRGenericDeclaration = array of Arr2JLRGenericDeclaration;
JLRAnnotatedElement = interface;
Arr1JLRAnnotatedElement = array of JLRAnnotatedElement;
Arr2JLRAnnotatedElement = array of Arr1JLRAnnotatedElement;
Arr3JLRAnnotatedElement = array of Arr2JLRAnnotatedElement;
JUComparator = interface;
Arr1JUComparator = array of JUComparator;
Arr2JUComparator = array of Arr1JUComparator;
Arr3JUComparator = array of Arr2JUComparator;
JISerializable = interface;
Arr1JISerializable = array of JISerializable;
Arr2JISerializable = array of Arr1JISerializable;
Arr3JISerializable = array of Arr2JISerializable;
JLReadable = interface;
Arr1JLReadable = array of JLReadable;
Arr2JLReadable = array of Arr1JLReadable;
Arr3JLReadable = array of Arr2JLReadable;
JLThread = class external 'java.lang' name 'Thread';
Arr1JLThread = array of JLThread;
Arr2JLThread = array of Arr1JLThread;
Arr3JLThread = array of Arr2JLThread;
JUDate = class external 'java.util' name 'Date';
Arr1JUDate = array of JUDate;
Arr2JUDate = array of Arr1JUDate;
Arr3JUDate = array of Arr2JUDate;
JLClassLoader = class external 'java.lang' name 'ClassLoader';
Arr1JLClassLoader = array of JLClassLoader;
Arr2JLClassLoader = array of Arr1JLClassLoader;
Arr3JLClassLoader = array of Arr2JLClassLoader;
JNIntBuffer = class external 'java.nio' name 'IntBuffer';
Arr1JNIntBuffer = array of JNIntBuffer;
Arr2JNIntBuffer = array of Arr1JNIntBuffer;
Arr3JNIntBuffer = array of Arr2JNIntBuffer;
JNByteOrder = class external 'java.nio' name 'ByteOrder';
Arr1JNByteOrder = array of JNByteOrder;
Arr2JNByteOrder = array of Arr1JNByteOrder;
Arr3JNByteOrder = array of Arr2JNByteOrder;
JIInputStream = class external 'java.io' name 'InputStream';
Arr1JIInputStream = array of JIInputStream;
Arr2JIInputStream = array of Arr1JIInputStream;
Arr3JIInputStream = array of Arr2JIInputStream;
JNLongBuffer = class external 'java.nio' name 'LongBuffer';
Arr1JNLongBuffer = array of JNLongBuffer;
Arr2JNLongBuffer = array of Arr1JNLongBuffer;
Arr3JNLongBuffer = array of Arr2JNLongBuffer;
JLSecurityManager = class external 'java.lang' name 'SecurityManager';
Arr1JLSecurityManager = array of JLSecurityManager;
Arr2JLSecurityManager = array of Arr1JLSecurityManager;
Arr3JLSecurityManager = array of Arr2JLSecurityManager;
JIPrintWriter = class external 'java.io' name 'PrintWriter';
Arr1JIPrintWriter = array of JIPrintWriter;
Arr2JIPrintWriter = array of Arr1JIPrintWriter;
Arr3JIPrintWriter = array of Arr2JIPrintWriter;
JNDoubleBuffer = class external 'java.nio' name 'DoubleBuffer';
Arr1JNDoubleBuffer = array of JNDoubleBuffer;
Arr2JNDoubleBuffer = array of Arr1JNDoubleBuffer;
Arr3JNDoubleBuffer = array of Arr2JNDoubleBuffer;
JLPackage = class external 'java.lang' name 'Package';
Arr1JLPackage = array of JLPackage;
Arr2JLPackage = array of Arr1JLPackage;
Arr3JLPackage = array of Arr2JLPackage;
JURandom = class external 'java.util' name 'Random';
Arr1JURandom = array of JURandom;
Arr2JURandom = array of Arr1JURandom;
Arr3JURandom = array of Arr2JURandom;
JIOutputStream = class external 'java.io' name 'OutputStream';
Arr1JIOutputStream = array of JIOutputStream;
Arr2JIOutputStream = array of Arr1JIOutputStream;
Arr3JIOutputStream = array of Arr2JIOutputStream;
JLStackTraceElement = class external 'java.lang' name 'StackTraceElement';
Arr1JLStackTraceElement = array of JLStackTraceElement;
Arr2JLStackTraceElement = array of Arr1JLStackTraceElement;
Arr3JLStackTraceElement = array of Arr2JLStackTraceElement;
JIFile = class external 'java.io' name 'File';
Arr1JIFile = array of JIFile;
Arr2JIFile = array of Arr1JIFile;
Arr3JIFile = array of Arr2JIFile;
JUProperties = class external 'java.util' name 'Properties';
Arr1JUProperties = array of JUProperties;
Arr2JUProperties = array of Arr1JUProperties;
Arr3JUProperties = array of Arr2JUProperties;
JNFloatBuffer = class external 'java.nio' name 'FloatBuffer';
Arr1JNFloatBuffer = array of JNFloatBuffer;
Arr2JNFloatBuffer = array of Arr1JNFloatBuffer;
Arr3JNFloatBuffer = array of Arr2JNFloatBuffer;
JNShortBuffer = class external 'java.nio' name 'ShortBuffer';
Arr1JNShortBuffer = array of JNShortBuffer;
Arr2JNShortBuffer = array of Arr1JNShortBuffer;
Arr3JNShortBuffer = array of Arr2JNShortBuffer;
JSProtectionDomain = class external 'java.security' name 'ProtectionDomain';
Arr1JSProtectionDomain = array of JSProtectionDomain;
Arr2JSProtectionDomain = array of Arr1JSProtectionDomain;
Arr3JSProtectionDomain = array of Arr2JSProtectionDomain;
JIPrintStream = class external 'java.io' name 'PrintStream';
Arr1JIPrintStream = array of JIPrintStream;
Arr2JIPrintStream = array of Arr1JIPrintStream;
Arr3JIPrintStream = array of Arr2JIPrintStream;
JTCollationKey = class external 'java.text' name 'CollationKey';
Arr1JTCollationKey = array of JTCollationKey;
Arr2JTCollationKey = array of Arr1JTCollationKey;
Arr3JTCollationKey = array of Arr2JTCollationKey;
JLRConstructor = class external 'java.lang.reflect' name 'Constructor';
Arr1JLRConstructor = array of JLRConstructor;
Arr2JLRConstructor = array of Arr1JLRConstructor;
Arr3JLRConstructor = array of Arr2JLRConstructor;
JNURL = class external 'java.net' name 'URL';
Arr1JNURL = array of JNURL;
Arr2JNURL = array of Arr1JNURL;
Arr3JNURL = array of Arr2JNURL;
JIConsole = class external 'java.io' name 'Console';
Arr1JIConsole = array of JIConsole;
Arr2JIConsole = array of Arr1JIConsole;
Arr3JIConsole = array of Arr2JIConsole;
JLProcess = class external 'java.lang' name 'Process';
Arr1JLProcess = array of JLProcess;
Arr2JLProcess = array of Arr1JLProcess;
Arr3JLProcess = array of Arr2JLProcess;
JULocale = class external 'java.util' name 'Locale';
Arr1JULocale = array of JULocale;
Arr2JULocale = array of Arr1JULocale;
Arr3JULocale = array of Arr2JULocale;
JUTimeZone = class external 'java.util' name 'TimeZone';
Arr1JUTimeZone = array of JUTimeZone;
Arr2JUTimeZone = array of Arr1JUTimeZone;
Arr3JUTimeZone = array of Arr2JUTimeZone;
JUList = interface external 'java.util' name 'List';
Arr1JUList = array of JUList;
Arr2JUList = array of Arr1JUList;
Arr3JUList = array of Arr2JUList;
JLAAnnotation = interface external 'java.lang.annotation' name 'Annotation';
Arr1JLAAnnotation = array of JLAAnnotation;
Arr2JLAAnnotation = array of Arr1JLAAnnotation;
Arr3JLAAnnotation = array of Arr2JLAAnnotation;
JNCChannel = interface external 'java.nio.channels' name 'Channel';
Arr1JNCChannel = array of JNCChannel;
Arr2JNCChannel = array of Arr1JNCChannel;
Arr3JNCChannel = array of Arr2JNCChannel;
JLRTypeVariable = interface external 'java.lang.reflect' name 'TypeVariable';
Arr1JLRTypeVariable = array of JLRTypeVariable;
Arr2JLRTypeVariable = array of Arr1JLRTypeVariable;
Arr3JLRTypeVariable = array of Arr2JLRTypeVariable;
JUSortedMap = interface external 'java.util' name 'SortedMap';
Arr1JUSortedMap = array of JUSortedMap;
Arr2JUSortedMap = array of Arr1JUSortedMap;
Arr3JUSortedMap = array of Arr2JUSortedMap;

35
rtl/android/jvm/rtl.cfg Normal file
View File

@ -0,0 +1,35 @@
# first, disable all
# -Sf-
# uncomment to enable the stuff you want to use
# include full heap management into the rtl
# -SfHEAP
# include support for init final code of units into the rtl
# -SfINITFINAL
# -SfCLASSES
# -SfEXCEPTIONS
# -SfEXITCODE
# -SfANSISTRINGS
# -SfWIDESTRINGS
# -SfTEXTIO
# -SfCONSOLEIO
# -SfFILEIO
# -SfRANDOM
# -SfVARIANTS
# -SfOBJECTS
# -SfDYNARRAYS
# -SfTHREADING
# -SfCOMMANDARGS
# -SfPROCESSES
# -SfSTACKCHECK
# -SfDYNLIBS
# include exit code support
-SfEXITCODE
# arm is powerful enough to handle a softfpu
#ifdef CPUARM
-SfSOFTFPU
#endif CPUARM

View File

@ -72,8 +72,21 @@ const
{ Java base class type }
{$ifdef java}
{$define GOTJAVASYSINCLUDE}
{$i java_sysh.inc}
{$i java_sys.inc}
{$endif}
{$ifdef android}
{$define GOTJAVASYSINCLUDE}
{$i java_sysh_android.inc}
{$i java_sys_android.inc}
{$endif}
{$ifndef GOTJAVASYSINCLUDE}
{$error Missing include file with base Java classes}
{$endif}
FpcEnumValueObtainable = interface
function fpcOrdinal: jint;

File diff suppressed because it is too large Load Diff

View File

@ -1038,6 +1038,15 @@ SHAREDLIBEXT=.jar
SHORTSUFFIX=java
endif
# Android
ifeq ($(OS_TARGET),android)
OEXT=.class
ASMEXT=.j
SHAREDLIBEXT=.jar
SHORTSUFFIX=android
endif
else
# long version for 1.0.x - target specific extensions

View File

@ -71,7 +71,7 @@ interface
o_amiga,o_atari, o_solaris, o_qnx, o_netware, o_openbsd,o_wdosx,
o_palmos,o_macos,o_darwin,o_emx,o_watcom,o_morphos,o_netwlibc,
o_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian,o_nativent,o_iphonesim,
o_wii,o_jvm
o_wii,o_java,o_android
);
TTargetSet=array[tcpu,tos] of boolean;
@ -94,7 +94,7 @@ interface
'amiga','atari','solaris', 'qnx', 'netware','openbsd','wdosx',
'palmos','macos','darwin','emx','watcom','morphos','netwlibc',
'win64','wince','gba','nds','embedded','symbian','nativent',
'iphonesim', 'wii', 'java'
'iphonesim', 'wii', 'java', 'android'
);
OSSuffix : array[TOS] of string=(
@ -102,7 +102,7 @@ interface
'_amiga','_atari','_solaris', '_qnx', '_netware','_openbsd','_wdosx',
'_palmos','_macos','_darwin','_emx','_watcom','_morphos','_netwlibc',
'_win64','_wince','_gba','_nds','_embedded','_symbian','_nativent',
'_iphonesim','_wii','_java'
'_iphonesim','_wii','_java','_android'
);
{ This table is kept OS,Cpu because it is easier to maintain (PFV) }
@ -139,7 +139,8 @@ interface
{ nativent }( true, false, false, false, false, false, false, false, false, false, false, false, false, false, false),
{ iphonesim }( true, false, false, false, false, false, false, false, false, false, false, false, false, false, false),
{ wii } ( false, false, true, false, false, false, false, false, false, false, false, false, false, false, false),
{ jvm } ( false, false, false, false, false, false, false, false, false, false, false, false, false, false, true)
{ java } ( false, false, false, false, false, false, false, false, false, false, false, false, false, false, true),
{ android } ( false, false, false, false, false, false, false, false, false, false, false, false, false, false, true)
);
type