Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-01

Second version of FPC for iPhone SDK 2.x available

8 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe

Hello,

As promised last week, I've released a small update to the FPC for iPhone SDK 2.x. The changes since the previous release are:
* Mention that you need a certificate from Apple to run self-written applications on an iPhone/iPod Touch
* Installation script mentions its location whenever it aborts
* Link to wiki page with more information
* Xcode template now ignores FPC configuration files
* Xcode template handles Xcode reassembling previously compiled files (e.g., in case the current SDK is switched)

So apart from a couple of tweaks to the Xcode template, most changes are only to the documentation and the text printed by the installation script. The included FPC version is identical to the one of the previous version.

The download link is:
ftp://ftp.freepascal.org/fpc/snapshot/v23/arm-macosx/fpc-2.3.1v2.arm-iphone.dmg

Also see the wiki page (thanks, Dmitry) for more information, especially if you did not use FPC for iPhone SDK before: http://wiki.freepascal.org/iPhone/iPod_development

Enjoy,

Jonas

PS: there is no "upgrade" package available because this distribution is handled like the other snapshots for simplicity reasons (and I also don't think there are that many people who already downloaded the first release)

Reply by email

dmitry boyarintsev
to Jonas Maebe

hello Jonas,

thanks for advancing with fpc for iPhone development.

i have a question: i'm using fpc trunk, so copmiled i386 units are not located at /usr/local/lib/fpc/2.3.1/units/i386-darwin. Is there any way to reconfigure the building script, so compiled units are taken from the proper directory?

i guess, it's the reason, i'm getting compilation error:

Compiling to /Users/igorkokarev/iPhoneFPC2/iphonetest2/build/iphonetest2.build/Debug-iphonesimulator/iphonetest2.build/DerivedSources-normal/i386 Free Pascal Compiler version 2.3.1 [2008/10/27] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Darwin for i386
Compiling /Users/igorkokarev/iPhoneFPC2/iphonetest2/PascalLibrary.pas PPU Loading /usr/local/lib/fpc/2.3.1/units/i386-darwin//rtl/system.ppu PPU Invalid Version 95
error: Can't find unit system used by PascalLibrary error: Compilation aborted

sorry, I'm not much of XCode!

Thanks,
Dmitry

Reply by email

Jonas Maebe
to dmitry boyarintsev
dmitry boyarintsev wrote
i have a question: i'm using fpc trunk, so copmiled i386 units are not located at /usr/local/lib/fpc/2.3.1/units/i386-darwin. Is there any way to reconfigure the building script, so compiled units are taken from the proper directory?

The easiest is to do a

sudo make install FPC=`pwd`/compiler/i386`

from the FPC directory after you've compiled a new FPC 2.3.1 version. You can always re-execute the /Developer/FreePascalCompiler/ iPhoneSnapshot-2.3.1-r12531/InstallScript/
finish_fpc_iphone_install.command script should you wish to reinstall the original compiler/units from the SDK.

The only side-effect of doing a "make install" is that the /usr/local/ bin/fpc binary will then default to FPC 2.3.1 instead of to your currently installed "stable" release (/usr/local/bin/ppc386 will not be changed though). If you want to prevent that, you can do this before the "make install":

cp /usr/local/bin/fpc .

and this after:

sudo mv fpc /usr/local/bin

Show quoted text 13 lines
i guess, it's the reason, i'm getting compilation error: Compiling to /Users/igorkokarev/iPhoneFPC2/iphonetest2/build/ iphonetest2.build/Debug-iphonesimulator/iphonetest2.build/ DerivedSources-normal/i386 Free Pascal Compiler version 2.3.1 [2008/10/27] for i386 Copyright (c) 1993-2008 by Florian Klaempfl Target OS: Darwin for i386 Compiling /Users/igorkokarev/iPhoneFPC2/iphonetest2/PascalLibrary.pas PPU Loading /usr/local/lib/fpc/2.3.1/units/i386-darwin//rtl/system.ppu PPU Invalid Version 95 error: Can't find unit system used by PascalLibrary error: Compilation aborted

Yes.

sorry, I'm not much of XCode!

It's not Xcode-specific, but shell scripting. My scripts are not easily adaptable to a non-installed FPC, because then the layout of the unit directories is completely different (and I have to archive all object files belonging to the units in a static library for linking purposes, so it's not enough that the compiler can find the units).

Jonas

Reply by email

dmitry boyarintsev
to dmitry boyarintsev

hello Jonas,

what do you think about using another fpc.cfg file (i.e. fpcxcode.cfg) for iPhone compilation, rather than passing compiler configuration through the command line?
i guess that the ideally, there would be no additional .cfg files, and compiler should use common configuration.
But for now, an additional .cfg file would make compiler configuration easier!

Also, i'm not experienced in compiling fp-cross-compilers, but is it possile to build ppcarm (for darwin) from svn trunk?

Thanks,
Dmitry

Reply by email

Jonas Maebe
to dmitry boyarintsev
dmitry boyarintsev wrote 7 lines
hat do you think about using another fpc.cfg file (i.e. fpcxcode.cfg) for iPhone compilation, rather than passing compiler configuration through the command line? i guess that the ideally, there would be no additional .cfg files, and compiler should use common configuration. But for now, an additional .cfg file would make compiler configuration easier!

No, because it's not enough that the compile can find its units. Xcode can transparently link together C, C++, Objective-C and Pascal code, but for this it needs to know all the necessary libraries and object files. For this reason, the template generates a static library containing the object files of all units shipped with FPC and tells Xcode to link this library (it will only link the object files of the actually used units).

It would be hard to get everything smoothly running if custom fpc.cfg files were supported for a variety of reasons (no guaranteed order in which script phases are executed in Xcode, no guaranteed common directory to use by different targets). What would however be possible, is to allow easily changing the location of the used *installed* copy of FPC (so you don't have to install under /usr/ local, but anywhere you want). This requires some changes to the template though.

Also, i'm not experienced in compiling fp-cross-compilers, but is it possile to build ppcarm (for darwin) from svn trunk?

1) copy /Developer/FreePascalCompiler/iPhoneSnapshot-2.3.1-r12531/ Source/rtl/darwin/arm/sig_cpu.inc to the rtl/darwin/arm directory of your svn checkout (that file was generated when you installed the FPC iPhone SDK integration kit)
2) in the top level fpc directory of your checkout, execute the following (in the first line, replace "/iphone2.1" with the name of the actual directory where you installed the iPhone SDK):

export IPHONEPLATFORMBASEDIR=/iphone2.1/Platforms/iPhoneOS.platform/ Developer
make FPC=your_ppc386_2.3.1 CPU_TARGET=arm CROSSOPT="-FD$ {IPHONEPLATFORMBASEDIR}/usr/bin -XR${IPHONEPLATFORMBASEDIR}/SDKs/ iPhoneOS2.0.sdk/ -ap" all

Jonas

Reply by email

Jonas Maebe
to Jonas Maebe
Jonas Maebe wrote 18 lines
On 21 Mar 2009, at 10:38, dmitry boyarintsev wrote: > Also, i'm not experienced in compiling fp-cross-compilers, but is it > possile to build ppcarm (for darwin) from svn trunk? 1) copy /Developer/FreePascalCompiler/iPhoneSnapshot-2.3.1-r12531/ Source/rtl/darwin/arm/sig_cpu.inc to the rtl/darwin/arm directory of your svn checkout (that file was generated when you installed the FPC iPhone SDK integration kit) 2) in the top level fpc directory of your checkout, execute the following (in the first line, replace "/iphone2.1" with the name of the actual directory where you installed the iPhone SDK): export IPHONEPLATFORMBASEDIR=/iphone2.1/Platforms/iPhoneOS.platform/ Developer make FPC=your_ppc386_2.3.1 CPU_TARGET=arm CROSSOPT="-FD$ {IPHONEPLATFORMBASEDIR}/usr/bin -XR${IPHONEPLATFORMBASEDIR}/SDKs/ iPhoneOS2.0.sdk/ -ap" all

And to install it afterwards:

make FPC=`pwd`/compiler/ppcrossarm OPT="-ap" CPU_TARGET=arm CROSSOPT="- FD${IPHONEPLATFORMBASEDIR}/usr/bin -XR${IPHONEPLATFORMBASEDIR}/SDKs/ iPhoneOS2.0.sdk/ -ap" install CROSSINSTALL=1

(possibly with an INSTALL_PREFIX=xyz at the end to install it under "xyz" rather than under /usr/local)

Jonas

Reply by email