On 1/18/07, Florian Klaempfl <[EMAIL PROTECTED]> wrote:
You can either send partial patches if they don't affect the rest of the
compiler or you can get a separate branch to work on it.

Ok, I prepared a very basic patch. It shouldn´t affect the rest of the
compiler in any way.

Where should free pascal patches be sent? I am posting here in case
the patch needs to be discussed.

There is a diff and 2 new files to be added to fpc/compiler/systems

It would be great if someone can recompile fpcmake and regenerate all
makefiles =)

I didn´t add the rtl I am creating, because it will likely be modifyed
a lot the next weeks.

thanks,
--
Felipe Monteiro de Carvalho
Index: compiler/compiler.pas
===================================================================
--- compiler/compiler.pas	(revision 6039)
+++ compiler/compiler.pas	(working copy)
@@ -107,6 +107,9 @@
 {$ifdef win32}
   ,i_win
 {$endif win32}
+{$ifdef symbian}
+  ,i_symbian
+{$endif symbian}
   ;
 
 function Compile(const cmd:string):longint;
Index: compiler/i386/cputarg.pas
===================================================================
--- compiler/i386/cputarg.pas	(revision 6039)
+++ compiler/i386/cputarg.pas	(working copy)
@@ -71,6 +71,9 @@
     {$ifndef NOTARGETWATCOM}
       ,t_watcom
     {$endif}
+    {$ifndef NOTARGETSYMBIAN}
+      ,t_symbian
+    {$endif}
 
 {**************************************
              Assemblers
Index: compiler/systems.pas
===================================================================
--- compiler/systems.pas	(revision 6039)
+++ compiler/systems.pas	(working copy)
@@ -136,7 +136,9 @@
              system_x86_64_embedded,    { 55 }
              system_mips_embedded,      { 56 }
              system_arm_embedded,       { 57 }
-             system_powerpc64_embedded  { 58 }
+             system_powerpc64_embedded, { 58 }
+             system_i386_symbian,       { 59 }
+             system_arm_symbian         { 60 }
        );
 
        tasm = (as_none
Index: rtl/Makefile.fpc
===================================================================
--- rtl/Makefile.fpc	(revision 6038)
+++ rtl/Makefile.fpc	(working copy)
@@ -28,6 +28,7 @@
 dirs_solaris=solaris
 dirs_gba=gba
 dirs_nds=nds
+dirs_symbian=symbian
 
 [install]
 fpcpackage=y
Index: utils/fpcm/fpcmake.ini
===================================================================
--- utils/fpcm/fpcmake.ini	(revision 6038)
+++ utils/fpcm/fpcmake.ini	(working copy)
@@ -908,6 +908,12 @@
 SHORTSUFFIX=gba
 endif
 
+# Symbian OS
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+
 else
 # long version for 1.0.x - target specific extensions
 
Index: utils/fpcm/fpcmmain.pp
===================================================================
--- utils/fpcm/fpcmmain.pp	(revision 6038)
+++ utils/fpcm/fpcmmain.pp	(working copy)
@@ -70,7 +70,7 @@
         o_linux,o_go32v2,o_win32,o_os2,o_freebsd,o_beos,o_netbsd,
         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_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian
       );
 
       TTargetSet=array[tcpu,tos] of boolean;
@@ -88,14 +88,14 @@
         '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'
+        'win64','wince','gba','nds','embedded','symbian'
       );
 
       OSSuffix : array[TOS] of string=(
         '_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'
+        '_win64','_wince','_gba','_nds','_embedded','_symbian'
       );
 
       { This table is kept OS,Cpu because it is easier to maintain (PFV) }
@@ -126,7 +126,8 @@
         { wince    }( true,  false, false, false, false, true,  false),
         { gba    }  ( false, false, false, false, false, true,  false),
         { nds    }  ( false, false, false, false, false, true,  false),
-        { embedded }( true,  true,  true,  true,  true,  true,  true)
+        { embedded }( true,  true,  true,  true,  true,  true,  true),
+        { symbian } ( true,  false, false, false, false, true,  false)
       );
 
     type
{
    Copyright (c) 1998-2002 by Peter Vreman

    This unit implements support information structures for win32

    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.
 ****************************************************************************
}
{ This unit implements support information structures for win32. }
unit i_symbian;

  interface

    uses
       systems;

    const
       system_i386_symbian_info : tsysteminfo =
          (
            system       : system_i386_SYMBIAN;
            name         : 'Symbian OS for i386';
            shortname    : 'Symbian';
            flags        : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses
                            ,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},tf_winlikewidestring];
            cpu          : cpu_i386;
            unit_env     : 'SYMBIANUNITS';
            extradefines : 'UNIX;SYMBIAN';
            exeext       : '.exe';
            defext       : '.def';
            scriptext    : '.bat';
            smartext     : '.sl';
            unitext      : '.ppu';
            unitlibext   : '.ppl';
            asmext       : '.s';
            objext       : '.o';
            resext       : '.res';
            resobjext    : '.or';
            sharedlibext : '.dll';
            staticlibext : '.a';
            staticlibprefix : 'libp';
            sharedlibprefix : '';
            sharedClibext : '.dll';
            staticClibext : '.a';
            staticClibprefix : 'lib';
            sharedClibprefix : '';
            Cprefix      : '_';
            newline      : #13#10;
            dirsep       : '\';
            assem        : as_i386_pecoff;
            assemextern  : as_gas;
            link         : nil;
            linkextern   : nil;
            ar           : ar_gnu_ar;
            res          : res_gnu_windres;
            dbg          : dbg_stabs;
            script       : script_dos;
            endian       : endian_little;
            alignment    :
              (
                procalign       : 16;
                loopalign       : 4;
                jumpalign       : 0;
                constalignmin   : 0;
                constalignmax   : 16;
                varalignmin     : 0;
                varalignmax     : 16;
                localalignmin   : 4;
                localalignmax   : 8;
                recordalignmin  : 0;
                recordalignmax  : 4;
                maxCrecordalign : 16
              );
            first_parm_offset : 8;
            stacksize    : 262144;
            abi          : abi_default;
          );


implementation

initialization

{$ifdef CPU86}
  set_source_info(system_i386_symbian_info);
{$endif CPU86}

{$ifdef CPUARM}
  set_source_info(system_arm_symbian_info);
{$endif CPUARM}
end.
{
    Copyright (c) 1998-2002 by Peter Vreman

    This unit implements support import,export,link routines
    for the (i386) Win32 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_symbian;

{$i fpcdefs.inc}

interface

    uses
       cutils,cclasses,
       aasmbase,aasmtai,aasmdata,aasmcpu,fmodule,globtype,globals,systems,verbose,
       symconst,symdef,symsym,
       script,gendef,
       cpubase,
       import,export,link,cgobj,t_win, i_symbian;

implementation

  uses
    SysUtils,
    cfileutils,
    cpuinfo,cgutils,dbgbase,
    owar,ogbase,ogcoff;

{*****************************************************************************
                                     Initialize
*****************************************************************************}

initialization
{$ifdef i386}
  RegisterExternalLinker(system_i386_symbian_info,TExternalLinkerWin);
  RegisterInternalLinker(system_i386_symbian_info,TInternalLinkerWin);
  RegisterImport(system_i386_symbian,TImportLibWin);
  RegisterExport(system_i386_symbian,TExportLibWin);
  RegisterDLLScanner(system_i386_symbian,TDLLScannerWin);
//  RegisterRes(res_gnu_windres_info);
  RegisterTarget(system_i386_symbian_info);
{$endif i386}
end.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to