fpcupdeluxe/ru

From Free Pascal wiki
Jump to navigationJump to search

Deutsch (de) English (en) español (es) русский (ru)

Обзор

fpupdeluxe on Windows

Процесс установки FPC и Lazarus

Основная цель fpcdeluxe - предоставить средства для установки и обновления нескольких версий FPC и Lazarus автономным способом. Это означает, что установка с помощью fpcupdeluxe не окажет влияния на вашу систему (не помешает ей): следовательно, вы можете установить несколько версий FPC и Lazarus.

Чтобы процесс установки заработал, вы ДОЛЖНЫ использовать сгенерированную ссылку, чтобы начать установку!

Эта ссылка для запуска содержит строку типа:

Exec=/P/s/lazarus/lazarus --pcp="/P/s/config_lazarus"

, указывающая Lazarus на использование pcp, то есть primary configuration(первичной конфигурации), задающей путь "/P/s/config_lazarus" или аналогичного подкаталога в /home/ в зависимости от вашего выбора, сделанного из графического интерфейса. В пути поиска не требуется указывать путь к fpc или еще к чему-либо.

Продвинутые настройки

Fpcupdeluxe advanced settings screen.

На приведенном выше снимке экрана (нажмите Setup+ на главном экране) показаны расширенные настройки fpcupdeluxe.

Некоторые примеры продвинутых настроек: --> для отладки самой FPC добавьте "-g -gl -O-" в поле "FPC options".

Crosscompiling

Fpcupdeluxe makes cross-compiling easy: just select a CPU and an OS, and press install crosscompiler. If libraries and/or binary tools are needed, fpcupdeluxe will try to get them online. Use the link to see what is available at the moment !

Crosscompiling from Windows and Linux towards Darwin: the hard way

With the help of fpcupdeluxe, NewPascal or FPC trunk, and a toolset called osxcross/cctools-port, you can crosscompile towards Darwin. This help will concentrate on manually setting up crossing from Windows/Linux towards Darwin (fpcupdeluxe can also do all the auto-magic for you for crossing towards Darwin; see above).

First, you will need to get osxcross/cctools-port, and compile it yourself.

For macOS, you will need the osxcross for FPC that has been adapted for use by FPC.

For iOS/iPhone, you will need the cctools-port for FPC that has been adapted for use by FPC.

Get yourself a SDK, either from your own Mac, or from online sources: Various Mac SDK's

SDKs for iPhone can also be obtained from online sources: Various iPhone SDK's

Build osxcross/cctools-port according to the instructions. For example, on Windows with Cygwin.

Light bulb  Примечание: Please note: to be able to cross from Windows towards Darwin, you need to have NewPascal or FPC trunk installed !

Use fpcupdeluxe to install NewPascal or FPC trunk.

Before building the cross-compiler, you need to inform fpcupdeluxe where to find the Darwin libs (SDK) and the binary tools (build by osxcross/cctools-port). The two screenshot below show how to proceed:

  • Choose a CPU-type and an OS (Darwin). Select custom. You should now be able to use the buttons and point fpcupdeluxe to the right locations.

Point fpcupdeluxe towards the library location
Point fpcupdeluxe towards the binary tools location
  • Now, on the mainscreen, you can select your CPU and OS (Darwin) and build the cross-compiler !

  • Again, fpcupdeluxe also has pre-built tools for crossing towards Darwin: using the fpcupdeluxe-auto-magic will be the easiest !!!

Caveats, Observations, Troubleshooting

  • It was observed, that f. often times works on first run on an empty install dir, but subsequents runs, i.e. in order to add controls to the pallette, add the .chm help system asf., often times fail. In case of failure to recompile / make the IDE, the Lazarus binary may be gone, so unless you made a file backup earlier, you cannot start Lazarus anymore.
  • copy and save the logfile for reference / troubleshoot.
  • adding the help system is easy: just tag it under "advanced settings", saving some manual labour.
  • it takes about 10 minutes to make a full new install of fpc + Laz.
  • try out new --pcp settings to get a feeling for it, you can always delete the config and start anew (save the pristine fresh content of the --pcp dir right after install).

Launching an installed Lazarus and fpc instance

For launching the Lazarus GUI, a script is created (in the users home directory) and a launcher (on the desktop) which opens Lazarus with the correct config path & environment. Example, on Linux if installing to a folder named "/home/user/trunk", fpcupdeluxe creates:

 /home/user/Desktop/Lazarus_trunk.desktop (launcher)
 /home/user/Lazarus_trunk  (shell script)

For Linux FPC/lazbuild command line work the following shell script can be used (assumes a bash shell and using example install dir of "/home/user/trunk"):

  #!/bin/sh
  # fpcupdeluxe: FPC home startlink script
  export PATH="/home/user/trunk/fpc/bin/x86_64-linux:/home/user/trunk/lazarus:${PATH}"
  export PPC_CONFIG_PATH="/home/user/trunk/fpc/bin/x86_64-linux"
  exec /bin/bash

Windows equivalent batch file for setting up environment for working from command line (using example install dir of "f:\trunk"):

  REM fpcupdeluxe: FPC home startlink script
  SET PATH=F:\trunk\fpc\bin\x86_64-win64;F:\trunk\lazarus;%PATH%
  SET PPC_CONFIG_PATH=F:\trunk\fpc\bin\x86_64-win64
  cmd.exe
Light bulb  Примечание: Setting the paths this way is not global and only effects the current terminal shell and child shells.

External links