-
Notifications
You must be signed in to change notification settings - Fork 95
/
fpcup_lazwikipage.txt
809 lines (721 loc) · 26.4 KB
/
fpcup_lazwikipage.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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
== About ==
fpcup is a tool that automates running a subversion client to build FPC and/or Lazarus in a self-contained directory structure. Think of it as a batch file on steriods that does the boring svn work for you.
On Windows, it can also serve as a "bare metal" installer: it can download a subversion client, binutils (make.exe etc).
fpcup allows maintaining multiple different FPC/Lazarus combinations.
It is a third party tool, not part of FPC or Lazarus.
The fpcup GUI which is provided with the source code:
[[Image:fpcupgui.png]]
== Ready to run ==
fpcup is ready to run out of the box. It will download and install FPC and Lazarus.
On Windows, this directory layout is used:
<syntaxhighlight lang="dos">
C:\development\config_lazarus # Default primary-config-path directory
# (contains Lazarus settings)
C:\development\cross # Place to store cross compiling binutils and libs if wanted
C:\development\extras # Third party modules (see fpcup.ini) such as fpcdocs
C:\development\fpcbootstrap # Binutils (make.exe etc) and bootstrap compiler
C:\development\fpc # FPC fixes 2.6 by default
C:\development\lazarus # Lazarus trunk by default
</syntaxhighlight>
On Linux/OSX/BSD, a similar layout is used under ~
fpcup will create a shortcut to the installed Lazarus on your desktop.
Just run fpcup, e.g. on Windows:
<syntaxhighlight lang="dos">
fpcup
</syntaxhighlight>
On *nix:
<syntaxhighlight lang="dos">
#replace fpcup_linux_x86 with your actual fpcup filename of course if not on linux x86
chmod u+rx fpcup_linux_x86 #make executable (one time only action)
./fpcup_linux_x86 #run
</syntaxhighlight>
Next time, you can either run the exact same command, or run the fpcup_update desktop shortcut or home directory shell script/batch file.
== Documentation ==
fpcup has a -h option, a [https://bitbucket.org/reiniero/fpcup/overview readme.txt] and [https://bitbucket.org/reiniero/fpcup/downloads/fpcup.html fpcup.html] with development notes (see the [https://bitbucket.org/reiniero/fpcup/src source code repository] for the latest readme.txt and fpcup.html).
To make it easier to get user contributions for documentation/tips, this wiki page has been created. Please feel free to add your own examples etc.
== Tips ==
=== Anchordocking ===
One way to enable anchordocking is by using settings.ini:
open your settings file or add a new file <code>settings.ini</code>
<syntaxhighlight lang="ini">
[anchordocking]
; Just a plain install except enable anchordocking package
anchordocking=1
</syntaxhighlight>
This will use default settings but also enable the anchordocking package in the IDE.
Of course, you can use the anchordocking=1 module setting in any .ini section.
=== Building only FPC ===
You can build FPC without Lazarus if you want (or the other way round). The example below builds FPC from the fixes 2.6 SVN branch.
==== Settings ====
Open your settings file or add a new file, <code>settings.ini</code>:
<syntaxhighlight lang="ini">
[fixes26]
; FPC 2.6 fixes only (no Lazarus)
fpcdir=c:\development\fpcfixes26
fpcurl=http://svn.freepascal.org/svn/fpc/branches/fixes_2_6
; Let's specify Lazarus info in case we ever want to add lazarus
lazdir=c:\development\lazarus12_fixes26
; Just an example: build Lazarus 1.2:
lazurl=http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_2
primary-config-path=c:\development\configlazarus12_fixes26
; If we ever build Lazarus, do create a link/shortcut:
lazlinkname=lazarus12_fixes26
; Do not create a batch file with shortcut
fpcuplinkname=""
; We can use the binutils/bootstrap dirs that we usually use:
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
; Just install/update, no questions asked:
noconfirm=true
; In case you want to submit patches, it's nice to be able to update
; without overwriting your fixes:
keeplocalchanges=true
; Specify we only want FPC, not Lazarus
; in case of fpc patches FPCBuildOnly
only=FPC,FPCCrossWin32-64
skip=helplazarus,lazarus,lazbuild,bigide,useride
</syntaxhighlight>
Then get FPC and build it with:
<syntaxhighlight lang="dos">
fpcup --inifile=settings.ini --inisection=fixes26
</syntaxhighlight>
Now you can run your compiler:
<syntaxhighlight lang="dos">
c:\development\fpcfixes26\bin\i386-win32\fpc.exe -h
</syntaxhighlight>
Cross-compile for win64, e.g.:
<syntaxhighlight lang="dos">
c:\development\fpcfixes26\bin\i386-win32\fpc.exe -Px86_64 yourfile.pas
</syntaxhighlight>
=== Avoid lengthy lcl.chm documentation generation ===
By default, fpcup tries to compile the <code>$(lazarusdir)\docs\chm\lcl.chm</code> Lazarus help file every day or so. This can take a long time due to the fpdoc tool being quite slow.
You can avoid compiling lcl.chm by generating it one time (or copying over an existing file) and making the file read-only.
== Cross compilers ==
fpcup not only lets you install native FPC/Lazarus, but will also build cross compilers for you.
For most cross compilers, you do need to have the relevant binutils that are specific for the host<>target system.
Often, you will also need libraries in target system format if you want to compile programs (e.g. Linux Qt or Gtk libraries for the relevant CPU if you're crosscompiling for Linux).
When you run a crosscompiler, fpcup briefly checks if it can find required binutils and libraries and will warn you if they can't be found.
===Status===
* Built in means no additional files are needed
* Needs binutils/libs: means that you need to supply those (see above)
* N/A: means non-applicable/impossible
* No: means no plans to implement this. However, contributions are welcome, as always
{| border="1" cellpadding="2" class="wikitable sortable"
|-
|From\To
|DOS
|GO32v2
|Windows x86
|Windows x64
|Linux x64
|Linux x86
|Linux mipsel
|Linux arm
|Android ARM
|FreeBSD x64
|FreeBSD x86
|OSX
|AIX powerpc32
|-
|Any
|
|
|
|
|
|
|needs binutils,libs
|needs binutils,libs
|needs binutils,libs
|
|
|
|needs binutils,libs
|-
|Windows x86
|needs FPC trunk, binutils
|yes, built in
|N/A
|yes
|needs binutils,libs
|needs binutils,libs
|see Any
|see Any
|
|
|
|
|See Any
|-
|Windows x64
|no
|needs binutils
|yes
|N/A
|needs binutils,libs
|needs binutils,libs
|see Any
|see Any
|
|
|
|
|See Any
|-
|Linux x64
|no
|
|yes, built in
|
|N/A
|
|see Any
|see Any
|
|no plans
|no plans
|
|See Any
|-
|Linux x86
|
|
|yes, built in
|
|
|N/A
|see Any
|see Any
|
|no plans
|no plans
|
|See Any
|-
|Linux mipsel
|
|
|
|
|
|
|N/A
|see Any
|
|
|
|
|See Any
|-
|Linux arm
|
|
|
|
|
|
|see Any
|N/A
|
|
|
|
|See Any
|-
|Android ARM
|
|
|
|
|
|
|see Any
|see Any
|N/A
|
|
|
|See Any
|-
|FreeBSD x64
|no
|no plans
|yes, built in
|
|
|
|see Any
|see Any
|
|N/A
|
|
|See Any
|-
|FreeBSD x86
|
|no plans
|yes, built in
|
|
|
|see Any
|see Any
|
|
|N/A
|
|See Any
|-
|OSX
|
|
|verify
|
|
|
|see Any
|see Any
|
|
|
|N/A
|See Any
|-
|AIX powerpc32
|
|
|
|
|
|
|see Any
|see Any
|
|
|
|
|N/A
|}
(With thanks to [[FPSpreadsheet]]'s spreadsheet to wikitable conversion tool, see e.g. examples\fpsgrid)
=== AIX PowerPC crosscompiler ===
Once you have set up a regular FPC trunk/2.7.1 compiler, you can add an [[FPC AIX Port]] cross compiler.
Limitations:
* FPC trunk/2.7.1+ only
* untested; don't have target platform libs (or access to target platform). Test reports welcome.
==== Required files ====
* Crossbinutils: see wiki article mentioned earlier. Win32 cross binutils are provided; for *nix, you have to compile your own.
* Libs: copy over from target device; see wiki article as well.
==== Settings ====
Open your settings file or add a new file, settings.ini:
<syntaxhighlight lang="dos">
[aix]
; AIX on powerpc32 cross compiler. Also runs on 64 bit powerpc
; a full fpcup run must have been done before
; please adjust paths etc
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
fpcopt=""
fpcuplinkname=""
lazlinkname=""
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
noconfirm=true
keeplocalchanges=true
cputarget=powerpc
fpcopt=""
crossopt=""
ostarget=aix
; Perhaps best to always clean... can be removed for speed
only=FPCCleanOnly,FPCBuildOnly
skip=FPCGetOnly,lazbuild,bigide,useride
</syntaxhighlight>
See also:
* any (cross compiler) page about your device
* your AIX documentation
==== Creating and using the cross compiler ====
Then generate the cross compiler with
<syntaxhighlight lang="dos">
fpcup --inifile=settings.ini --inisection=aix
</syntaxhighlight>
If, like me, you don't have the libs from the target platform and run with <code>--verbose</code>, you'll see something like:
<syntaxhighlight lang="dos">
C:\development\cross\bin\powerpc-aix\powerpc-aix-ld.exe: cannot find \lib\crt0.o
C:\development\cross\bin\powerpc-aix\powerpc-aix-ld.exe: cannot find -lm
C:\development\cross\bin\powerpc-aix\powerpc-aix-ld.exe: cannot find -lc
C:\development\cross\bin\powerpc-aix\powerpc-aix-ld.exe: cannot find -lbsd
</syntaxhighlight>
If the compiler generation went ok, you can run a test compile, compiling a file test.pas with
* option -CN: avoid reading for null pointers on AIX; see wiki article
<syntaxhighlight lang="dos">
fpc -Ppowerpc -Taix -CN test.pas
</syntaxhighlight>
(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)
=== Android ARM crosscompiler ===
Once you have set up a regular FPC trunk/2.7.1 compiler, you can add an [[Android]] cross compiler.
Limitations:
* only tested on FPC trunk
* only builds FPC cross compiler, Android does not have "regular" LCL support so not enabled
* patches for getting customdrawn support going are welcome
==== Required files ====
Download the Android NDK (e.g. a file like android-sdk_r22.3-windows.zip) for your platform and extract the crossbinutils, e.g. from a path like
<syntaxhighlight lang="dos">
android-ndk-r9c\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\bin
</syntaxhighlight>
The result is something ''like'' these files (adjust for your platform etc):
<syntaxhighlight lang="dos">
arm-linux-androideabi-addr2line.exe
arm-linux-androideabi-ar.exe
arm-linux-androideabi-as.exe
arm-linux-androideabi-c++.exe
arm-linux-androideabi-c++filt.exe
arm-linux-androideabi-cpp.exe
arm-linux-androideabi-elfedit.exe
arm-linux-androideabi-g++.exe
arm-linux-androideabi-gcc-4.8.exe
arm-linux-androideabi-gcc-ar.exe
arm-linux-androideabi-gcc-nm.exe
arm-linux-androideabi-gcc-ranlib.exe
arm-linux-androideabi-gcc.exe
arm-linux-androideabi-gcov.exe
arm-linux-androideabi-gdb-orig.exe
arm-linux-androideabi-gdb.exe
arm-linux-androideabi-gprof.exe
arm-linux-androideabi-ld.bfd.exe
arm-linux-androideabi-ld.exe
arm-linux-androideabi-ld.gold.exe
arm-linux-androideabi-ld.mcld.exe
arm-linux-androideabi-nm.exe
arm-linux-androideabi-objcopy.exe
arm-linux-androideabi-objdump.exe
arm-linux-androideabi-ranlib.exe
arm-linux-androideabi-readelf.exe
arm-linux-androideabi-size.exe
arm-linux-androideabi-strings.exe
arm-linux-androideabi-strip.exe
</syntaxhighlight>
Put these files in your cross binutils directory for the right platform - e.g. on a standard Windows fpcup install:
<syntaxhighlight lang="dos">
C:\development\cross\bin\arm-android
</syntaxhighlight>
Libs: extract the libs from a path like
<syntaxhighlight lang="dos">
android-ndk-r9c\platforms\android-19\arch-arm\usr\lib
</syntaxhighlight>
into
<syntaxhighlight lang="dos">
C:\development\cross\lib\arm-android
</syntaxhighlight>
The libs in question can be ''like'' this list:
<syntaxhighlight lang="dos">
crtbegin_dynamic.o
crtbegin_so.o
crtbegin_static.o
crtend_android.o
crtend_so.o
libandroid.so
libc.a
libc.so
libdl.so
libEGL.so
libGLESv1_CM.so
libGLESv2.so
libGLESv3.so
libjnigraphics.so
liblog.so
libm.a
libm.so
libm_hard.a
libOpenMAXAL.so
libOpenSLES.so
libstdc++.a
libstdc++.so
libthread_db.so
libz.so
rs
</syntaxhighlight>
==== Settings ====
Open your settings file or add a new file, settings.ini:
<syntaxhighlight lang="dos">
[android]
; Android ARM cross compiler
; a full fpcup run must have been done before
; please adjust paths etc
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
fpcopt=""
fpcuplinkname=""
lazlinkname=""
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
cputarget=arm
ostarget=android
; You can specify exact instruction set and floating point support etc:
crossopt="-CpARMV7 -CfVFPV3"
; ... or something more conservative/compatible:
;crossopt="-CpARMV6"
verbose=0
; We only need an FPC here; assume FPC has been updated by regular update
only=FPCBuildOnly
; No LCL support on Android yet
</syntaxhighlight>
See also:
* [[ARM compiler options]]
* any (cross compiler) page about your device
* your ARM device documentation
==== Creating and using the cross compiler ====
Then generate the cross compiler with
<syntaxhighlight lang="dos">
fpcup --inifile=settings.ini --inisection=android
</syntaxhighlight>
Now you can run a test compile, compiling a file test.pas with
<syntaxhighlight lang="dos">
fpc -Parm -Tandroid test.pas
</syntaxhighlight>
(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)
=== Linux ARM cross compiler ===
Once you have set up a regular FPC compiler, you can add an Linux on ARM cross compiler (e.g. for a Raspbian/Raspberry Pi).
==== Required files ====
* Linux/Unix build or install the relevant crossbinutils (Linux, unix)
* Windows: download the binutils from http://svn2.freepascal.org/svn/fpcbuild/binaries/i386-win32 (the files starting with arm-linux-) Put them into <syntaxhighlight lang="dos">
C:\development\cross\lib\arm-linux
</syntaxhighlight>
On Windows, the result is something ''like'' these files (adjust for your platform etc):
<syntaxhighlight lang="dos">
arm-linux-addr2line.exe
arm-linux-ar.exe
arm-linux-as.exe
arm-linux-ld.exe
arm-linux-objcopy.exe
arm-linux-objdump.exe
arm-linux-strip.exe
</syntaxhighlight>
Libs: extract the libs from your device - e.g. this on Raspbian:
* all .so files in /lib
* all .so files in /usr/lib
* all .so files in /usr/lib/arm-linux-gnueabihf
Note: some .so files are actually scripts; check
<syntaxhighlight lang="bash">
grep -i "ld script" *
</syntaxhighlight>
Remove those .so and copy over (or symlink) the .so.x to .so in order for the linker to find them
Examples:
libpthread.so
libc.so
libgcc_s.so
put them into your cross lib path, e.g. on Windows
<syntaxhighlight lang="dos">
C:\development\cross\lib\arm-linux
</syntaxhighlight>
==== Settings ====
Open your settings file or add a new file, settings.ini.
As you can see in the comments below, you can build an ARMHF cross-compiler which works on e.g. Raspbian, requires an FPU and requires ARMHF libraries, but only on FPC 2.7+.
<syntaxhighlight lang="dos">
[linuxarm]
; a full fpcup run must have been done before (e.g. win32full)
; does not update packages
; please adjust paths etc
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
lazdir=lazdir=c:\development\lazarus
primary-config-path=c:\development\lazarussettings
lazlinkname=""
fpcuplinkname=""
; NO FPIC: not supported on 2.6.x
; http://bugs.freepascal.org/view.php?id=19729
; otherwise Fatal: Internal error 200502052
; If using -CaEABIHF in crossopt, specify -dFPC_ARMHF here (only works on 2.7.x)
; more info see below
fpcopt=""
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
noconfirm=true
keeplocalchanges=true
cputarget=arm
; if using armhf, you MUST specify -dFPC_ARMHF in the FPC options;
; specifying in crossopt is not enough.
; -fPIC not supported on FPC 2.6.x, only on 2.7.x;
fpcopt="-dFPC_ARMHF"
; safe default but slow:
;crossopt="-CpARMV6 -CaEABI -CfSOFT"
; Raspbian for Raspberry Pi safe
; ARMv6 instruction set
; if using arm hf (hard float/floating point), please specify -dFPC_ARMHF
; copy over /lib, /usr/lib
; /usr/lib/arm-linux-gnueabihf (Raspbian) => note:
; some .so files are actually scripts; check
; grep -i "ld script" *
; Remove those .so and copy over (or symlink) the .so.x to .so in order for the linker to find them
; Examples:
; libpthread.so
; libc.so
; libgcc_s.so
; to cross lib dir (try compiling and keep copying until no errors left)
; Note: -CpARMV6Z parameter not supported on 2.6.x, only on 2.7.x
; Note: -CaEABIHF parameter not supported on 2.6.x, only on 2.7.x
; Note: don't use -fPIC; will give segmentation fault
crossopt="-CaEABIHF -CpARMV6 -CfVFPV2"
; beagleboard black with hardfloat:
; if using armhf, also specify -dFPC_ARMHF (in fpcopt) to avoid gtk scrollbar errors
; Note: -CaEABIHF not supported on 2.6.x, only on 2.7.x
;crossopt="-CaEABIHF -Cparmv7 -CfVFPv3"
ostarget=linux
; we only need to do Lazarus as FPC won't change here
only=FPCCleanOnly,FPCBuildOnly
skip=FPCGetOnly,lazbuild,bigide,useride
</syntaxhighlight>
See also:
* [[ARM compiler options]]
* any (cross compiler) page about your device
* your ARM device documentation
==== Creating and using the cross compiler ====
Then generate the cross compiler with
<syntaxhighlight lang="dos">
fpcup --inifile=settings.ini --inisection=linuxarm
</syntaxhighlight>
Now you can run a test compile, compiling a file test.pas with
<syntaxhighlight lang="dos">
fpc -Parm -Tlinux test.pas
</syntaxhighlight>
(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)
=== DOS crosscompiler ===
Using 32 bit fpcup.exe on Windows, once you have set up a regular FPC trunk/2.7.1 compiler, you can add a [[DOS]] cross compiler.
==== Required files ====
Download the required binaries as mentioned in [[DOS]], currently:
<syntaxhighlight lang="dos">
msdos-nasm.exe
msdos-wlib.exe
msdos-wlink.exe
nasm.exe
wlibd.dll
wlinkd.dll
wlsystem.lnk
</syntaxhighlight>
and put them in your cross binutils directory for the right platform - e.g. on a standard Windows fpcup install:
<syntaxhighlight lang="dos">
c:\development\cross\bin\i8086-msdos
</syntaxhighlight>
There are no files needed in the corresponding library directory,
<syntaxhighlight lang="dos">
C:\development\cross\lib\i8086-msdos
</syntaxhighlight>
==== Settings ====
Open your settings file or add a new file, settings.ini:
<syntaxhighlight lang="ini">
[dos]
; dos cross compiler
; a full fpcup run must have been done before
; please adjust paths etc
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
fpcopt=""
fpcuplinkname=""
lazlinkname=""
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
cputarget=i8086
ostarget=msdos
verbose=0
; We only need an FPC here; assume FPC has been updated by regular update
only=FPCBuildOnly
</syntaxhighlight>
==== Creating and using the cross compiler ====
Then generate the cross compiler with
<syntaxhighlight lang="dos">
fpcup --inifile=settings.ini --inisection=dos
</syntaxhighlight>
Now you can run a test compile, compiling a file test.pas with
<syntaxhighlight lang="dos">
fpc -Pi8086 -TMSDOS test.pas
</syntaxhighlight>
(your fpc.cfg will have been modified to use DOS medium memory model, smartlinking etc)
== Download ==
The official site is at:
https://bitbucket.org/reiniero/fpcup/downloads
== License ==
fpcup is open source software released under the LGPL with linking exception (same as FreePascal/LCL).
== Troubleshooting ==
When you hit errors with fpcup:
* Try running fpcup with <code>--verbose</code> to see what's going on exactly.
* Look into the error message fpcup generates; it also shows some troubleshooting steps you may perform.
* Sometimes, the FPC or Lazarus build process leaves incorrect files; you can delete all .ppu files from your FPC and Lazarus directories (including subdirectories) and run fpcup again.
* Try removing all intermediate files by running fpcup with the <code>--clean</code> option
* If compiling Lazarus, make sure lazarus and lhelp are not running.
* Try running <syntaxhighlight lang=bash>svn revert THEDIRECTORY --recursive</syntaxhighlight> followed by <syntaxhighlight lang=bash>svn update THEDIRECTORY</syntaxhighlight> for your Lazarus and FPC directories to remove local modifications, if any.
* Remove possible stale files:
** the bootstrap compiler and any binutils: remove all files and directories in the fpcbootstrap directory
** if you haven't modified fpcup.ini, remove it and let fpcup regenerate it
** same for settings.ini
** same for fpc.cfg in $(fpcdir)\bin\<architecture>
** same for your Lazarus primary config path
* See if there's a newer fpcup version available that may have fixed your problem
If the steps before do not work: you can use the <code>--uninstall</code> option to remove all files including your FPC and Lazarus directories, then run fpcup with the same commands.
{{Note|Of course, errors introduced in FPC and Lazarus source code/repository may also influence builds. There's nothing fpcup can do to fix incorrect code breaking the build. However, some of the steps mentioned above (deleting .ppu files, fpc.cfg, Lazarus config) may fix Lazarus/FPC build problems..}}
=== Known issues ===
Known issues can be found in the issue tracker:
https://bitbucket.org/reiniero/fpcup/issues?status=new&status=open
=== Strange errors running clean/distclean ===
This is a symptom of issues with the FPC build system (not fpcup).
On Windows, make 3.80 which is distributed with FPC 2.6.x has problems when there are spaces in your path. This may lead to strang error messages when cleaning.
Solution: download make 3.81 (make 3.82 is newer, but cannot build FPC 2.6.x; it builds FPC 2.7.x fine, though).
=== Info: Error running fpcup. Technical details: error executing sequence helplazarus; line: 4, param: helplazarus ===
HelpLazarus is often the first module that will be built after building lazbuild and the other core IDE units. However, the actual problem may be that lazbuild itself was not generated due to an error. Try running with --verbose to pinpoint where the problem is and follow the troubleshooting steps above.
=== Error finding (e.g.) system.ppu when compiling with FPC/Lazarus ===
Errors like this may be caused by an fpc.cfg from an older/different version of FPC that remains in your fpc/bin/<platform> directory.
Because you can customise fpc.cfg, fpcup will not just replace it.
If you have not customised fpc.cfg, you can remove it and let fpcup regenerate it when rebuilding FPC.
== Support and bug reporting ==
Please post support requests on the forum (e.g. in the thread dedicated to FPCUP in the Third-Party announcements section).
If you report problems, '''after''' running the troubleshooting steps above, please be sure to mention:
# operating system
# fpcup version (as printed in its output)
# description of what went wrong/error message
# run fpcup with the <code>--verbose --noconfirm</code> arguments (or the equivalents in settings.ini) as well as the other arguments you used, redirect the output to file, and attach the file, e.g.: <syntaxhighlight lang=bash>fpcup --verbose --noconfirm > fpcupverbose.txt</syntaxhighlight>; if you post on the forum, please zip it and attach the result to your post
== Current progress ==
* Support for Windows 2000-7 (untested, probably works on 8). Bare metal install currently needs Windows XP or later for the subversion client. On Windows 2000, manually installing a subversion client in advance will work.
* Linux x86: works
* Linux x64: works
* OSX 10.?: experimental support
* FreeBSD 9: lightly tested; seems to work
== Changelog ==
This log tracks fpcup binaries as available on the download page. Note that not all binaries may be updated at the same time; fpcup prints a version string at the beginning which you can check.
For more details, please see the Mercurial commit log in https://bitbucket.org/reiniero/fpcup/commits/all
* 20140113:
** Experimental AIX cross compiler module.
* 20140111:
** Working fpc fixes 2.6 cross compiler for Linux ARM (e.g. Raspbian).
* 20131231:
** Add --crossOPT option that lets you pass options to cross compilers. Useful for e.g. specifying softfloat or hardfloat on ARM/MIPS processors. See example in settings.ini Please delete settings.ini and let fpcup regenerate it.
* 20131230:
** cross compiler modules not only add but also update fpc.cfg configuration snippets.
Snippet format changed:
PLEASE REMOVE ALL # fpcup do not remove snippets from fpc.cfg or entire fpc.cfg and rerun your cross compilers.
** new Android-ARM cross-compiler module
** updated ARMEL cross compiler
** update configuration to Lazarus 1.3, avoiding upgrade process
** add dcpcrypt package
** add anchordocking package
** add CodeLibrarian package
** update rx to new repository URL. Please remove existing directory or do svn switch
* 20131122:
** New SVN URL for [[RXfpc]] components. Please delete your fpcup.ini (if not modified) to let it regenarate and remove the <code>extras\rx</code> directory before running the new fpcup so the new repository can be downloaded.
* 20131118:
** Initial stab at support for http proxy: --httpproxy=user:password@host:port (user and password are optional). Also picks up http_proxy variable. Used in http, svn, hg over http downloads; not supported for git over http downloads. Needs testing.
** Bug fix: Ini file parameters should not be stored in fpcup start shell script/batch file
** Added fpc only example to settings.ini.
** Changed settings.ini: make full install/update default
** Split win32->win64 cross compile into FPC and Lazarus parts
** Reinstate bare metal install on Windows XP+. Windows 2000 users will get a warning that they should install SVN themselves.
* 20131023: Win32=>DOS crosscompiler support for FPC trunk
Earlier releases: please see the [http://forum.lazarus.freepascal.org/index.php/topic,15919.0.html fpcup forum thread]
== External links ==
* [https://bitbucket.org/reiniero/fpcup Project page]
* [https://bitbucket.org/reiniero/fpcup/downloads Downloads for several platforms]
* [https://www.ohloh.net/p/fpcup Ohloh code statistics]
== See also ==
* [[Installing Lazarus]] Official way to install Lazarus
* [[Lazarus Manager]] Another installer for Lazarus/FPC
[[Category:Lazarus]]
[[Category:FPC]]
[[Category:Tools]]
[[Category:Install]]