forked from fpc/Lazarus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.txt
326 lines (223 loc) · 11.2 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
Installation hints for lazarus
==============================
Lazarus provides two main parts:
- LCL - the Lazarus Component Library
- IDE - the RAD tool (editor, form designer, GUI for debugger and compiler, ...)
What is required for Lazarus:
- FreePascal - the FreePascal Compiler plus packages plus FPC sources.
IMPORTANT: try to get the same version of the compiler sources
as the installed compiler.
- Under Linux/xxxBSD: gtk2 libaries - Most distributions already install them.
See www.gtk.org.
The FAQ - Frequently Asked Question is available at www.lazarus.freepascal.org
and some can be found in the file 'FAQ'.
The following will describe how to get FreePascal and how to install Lazarus
properly:
================================================================================
1. Quick installation guide
--------------------------------------------------------------------------------
1.1 This is the short version. For more details, see the following sections.
Lazarus is intended to be a development tool. Therefore it is designed, that
any normal user can easily install his local copy. This means Lazarus does
not need to be installed as root and it does not create any symlinks or
configuration entries. You can literally just unpack it into a directory of
your choice and compile it.
1.2 Under Linux/BSD:
Make sure that you have installed X, gtk2 and gtk2-devel.
Fedora:
yum install gtk2 gtk2-devel
Debian/Ubuntu:
apt-get install lazarus #will pull in required gtk dependencies
Download and install FreePascal. Either the rpm, tgz or the daily snapshot.
You need at least FPC 2.6.4 (3.0.0 is the stable version of FPC; uneven
versions like 3.1.1 are development versions).
To compile Lazarus (LCL + IDE) go to your unpacked Lazarus source and do:
[]$ make clean all
You don't need "./configure" and you don't need "make install". You now
already have a complete Lazarus. You can start the IDE with "./lazarus".
The "make install" as root will just copy the files and set some nice symlinks
and desktop entries.
1.3 Under Mac OS X:
What you need: Apple Developer tools
The Developer tools are included on the original OSX installation CDs, or
can be downloaded at ADC (free registration required)
http://developer.apple.com/.
Download and install FreePascal. Either the dmg or the daily snapshot.
You need at least FPC 2.6.4 (2.6.4 is the stable version of FPC; uneven
versions like 3.1.1 are development versions).
To compile Lazarus (LCL + IDE) go to your unpacked Lazarus source and do:
[]$ make clean all
You don't need "./configure" and you don't need "make install". You now have
already a complete lazarus. You can start the IDE with "./lazarus".
The "make install" as root will just copy the files and set some nice symlinks
and desktop entries.
================================================================================
2. Installing FreePascal
--------------------------------------------------------------------------------
2.1 Installing FreePascal under Linux:
Lazarus requires FPC (Free Pascal) version 2.6.4 (or newer) and it requires
both the compiled FPC libs (binaries) and the FPC sources. Most of the Linux
distributions contain packages for FreePascal (look for FPC). Use your package
manager to install them.
The FPC binaries:
At the Lazarus downloads section (www.lazarus.freepascal.org
or http://sourceforge.net/project/showfiles.php?group_id=89339) you can get
the rpm/deb of the Free Pascal compiler(compiler / linux) and its packages.
Alternatively, if you don't have a rpm system, you can download and install
the tars from www.freepascal.org.
If you want to compile the binaries for yourself see the BSD section.
The FPC sources:
The easiest way to get the Free Pascal sources is via git. Of course you can
also download it as whole, see http://www.freepascal.org/develop.html
for the daily snapshot of the release tree (3.1.x).
The FPC sources via git:
Create a directory where you would like to put the sources. You don't need
to be root to do this.
First create a directory for fpc (e.g. /home/username/freepascal) then do
the following:
[]$ bash
[]$ git clone https://gitlab.com/freepascal.org/fpc/source.git
[]$ git switch main
This will create a directory fpc, which can later be used in the IDE.
Hint:
To download/update the latest changes you can simply do
[]$ cd /home/username/freepascal/fpc
[]$ git pull
--------------------------------------------------------------------------------
2.2 Installing FreePascal under Windows:
If you use the Windows installer for lazarus, then you don't need to install
Free Pascal separately, because the installer already contains the necessary
files.
See http://www.freepascal.org/down-win32.html. You can find a list of mirrors
at http://www.freepascal.org/sdown.html. Download for example FPC as one big
file, unzip it and run install.exe. Then extend your PATH variable to the
FPC directory. For example under Windows 98:
Edit autoexec.bat and add the line
PATH=%PATH%;C:\pp\bin\bin\win32
Then restart Windows.
ToDo: explain how to download fpc sources and build the compiler
--------------------------------------------------------------------------------
2.3 Installing FreePascal under BSD/manually:
Read 1.2 first.
Effectively, you need:
- a file with all sources, or two (FPC and Lazarus)
(1) e.g. for FPC ftp://ftp.freepascal.org/fpc/dist/Linux/separate/sources.tar
preferably an export (no .git/ dirs). The above file misses this
(2) Lazarus source snapshot.
- _any_ starting compiler from the 2.6.4 branch) You can do a check by parsing
the output of 'fpc -v' if it is 2.6.4, it is ok.
- dependant packages. (for FreeBSD that is gtk2, and
GNU make, iconv and gettext)
FPC build:
(1) (fetch) necessary files (FPC source, starting compiler)
(2) (extract) Then de-tgz in work directory,
(3 (build) enter work/fpc/ and run
$MAKE all OPT='-gl -O3p3' PP=/path/to/startingcompiler-name-ppc386
(/path/to/ can be omitted when ppc386 is in the path)
($MAKE is make on linux and gmake on BSD)
(4) (install) then, again in work/fpc, run
$MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX
(THEPREFIX= usually is /usr/lcoal, but e.g. on NetBSD it is /usr/pkg
for ports)
Create a symlink
ln -s $THEPREFIX/lib/fpc/2.6.4/ppc386 $THEPREFIX/bin/ppc386
install sourceinstall PREFIX=$THEPREFIX
(5) (configure) run compiler/utils/samplecfg $THEPREFIX/lib/fpc/2.6.4 $ETCDIR
(6) (optional, test), see if ppc386 -i gives output, else give a warning
that user need to add $PREFIX/bin to his current path.
Try to compiler a program with -viwn, and see if that gives errors.
Notes:
- If you need fpcmake package lists, you need to generate or supply them
yourself, (in the port, or in an extra archive)
either way, do a dummy install to /tmp/pack and determine the files
installed with find . >ll
- $THEPREFIX and $ETCDIR should be user configurable. Otherwise local installs
aren't possible.
- BSDHIER=1 on all make commands forces BSD hierarchy conventions.
--------------------------------------------------------------------------------
2.4 Installing FPC on Mac OSX
Read 1.3 first.
Information:
http://www.freepascal.org/fpcmac.html#TargetDarwin
Download the latest Mac OSX dmg package.
Since FPC for Mac OSX is under heavy development, it s recommended to use
the latest FPC from git.
Open a terminal and type (without the []$)
[]$ git clone https://gitlab.com/freepascal.org/fpc/source.git
[]$ git switch main
This will create a directory fpc, which can also be later used by the IDE.
Compile fpc:
[]$ make clean all
Install fpc
[]$ sudo make install
This will install fpc in /usr/local/bin. The compiler is for example
/usr/local/bin/fpc. You can add the path to your /Users/username/.profile.
Hint:
To download/update the latest changes you can simply do
[]$ cd /Users/username/fpc
[]$ git pull
================================================================================
3. Installing Lazarus
--------------------------------------------------------------------------------
3.1 Installing Lazarus under Linux/BSD/Mac OSX:
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/zip files from the downloads section or you can download it
directly via git.
Hint: Most Linux distributions contain a Lazarus package. Go to your package
manager and install it.
Downloading Lazarus git: git 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.
You don't to be root. Lazarus does not need any special permissions, neither
during installation nor at runtime.
First create a directory for Lazarus (e.g. /home/username/freepascal) then do
the following:
connect to the git server (note: Lazarus and Free Pascal use the same server)
[]$ git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git
[]$ git switch main
compile Lazarus:
[]$ cd lazarus
[]$ make (gmake on BSD)
If FPC is installed correctly, the compilation should work without problems.
If not, see the FAQ.
Start Lazarus:
[]$ ./lazarus
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.
Check the paths:
Use the IDE menu to go to
Environment -> Environment Options -> Files
The 'FPC Source directory' should point to your FPC source directory. This
directory normally ends with /fpc/ or /fpcsrc/ (e.g. /usr/share/fpcsrc or
/home/username/freepascal/fpc) and
contains directories like 'compiler', 'docs', 'fcl', 'rtl' and 'packages'.
ToDo: explain the other paths
Hint:
To update Lazarus you can use
[]$ cd /home/username/freepascal/lazarus
[]$ git pull
[]$ make clean all (gmake on BSD)
This will rebuild Lazarus and create a minimal IDE with only the basic
packages.
[]$ make idepkg
--------------------------------------------------------------------------------
3.1 Installing Lazarus under Windows:
Just download and install the .exe file. You can get the files from:
http://sourceforge.net/project/showfiles.php?group_id=89339 (stable release)
Thanks to Joe for this Step-by-step description:
You have to download the Lazarus source:
ftp://ftp.freepascal.org/pub/fpc/source/lazarus.zip
Then unzip it to c:\lazarus for example.
You have to install at least FPC 2.6.4, e.g. in
c:\pp\bin\win32.
In this directory you can find a lot of exes (make, grep, ppc386, and so on).
Open a command line. Start->Run...>command or choose MS-DOS icon.
Type:
cd c:\lazarus
rem of course adjust to your path:
set path=c:\pp\bin\win32;c:\lazarus
make
If you are lucky then you can type: lazarus.exe