Recent

Author Topic: Modify fpc source  (Read 4740 times)

DRIGUS

  • Jr. Member
  • **
  • Posts: 59
Modify fpc source
« on: April 11, 2014, 02:45:42 pm »
Hi *.*,

  we can't get our existing Windows CE 6.x application working on a new version of our hardware (switching to an ARM7 Cortex A5 hybrid CPU). We suspect it could be a problem with the AYGSHELL.dll and therefor start modifing the original aygshell.pp in ...\packages\winceunits\src\.
  But now we are unable to compile the project anymore, the compiler can't find a unit. This must be because of the old AYGSHELL.ppu file. But we have no clue how to solve this problem.

  What is the recommended way to modify original fpc sources?


Greetings
DRIGUS GmbH

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Modify fpc source
« Reply #1 on: April 11, 2014, 03:48:17 pm »
A good compromise between safe and easy is to copy the modified sources to a new dir, and remove the directory of the package in the precompiled units (  units/arm-wince/winceunits dir in the FPC directory). Then include the directory with the modified sources in the unit path of the project.

Never add directories of FPC sources to the compiler search path.

DRIGUS

  • Jr. Member
  • **
  • Posts: 59
Re: Modify fpc source
« Reply #2 on: January 21, 2015, 04:36:13 pm »
I need some advice in order to get it work. What I have done so far (fresh install of Lazarus 1.2.6):

Renamed

fpc\2.6.4\units\arm-wince\winceunits

to

fpc\2.6.4\units\arm-wince\winceunits.BACKUP

Copied

fpc\2.6.4\source\packages\winceunits\src

to the project directory and added the path to unit path (-Fu). If I now try to build the project I get the error "Recompiling LCLIntf, checksum changed for shellapi".


Greetings
« Last Edit: January 21, 2015, 04:37:46 pm by DRIGUS »
DRIGUS GmbH

Laksen

  • Hero Member
  • *****
  • Posts: 724
    • J-Software
Re: Modify fpc source
« Reply #3 on: January 21, 2015, 04:40:17 pm »
Delete the folder winceunits.BACKUP or move it out of the units directory altogether. It looks in all subdirectories of arm-wince

DRIGUS

  • Jr. Member
  • **
  • Posts: 59
Re: Modify fpc source
« Reply #4 on: January 22, 2015, 01:20:31 pm »
Argh, of course it was a bad idea to only rename the directory when the compiler checks the paths recursive. But deleting the directory didn't solve the problem:


Free Pascal Compiler version 2.6.4 [2014/10/11] for arm
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: WinCE for ARM
Compiling alllclunits.pp
Compiling barchart.pp
Compiling lclintf.pas
lclintf.pas(46,28) Fatal: Can not find ShellApi used by LCLIntf, ppu=..\fpc\2.6.4\units\arm-wince\winceunits\shellapi.ppu


  I now copied the source files to \fpc\2.6.4\units\arm-wince\winceunits to get it work. This isn't really a big problem, because I use a separte Lazaraus installation just for testing.


Greetings
DRIGUS GmbH

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Modify fpc source
« Reply #5 on: January 22, 2015, 02:30:16 pm »
You might be trying to compile it with wrong FPC binaries version? I would guess that you need 2.6.0, but try 2.4.x if not working (assuming the fpc.cfg is set correctly). I do know that you need 2.6.0 for compiling 2.7.x source.

Laksen

  • Hero Member
  • *****
  • Posts: 724
    • J-Software
Re: Modify fpc source
« Reply #6 on: January 22, 2015, 03:12:55 pm »
Just build 3.1.1 from SVN trunk instead with your modifications. It's very easy :)

What are your modifications anyway?

DRIGUS

  • Jr. Member
  • **
  • Posts: 59
Re: Modify fpc source
« Reply #7 on: January 22, 2015, 04:20:50 pm »
We test a new baseboard for our device (Windows CE 6 / Windows Compact 7). While a simple fpc program - just displaying a MessageBox - runs without any problen on the new hardware, a simple Lazarus program with only one empty form raises an access violation at start even before Application.Initialize.

The problem is that we can't use GDB, wince-stub doesn't work on the hardware (always "connection lost" at start).

So the idea was to put some MessageBox calls in the original fpc/LCL  sources in order to get some more information.


Greetings


DRIGUS GmbH

DRIGUS

  • Jr. Member
  • **
  • Posts: 59
Re: Modify fpc source
« Reply #8 on: January 26, 2015, 09:24:56 am »
Seems that we managed to isolate the problem: The access violations happen by including the unit SysUtils, to be precise by calling GetFormatSettings through the initialization part of the unit.

I will ask a question on the FPC mailing list.


Greetings
DRIGUS GmbH

 

TinyPortal © 2005-2018