mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-01 16:53:42 +02:00

(= 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 -
110 lines
3.1 KiB
ObjectPascal
110 lines
3.1 KiB
ObjectPascal
{
|
|
Copyright (c) 2010 by Jonas Maebe
|
|
|
|
This unit implements support import,export,link routines
|
|
for the JVM target
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
****************************************************************************
|
|
}
|
|
unit t_jvm;
|
|
|
|
{$i fpcdefs.inc}
|
|
|
|
interface
|
|
|
|
|
|
implementation
|
|
|
|
uses
|
|
sysutils,
|
|
cutils,cfileutl,cclasses,
|
|
verbose,systems,globtype,globals,
|
|
symconst,script,
|
|
fmodule,aasmbase,aasmtai,aasmdata,aasmcpu,cpubase,symsym,symdef,
|
|
import,export,link,comprsrc,rescmn,i_jvm,
|
|
cgutils,cgbase,cgobj,cpuinfo,ogbase;
|
|
|
|
type
|
|
timportlibjvm=class(timportlib)
|
|
procedure generatelib;override;
|
|
end;
|
|
|
|
texportlibjvm=class(texportlib)
|
|
end;
|
|
|
|
tlinkerjvm=class(texternallinker)
|
|
constructor Create;override;
|
|
function MakeExecutable:boolean;override;
|
|
function MakeSharedLibrary:boolean;override;
|
|
end;
|
|
|
|
|
|
|
|
{*****************************************************************************
|
|
TIMPORTLIBJVM
|
|
*****************************************************************************}
|
|
|
|
procedure timportlibjvm.generatelib;
|
|
begin
|
|
end;
|
|
|
|
|
|
{*****************************************************************************
|
|
TEXPORTLIBJVM
|
|
*****************************************************************************}
|
|
|
|
{*****************************************************************************
|
|
TLINKERJVM
|
|
*****************************************************************************}
|
|
|
|
Constructor tlinkerjvm.Create;
|
|
begin
|
|
Inherited Create;
|
|
end;
|
|
|
|
|
|
function tlinkerjvm.MakeExecutable:boolean;
|
|
begin
|
|
result:=true;
|
|
end;
|
|
|
|
|
|
Function tlinkerjvm.MakeSharedLibrary:boolean;
|
|
begin
|
|
result:=false;
|
|
end;
|
|
|
|
|
|
{*****************************************************************************
|
|
Initialize
|
|
*****************************************************************************}
|
|
|
|
initialization
|
|
RegisterExternalLinker(system_jvm_java32_info, tlinkerjvm);
|
|
RegisterImport(system_jvm_java32,timportlibjvm);
|
|
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.
|