1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY fpc-bin-x86-dl "https://mirror.freemirror.org/pub/fpc/dist/&freepascal-bin-version;/x86_64-linux/fpc-&freepascal-bin-version;-x86_64-linux.tar">
|
---|
8 | <!ENTITY fpc-bin-x86-md5sum "519c5e0b9e7b61c07d61511a52aaecaa">
|
---|
9 | <!ENTITY fpc-bin-x86-size "80.4 MB">
|
---|
10 | <!ENTITY fpc-bin-x86-bldsize "x.x MB">
|
---|
11 |
|
---|
12 | <!ENTITY fpc-bin-i686-dl "https://mirror.freemirror.org/pub/fpc/dist/&freepascal-bin-version;/i386-linux/fpc-&freepascal-bin-version;.i386-linux.tar">
|
---|
13 | <!ENTITY fpc-bin-i686-md5sum "2d9dece3f2c83a82cb07e422e59ca91e">
|
---|
14 | <!ENTITY fpc-bin-i686-size "146.7 MB">
|
---|
15 | <!ENTITY fpc-bin-i686-bldsize "x.x MB">
|
---|
16 |
|
---|
17 | <!ENTITY fpc-src-dl "https://mirror.freemirror.org/pub/fpc/dist/&freepascal-version;/source/fpc-&freepascal-version;.source.tar.gz">
|
---|
18 | <!ENTITY fpc-src-md5sum "e7649ad0fc9230fdd9493a7fcabbd426">
|
---|
19 | <!ENTITY fpc-src-size "49.8 MB">
|
---|
20 | <!ENTITY fpc-src-bldsize "x.x MB">
|
---|
21 |
|
---|
22 | <!ENTITY fpc-tmp-target "/opt/fpc-temp">
|
---|
23 | ]>
|
---|
24 |
|
---|
25 | <!--
|
---|
26 | TODO:
|
---|
27 | The instructions below does the bootstrap by using a
|
---|
28 | binary package to compile the compiler.
|
---|
29 | I've never tested whether the built compiler is capable
|
---|
30 | to recompile itself, maybe it work, maybe not. With the
|
---|
31 | compiler which is installed, building QT5PAS and Lazarus
|
---|
32 | (the Delphi-like GUI) with QT or GTK2 toolkits does work.
|
---|
33 |
|
---|
34 | We definitly should test this and maybe tweak the instructions
|
---|
35 | to do a correct build to enable this.
|
---|
36 | -->
|
---|
37 |
|
---|
38 | <sect1 id="fpc" xreflabel="FreePascal-&freepascal-version;">
|
---|
39 | <?dbhtml filename="fpc.html"?>
|
---|
40 |
|
---|
41 | <sect1info>
|
---|
42 | <date>$Date$</date>
|
---|
43 | </sect1info>
|
---|
44 |
|
---|
45 | <title>FreePascal-&freepascal-version;</title>
|
---|
46 |
|
---|
47 | <indexterm zone="java">
|
---|
48 | <primary sortas="a-java">FreePascal Binary</primary>
|
---|
49 | </indexterm>
|
---|
50 |
|
---|
51 | <sect2 id="fpc-bin" xreflabel="FPC Binary" role="package">
|
---|
52 | <title>Binary FreePascal Information</title>
|
---|
53 |
|
---|
54 | <para>
|
---|
55 | FreePascal is a compiler software used to translate Pascal
|
---|
56 | source code to executable programs. An introductory Pascal
|
---|
57 | program looks like:
|
---|
58 | </para>
|
---|
59 |
|
---|
60 | <screen><literal>program Hello;
|
---|
61 | begin
|
---|
62 | writeln('Hello world!');
|
---|
63 | end.</literal></screen>
|
---|
64 |
|
---|
65 | <para>
|
---|
66 | The <application>FreePascal</application> package does not only
|
---|
67 | contain the compiler itself but also a complete semi-graphical,
|
---|
68 | text based IDE. This IDE can be operated using keyboard commands
|
---|
69 | and by mouse interaction. The IDE is constructed with a toolkit
|
---|
70 | previously named <application>Turbo Vision</application> which
|
---|
71 | was introduced by Borland somewhere back in the MS-DOS age
|
---|
72 | together with <application>Turbo Pascal 6.0</application>
|
---|
73 | - that was in Nov. 1990. This toolbox is available for own
|
---|
74 | programs, too.
|
---|
75 | </para>
|
---|
76 |
|
---|
77 | <para>
|
---|
78 | Creating the <application>FreePascal</application> compiler from
|
---|
79 | source requires a <application>FreePascal</application> compiler
|
---|
80 | to be available. This is a circular dependency which can be
|
---|
81 | solved by using a precompiled package.
|
---|
82 | </para>
|
---|
83 |
|
---|
84 | <para>
|
---|
85 | To start, we set up a binary installation of <application>FreePascal</application>
|
---|
86 | created by the FreePascal development team. It is installed in
|
---|
87 | the <filename>/opt</filename> directory. Using this temporary
|
---|
88 | compiler installation, the compiler can be created from source.
|
---|
89 | After this step is done, the temporary compiler can be easily
|
---|
90 | removed.
|
---|
91 | </para>
|
---|
92 |
|
---|
93 | &lfs110a_checked;
|
---|
94 |
|
---|
95 | <bridgehead renderas="sect3">Binary Package Information</bridgehead>
|
---|
96 | <itemizedlist spacing="compact">
|
---|
97 | <listitem>
|
---|
98 | <para>
|
---|
99 | Binary download (x86): <ulink url="&fpc-bin-i686-dl;"/>
|
---|
100 | </para>
|
---|
101 | </listitem>
|
---|
102 | <listitem>
|
---|
103 | <para>
|
---|
104 | Download MD5 sum: &fpc-bin-i686-md5sum;
|
---|
105 | </para>
|
---|
106 | </listitem>
|
---|
107 | <listitem>
|
---|
108 | <para>
|
---|
109 | Download size (binary): &fpc-bin-i686-size;
|
---|
110 | </para>
|
---|
111 | </listitem>
|
---|
112 | <listitem>
|
---|
113 | <para>
|
---|
114 | Estimated disk space required: &fpc-bin-i686-bldsize;
|
---|
115 | </para>
|
---|
116 | </listitem>
|
---|
117 | </itemizedlist>
|
---|
118 | <itemizedlist spacing="compact">
|
---|
119 | <listitem>
|
---|
120 | <para>
|
---|
121 | Binary download (x86_64): <ulink url="&fpc-bin-x86-dl;"/>
|
---|
122 | </para>
|
---|
123 | </listitem>
|
---|
124 | <listitem>
|
---|
125 | <para>
|
---|
126 | Download MD5 sum: &fpc-bin-x86-md5sum;
|
---|
127 | </para>
|
---|
128 | </listitem>
|
---|
129 | <listitem>
|
---|
130 | <para>
|
---|
131 | Download size (binary): &fpc-bin-x86-size;
|
---|
132 | </para>
|
---|
133 | </listitem>
|
---|
134 | <listitem>
|
---|
135 | <para>
|
---|
136 | Estimated disk space required: &fpc-bin-x86-bldsize;
|
---|
137 | </para>
|
---|
138 | </listitem>
|
---|
139 | </itemizedlist>
|
---|
140 |
|
---|
141 | <bridgehead renderas="sect3">Source Package Information</bridgehead>
|
---|
142 | <itemizedlist spacing="compact">
|
---|
143 | <listitem>
|
---|
144 | <para>
|
---|
145 | Source download: <ulink url="&fpc-src-dl;"/>
|
---|
146 | </para>
|
---|
147 | </listitem>
|
---|
148 | <listitem>
|
---|
149 | <para>
|
---|
150 | Download MD5 sum: &fpc-src-md5sum;
|
---|
151 | </para>
|
---|
152 | </listitem>
|
---|
153 | <listitem>
|
---|
154 | <para>
|
---|
155 | Download size (binary): &fpc-src-size;
|
---|
156 | </para>
|
---|
157 | </listitem>
|
---|
158 | <listitem>
|
---|
159 | <para>
|
---|
160 | Estimated disk space required: &fpc-src-bldsize;
|
---|
161 | </para>
|
---|
162 | </listitem>
|
---|
163 | </itemizedlist>
|
---|
164 |
|
---|
165 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
166 | <itemizedlist spacing="compact">
|
---|
167 | <listitem>
|
---|
168 | <para>
|
---|
169 | Optional patch (Required if building on i686 systems):
|
---|
170 | <ulink url="&patch-root;/fpc-&freepascal-version;-glibc_2.34-1.patch"/>
|
---|
171 | </para>
|
---|
172 | </listitem>
|
---|
173 | </itemizedlist>
|
---|
174 |
|
---|
175 | <bridgehead renderas="sect3">FreePascal Dependencies</bridgehead>
|
---|
176 | <para role="required">
|
---|
177 | <xref linkend="gdb"/> (with static library libgdb.a)
|
---|
178 | </para>
|
---|
179 |
|
---|
180 | <para condition="html" role="usernotes">User Notes:
|
---|
181 | <ulink url="&blfs-wiki;/fpc"/></para>
|
---|
182 |
|
---|
183 | </sect2>
|
---|
184 |
|
---|
185 | <sect2 role="installation">
|
---|
186 | <title>Installation of FreePascal</title>
|
---|
187 |
|
---|
188 | <para>
|
---|
189 | Begin by extracting the appropriate binary tarball for your
|
---|
190 | architecture and changing to the extracted directory. Install
|
---|
191 | the binary <application>FreePascal</application> with the
|
---|
192 | following commands:
|
---|
193 | </para>
|
---|
194 |
|
---|
195 | <screen><userinput>tar -xf fpc-&freepascal-bin-version;-x86_64-linux.tar &&
|
---|
196 | cd fpc-&freepascal-bin-version;-x86_64-linux &&
|
---|
197 | sed -e "s;export PREFIX$;export PREFIX=&fpc-tmp-target;;" -i install.sh</userinput></screen>
|
---|
198 |
|
---|
199 | <para>Remove some packages which are not required for the
|
---|
200 | temporary compiler:</para>
|
---|
201 |
|
---|
202 | <screen><userinput>rm demo.tar.gz &&
|
---|
203 | rm doc-pdf.tar.gz</userinput></screen>
|
---|
204 |
|
---|
205 | <para>Install the temporary compiler as the
|
---|
206 | <systemitem class="username">root</systemitem> user:</para>
|
---|
207 |
|
---|
208 | <screen role="root"><userinput>yes "" | ./install.sh</userinput></screen>
|
---|
209 |
|
---|
210 | <para>Remove the extracted binary objects:</para>
|
---|
211 |
|
---|
212 | <screen><userinput>cd .. &&
|
---|
213 | rm -rf fpc-&freepascal-bin-version;-x86_64-linux</userinput></screen>
|
---|
214 |
|
---|
215 | <para>
|
---|
216 | The binary version is now installed in
|
---|
217 | <filename class="directory">&fpc-tmp-target;</filename>. Add this
|
---|
218 | directory to the <envar>PATH</envar> environment variable:
|
---|
219 | </para>
|
---|
220 |
|
---|
221 | <screen><userinput>export PATH=&fpc-tmp-target;/bin:$PATH</userinput></screen>
|
---|
222 |
|
---|
223 | <para>
|
---|
224 | The temporary compiler is now ready to compile the
|
---|
225 | <application>FreePascal</application> suite from source. To do
|
---|
226 | this, extract the source archive and cd into the extracted
|
---|
227 | directory as usual.
|
---|
228 | </para>
|
---|
229 |
|
---|
230 | <para>
|
---|
231 | If building on i686 systems (32-bit), a patch is required
|
---|
232 | to overcome an issue with glibc-2.34:
|
---|
233 | </para>
|
---|
234 |
|
---|
235 | <screen><userinput>patch -Np1 -i ../fpc-&freepascal-version;-glibc_2.34-1.patch</userinput></screen>
|
---|
236 |
|
---|
237 | <para>
|
---|
238 | Compile the <application>FreePascal</application> compiler
|
---|
239 | and tools by executing the following commands:
|
---|
240 | </para>
|
---|
241 |
|
---|
242 | <screen><userinput>make clean &&
|
---|
243 | make OVERRIDEVERSIONCHECK=1 all</userinput></screen>
|
---|
244 |
|
---|
245 | <para>
|
---|
246 | Install the <application>FreePascal</application> compiler
|
---|
247 | and tools by executing the following commands as the
|
---|
248 | <systemitem class="username">root</systemitem> user:</para>
|
---|
249 |
|
---|
250 | <screen role="root"><userinput>make_install -j1 PREFIX=/usr &&
|
---|
251 | case "$(uname -m)" in
|
---|
252 | i?86)
|
---|
253 | ln -svf /usr/lib/fpc/&freepascal-version;/ppc386 /usr/bin/
|
---|
254 | ;;
|
---|
255 | x86_64)
|
---|
256 | ln -svf /usr/lib/fpc/&freepascal-version;/ppcx64 /usr/bin/
|
---|
257 | ;;
|
---|
258 | esac</userinput></screen>
|
---|
259 |
|
---|
260 | <para>
|
---|
261 | Now that the compiler has been created from source, the temporary
|
---|
262 | compiler in <filename class="directory">&fpc-tmp-target;</filename>
|
---|
263 | can be removed. Execute the following commands as the
|
---|
264 | <systemitem class="username">root</systemitem> user:</para>
|
---|
265 |
|
---|
266 | <screen role="root"><userinput>rm -rf /etc/fppkg* &&
|
---|
267 | rm -rf /etc/fpc.* &&
|
---|
268 | rm -rf &fpc-tmp-target;</userinput></screen>
|
---|
269 |
|
---|
270 | </sect2>
|
---|
271 |
|
---|
272 | <sect2 role="configuration">
|
---|
273 | <title>Configuring FreePascal</title>
|
---|
274 |
|
---|
275 | <para>
|
---|
276 | A default configuration file <filename>/etc/fpc.cfg</filename>
|
---|
277 | can be created by a tool which is part of the compiler suite.
|
---|
278 | Generate the default config file as the
|
---|
279 | <systemitem class="username">root</systemitem> user:
|
---|
280 | </para>
|
---|
281 |
|
---|
282 | <screen role="root"><userinput>/usr/lib/fpc/&freepascal-version;/samplecfg /usr/lib/fpc/&freepascal-version; /etc &&
|
---|
283 | cat >> /etc/fpc.cfg <<EOF
|
---|
284 | #ifdef cpux86_64
|
---|
285 | # for x86_64 use -fPIC by default
|
---|
286 | -Cg
|
---|
287 | #endif
|
---|
288 | EOF</userinput></screen>
|
---|
289 |
|
---|
290 | <para>
|
---|
291 | If you are going to use QT (most likely when building Lazarus
|
---|
292 | with the QT library), add the QT library path to the config as the
|
---|
293 | <systemitem class="username">root</systemitem> user:
|
---|
294 | </para>
|
---|
295 |
|
---|
296 | <screen role="root"><userinput>sed -e "/^-Fl\/usr\/lib\/fpc/a -Fl/opt/qt5/lib" \
|
---|
297 | -i /etc/fpc.cfg</userinput></screen>
|
---|
298 |
|
---|
299 | <para>
|
---|
300 | It is highly recommended that the compiler sources are available
|
---|
301 | for later use. To extract the sources at a proper location,
|
---|
302 | execute the following command as the
|
---|
303 | <systemitem class="username">root</systemitem> user:
|
---|
304 | </para>
|
---|
305 |
|
---|
306 | <!--
|
---|
307 | not sure if we can simply copy the files in $PWD as they may
|
---|
308 | contain compiled binaries
|
---|
309 | -->
|
---|
310 | <screen role="root"><userinput>mkdir -p /usr/lib/fpc/src &&
|
---|
311 | tar --strip-components=1 -C /usr/lib/fpc/src -xf ../fpc-&freepascal-version;.source.tar.gz</userinput></screen>
|
---|
312 |
|
---|
313 | </sect2>
|
---|
314 |
|
---|
315 | <sect2 role="content">
|
---|
316 | <title>Contents</title>
|
---|
317 |
|
---|
318 | <segmentedlist>
|
---|
319 | <segtitle>Installed Program</segtitle>
|
---|
320 | <segtitle>Installed Libraries</segtitle>
|
---|
321 | <segtitle>Installed Directories</segtitle>
|
---|
322 |
|
---|
323 | <seglistitem>
|
---|
324 | <seg>fpc, fp</seg>
|
---|
325 | <seg>None</seg>
|
---|
326 | <seg>None</seg>
|
---|
327 | </seglistitem>
|
---|
328 | </segmentedlist>
|
---|
329 |
|
---|
330 | <variablelist>
|
---|
331 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
332 | <?dbfo list-presentation="list"?>
|
---|
333 | <?dbhtml list-presentation="table"?>
|
---|
334 |
|
---|
335 | <varlistentry id="i-fp">
|
---|
336 | <term><command>fp</command></term>
|
---|
337 | <listitem>
|
---|
338 | <para>
|
---|
339 | FreePascal text based IDE
|
---|
340 | </para>
|
---|
341 | <indexterm zone="fpc i-fp">
|
---|
342 | <primary sortas="b-fp">fp</primary>
|
---|
343 | </indexterm>
|
---|
344 | </listitem>
|
---|
345 | </varlistentry>
|
---|
346 |
|
---|
347 | <varlistentry id="i-fpc">
|
---|
348 | <term><command>fpc</command></term>
|
---|
349 | <listitem>
|
---|
350 | <para>
|
---|
351 | FreePascal compiler frontend
|
---|
352 | </para>
|
---|
353 | <indexterm zone="fpc i-fpc">
|
---|
354 | <primary sortas="b-fpc">fpc</primary>
|
---|
355 | </indexterm>
|
---|
356 | </listitem>
|
---|
357 | </varlistentry>
|
---|
358 |
|
---|
359 | <varlistentry id="i-fpcmake">
|
---|
360 | <term><command>fpcmake</command></term>
|
---|
361 | <listitem>
|
---|
362 | <para>
|
---|
363 | FreePascal make utility
|
---|
364 | </para>
|
---|
365 | <indexterm zone="fpc i-fpcmake">
|
---|
366 | <primary sortas="b-fpcmake">fpcmake</primary>
|
---|
367 | </indexterm>
|
---|
368 | </listitem>
|
---|
369 | </varlistentry>
|
---|
370 |
|
---|
371 | </variablelist>
|
---|
372 |
|
---|
373 | </sect2>
|
---|
374 |
|
---|
375 | </sect1>
|
---|