HOWTO: installing gmake, gcc, svn and git on OpenSolaris

Published: 2008-12-21
OpenSolaris is a cool OS, but it's lacking a lot of software packages present in all Linux distributions. This should improve gradually, but in the meantime, you probably will have to rebuild a lot of stuff from source.

However, some really basic tools are not installed by default:
Let's take care of this.

1) Installing GNU make

julien@opensolaris:~$ sudo pkg install SUNWgmake
DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 6/6 0.22/0.22
PHASE ACTIONS
Install Phase 31/31
PHASE ITEMS
Reading Existing Index 9/9
Indexing Packages 1/1
julien@opensolaris:~$ gmake
gmake: *** No targets specified and no makefile found. Stop.


2) Installing GNU C / C++

julien@opensolaris:~$ sudo pkg install SUNWgcc
DOWNLOAD PKGS FILES XFER (MB)
Completed 4/4 2086/2086 29.94/29.94
PHASE ACTIONS
Install Phase 2512/2512
PHASE ITEMS
Reading Existing Index 9/9
Indexing Packages 4/4
julien@opensolaris:~$ gcc
gcc: no input files

3) Installing Subversion

julien@opensolaris:~$ sudo pkg install SUNWsvn
DOWNLOAD PKGS FILES XFER (MB)
Completed 4/4 249/249 2.05/2.05
PHASE ACTIONS
Install Phase 372/372
PHASE ITEMS
Reading Existing Index 9/9
Indexing Packages 4/4
julien@opensolaris:~$ svn
Type 'svn help' for usage.

4) Installing Git

Let's build Git from source. You need to download the latest stable release from the Git homepage (1.6.0.6 at the time of writing):

julien@opensolaris:~$ wget http://kernel.org/pub/software/scm/git/git-1.6.0.6.tar.bz2
--20:23:40-- http://kernel.org/pub/software/scm/git/git-1.6.0.6.tar.bz2
=> `git-1.6.0.6.tar.bz2'
Resolving kernel.org... 149.20.20.133, 204.152.191.37
Connecting to kernel.org|149.20.20.133|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,882,225 (1.8M) [application/x-bzip2]
100%[====================================>] 1,882,225 126.47K/s ETA 00:00
20:23:55 (122.96 KB/s) - `git-1.6.0.6.tar.bz2' saved [1882225/1882225]

julien@opensolaris:~$ bzip2 -d git-1.6.0.6.tar.bz2
julien@opensolaris:~$ tar xvf git-1.6.0.6.tar
julien@opensolaris:~$ cd git-1.6.0.6
julien@opensolaris:~$ ./configure --prefix=/usr/local
julien@opensolaris:~$ gmake
julien@opensolaris:~$ sudo make install
julien@opensolaris:~$ git --version
git version 1.6.0.6

Done! Now we have a basic build environment on OpenSolaris :)

You also may want to check the 'GNU' section in the graphical Package Manager: it lists all GNU packages available for OpenSolaris, including automake, autoconf, etc.