I saw a similar post about Solaris and thought of a similar howto. I've heard of recent news (as in 2013) with the distribution and I learned I could easily update my initial OpenIndiana 151a7 release to hipster (0.5.11-0.151.1.8.1 to be more precise - you can check individual files in the distribution with the link). In this upcoming release, many things are different from what is explained in the old OpenIndiana wiki or the Illumos build howto and its "how to use gcc only" section because of the ownership of SunStudio etc. I've learned a long time ago that setting up an environment for development, or simply to compile a few things like I do, involves more than just having the right software. It's a lot about configuration and information - and development skills when you do develop software.
Extra repositories need to be configured to access extra packages:
$ pkg set-publisher -p http://pkg.openindiana.org/sfe
and the encumbered one if applicable
pkg set-publisher -p http://pkg.openindiana.org/sfe-encumbered
On a clean install, I've settled for these 2 big metapackages (about 600mb of downloads total, some few GBs installed) and a few things which appeared appropriate when I compiled fvwm:
sudo pkg install pkg://email@example.com,5.11-0.151.1.8.1:20130803T052718Z sudo pkg install sunstudio12u1 sudo pkg install pkg:/firstname.lastname@example.org sudo pkg install pkg:/email@example.com sudo pkg install pkg://firstname.lastname@example.org,5.11-0.151.1.5:20120805T091919Z
Build-essential contains mostly everything you need including but not limited to:
pkg install -v pkg:/archiver/gnu-tar pkg:/compress/p7zip pkg:/compress/unzip \ pkg:/developer/build/ant pkg:/developer/build/autoconf pkg:/developer/build/automake-110 \ pkg:/developer/build/gnu-make pkg:/developer/build/libtool pkg:/developer/build/make \ pkg:/developer/gnome/gettext pkg:/developer/java/jdk \ pkg:/developer/java/junit pkg:/developer/lexer/flex pkg:/developer/macro/cpp \ pkg:/developer/macro/gnu-m4 pkg:/developer/object-file pkg:/developer/parser/bison \ pkg:/file/gnu-coreutils pkg:/file/gnu-findutils \ pkg:/library/libtool/libltdl pkg:/library/libxslt pkg:/library/pcre \ pkg:/system/library/math/header-math pkg:/text/gawk \ pkg:/text/gnu-diffutils pkg:/text/gnu-gettext pkg:/text/gnu-grep \ pkg:/text/gnu-patch pkg:/text/gnu-sed pkg:/text/groff \ pkg:/text/texinfo pkg:/library/neon pkg:/library/apr-util-13 \ pkg:/developer/library/lint pkg:/system/header pkg:/developer/build/onbld \ pkg:/data/docbook \ pkg:/library/glib2 \ pkg:/library/libxml2 \ pkg:/library/libxslt \ pkg:/library/nspr/header-nspr \ pkg:/library/perl-5/xml-parser \ pkg:/system/library/install \ pkg:/system/library/dbus \ pkg:/system/library/libdbus \ pkg:/system/library/libdbus-glib \ pkg:/library/python-2/python-extra-26 \ pkg:/system/library/mozilla-nss/header-nss
gcc 4.7.3 is the latest available in the hipter branch (pkg://email@example.com,5.11-0.151.1.8.1:20130802T223703Z).
There is also the gcc-dev and ss-dev metapackages but I'm not sure to what extent they'd add anything to what I have now.
Configuration (highlights from my .bashrc file)
In some cases there might be a need to use another version of gcc than 4.7 but for now I'm using the latest available and have been relying on some suggested configuration from both the OpenIndiana and Illumos site, doing the best I could:
[...] CW_GCC_DIR="/usr/gcc/4.7/bin/"; export CW_GCC_DIR GCC_ROOT="/usr/gcc/4.7"; export GCC_ROOT ONBLD_TOOLS="/opt/onbld"; export ONBLD_TOOLS ONLY_LINT_DEFS="-I/sunstudio12.1/prod/include/lint"; export ONLY_LINT_DEFS __GNUC=""; export __GNUC amd64_LINT="/opt/sunstudio12.1/bin/lint"; export amd64_LINT i386_LINT="/opt/sunstudio12.1/bin/lint"; export i386_LINT PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/opt/onbld/bin:/opt/onbld/bin/i386:/opt/sfw/bin:/usr/sfw/bin:/usr/dt/bin:/usr/openwin/bin:/usr/sbin:/usr/gnu/bin/:/usr/sbin/:/sbin:/usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/dt/bin:/usr/gnu/bin/"; export PATH
The challenge may be great, even for a developer, which I am not. After configuring my environment, I try to compile fvwm 2.6.5 because it's something standard, it's small and is sort of a landmark piece of software I'm interested in... to see what gives. Trying to improve on the features afforded by the configuration, I thought I had an issue and had to compile glib from source. So I came across this amazing account from this obviously very knowledgeable person who actually compiled this on OI. I realized I didn't need to install any further glib package, but this person maintains a repository of ported compiled software and that can be quite useful considering some of the complexity...
Common Build Environment
In the old section of the wiki on building the OI OS proper, there's reference to this tool called CBE 1.7.0. It cannot be installed at this point because it requires SUNWperl510core and force installing this will ruin your acl in my experience. When I succeeded in installing it, I'll admit to having no clue whatsoever on how to use that as it's way over my head and I wish I knew if this can simplify something when compiling userland stuff. What I know is that in the latest releases you have a mini-version of it 1.8.0 (pkg://firstname.lastname@example.org,5.11-0.151.1.8:20130305T143840Z) so I installed that which doesn't require the old perl dependency. Still nowhere near grasping what it's about (I'll have to read about specs and such) but it's there. I see some 2013 dated thread in the mailing list in the context of contributing SFE packages and pkgbuild.
- I was able to build fvwm 2.6.5 easily but does my setup look like a minimally acceptable build environment and is there anything specific that doesn't comply with best practices here?
References and links
: http://openindiana.org/pipermail/oi-dev/2013-May/002109.html : http://pkg.openindiana.org/hipster/en/index.shtml : http://wiki.openindiana.org/oi/Compiler+Migration : http://wiki.illumos.org/display/illumos/How+To+Build+illumos : http://wiki.illumos.org/display/illumos/How+To+Build+illumos#HowToBuildillumos-BuildingwithGCC-444iewithoutSunStudio : http://docs.oracle.com/cd/E23824_01/html/E21802/ips_intro.html#scrolltoc : http://docs.oracle.com/cd/E19963-01/html/820-6572/managepkgs.html : http://wiki.openindiana.org/oi/Spec+Files+Extra+Repository : http://www.fvwm.org/download/ : http://www.openindiana.co.uk/tags/c-standards : http://www.openindiana.co.uk/content/repository-update-73-new-packs : https://www.illumos.org/projects/openindiana/issues?page=1 : http://openindiana.org/mailman/listinfo : http://wiki.openindiana.org/oi/Setting+up+the+recommended+build+environment : http://comments.gmane.org/gmane.os.openindiana.devel/1887 : http://sourceforge.net/apps/mediawiki/pkgbuild/index.php?title=Pkgbuild_on_OpenSolaris : http://i.stack.imgur.com/xSB2n.png : https://blogs.oracle.com/JeffV/entry/comparing_solaris_11_zones_to : http://ptribble.blogspot.ca/2013/05/sparse-root-zones-in-tribblix.html : http://tribblix.blogspot.co.uk/ : http://unixed.com/blog/2013/02/the-solaris-11-immutable-zone/ : http://www.logiqwest.com/dataCenter/Demos/RunBooks/Zones/createBasicZone.html : http://www.oracle.com/technetwork/server-storage/solaris/solaris-dtrace-wp-167895.pdf : http://www.oracle.com/technetwork/server-storage/solaris11/documentation/solaris-11-cheat-sheet-1556378.pdf