Sign in Join
Wiki copytemporary

Installing Lazarus/ru: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Installing Lazarus/ru

OldNewLine
1+## Обзор
2+
3+Ознакомится с более подробной инструкцией по сборке можно [здесь](http://www.stack.nl/~marcov/buildfaq.pdf).
4+
5+Для загрузки исполняемых файлов Lazarus смотрите [Загрузка и установка релизной версии Lazarus](http://wiki.lazarus.freepascal.org/Getting_Lazarus/ru#Загрузка_и_установка_релизной_версии_Lazarus)
6+
7+Для тех, кто просто хочет установить Lazarus и начать использовать его для написания программ, наиболее простым способом является загрузка и установка последней стабильной версии исполняемых файлов (таких, как rpm-пакеты для Linux, установочные exe-файлы для Windows или dmg-пакеты для Mac OS X). Вы можете прочитать об этом в разделах "Исполняемые файлы FPC" для Linux и Windows или в первых параграфах в разделах установки Lazarus в средах Linux или Windows; оставшуюся часть информации можно спокойно пропустить.
8+
9+Для тех, кто хочет принимать участие в разработке компилятора, IDE или использовать актуальные инструменты, необходима установка из исходных файлов.
10+
11+Lazarus состоит из двух основных частей:
12+
13+- LCL - Lazarus Component Library, библиотека компонентов Lazarus
14+- IDE - RAD, среда быстрой разработки
15+
16+В свою очередь они зависят от:
17+
18+- FPC - компилятор Free Pascal
19+- FCL - Free Pascal Component library, библиотека компонентов компилятора FPC, содержащая большое количество невизуальных компонентов, используемых в Lazarus
20+
21+### Системные требования Lazarus
22+
23+1. компилятор Free Pascal, пакеты и исходные файлы. (*важно*: той же версии/даты сборки)
24+2. поддерживаемый набор виджетов
25+ :;Win32: может быть использован внутренний набор Win32 API или набор виджетов Qt.
26+
27+ :;Linux/xxxBSD: GTK+ 2.x or Qt : Most Linux distributions and *BSDs already install the GTK+ 2.x libraries. You can also find them at <http://www.gtk.org>.\
28+ Qt is also supported with all distributions (auto installed if you prefer KDE).\
29+ :;Mac OS X: You need the Apple developer tools. See Installing under Mac OS X below. Qt can be used too.
30+
31+FAQ - Frequently Asked Questions (часто задаваемые вопросы) доступны по ссылке <http://www.lazarus.freepascal.org> . Некоторые вопросы можно найти в файле 'FAQ'.
32+
33+Qt widget set is supported on Linux 32/64,Win32/64,Mac OS X, Haiku and embedded linux (qtopia) platforms.\
34+Более подробно узнать про установку можно по ссылке <http://wiki.lazarus.freepascal.org/index.php/Qt_Interface>\
35+В следующих разделах описывается как можно получить компилятор Free Pascal и как правильно установить Lazarus.
36+
37+## Краткое руководство
38+
39+Хотя остальная часть этой страницы содержит много ценной информации, многим пользователям может понадобиться не более, чем следующие «краткие руководства» - возможно?
40+
41+#### Linux
42+
43+- См. [[Installing Lazarus on Linux]]
44+
45+#### macOS
46+
47+- См. [[Installing Lazarus on MacOS X/ru|Установка Lazarus на MacOS X]]
48+
49+#### Windows
50+
51+Безусловно, самый простой и распространенный способ установки Lazarus на Windows - это перейти на [сайт загрузки Lazarus](https://sourceforge.net/projects/lazarus/files/) SourceForge, выбрать подходящий комбинированный пакет FPC/Lazarus, скачать и установить.
52+
53+## Установка компилятора Free Pascal
54+
55+Существует подробная инструкция, как устанавливать и собирать компилятор Free Pascal, доступная по ссылке <http://www.stack.nl/~marcov/buildfaq.pdf> - для некоторых пользователей она может быть слишком подробной, но при этом в ней дана исчерпывающая информация.
56+
57+Для Lazarus 1.8 требуется fpc (Free Pascal) версии 3.0.4 или выше, а также необходимо, чтобы библиотеки fpc (исполняемые файлы) и исходные файлы fpc были одинаковых версий.
58+
59+### Установка Free Pascal в Linux
60+
61+#### Исполняемые файлы FPC
62+
63+Последнюю стабильную версию Free Pascal 3.0.4 можно получить на сайте Free Pascal (перейдите по ссылке <http://www.freepascal.org/download.var> и далее выберите зеркало) или на сайте SourceForge (http://sourceforge.net/projects/lazarus).
64+
65+В разделе загрузок Lazarus (http://www.lazarus.freepascal.org ) можно получить RPM- или DEB-пакеты компилятора Free Pascal (компилятор для Linux). Если вам не нужны RPM или debian дистрибутивы, вы можете загрузить и установить tar-архивы с <http://www.freepascal.org>. Если вы хотите самостоятельно скомпилировать исполняемые файлы, смотрите в разделе BSD.
66+
67+Инструкции:
68+
69+> **Warning:** если вы **не используете RPM- или debian-пакеты** (даже если вы планируете использовать другие) лучшим вариантом будет получение актуальной стабильной версии fpc (на данный момент 3.0.4) и установка Lazarus из исходных файлов.
70+
71+\
72+Запустите Linux и войдите в систему под **root**'ом.
73+
74+Загрузите актуальные версии файлов с <https://sourceforge.net/projects/lazarus/files/>. Например:
75+
76+:* fpc-3.0.4-1.i686.rpm
77+
78+:* fpc-src-3.0.4-1.i686.rpm
79+
80+:* lazarus-2.0.6-1.i686.rpm и установите их с помощью команды:
81+
82+:* rpm -Uvh *.rpm
83+
84+Пользователям системы Debian рекомендуется использовать deb-пакеты, но можно использовать и другие (внимание: они не создают fpc.cfg), например установить tar-архивы.
85+
86+#### Исходные файлы FPC
87+
88+Исходные файлы FPC хранятся в репозитории Subversion (SVN), в котором отслеживаются все изменения. Если у вас уже есть исходные файлы, пожалуйста, посмотрите инструкции по их установке в разделе #Installing Free Pascal from source under Linux/BSD.
89+
90+##### Загрузка ежедневных исходных файлов из ветки разработки
91+
92+Вы можете загрузить ежедневно обновляемые исходные файлы в форме упакованных ночных сборок из репозитория SVN: они обновляются ежедневно и отображают состояние исходных файлов. Они не протестированы, могут не работать или даже привести к нарушению работы вашей системы. Файлы сохранены на сайте, который содержит архив SVN. Версия FPC может варьироваться. Расположены по адресу: [1](http://www.hu.freepascal.org/lazarus/)
93+
94+##### Обновление исходных файлов с помощью SVN
95+
96+В качестве альтернативы ежедневным zip-файлам исходников SVN, репозиторий SVN сделан доступным для всех с доступом только для чтения. Это означает, что вы можете получить прямой доступ к коду, и у вас будут действительно доступные исходники на последний момент. Это также метод, который требует меньшей полосы пропускания после первой загрузки (извлечение в SVN lingo).
97+
98+##### Получение исходных файлов
99+
100+Как это можно сделать? Для начала вам необходим установленный клиент для SVN. Используйте менеджер установки и установите утилиту, например, TortoiseSVN для Windows или смотрите подробней на сайте [2](http://subversion.tigris.org/).
101+
102+Использование командной строки SVN: измените текущую директорию (cd) на родительскую директорию, которая используется для работы, например, чтобы получить полные исходные файлы из репозитория в поддиректорию fpc домашней директории и напишите
103+
104+``` bash
105+cd ~
106+svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc
107+```
108+
109+Для обновления исходных файлов, загруженных с помощью команды, указанной выше
110+
111+``` bash
112+cd ~
113+svn update fpc
114+```
115+
116+##### Получение отдельных веток
117+
118+Если текущая версия транка находится в состоянии быстрого изменения и не подходит для большого использования, если вы не хотите работать с самим компилятором, вы можете остаться на версии, которая обновлена с исправлениями. Чтобы сделать это, вы должны найти стабильную ветку, которую вы хотите отслеживать, вместо девелоперской **trunk** версии по умолчанию. Пример ниже показывает, как вы можете отслеживать версию fixes_2_6; конечно замените \[номер версии\] по мере необходимости в зависимости от того, какие ветки вы хотите отслеживать.
119+
120+Этот пример хранит исправления в другой папке в вашем домашнем каталоге - не имеет смысла помещать две версии исходного кода в один каталог ...
121+
122+``` bash
123+cd ~
124+svn checkout http://svn.freepascal.org/svn/fpc/branches/fixes_2_6 fpc_fixes_2_6
125+```
126+
127+Обычное обновление:
128+
129+``` bash
130+cd ~
131+svn update fpc_fixes_2_6
132+```
133+
134+##### Документация
135+
136+Исходные файлы документации расположены в отдельном репозитории с именем fpcdocs, поэтому для их получения необходима следующая команда
137+
138+``` bash
139+cd ~
140+svn checkout http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs
141+```
142+
143+Если вы хотите больше узнать о subversion, прочитайте эту отличную [книгу по Subversion](http://svnbook.red-bean.com/), которая также бесплатно доступна в разных форматах.
144+
145+Более подробную информацию смотрите на [сайте Free Pascal](http://www.freepascal.org/develop.var).
146+
147+### Установка Free Pascal в Windows
148+
149+#### Исполняемые файлы FPC для Windows
150+
151+Самым простым способом получения установочных файлов Free Pascal является загрузка текущей стабильной версии исполняемых файлов Lazarus для Windows из репозитория SourceForge [3](http://sourceforge.net/projects/lazarus/files/) - эти файлы содержат текущие стабильные версии компилятора и необходимых библиотек Free Pascal, а также среду разработки Lazarus.
152+
153+Если вы хотите установить из исходных файлов читайте дальше!
154+
155+Вы можете загрузить zip-архив с fpc в разделе загрузок Free Pascal (перейдите по ссылке <http://www.freepascal.org/download.var> и далее выберите зеркало). Установка из исходных файлов -- смотрите следующий раздел, чтобы узнать как это сделать -- не для новичков, так как для этого вам необходим изначально установленный компилятор.
156+
157+#### Исходные файлы FPC для Windows
158+
159+\<\<\<\< Смотрите выше в разделе Исходные файлы FPC для Linux, где описано использование SVN \>\>\>\>
160+
161+Наиболее простым способом получить исходные файлы Free Pascal является использование SVN; смотрите следующий раздел для более подробной информации. Также вы можете загрузить установочный пакет целиком -- смотрите на сайте <http://www.freepascal.org/develop.var> ежедневные сборки ветки 3.0.x.
162+
163+Исходные файлы FPC для Windows с помощью SVN
164+
165+Вам необходим установленный SVN-клиент, например [TortoiseSVN](http://tortoisesvn.tigris.org/), для выполнения дальнейших шагов. Точные команды отличаются для разных SVN-клиентов; приведенные ниже команды должны использоваться для SVN-клиента, который можно скачать здесь.
166+
167+Для начала создайте директорию, в которую вы хотите поместить исходные файлы. С этим может справиться любой пользователь. Создайте директорию для fpc (например C:\Source), после чего чего выполните следующую команду в командной строке:
168+
169+``` bash
170+C:\Source> svn co http://svn.freepascal.org/svn/fpc/trunk fpc
171+```
172+
173+Совет: для загрузки/обновления файлов с последними изменениями вы просто можете выполнить
174+
175+```dos
176+C:\> cd Source\FPC
177+C:\Source\FPC> svn up
178+```
179+
180+Смотрите: <http://www.freepascal.org/down/i386/win32.var> . Загрузите FPC одним большим файлом, распакуйте его и запустите install.exe.
181+
182+Добавьте путь к директории fpc в переменную среды:
183+
184+- Win98: отредактируйте autoexec.bat и добавьте строку: PATH=%PATH%;C:\pp\bin\bin\win32
185+- WinXP/2k: Мой компьютер (правая кнопка мыши по ярлыку) -\> Свойства -\> Дополнительно (вкладка) -\> Переменные среды -\> Системные переменные -\> Изменить "PATH", добавить здесь "C:\pp\bin\bin\win32".
186+
187+После этого перезагрузите windows.
188+
189+После установки исполняемых файлов FPC вы можете собирать исходные файлы FPC из subversion.
190+
191+Советы:
192+
193+- Для Windows 7 (и выше) требуются повышенные права пользователя для работы в командной строке. Щелкните правой кнопкой мыши по ярлыку "Командная строка" в меню Пуск и выберите "Запустить от имени Администратора".
194+- YOUR-PREFIX полностью зависит от места установки FPC. При составлении данной статьи исполняемые файлы по умолчанию располагаются в директории "C:\FPC" и помещаются в "C:\FPC\3.0.4". В системе Linux сценарии "make install" были скорректированы для создания новой поддиректории ЕСЛИ версия FPC изменилась с момента последней сборки. В сценариях для Windows это не сделано. Поэтому, если вы знаете, что имя поддиректории, например 3.1.1, то вы можете указать это. Однако, по причине частой смены версий, рекомендуется просто выбрать и сохранить один PREFIX вне зависимости от версий FPC. Хорошим значением для prefix является C:\FPC, но вы также должны убедиться, что директория C:\FPC\bin\i386-win32\\ добавлена в переменную среды PATH (смотрите выше, как прописать путь и изменить версию исполняемых файлов на только что скомпилированные).
195+
196+Инструкции:
197+
198+- В командной строке перейдите к расположенным исходным файлам FPC, например напишите "cd c:\Developer\FPC"
199+- Для сборки FPC напишите "make all"
200+- Для перезаписи существующих файлов FPC напишите "make install PREFIX=YOUR-PREFIX"
201+- Для установки исходных файлов напишите "make install sourceinstall PREFIX=YOUR-PREFIX"
202+
203+#### Компиляция/установка FPC и Lazarus из исходных файлов с помощью SVN (Win32)
204+
205+14 Dec 2017 версия FPC **3.0.4** или **trunk** - версия Lazarus **1.9.x**
206+
207+##### Шаг \#1: Создать каталоги и скачать исходные файлы
208+
209+Создайте следующие каталоги:
210+
211+` c:\freepascal\`\
212+` c:\freepascal\binutils\`\
213+` c:\freepascal\binutils\i386-win32\`\
214+` c:\freepascal\fpc\`\
215+` c:\freepascal\fpc\3.0.4\`\
216+` c:\freepascal\laz\`
217+
218+или для fpc из trunk:
219+
220+` c:\freepascal\`\
221+` c:\freepascal\binutils\`\
222+` c:\freepascal\binutils\i386-win32\`\
223+` c:\freepascal\fpc\`\
224+` c:\freepascal\fpc\trunk\`\
225+` c:\freepascal\laz\`
226+
227+Вам понадобится последняя *стабильная* версия компилятора для сборки новой версии компилятора. Скачайте файл ppc386 (сам компилятор) с FTP (по ссылке ниже) и распакуйте его в c:\freepascal\binutils\\
228+
229+` `[`ftp://ftp.freepascal.org/pub/fpc/dist/3.0.4/bootstrap/i386-win32-ppc386.zip`](ftp://ftp.freepascal.org/pub/fpc/dist/3.0.4/bootstrap/i386-win32-ppc386.zip)
230+
231+После установки [TortoiseSVN](http://tortoisesvn.tigris.org/) скачайте исходные файлы из SVN используя URL-адрес для каждого каталога:
232+
233+` Dir: c:\freepascal\binutils\i386-win32\`\
234+` URL: `[`http://svn.freepascal.org/svn/fpcbuild/branches/fixes_3_0/install/binw32`](http://svn.freepascal.org/svn/fpcbuild/branches/fixes_3_0/install/binw32)
235+
236+или для fpc из trunk:
237+
238+` Dir: c:\freepascal\binutils\i386-win32\`\
239+` URL: `[`http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw32`](http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw32)
240+
241+` Dir: c:\freepascal\fpc\3.0.4`\
242+` URL: `[`http://svn.freepascal.org/svn/fpc/branches/fixes_3_0/`](http://svn.freepascal.org/svn/fpc/branches/fixes_3_0/)
243+
244+или для fpc из trunk:
245+
246+` Dir: c:\freepascal\fpc\trunk`\
247+` URL: `[`http://svn.freepascal.org/svn/fpc/trunk/`](http://svn.freepascal.org/svn/fpc/trunk/)
248+
249+` Dir: c:\freepascal\laz`\
250+` URL: `[`http://svn.freepascal.org/svn/lazarus/trunk`](http://svn.freepascal.org/svn/lazarus/trunk)
251+
252+##### Шаг \#2: Создать BAT-файл для компиляции FPC
253+
254+После того, как всё скачалось, нам необходимо создать BAT-файл для компиляции исходных файлов FPC. Создайте новый файл c:\freepascal\makefpc.bat и скопируйте в него следующий сценарий:
255+
256+```dos
257+@echo on
258+set myroot=c:\freepascal
259+set myFPC=%myroot%\fpc\3.0.4
260+set mybinutils=%myroot%\binutils
261+set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
262+cd %myFPC%
263+rd /s /q %myfpc%\examples
264+svn cleanup . --remove-unversioned --remove-ignored
265+make distclean all install INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
266+cd /d %myFPC%\bin\i386-win32
267+fpcmkcfg -d basepath=%myFPC% -o .\fpc.cfg
268+copy fpc.exe %mybinutils%\i386-win32
269+```
270+
271+или для fpc из trunk:
272+
273+```dos
274+@echo on
275+set myroot=c:\freepascal
276+set myFPC=%myroot%\fpc\trunk
277+set mybinutils=%myroot%\binutils
278+set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
279+cd %myFPC%
280+rd /s /q %myfpc%\examples
281+svn cleanup . --remove-unversioned --remove-ignored
282+make distclean all install INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
283+cd /d %myFPC%\bin\i386-win32
284+del fpc.cfg
285+fpcmkcfg -d basepath=%myFPC% -o .\fpc.cfg
286+copy fpc.exe %mybinutils%\i386-win32
287+```
288+
289+Для компиляции кросс-платформенных программ в режиме x86_64 добавьте следующие строки после первой команды make:
290+
291+```dos
292+make all OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
293+make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
294+```
295+
296+При использовании данных сценариев скомпилированные файлы компилятора и необходимые директории для корректной его работы будут созданы непосредственно в корневой директории, куда были загружены исходные файлы. В некоторых случаях это не удобно, например, если необходимо *перенести* всю директорию с компилятором на другой компьютер или просто сделать несколько директорий разных версий (или ревизий) компилятора и при необходимости пользоваться каждой из них путем выбора нужного пути в свойствах проекта. Для этого необходимо модифицировать сценарий. Ниже представлен пример сценария для создания полностью автономной директории с компилятором и необходимыми файлами (для универсальности добавлены инструкции, позволяющие собрать компилятор версий **x86** и **x64**):
297+
298+```dos
299+@echo on
300+set myroot=c:\freepascal
301+
302+set instdir=%myroot%\fpc\3.0.5
303+
304+set myFPC=%myroot%\fpc\3.0.4
305+set mybinutils=%myroot%\binutils
306+set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
307+cd %myFPC%
308+rd /s /q %myfpc%\examples
309+svn cleanup . --remove-unversioned --remove-ignored
310+make distclean all install INSTALL_PREFIX=%instdir% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
311+make all OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%instdir% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
312+make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%instdir% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
313+cd /d %instdir%\bin\i386-win32
314+fpcmkcfg -d basepath=%instdir% -o .\fpc.cfg
315+copy fpc.exe %mybinutils%\i386-win32
316+
317+xcopy %myFPC%\rtl %instdir%\source\rtl /H /Y /C /R /S /I
318+xcopy %myFPC%\packages %instdir%\source\packages /H /Y /C /R /S /I
319+```
320+
321+В данном случае дополнительная переменная **instdir** задает новую директорию для компилятора. Последние 2 команды предназначены для копирования содержимого директорий **rtl** и **packages** в новую директорию компилятора.
322+
323+Совет: при переносе в другое место полученной директории для корректной работы компилятора необходимо отредактировать файл **fpc.cfg**.
324+
325+##### Шаг \#3: Собрать и установить FPC
326+
327+С помощью командной строки (cmd.exe) перейдите в директорию c:\freepascal и выполните сценарий, который мы только что написали:
328+
329+```dos
330+cd /d c:\freepascal
331+makefpc.bat
332+```
333+
334+##### Шаг \#4: Создать BAT-файл для компиляции Lazarus
335+
336+Если Lazarus компилируется впервые, создайте новый файл c:\freepascal\makelaz.bat и скопируйте в него следующий сценарий:
337+
338+```dos
339+set myroot=c:\freepascal
340+set myFPC=%myroot%\fpc\3.0.4
341+set mybinutils=%myroot%\binutils
342+set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
343+cd %myroot%\laz
344+make clean all OPT="-glw2 -Xg"
345+```
346+
347+или для fpc из trunk:
348+
349+```dos
350+set myroot=c:\freepascal
351+set myFPC=%myroot%\fpc\trunk
352+set mybinutils=%myroot%\binutils
353+set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
354+cd %myroot%\laz
355+make clean all OPT="-glw2 -Xg"
356+```
357+
358+Подсказка: данный BAT-файл необходимо использовать только для первой компиляции. В дальнейшем вы можете собирать Lazarus используя команду меню Tools \> Build Lazarus.
359+
360+##### Шаг \#5: Собрать Lazarus
361+
362+С помощью командной строки перейдите в директорию c:\freepascal и выполните сценарий: makelaz.bat
363+
364+Готово!
365+
366+### Установка Free Pascal в FreeBSD/auto
367+
368+Последняя коллекция портов для FreeBSD имеет версию 3.0.4 и находится в ports/lang/fpc. Но они разбросаны по более чем 96 пакетам (!) и исходный код может быть получен из /usr/ports/distfiles/freepascal.
369+
370+Данная команда может быть выполнена с правами администратора (из-под root'а).
371+
372+``` bash
373+[]# cd /usr/ports/lang/fpc && make install && make clean
374+```
375+
376+Другая возможность заключается в использовании portinstall.
377+
378+``` bash
379+[]# portinstall fpc
380+```
381+
382+Как только fpc установлен, вы можете проверить его работоспособность просто выполнив команду
383+
384+``` bash
385+[]$ fpc
386+```
387+
388+### Установка Free Pascal из исходных файлов в Linux/BSD
389+
390+Для эффективности вам нужно
391+
392+Если у вас есть файл со всеми исходниками FPC или обоих (FPC и Lazarus):
393+
394+1. напр., для fpc (последний снапшот на момент правки статьи) предпочтителен экспорт с [ftp](ftp://ftp.freepascal.org/fpc/snapshot/v33/) (без SVN/dirs).
395+2. снапшот исходника Lazarus.
396+
397+- начальный компилятор, последняя версия релиза (fpc 3.0.4 на момент правки статьи) является единственной гарантированной версией. Вы можете скачать загрузочный компилятор или использовать систему управления пакетами/программного обеспечения вашего дистрибутива, чтобы установить его
398+
399+Процесс сборки FPC:
400+
401+- Получить необходимые файлы (начиная с компилятора), исходный файл FPC или исходный svn-каталог
402+- При использовании исходных файлов FPC: extract/de-tgz в рабочий каталог
403+- Сборка: войдите в work/fpc/ и запустите
404+
405+``` bash
406+# можно использовать:
407+export MAKE=`which make` ; echo $MAKE
408+$MAKE all OPT='-gl' PP=/path/to/startingcompiler-name-ppc386
409+# $MAKE применяется в linux и gmake в BSD
410+# /path/to/ может быть пропущен, когда ppc386 прописан в путях поиска
411+```
412+
413+- Установка fpc. Снова \[заходим\] в work/fpc, запускаем
414+
415+``` bash
416+$MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX
417+#заменяем PP=compiler/ppc386 на соответствующий компилятор, если это не Intel x86
418+#THEPREFIX= обычно это /usr/local или просто /usr (но, например, на NetBSD для портов это /usr/pkg)
419+```
420+
421+- Создаем симлинк:
422+
423+``` bash
424+ln -s $THEPREFIX/lib/fpc/3.0.0/ppc386 $THEPREFIX/bin/ppc386
425+```
426+
427+- Устанавливаем исходники:
428+
429+``` bash
430+$MAKE install sourceinstall PREFIX=$THEPREFIX
431+```
432+
433+- Создаем симлинк к исходникам по умолчанию для Lazarus:
434+
435+``` bash
436+ln -sf $THEPREFIX/share/src/3.0.0/fpc /usr/share/fpcsrc
437+```
438+
439+- Настраиваем файл конфигурации fpc.cfg:
440+
441+``` bash
442+$THEPREFIX/lib/fpc/3.0.0/samplecfg $THEPREFIX/lib/fpc/3.0.0 $ETCDIR
443+```
444+
445+- При желании можете проверить, выдает ли ppc386 -i (или какой-либо другой компилятор, используемый вашей архитектурой) \[какую-либо\] информацию, иначе будет предупреждение о том, что пользователю необходимо добавить \$PREFIX/bin в его текущий путь. Попробуйте скомпилировать программу с -viwn и посмотрите, не выдаст ли это ошибку.
446+
447+Примечание:
448+
449+- Если вам нужны списки пакетов fpcmake, вам нужно сгенерировать или предоставить их самостоятельно (\[с помощью\] порта или в дополнительном архиве) в любом случае, выполнить фиктивную установку в /tmp/pack и определить файлы, установленные с
450+ ``` bash
451+ find . >ll
452+ ```
453+
454+- \$THEPREFIX и \$ETCDIR должен \[иметь возможность\] быть настраиваемым пользователем. В противном случае локальная установка невозможна.
455+
456+- BSDHIER=1 для всех команд make действуют соглашения об иерархии BSD.
457+
458+### Установка Free Pascal в macOS
459+
460+См [[Installing Lazarus on macOS|Установка Lazarus на macOS]]
461+
462+## Установка Lazarus
463+
464+### Установка Lazarus в Linux
465+
466+#### Ubuntu / Debian
467+
468+Рекомендуется использовать установщик обновлений [[fpcup|fpcUP]] для начинающих пользователей Lazarus, который устанавливает FPC и Lazarus за один раз в единую структуру подкаталогов (~/development).
469+
470+------------------------------------------------------------------------
471+
472+(Прим.перев.: а еще лучше использовать форк этой утилиты [[fpcupdeluxe]] от [LongDirtyAnimAlf](https://github.com/LongDirtyAnimAlf), последний релиз которой всегда можно скачать [здесь](https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases))
473+
474+------------------------------------------------------------------------
475+
476+Чтобы получить текущую рабочую установку Lazarus, загрузите файлы .deb для Free Pascal и Lazarus из репозитория SourceForge. Вот как: [[Lazarus release version for Ubuntu|Получение Lazarus из нашего репозитория Ubuntu]].
477+
478+Обратите внимание, что установка из исходных кодов Ubuntu по умолчанию не приведет к установке Free Pascal Source Libraries - используйте метод выше.
479+
480+> **Note:** по крайней мере в Linux Ubuntu команда для запуска Lazarus из консоли - [[startlazarus]]. Иначе, если вы установили его из пакета Debian, у вас должен быть пункт меню Lazarus в разделе Application/Programming(«Приложение/Программирование»). (Проблема: существует неоднозначность с программой, также называемой "lazarus" из пакета "tct", доступного для Ubuntu).
481+
482+##### Простой способ сборки из deb-пакетов
483+
484+Самый простой способ получить текущую рабочую установку Lazarus - это загрузить свои собственные пакеты .deb, следуя инструкциям отсюда: [[How to setup a FPC and Lazarus Ubuntu repository|Как настроить хранилище FPC и Lazarus Ubuntu]]
485+
486+##### Установка с использованием rpms
487+
488+Следующим самым простым способом установки является установка RPM-пакетов для Free Pascal и Lazarus из репозитория SourceForge.
489+
490+Вам необходимо загрузить выбранные версии следующих компонентов:
491+
492+- компилятор (например, fpc-3.0.4-1.i686.rpm)
493+- исходный код библиотеки pascal (например, fpc-src-3.0.4-1.i686.rpm)
494+- Lazarus (например, lazarus-1.8.4-0.i686.rpm).
495+
496+Удалите старые пакеты:
497+
498+``` bash
499+rpm -ev lazarus
500+rpm -ev fpc
501+rpm -ev fpc-src
502+```
503+
504+Установите новые пакеты:
505+
506+``` bash
507+rpm -ivh fpc-*
508+rpm -ivh lazarus-*
509+```
510+
511+##### Установка на Raspbian Wheezy
512+
513+Raspbian - это специальная версия Debian для компьютера Raspberry Pi размером с кредитную карту. См. [[Lazarus on Raspberry Pi]] для получения детальной информации.
514+
515+#### Установка на Mandriva
516+
517+##### Lazarus 0.9.30 на Mandriva 2010.
518+
519+Установите как указано ниже, однако при компиляции программы вы можете получить два сообщения об ошибках, сообщающих, что вам не хватает pixbuf 2.0 и lgtk-x11-2.0. Чтобы исправить это, установите libdgk_pixbuf2.0_0-devel и libgtk + 2.0_0-devel из установщика программного обеспечения.
520+
521+#### Установка на Slackware
522+
523+##### Установка Lazarus на Slackware 13.0
524+
525+Нет реальной разницы от версий slackware 12.2 или 12.0, поэтому описанная ниже процедура должна работать точно так же.
526+
527+##### Установка Lazarus 0.9.30 для пользователей Slackware 12.0
528+
529+Это работало в Slackware-12.0 на компьютере Pentium-3:
530+
531+- Free Pascal Compiler (FPC) устанавливается в режиме SUPERUSER
532+- Lazarus устанавливается в режиме USER
533+- Компилятор FPC будет перекомпилирован
534+- Исходный код IDE Lazarus загружается с сервера SVN.
535+
536+-- Загружаем "fpc-2.4.2.i386-linux.tar" в папку пользователя и устанавливаем его. Переходим в эту папку и вводим:
537+
538+``` bash
539+bash-3.1$ tar -xvf fpc-2.4.2.i386-linux.tar
540+bash-3.1$ su
541+bash-3.1$ password:xxxxxx
542+bash-3.1# sh install.sh
543+...
544+(используем ответы по умолчанию для следующих 6 вопросов: нажимаем "Enter" 6 раз)
545+...
546+bash-3.1# exit
547+bash-3.2$ fpc
548+free pascal compiler version 2.4.2 [] for i386
549+Copyright (c) 2010 ...
550+...
551+...
552+```
553+
554+Вы установили компилятор. Возможно, вы захотите перекомпилировать его или нет, но в любом случае вам нужно будет загрузить исходный код в соответствии с требованиями IDE lazarus.
555+
556+-- загружаем "fpc-2.4.2.source.tar.gz" во временную папку. Если вы не хотите перекомпилировать исходный код, просто пропустите этот раздел. Если вы хотите запустить свою собственную скомпилированную версию FPC, просто введите:
557+
558+``` bash
559+bash-3.1$ tar -xvzf fpc-2.4.2.source.tar.gz
560+bash-3.1$ cd fpc-2.4.2
561+bash-3.1$ make clean all
562+bash-3.1$ su
563+bash-3.1$ password: xxxxxxxx
564+bash-3.1# make install
565+bash-3.1# exit
566+bash-3.1$ fpc
567+free pascal compiler version 2.4.2 [...] for i386
568+Copyright (c) 2010 ...
569+...
570+...
571+```
572+
573+Теперь у вас есть собственная скомпилированная версия.
574+
575+-- Редактор Lazarus IDE должен видеть исходный код FPC. Даже если вы не хотите перекомпилировать FPC, вам нужен его исходный код. Однако для экономии места я сохраняю только чистую (не скомпилированную) копию исходного кода. Я снова начинаю с файла "fpc-2.4.2.source.tar.gz" и копирую его в папку /usr/local/src/FPC:
576+
577+``` bash
578+bash-3.1$ su
579+bash-3.1$ password: xxxxxxxx
580+bash-3.1# cp fpc-2.4.2.source.tar.gz /usr/local/src/
581+bash-3.1# cd /usr/local/src/
582+bash-3.1# tar -xvzf fpc-2.4.2.source.tar.gz
583+bash-3.1# rm fpc-2.4.2.source.tar.gz
584+bash-3.1# exit
585+```
586+
587+Номер версии включен в название папки "fpc-2.4.2". Таким образом, я могу сохранить многие версии исходного кода компилятора и в конечном итоге переключаться между ними.
588+
589+-- The lazarus IDE is kept in my USER "~/lazarus" folder and always compiled in USER mode. I usually download the "lazarus-0.9.30-0.tar.gz" file, but here we can also get the latest development version from the SVN server:
590+
591+``` bash
592+bash-3.1$ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
593+```
594+
595+This is for the first time you load it. Next time you will only need to type:
596+
597+``` bash
598+bash-3.1$ svn update
599+```
600+
601+If you do not have SVN installed on your computer, here is how to get it quickly:
602+
603+--Download the two files: "subversion-1.4.6.tar.gz" and "subversion-deps-1.4.5.tar.gz" (or later versions). Type:
604+
605+``` bash
606+bash-3.1$ tar -xvzf subversion-1.4.6.tar.gz
607+bash-3.1$ tar -xvzf subversion-deps-1.4.6.tar.gz
608+bash-3.1$ cd subversion-1.4.6
609+bash-3.1$ ./configure
610+bash-3.1$ make
611+bash-3.1$ su
612+bash-3.1$ password:xxxxxx
613+bash-3.1# make install
614+bash-3.1$ exit
615+```
616+
617+-- At this point you have the folder "~/lazarus" containing the source code. You should compile it very simply:
618+
619+`  bash-3.1$ make clean all`
620+
621+After a few minutes, the compiler stops:
622+
623+``` bash
624+...
625+...
626+Linking ../Lazbuild
627+987 linescompiled ...
628+make [2] leaving ...
629+make [1] leaving ...
630+bash-3.1$
631+```
632+
633+-- Just type:
634+
635+``` bash
636+bash-3.1$ ./lazarus
637+```
638+
639+WOW! You get a message: "Free Pascal sources not found". Just follow the instructions and indicate your Free Pascal Compiler source directory in the panel: "Environment-\>Options-\>Files". As explained earlier, on my computer this should point to "/usr/local/src/fpc-2.4.2". Note that when you change this folder, you should click on "Environment / Rescan_FPC_source_directory".
640+
641+Voila!
642+
643+#### Установка на openSUSE
644+
645+##### Установка Lazarus 0.9.30 для пользователей openSUSE 11.1
646+
647+Free Pascal Compiler requires:\
648+\- Gnu binutils (gnu as, gnu ld, gnu make) These utils can be installed by:
649+
650+``` bash
651+zypper in -t pattern devel_basis
652+```
653+
654+Lazarus also requires these components: 1) glib2 devel 2) gtk2 devel
655+
656+**Important**: The lazarus rpm requires the gtk 2 version, not the version 1.2.
657+
658+These libraries can be installed by:
659+
660+``` bash
661+zypper -n install gtk2 glib2
662+```
663+
664+Download these binary files (RPM)
665+
666+:* fpc-2.4.2-0.i686.rpm (yes i686 and not i386)
667+
668+:* fpc-src-2.4.2-0.i686.rpm
669+
670+:* lazarus-0.9.30-0.i686.rpm
671+
672+install them opening a terminal session (mouse's right button -\> Menu: Open in terminal)
673+
674+``` bash
675+rpm -Uvh fpc-2.4.2-0.i686.rpm
676+rpm -Uvh fpc-src-2.4.2-0.i686.rpm
677+rpm -Uvh lazarus-0.9.30-0.i686.rpm
678+```
679+
680+#### Установка Lazarus 1.0.8 на Fedora Core 18
681+
682+After a fresh install of Fedora Core 18 **yum** is installed, but fails with an error messages.
683+
684+- Open **Software**, check for new software and update all packages.
685+- Reboot.
686+- Install packages **gtk2-devel**, **fpc** and **subversion**. Fedora Core 18 already has fpc 2.6.2.
687+- Open a Terminal and do
688+
689+`svn co svn+ssh://svn.freepascal.org/FPC/svn/lazarus/tags/lazarus_1_0_8 lazarus`\
690+`cd lazarus`\
691+`make bigide`\
692+`./lazarus`
693+
694+#### Установка Lazarus на Scientific Linux
695+
696+Scientific Linux is an RPM-based distribution focussing on science and research. See [[Scientific Linux]] for details.
697+
698+#### Установка из исходных файлов
699+
700+If you prefer to install from source and compile the files yourself, follow these instructions. Because the whole lazarus stuff is installed into one directory, uninstall is very easy and you don't need to be root to install lazarus. You can get tgz files for fpc, fpcsrc and lazarus from the downloads section or you can download it directly via svn.
701+
702+Here is an example of installing 0.9.28 to Ubuntu 6.06. If you understand Linux commands and bash script, you can get what steps are needed. Just copy the script (change the version number when new version has been released), paste it into a text editor, and save it as something like "install_lazarus.sh". Give it execute permission, and run it in a console.
703+
704+> **Note:** In this example, fpc is installed in /opt. So when prompted **'Install prefix**', enter '/opt/fpc'.
705+
706+``` bash
707+#!/bin/sh
708+
709+#installing required packages
710+sudo apt-get install build-essential
711+sudo apt-get install libgtk2.0-dev
712+sudo apt-get install libgdk-pixbuf-dev
713+
714+#installing Free Pascal source
715+cd /opt
716+sudo wget http://nchc.dl.sourceforge.net/lazarus/fpc-src-2.4.2.source.tgz
717+sudo tar -xvf fpc-src-2.4.2.source.tgz
718+sudo mv fpc fpcsrc
719+
720+#installing Free Pascal
721+sudo mkdir fpc
722+cd fpc
723+sudo wget http://nchc.dl.sourceforge.net/lazarus/fpc-2.4.2.i686-linux.tar
724+sudo tar -xvf fpc-2.4.2.i686-linux.tar
725+echo "Enter '/opt/fpc' when prompted 'Install prefix'"
726+sudo sh install.sh
727+
728+#adding fpc path to the PATH
729+echo "#FPC PATH" >> ~/.bash_profile
730+echo "if [ -d /opt/fpc/bin ] ; then" >> ~/.bash_profile
731+echo PATH=/opt/fpc/bin:"${PATH}" >> ~/.bash_profile
732+echo "fi" >> ~/.bash_profile
733+
734+#installing Lazarus
735+cd ../
736+sudo wget http://nchc.dl.sourceforge.net/lazarus/lazarus-0.9.30-0.tar.gz
737+# sudo wget https://downloads.sourceforge.net/project/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%201.8.0RC5/lazarus-1.8.0-RC5.tar.gz
738+sudo tar -zxvf lazarus-0.9.30-0.tar.gz
739+PATH=/opt/fpc/bin:"${PATH}"
740+sudo chmod -R 777 lazarus
741+cd lazarus
742+make clean all
743+./lazarus
744+```
745+
746+> **Note:** You have to manually set fpc-src path in the Environmental Options.
747+
748+##### Загрузка исходных файлов Lazarus
749+
750+Both the Lazarus and FPC source code reside in SVN/subversion repositories. SVN provides an easy way to update your sources by only downloading the changes. This is the recommended way and saves you a lot of time. A connection to the internet is needed for this, but you don't need to be root.
751+
752+Please note these instructions are for subversion.
753+
754+Lazarus does not need any special permissions, neither during installation nor at runtime.
755+
756+<font color="red">If you decide to use TortoiseSVN, remember to check "command line client tools" during its installation if you want Lazarus to show the SVN revision number in the About dialog.</font>
757+
758+Now getting the sources
759+
760+``` bash
761+ svn checkout http://svn.freepascal.org/svn/lazarus/trunk/ lazarus
762+```
763+
764+(replace the last lazarus with any other dir where you want to place your sources)
765+
766+On subsequent occasions, to update simply type
767+
768+``` bash
769+ svn update lazarus
770+```
771+
772+For more information on Subversion, see: <http://subversion.tigris.org/>
773+
774+##### Компиляция и запуск
775+
776+Whether you checkout from cvs or svn, the next step is:
777+
778+compile lazarus
779+
780+``` bash
781+ cd lazarus
782+ make (gmake on BSD)
783+```
784+
785+If fpc is installed correctly, the compilation should work without problems. If not, see FAQ.
786+
787+Start lazarus
788+
789+``` bash
790+ ./lazarus
791+```
792+
793+The IDE should start. If you started lazarus in a terminal, you can see some notes about missing settings. This is normal at first start. The IDE automatically tries to find out where the Free Pascal compiler and its sources are installed by searching in the most common directories.
794+
795+Check the paths
796+Use the IDE menu to go to
797+
798+
799+Environment -\> Environment Options -\> Files
800+
801+The 'FPC Source directory' should point to your fpc source directory. This directory normally ends with /fpc/ or /fpcsrc/ (e.g. /usr/src/fpcsrc or /home/username/freepascal/fpc) and contains directories like 'compiler', 'docs', 'fcl', 'rtl' and 'packages'.
802+
803+See here for the documentation about this dialog: [[IDE Window: Environment Options|IDE Options]].
804+
805+Hint
806+
807+To update lazarus you can use
808+
809+``` bash
810+ svn update lazarus
811+```
812+
813+then for either update pathway:
814+
815+``` bash
816+ make clean all (gmake on BSD)
817+```
818+
819+This will rebuild lazarus and create an IDE without lazarus packages. To link your installed packages do **after** the above:
820+
821+``` bash
822+ ./lazbuild --build-ide=
823+```
824+
825+You may have to append other options if for example you use a custom config directory (ie. add --pcp="C:\Documents and Settings\\\<USER\>\Local Settings\Application Data\lazarus-tests"). See [[lazbuild]].
826+
827+#### Установка Lazarus в Debian GNU/Linux
828+
829+There are preliminary Debian packages for lazarus available for download. They are not the latest versions, however. Make sure you read /usr/share/doc/lazarus/README.Debian carefully before you start using it. Feedback is needed and appreciated; please send your comments to Carlos Laviola \<claviola@debian.org\>.
830+
831+Note that for a fully working Lazarus install, no older or incompatible versions of, for example, the fpc source or fpc compiler must be installed. Remove them by typing
832+
833+``` bash
834+dpkg -r <package name>
835+```
836+
837+without .deb extension. And then install the newest versions as described.
838+
839+### Установка Lazarus в Windows
840+
841+Текущие стабильные версии исполняемых файлов Lazarus для Windows устанавливаются очень легко и могут работать 'из коробки'.
842+
843+Исключение составляют Win98 и ME, для которых необходимо указывать специальный флаг при компиляции. Смотрите Установка из исходных файлов.
844+
845+#### Установка портативной версии Lazarus на USB-диск
846+
847+It is even possible to install the whole Lazarus/FPC package on a portable USB drive (capacity at least 256 MB), for use in environments where you are not allowed to install software on your Windows workstation or where you haven't got administrator privileges. You do have to be a little careful about adjusting the paths in the compiler and environment options and the fpc.cfg file. It may also be necessary to keep the directory for test compilation on your portable drive.
848+
849+\<\< Q:DOES ANYONE KNOW HOW TO SET UP RELATIVE PATHS IN THESE TAGS AND FILES, SO THAT THE ADDRESSING WORKS WHEN YOU MOVE THE USB DEVICE TO ANOTHER MACHINE WHERE IT HAS A DIFFERENT DRIVE LETTER?
850+
851+A: This is what I do. It's relatively convoluted, but it's the best solution I've found. I have a "bin" directory on my USB drive, where I have several scripts and utilities installed. Inside that directory is a batch file called "setenv.bat" which sets an environment variable called THUMBDRIVE. It is set by using this command in the batch file:
852+
853+```dos
854+set THUMBDRIVE=%CD:~0,2%
855+```
856+
857+This is used in setenv.bat to set some paths to other things I have installed on the USB drive. I also have a link in the root directory of the thumb drive with this property:
858+
859+```dos
860+%SystemRoot%\system32\cmd.exe /k bin\setenv
861+```
862+
863+so that when I click on that link when the thumb drive folder is diplayed after inserting it, it will open a command prompt at the thumb drive with the environment variables set from setenv.bat.
864+
865+Also inside the bin directory is [sed](http://sed.sf.net) (the actual binary is one I obtained from the mingw distribution). So I created another batch file called fixlaz.bat which takes one argument, the drive letter which is currently in the Lazarus/fpc settings files that you want to change (note that this is the previous drive letter the last time you ran fixlaz.bat, not the current one of your USB drive which fixlaz.bat already knows). You will need to create this batch file to fit where you installed Lazarus in the root directory structure of the drive if you didn't install it directly in the root folder, and then repeat these lines also for the editoroptions.xml and fpc.cfg files (fpc.cfg is the the fpc bin directory, which might be buried deep in the lazarus folder):
866+
867+```dos
868+copy %THUMBDRIVE%\lazarus\environmentoptions.xml %THUMBDRIVE%\lazarus\environmentoptions.bak
869+sed -e 's/%1/%THUMBDRIVE%/g' %THUMBDRIVE%\lazarus\environmentoptions.bak > %THUMBDRIVE%\lazarus\environmentoptions.xml
870+```
871+
872+So to use it, I would type at the command prompt of the USB drive:
873+
874+```dos
875+fixlaz G:
876+```
877+
878+if "G:" was the previous drive letter used the last time I ran it. This will then scan the file(s) and replace "G:" with the current drive letter of the USB drive, which is in the %THUMBDRIVE% environment variable (after running setenv.bat). Note that you could write it to save the current drive letter in a separate file, so that you wouldn't have to remember it yourself the next time. But this works well enough for me right now. \>\>
879+
880+The binary package is available for Linux and Windows from
881+
882+<http://sourceforge.net/project/showfiles.php?group_id=89339>
883+
884+Download the latest release (currently Lazarus-0.9.30-0-win32.exe) and launch the application. You will be taken through a typical Windows installation, in which the FPC compiler and source libraries are installed within the same directory structure as Lazarus, and the IDE should launch and operate without significant problems, provided you have uninstalled(!!!) any previous version of Lazarus and/or FPC (often found in the C:\pp directory).
885+
886+You can also use a Lazarus Snapshot. For download locations see [[Lazarus Snapshots Downloads]].
887+
888+Tip: It's perhaps a good idea to reboot your Windows after you installed Lazarus and before you try to install additional lazarus components as zeoslib fore example.
889+
890+#### Установка из исходных файлов
891+
892+If you prefer to install from sources, then follow these instructions.
893+
894+Please note these instructions are for SubVersion.
895+
896+Open a command prompt window. Start-\>Run...\>CMD or choose MS-DOS icon. You will use this window to enter the commands below
897+
898+You have to download the lazarus source from one of the [[Lazarus Snapshots Downloads|snapshots servers]]. Then unzip it to c:\lazarus for example \[below called \$(LazarusDir)\].
899+
900+Or you use SVN (example for text mode SVN; adapt to GUI tools such as TortoiseSVN if you want to):
901+
902+``` bash
903+mkdir c:\lazarus
904+cd /d c:\lazarus
905+svn checkout http://svn.freepascal.org/svn/lazarus/trunk/ c:\lazarus
906+```
907+
908+You have to install at least the latests stable FPC version (e.g. FPC 2.6.4, but an FPC 3.1.1 snapshot is also possible).
909+
910+Type (replace \$(LazarusDir) with the path you have unzipped/checked out Lazarus; replace
911+
912+```dos
913+cd /d $(LazarusDir)
914+rem Of course change the first path variable to
915+rem the path of your FPC compiler
916+set path=c:\freepascal\bin\i386-win32;$(LazarusDir)
917+make
918+```
919+
920+- Win9x: use make OPT="-dWIN9XPLATFORM" (Lazarus trunk (and upcoming 1.4)) otherwise the lazarus.exe will not be able to run on this platform.
921+
922+If this works, you can type: lazarus.exe.
923+
924+You can compile examples also:
925+
926+```dos
927+cd /d $(LazarusDir)\examples
928+make
929+```
930+
931+<s>If you extracted lazarus to another drive, eg.: d:\lazarus, tt can happen that you need the gnu make utility to make it. If you have it, you can take its path to set path=...;\<gmakepath\> but it is simpler not to choose drive d:\\</s>
932+
933+#### Установка из исходных файлов с использованием стабильной версии
934+
935+An alternative version of the instructions above.
936+
937+1\> First of all install the latest stable Lazarus to obtain a good starting FPC, for example in C:\lazarus_1_4
938+
939+2\> Now use TortoiseSVN to checkout <http://svn.freepascal.org/svn/lazarus/trunk/> into c:\lazarus
940+
941+3\> Make the following C:\lazarus\build.bat file:
942+
943+Replace \$(LazarusDir) with your Lazarus did and make sure the FPC version number matches
944+
945+```dos
946+SET PATH=$(LazarusDir)\fpc\2.6.4\bin\i386-win32\
947+make bigide
948+```
949+
950+Now create a shortcut in your desktop to start Lazarus and put the following command to start Lazarus which will make sure that it separates the config files from the stable and the SVN versions:
951+
952+```dos
953+$(LazarusDir)\startlazarus.exe --pcp=$(LazarusDir)\configdir
954+```
955+
956+Always start Lazarus from this shortcut, never directly from the executable. At the first time you start Lazarus configure you FPC dir, FPC sources dir and Lazarus dir.
957+
958+#### Сборка Lazarus в Win98 и WinME
959+
960+Так как среда разработки Lazarus по умолчанию вызывает функцию "CreateToolhelp32Snapshot", которая отсутствует на платформе Win9x, IDE не запустится в Win9x "из коробки".
961+
962+Для того, чтобы сделать это запустите пересборку IDE Lazarus с ключом "-dWIN9XPLATFORM".
963+
964+### Установка Lazarus в FreeBSD
965+
966+Следующие инструкции относятся только для версии FreeBSD 9 и выше.
967+
968+#### via Ports tree
969+
970+The latest version of Lazarus available in the FreeBSD port tree, is v 1.6.4 We can use that to install Lazarus.
971+
972+``` bash
973+[]# cd /usr/ports/editors/lazarus && make install clean clean-depends
974+```
975+
976+If you start Lazarus IDE and you get a messages about missing source files, then go to **Environment - Environment Options - Files Tab: FPC source library** and enter the directory of the FPC source files. It can be obtained from /usr/ports/distfiles/freepascal
977+
978+#### via pkgng
979+
980+``` bash
981+[]# pkg install editors/lazarus
982+```
983+
984+At this point Lazarus might complain about missing source files. If you don't have them:-
985+
986+` mkdir /usr/ports/distfiles`\
987+` mkdir /usr/ports/distfiles/freepscal`\
988+` cd /usr/ports/distfiles/freepascal`\
989+` wget `[`http://distcache.freebsd.org/ports-distfiles/freepascal/fpc-3.0.2.source.tar.gz`](http://distcache.freebsd.org/ports-distfiles/freepascal/fpc-3.0.2.source.tar.gz)\
990+` tar xvfz fpc-3.0.2.source.tar.gz`
991+
992+Change the 3.0.2 to whatever version of fpc you have installed. Then go to **Environment - Environment Options - Files Tab: FPC source library** and enter
993+
994+` /usr/ports/distfiles/freepascal/fpc-3.0.2`
995+
996+If when you try to compile something you get this error
997+
998+` Error: resource compiler "fpcres" not found, switching to external mode`
999+
1000+Then you can install fpcres like this
1001+
1002+``` bash
1003+[]# pkg install lang/fpc-utils
1004+```
1005+
1006+#### via Lazarus repository
1007+
1008+This option will often be used if you want to follow Lazarus Trunk, a Fixes branch, or some other release (eg: compiling from a source tarball).
1009+
1010+- Use the SubVersion or Git repositories to checkout a copy of the source code you want, or unpack a downloaded source archive into a suitable location
1011+- The readme.txt file in Lazarus directory mentions 'make clean all'. This works if you are using Linux. Under FreeBSD 9.1 I had to replace 'make' with 'gmake'.
1012+
1013+` cd /patch/to/lazarus_source`\
1014+` gmake clean all`
1015+
1016+### Установка Lazarus в PC-BSD 1.0rc1+
1017+
1018+You can install Lazarus on PB-BSD by simply downloading the Lazarus PBI from [PBI Dir](http://www.pbidir.com/)
1019+
1020+Note that you must install glib* port from /usr/port/devel/glib* or glib packages by pkg_add -r glib12 glib20. I will fix this in new PBI releases.
1021+
1022+**\[other OpenBSD/NetBSD/DragonFlyBSD goes here\]**
1023+
1024+### Установка Lazarus в macOS
1025+
1026+See [[Installing Lazarus on macOS]].
1027+
1028+### Установка Lazarus в Haiku
1029+
1030+Lazarus requires Qt under Haiku. Qt is not installed by default under Haiku. You need to install package available from this site : <http://qt-haiku.ru/>
1031+
1032+Currently, there is no binary package to install Lazarus.
1033+
1034+You will have to compile Lazarus from sources.
1035+
1036+Detailed instructions to build Lazarus under Haiku are available here : [[Installing Lazarus on Haiku]]
1037+
1038+# Установка нескольких версий Lazarus
1039+
1040+Please see [[Multiple Lazarus]] for details on having more than one Lazarus version installed on one system. We cover issues that can arise due to multiple Lazarus installs here, because they can also happen when installing over a previous version.
1041+
1042+# Устранение проблем
1043+
1044+These hints should (hopefully) be applicable across platforms; please adjust paths etc. according to your platform. Also, problems and solutions might be mentioned in the [[Lazarus Faq]].
1045+
1046+## Isolating the component
1047+
1048+There may be multiple problems when installing Free Pascal and Lazarus. If you have problems with starting Lazarus or compiling with it, first make sure your underlying FPC installation works, e.g. by trying to compile a simple example program.
1049+
1050+## Расположение установленных компонентов
1051+
1052+On Linux/Unix/macOS, package/distribution provided installations will often install FPC in /bin or /usr/bin, with the libraries in /lib or /usr/lib, and probably the configuration in /etc/fpc.cfg Source (Subversion) downloads often install in /usr/local/bin (libraries in /usr/local/lib).
1053+
1054+## Отсутствие или повреждение файла fpc.cfg
1055+
1056+Файл fpc.cfg является файлом настроек FPC. В системе Windows его можно найти в директории с исполняемыми файлами компилятора fpc. On Unix/Linux/macOS, it is first searched in /etc/fpc.cfg, then Only some problems that often occur are covered. Please see the Free Pascal User's guide, e.g. chapter Compiler usage/configuration file for more details, including the search order for fpc.cfg
1057+
1058+Если его нет, FPC не скомпилирует вашу программу должным образом.
1059+
1060+### Автоматическое создание fpc.cfg
1061+
1062+Вы можете попытаться создать fpc.cfg с помощью специальной утилиты:
1063+
1064+```dos
1065+rem Измените путь к директории с исполняемыми файлами FPC
1066+cd /d C:\freepascal\fpc\2.4.5\bin\i386-win32
1067+rem Создание fpc.cfg; basepath - это "корневая" директория fpc
1068+fpcmkcfg -d basepath=C:\freepascal\fpc\2.4.5 -o .\fpc.cfg
1069+```
1070+
1071+> **Note:** earlier instructions had \bin\i386-win32 appended to the basepath. This is not needed since at least FPC 2.4.4.
1072+
1073+### Ручное создание fpc.cfg
1074+
1075+If the above doesn't work for you, you can copy/paste the code below to a new file named fpc.cfg to your fpc executable directory (or ~/.fpc.cfg or other location). Modify the paths so they match your situation.
1076+
1077+\$FPCVERSION is used to automatically determine the version of FPC being used for the compile. Using this variable allows this single fpc.cfg to be used with multiple fpc versions that have the same path structure making it easier to maintain multiple FPC installs.
1078+
1079+ #
1080+ # Config file generated by fpcmkcfg on 24/12/2010 - 18:17:42
1081+ # Example fpc.cfg for Free Pascal Compiler
1082+ #
1083+
1084+ # ----------------------
1085+ # Defines (preprocessor)
1086+ # ----------------------
1087+
1088+ #
1089+ # nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed
1090+ #
1091+ # -d is the same as #DEFINE
1092+ # -u is the same as #UNDEF
1093+ #
1094+
1095+ #
1096+ # Some examples (for switches see below, and the -? helppages)
1097+ #
1098+ # Try compiling with the -dRELEASE or -dDEBUG on the commandline
1099+ #
1100+
1101+ # For a release compile with optimizes and strip debuginfo
1102+ #IFDEF RELEASE
1103+ -O2
1104+ -Xs
1105+ #WRITE Compiling Release Version
1106+ #ENDIF
1107+
1108+ # For a debug version compile with debuginfo and all codegeneration checks on
1109+ #IFDEF DEBUG
1110+ -glh
1111+ -Crtoi
1112+ #WRITE Compiling Debug Version
1113+ #ENDIF
1114+
1115+ # ----------------
1116+ # Parsing switches
1117+ # ----------------
1118+
1119+ # Pascal language mode
1120+ # -Mfpc free pascal dialect (default)
1121+ # -Mobjfpc switch some Delphi 2 extensions on
1122+ # -Mdelphi tries to be Delphi compatible
1123+ # -Mtp tries to be TP/BP 7.0 compatible
1124+ # -Mgpc tries to be gpc compatible
1125+ # -Mmacpas tries to be compatible to the macintosh pascal dialects
1126+ #
1127+ # Turn on Object Pascal extensions by default
1128+ #-Mobjfpc
1129+
1130+ # Assembler reader mode
1131+ # -Rdefault use default assembler
1132+ # -Ratt read AT&T style assembler
1133+ # -Rintel read Intel style assembler
1134+ #
1135+ # All assembler blocks are AT&T styled by default
1136+ #-Ratt
1137+
1138+ # Semantic checking
1139+ # -S2 same as -Mobjfpc
1140+ # -Sc supports operators like C (*=,+=,/= and -=)
1141+ # -Sa include assertion code.
1142+ # -Sd same as -Mdelphi
1143+ # -Se<x> compiler stops after the <x> errors (default is 1)
1144+ # -Sg allow LABEL and GOTO
1145+ # -Sh Use ansistrings
1146+ # -Si support C++ styled INLINE
1147+ # -SI<x> set interface style to <x>
1148+ # -SIcomCOM compatible interface (default)
1149+ # -SIcorbaCORBA compatible interface
1150+ # -Sm support macros like C (global)
1151+ # -So same as -Mtp
1152+ # -Sp same as -Mgpc
1153+ # -Ss constructor name must be init (destructor must be done)
1154+ #
1155+ # Allow goto, inline, C-operators, C-vars
1156+ -Sgic
1157+
1158+ # ---------------
1159+ # Code generation
1160+ # ---------------
1161+
1162+ # Uncomment the next line if you always want static/dynamic units by default
1163+ # (can be overruled with -CD, -CS at the commandline)
1164+ #-CS
1165+ #-CD
1166+
1167+ # Set the default heapsize to 8Mb
1168+ #-Ch8000000
1169+
1170+ # Set default codegeneration checks (iocheck, overflow, range, stack)
1171+ #-Ci
1172+ #-Co
1173+ #-Cr
1174+ #-Ct
1175+
1176+ # Optimizer switches for i386 compiler
1177+ # -Os generate smaller code
1178+ # -O1 level 1 optimizations (quick optimizations)
1179+ # -O2 level 2 optimizations (-O1 + slower optimizations)
1180+ # -O3 level 3 optimizations (same as -O2u)
1181+ # -Oa=N set alignment to N
1182+ # -OoX switch on optimalization X.
1183+ # -OoNOX switch off optimalization X.
1184+ # X is one of REGVAR UNCERTAIN STACKFRAME PEEPHOLE ASMCSE LOOPUNROLL
1185+ # -OpCPU set target processor.
1186+ # CPU is one of 386, PENTIUM, PENTIUM2, PENTIUM3, PENTIUM4, PENTIUMM
1187+
1188+ # -----------------------
1189+ # Set Filenames and Paths
1190+ # -----------------------
1191+
1192+ # Both slashes and backslashes are allowed in paths
1193+
1194+ # path to the messagefile, not necessary anymore but can be used to override
1195+ # the default language
1196+ #-FrC:\freepascal\fpc\$FPCVERSION/msg/errore.msg
1197+ #-FrC:\freepascal\fpc\$FPCVERSION/msg/errorn.msg
1198+ #-FrC:\freepascal\fpc\$FPCVERSION/msg/errores.msg
1199+ #-FrC:\freepascal\fpc\$FPCVERSION/msg/errord.msg
1200+ #-FrC:\freepascal\fpc\$FPCVERSION/msg/errorr.msg
1201+
1202+ #IFDEF FPCAPACHE_1_13
1203+ -FuC:\freepascal\fpc\$FPCVERSION/units/$FPCTARGET/httpd13/
1204+ #ELSE
1205+ #IFDEF FPCAPACHE_2_0
1206+ -FuC:\freepascal\fpc\$FPCVERSION/units/$FPCTARGET/httpd20
1207+ #ELSE
1208+ -FuC:\freepascal\fpc\$FPCVERSION/units/$FPCTARGET/httpd22
1209+ #ENDIF
1210+ #ENDIF
1211+
1212+ # searchpath for units and other system dependent things
1213+ -FuC:\freepascal\fpc\$FPCVERSION/units/$FPCTARGET/
1214+ -FuC:\freepascal\fpc\$FPCVERSION/units/$FPCTARGET/*
1215+ -FuC:\freepascal\fpc\$FPCVERSION/units/$FPCTARGET/rtl
1216+
1217+ # path to the gcclib
1218+
1219+ # searchpath for libraries
1220+ #-FlC:\freepascal\fpc\$FPCVERSION/lib
1221+ #-Fl/lib;/usr/lib
1222+
1223+ # searchpath for tools
1224+ -FDC:\freepascal\fpc\$FPCVERSION/bin/$FPCTARGET
1225+
1226+ #IFNDEF CPUI386
1227+ #IFNDEF CPUAMD64
1228+ #DEFINE NEEDCROSSBINUTILS
1229+ #ENDIF
1230+ #ENDIF
1231+
1232+ #IFNDEF Win32
1233+ #DEFINE NEEDCROSSBINUTILS
1234+ #ENDIF
1235+
1236+ # binutils prefix for cross compiling
1237+ #IFDEF FPC_CROSSCOMPILING
1238+ #IFDEF NEEDCROSSBINUTILS
1239+ -XP$FPCTARGET-
1240+ #ENDIF
1241+ #ENDIF
1242+
1243+ # -------------
1244+ # Linking
1245+ # -------------
1246+
1247+ # generate always debugging information for GDB (slows down the compiling
1248+ # process)
1249+ # -gc generate checks for pointers
1250+ # -gd use dbx
1251+ # -gg use gsym
1252+ # -gh use heap trace unit (for memory leak debugging)
1253+ # -gl use line info unit to show more info for backtraces
1254+ # -gv generates programs tracable with valgrind
1255+ # -gw generate dwarf debugging info
1256+ #
1257+ # Enable debuginfo and use the line info unit by default
1258+ #-gl
1259+
1260+ # always pass an option to the linker
1261+ #-k-s
1262+
1263+ # Always strip debuginfo from the executable
1264+ -Xs
1265+
1266+ # -------------
1267+ # Miscellaneous
1268+ # -------------
1269+
1270+ # Write always a nice FPC logo ;)
1271+ -l
1272+
1273+ # Verbosity
1274+ # e : Show errors (default) d : Show debug info
1275+ # w : Show warnings u : Show unit info
1276+ # n : Show notes t : Show tried/used files
1277+ # h : Show hints m : Show defined macros
1278+ # i : Show general info p : Show compiled procedures
1279+ # l : Show linenumbers c : Show conditionals
1280+ # a : Show everything 0 : Show nothing (except errors)
1281+ # b : Show all procedure r : Rhide/GCC compatibility mode
1282+ # declarations if an error x : Executable info (Win32 only)
1283+ # occurs
1284+ #
1285+ # Display Info, Warnings, Notes and Hints
1286+ -viwn
1287+ # If you don't want so much verbosity use
1288+ #-vw
1289+
1290+### Testing and batch file/shortcut usage
1291+
1292+You can also explicitly specify a fpc.cfg to use:\<bash\>fpc -n -@/path/to/fpc.cfg\</bash\>. Handy for testing, creating shortcuts/shell scripts, having multiple FPC installations etc.
1293+
1294+If that does not work, you can try to create fpc.cfg manually: copy over an existing fpc.cfg from a working installation and change the paths.
1295+
1296+## Mixing FPC versions
1297+
1298+If your FPC cannot find its sources/ppu files while fpc.cfg has the right paths, another cause could be that the fpc executable is a different version than the (link to) ppc\<architecture\> compiler.
1299+
1300+When compiling with fpc, fpc starts e.g ppc386 to compile for x86 targets. Please make sure fpc and ppc\<architecture\> are compiled by the same version/sourced from the same package.
1301+
1302+## Lazarus can't find sources
1303+
1304+There may be a message saying Lazarus can't find the sources; if so, go to the menu at the top and select Environment -\> Environment options and insert the name of the directory where you expect to find your lazarus files (eg ~/FreePascal/lazarus), your compiler (e.g. /usr/local/bin/ppc386), the Free Pascal source directory (e.g. /usr/local/lib/fpc/\$version/fpc or a directory in your own space e.g. ~/FreePascal/fpc). Then close the dialog and start programming.
1305+
1306+## Пути к файлам в настройках Lazarus и проекта
1307+
1308+Учтите, что вы можете установить пути (для компилятора, модулей FPC и т.д.) в общих настройках параметров. Параметры, которые вы укажете в *Параметрах проекта*, могут переопределять параметры, используемые для каждого проекта. Если вы испытываете проблемы, связанные с путями в данном проекте, но не в других проектах, вам необходимо проверить, не ошиблись ли вы в переопределении параметров в общих настройках.
1309+
1310+# Установка старых версий
1311+
1312+Смотрите [[Installation hints for old versions]]
1313+
1314+---
1315+*From the Free Pascal wiki, page "Installing Lazarus/ru", as it stood on 2022-01-13 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
1316+Category: Russian (unfinished translation)

Back to history