Sign in Join
Wiki copytemporary

Lazarus on Solaris: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11This howto explains the steps to get Lazarus svn and FPC svn up and running starting from a clean Solaris 10 system on either x86 or SPARC. It assumes that you have already used svn (Subversion) and have built FPC and Lazarus from source before.
22
33There are older notes referring only to the FPC compiler and Solaris 7 at [[Solaris Port]]. While the FPC compiler will run on Solaris 8 with a little bit of library fiddling, it's unlikely that Lazarus will run on it due to missing prerequisite libraries.
44
55## Install the FPC Compiler Solaris Binaries
66
77For x86:
88
99Get and install fpc 2.4.4 from <ftp://193.224.143.39/pub/fpc/dist/2.4.4/i386-solaris/fpc-2.4.4.i386-solaris.tar.gz> and the install script <ftp://193.224.143.39/pub/fpc/dist/2.4.4/i386-solaris/install.sh>.
1010
1111For SPARC:
1212
1313The most recent version available as binaries is 2.4.2, which can be downloaded from <ftp://193.224.143.39/pub/fpc/dist/2.4.2/sparc-solaris/fpc-2.4.2.sparc-solaris.tar.gz>. There is an install script corresponding to this version at <ftp://193.224.143.39/pub/fpc/dist/2.4.2/sparc-solaris/install.sh>, but see <http://62.166.198.202/view.php?id=18271> for patches that might be needed; there might be a more recent version of this script with the trunk sources available via Subversion.
1414
1515In either case it is probably worth making sure that the binaries are no more than one release behind the svn trunk. At the time of writing (July '11) trunk is 2.4.5, so while the x86 binaries at 2.4.4 are OK it might be advisable to get, build and install the 2.4.4 release for SPARC before proceeding any further. As of mid 2015, version 2.7.1 revision 29398 is particularly robust.
1616
1717It might be necessary to treat ncurses from Sunfreeware (see below) as a prerequisite to recompilation. If necessary, apply the patch from <http://bugs.freepascal.org/view.php?id=19675>
1818
1919## Install Required Libraries
2020
2121There is an extensive freeware library containing GNU utilities and libraries at <http://sunfreeware.com/> (mirrored at e.g. <http://sunfreeware.saix.net/>), these are more recent and more complete than the libraries etc. on Sun's Solaris 10 "Companion" CD. Note that these are initially downloaded using a web browser rather than by a graphical package or update manager, so don't waste time hunting for one on your system. Refer to <http://www.sunfreeware.com/download.html> for general instructions.
2222
2323Install the following packages from SunFreeware or a mirror. This is a long list because it includes a complete set of GTK2 libraries and dependencies, some of which mandate updated GNU binutils which themselves imply an update of gcc, (g)make and so on. In addition a development system will likely require a copy of Subversion, which itself has extensive dependencies. These are the versions for both Intel and SPARC systems at the time of writing (July '11):
2424
25-`atk-1.18.0`\
26-`binutils-2.21.1`\
27-`cairo-1.4.10`\
28-`coreutils-8.11`\
29-`expat-2.0.1`\
30-`fontconfig-2.8.0 †`\
31-`freetype-2.4.2`\
32-`gcc-3.4.6`\
33-`gdb-6.8`\
34-`glib-2.25.13`\
35-`gtk+-2.12.0`\
36-`jpeg-8a`\
37-`libiconv-1.13.1`\
38-`libintl-3.4.0`\
39-`libpng-1.2.44`\
40-`make-3.82`\
41-`ncurses-5.7`\
42-`pango-1.18.2`\
43-`render-0.8`\
44-`renderproto-0.9.3`\
45-`tiff-3.9.4`\
46-`xft-2.1.2`\
47-`xrender-0.8.3`\
48-`zlib-1.2.5`\
25+```text
26+atk-1.18.0
27+binutils-2.21.1
28+cairo-1.4.10
29+coreutils-8.11
30+expat-2.0.1
31+fontconfig-2.8.0 †
32+freetype-2.4.2
33+gcc-3.4.6
34+gdb-6.8
35+glib-2.25.13
36+gtk+-2.12.0
37+jpeg-8a
38+libiconv-1.13.1
39+libintl-3.4.0
40+libpng-1.2.44
41+make-3.82
42+ncurses-5.7
43+pango-1.18.2
44+render-0.8
45+renderproto-0.9.3
46+tiff-3.9.4
47+xft-2.1.2
48+xrender-0.8.3
49+zlib-1.2.5
4950
50-`† Install this only if it's not already on the system as part of Solaris.`
51+† Install this only if it's not already on the system as part of Solaris.
52+```
5153
5254The actual file names will be qualified by OS version and architecture, e.g. render-0.8-sol10-intel.local.gz and render-0.8-sol10-sparc.local.gz.
5355
5456In addition, for a complete Subversion (i.e. including Apache-based server) installation:
5557
56-`apache-2.2.19`\
57-`neon-0.29.5`\
58-`openldap-2.4.24`\
59-`openssl-1.0.0d`\
60-`sasl-2.1.21`\
61-`subversion-1.6.12`
58+```text
59+apache-2.2.19
60+neon-0.29.5
61+openldap-2.4.24
62+openssl-1.0.0d
63+sasl-2.1.21
64+subversion-1.6.12
65+```
6266
6367It might be less disruptive to build Subversion from source, e.g. <http://subversion.tigris.org/downloads/subversion-1.6.17.tar.bz2>. According to the INSTALL file the actual dependencies for a client using the svn: (as distinct from http:) protocol are libapr, libapr-util, SQLite and libz; these are available from e.g. <http://subversion.tigris.org/downloads/subversion-deps-1.6.17.tar.bz2>:
6468
65-`gtar xjf subversion-1.6.17.tar.bz2`\
66-`gtar xjf subversion-deps-1.6.17.tar.bz2`\
67-`cd subversion-1.6.17  `\
68-`export LDFLAGS='-lintl -L/usr/local/lib -R/usr/local/lib'`\
69-`./configure`\
70-`make`\
71-`make install`\
69+```text
70+gtar xjf subversion-1.6.17.tar.bz2
71+gtar xjf subversion-deps-1.6.17.tar.bz2
72+cd subversion-1.6.17
73+export LDFLAGS='-lintl -L/usr/local/lib -R/usr/local/lib'
74+./configure
75+make
76+make install
7277
73-`# I suspect this leaves some symlinks in a parlous state, but it appears usable.`
78+# I suspect this leaves some symlinks in a parlous state, but it appears usable.
79+```
7480
7581A client that is capable of using the http: protocol will also require an SSL library, this might be problematic on very old systems but a hack that might work is to build additional libraries from source packages from a Linux distro of the same age (e.g. Slackware 8.1 for Solaris 8).
7682
7783Adapt your PATH variable to get the gnu version of the binutils:
7884
7985\$ export PATH=/usr/local/bin:\$PATH
8086
8187\$ export LD_LIBRARY_PATH=/usr/local/lib:\$LD_LIBRARY_PATH
8288
8389Note that when FPC looks for an assembler and linker, it first scans the path looking for gas and gld, and then for as and ld. Make sure that the utilities that are found first are the ones from the binutils package installed above, other versions (i.e. the proprietary assembler and linker supplied with Solaris, or older GNU software) will probably not work as expected. Exact details might depend on what you've done with the system, which shell you're running and so on.
8490
8591Check your GTK2 installation:
8692
8793\$ gtk-demo
8894
8995## A note on gld (Intel architecture only)
9096
9197Gnu ld creates binaries that are not completely solaris abi compatible. malloc (libc) for example always returns a null pointer. FPC uses the solaris linker by using the -Xn compiler option (available from 2.4.2 onwards but not documented until 3.2). Solaris ld is in /usr/css/bin and gnu binutils has installed the link /usr/bin/ld :
9298
9399\# rm /usr/bin/ld
94100
95101\# ln -s /usr/css/bin/ld /usr/bin/ld
96102
97103Note that you need to specify the -Xn compiler option for all your fpc and lazarus programs. Lazarus programs linked without -Xn crash with the message GLib-ERROR ... Failed to allocate 42 bytes... core dump.
98104
99105## A note on paths (all architectures)
100106
101107The most common causes of problems are missing directories in the current search path, or not being able to find required libraries (e.g. libcairo.so.2) when trying to start the Lazarus IDE or a program that uses the LCL. If running the Bash shell, make sure that the ~/local.profile file exports appropriate PATH and LD_LIBRARY_PATH variables:
102108
103-`#`\
104-`# Copyright (c) 2001 by Sun Microsystems, Inc.`\
105-`# All rights reserved.`\
106-`#`\
107-`# ident "@(#)local.profile      1.10    01/06/23 SMI"`\
108-`stty istrip`\
109-`PATH=/usr/local/bin:/usr/sfw/bin:/usr/bin:/usr/ucb:/etc:.`\
110-`MANPATH=/usr/sfw/man:/usr/man`\
111-`PAGER=/usr/bin/less`\
112-`export PATH MANPATH PAGER`\
109+```text
110+#
111+# Copyright (c) 2001 by Sun Microsystems, Inc.
112+# All rights reserved.
113+#
114+# ident "@(#)local.profile 1.10 01/06/23 SMI"
115+stty istrip
116+PATH=/usr/local/bin:/usr/sfw/bin:/usr/bin:/usr/ucb:/etc:.
117+MANPATH=/usr/sfw/man:/usr/man
118+PAGER=/usr/bin/less
119+export PATH MANPATH PAGER
113120
114-`export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH`
121+export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
122+```
115123
116124## Get and Build Sources (Intel architecture)
117125
118126\$ svn co <http://svn.freepascal.org/svn/fpc/trunk> fpc
119127
120128\$ cd fpc
121129
122130\$ make clean all OPT="-Xn"
123131
124132\$ su
125133
126134\# make install INSTALL_PREFIX=/usr
127135
128136/etc/fpc.cfg installed with 2.4.4 is fine for your new 2.5.1 installation.
129137
130138\$ svn co <http://svn.freepascal.org/svn/lazarus/trunk> lazarus
131139
132140\$ cd lazarus
133141
134142\$ make clean all OPT="-Xn -k-L/usr/local/lib" PP=/usr/lib/fpc/2.5.1/ppc386
135143
136144## Get and Build Sources (SPARC architecture)
137145
138146This assumes that version 2.4.4 of the compiler has been built and installed. A later version of the compiler should work, but there are some cases where the Lazarus sources might have problems with 2.4.5/2.5.x due to conditional directives.
139147
140148In the FPC sources, make sure that packages/Makefile.fpc includes iconvenc and gtk2, if necessary running fpcmake to ensure changes "stick". As a minimum:
141149
142-`dirs_solaris=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \`\
143-`              libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib fcl-extra \`\
144-`              imlib utmp  fpgtk xforms fftw pcap ggi  openssl gnome1 httpd13 httpd20 httpd22 numlib iconvenc gtk2 cairo`
150+```text
151+dirs_solaris=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
152+ libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib fcl-extra \
153+ imlib utmp fpgtk xforms fftw pcap ggi openssl gnome1 httpd13 httpd20 httpd22 numlib iconvenc gtk2 cairo
154+```
145155
146156If Lazarus is to be compiled with database units etc. (i.e. make bigide) then also check the following:
147157
148-`In packages/src/sqldb/Makefile.fpc:`\
158+```text
159+In packages/src/sqldb/Makefile.fpc:
149160
150-`  dirs_solaris=interbase postgres mysql odbc oracle sqlite`
161+ dirs_solaris=interbase postgres mysql odbc oracle sqlite
162+```
151163
152164\$ cd fpc
153165
154166\$ gmake NOGDB=1 OPT='-O- -gl' all
155167
156168\$ su
157169
158170\# make install
159171
160172\# rm /usr/local/bin/ppcsparc
161173
162174\# ln -s /usr/local/lib/fpc/2.4.4/ppcsparc /usr/local/bin/ppcsparc
163175
164176\# exit
165177
166178/etc/fpc.cfg installed with 2.4.4 is fine for your new 2.5.1 installation.
167179
168180\$ svn co <http://svn.freepascal.org/svn/lazarus/trunk> lazarus
169181
170182\$ cd lazarus
171183
172184Either:
173185
174186\$ make clean all
175187
176188or:
177189
178190\$ make clean bigide
179191
180192## Solaris 11 Express
181193
182194**Dependencies**
183195
184196Depending on the installation media, gnome is already installed or can easily be installed by installing the slim_install package. subversion and gnu-binutils can be installed from the solaris repository with "pkg install" or the graphical Package Manager.
185197
186198**gld**
187199
188200solaris ld is already installed in /usr/bin. The use of -Xn is still mandatory.
189201
190202## Interim note: Lazarus 1.0 and successors
191203
192204*Do not link to this section, it will be superseded.*
193205
194206As of September 2012, Lazarus 1.0 has been released. As with the preceding version (0.9.30), the appropriate version of FPC to use for compilation is 2.6.0; later versions might be better with FPC 2.7.1 as described below.
195207
196208In the case of SPARC, there was a small number of late-breaking patches to fix code generation issues. While these are documented as having been applied to the development versions of the compiler (2.6.1 and 2.7.1), the more significant ones were also applied to the stable version (2.6.0) shortly before release: see the summary at <http://lists.freepascal.org/lists/fpc-devel/2012-September/029845.html>.
197209
198210Refer to <http://www.freepascal.org/develop.var> for information on getting a fixes-branch daily snapshot of the compiler, or fetching it from the Subversion repository.
199211
200212As of some time in 2013/2014, SunFreeware has moved to a subscription model announcing:
201213
202214
203215Following 20 years of providing free pre-compiled Open Source packages to the Solaris community though sponsorship. Sunfreeware.com no longer provides free downloads as of September 30, 2013 as the sponsorship has terminated.
204216
205217As of early 2015, the final FPC development trunk version of the 2.6 era (2.7.1 svn release 29398) compiles on SPARC Solaris 10 without problems. Lazarus trunk around svn release 48671 requires libraries etc. as discussed above, a usable mirror for Solaris 10 packages appears to be <http://sunfreeware.saix.net/>.
206218
207219Solaris appears to be more sensitive than Linux to whether something is being run as a privileged or unprivileged user. Subversion build might need to be done as root, and FPC installation may need to be done as a root login (i.e. not just using sudo).
208220
209221In the longer term, the viability of Solaris as an easily-obtained operating system is questionable. <http://opensxce.org/> might be worth investigating, this might prefer alternative packages from <http://mirror.opencsw.org/>.
210222
211223## See also
212224
213225- [[Solaris Port]]
214226
215227---
216228*From the Free Pascal wiki, page "Lazarus on Solaris", as it stood on 2020-08-09 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).*
217229Category: Install
218230Category: Solaris
219231Category: Unix

Back to history