Difference between revisions of "Lazarus on Solaris"

From Free Pascal wiki
Jump to navigationJump to search
m (Split SPARC compilation etc. from Intel)
m (→‎Install Required Libraries: Add missing libpng.)
Line 36: Line 36:
 
  libiconv-1.13.1
 
  libiconv-1.13.1
 
  libintl-3.4.0
 
  libintl-3.4.0
 +
libpng-1.2.44
 
  make-3.82
 
  make-3.82
 
  ncurses-5.7
 
  ncurses-5.7

Revision as of 21:23, 27 July 2011

This 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.

There 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.

Install the FPC Compiler Solaris Binaries

For x86:

Get 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.

For SPARC:

The 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.

In 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.

Install Required Libraries

There is an extensive freeware library containing GNU utilities and libraries at http://sunfreeware.com/. 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.

Install the following packages from http://sunfreeware.com/. 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, 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):

atk-1.18.0
binutils-2.21.1
cairo-1.4.10
coreutils-8.11
expat-2.0.1
fontconfig-2.8.0
freetype-2.4.2
gcc-3.4.6
gdb-6.8
glib-2.25.13
gtk+-2.12.0
jpeg-8a
libiconv-1.13.1
libintl-3.4.0
libpng-1.2.44
make-3.82
ncurses-5.7
pango-1.18.2
render-0.8
renderproto-0.9.3
tiff-3.9.4
xft-2.1.2
xrender-0.8.3
zlib-1.2.5

The 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.

In addition, for a complete Subversion (i.e. including Apache-based server) installation:

apache-2.2.19
neon-0.29.5
openldap-2.4.24
openssl-1.0.0d
sasl-2.1.21
subversion-1.6.12

It 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.

Adapt your PATH variable to get the gnu version of the binutils:

$ export PATH=/usr/local/bin:$PATH

$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

Exact details might depend on what you've done with the system, which shell you're running and so on.

Check your GTK2 installation:

$ gtk-demo


gld

Possibly Intel (x86) architecture only

Gnu 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 (not documented). Solaris ld is in /usr/css/bin and gnu binutils has installed the link /usr/bin/ld :

# rm /usr/bin/ld

# ln -s /usr/css/bin/ld /usr/bin/ld

Note 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.

Get and Build Sources (Intel architecture)

$ svn co http://svn.freepascal.org/svn/fpc/trunk fpc

$ cd fpc

$ make clean all OPT="-Xn"

$ su

# make install INSTALL_PREFIX=/usr

/etc/fpc.cfg installed with 2.4.4 is fine for your new 2.5.1 installation.

$ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus

$ cd lazarus

$ make clean all OPT="-Xn -k-L/usr/local/lib" FPC=/usr/lib/fpc/2.5.1/ppc386




Get and Build Sources (SPARC architecture)

This 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.

In the FPC sources, make sure that Makefile.fpc includes iconvenc and gtk2, if necessary running fpcmake to ensure changes "stick". As a minimum:

dirs_solaris=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
              libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib fcl-extra \
              imlib utmp  fpgtk xforms fftw pcap ggi  openssl gnome1 httpd13 httpd20 httpd22 numlib iconvenc gtk2 cairo

$ cd fpc

$ gmake NOGDB=1 OPT='-O- -gl' all

$ su

# make install

# rm /usr/local/bin/ppcsparc

# ln -s /usr/local/lib/fpc/2.4.4/ppcsparc /usr/local/bin/ppcsparc

# exit

/etc/fpc.cfg installed with 2.4.4 is fine for your new 2.5.1 installation.


SPARC stuff to be continued


$ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus

$ cd lazarus

$ make clean all OPT="-Xn -k-L/usr/local/lib" FPC=/usr/lib/fpc/2.5.1/ppc386




Solaris 11 Express

Dependencies

Depending 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.

gld

solaris ld is already installed in /usr/bin. The use of -Xn is still mandatory.