OPTIONAL: Install the IBM Visual Age for C Compiler suitable for your release of AIX. The installable package is in standard AIX installp format on the CD. For Visual Age C 6.0 you will also need to license the compiler with the iFor License Manager, which is a HOWTO topic in and of itself.
Download GCC (if you are not using VaC), zlib, make, and OpenSSL RPM binaries and development files from IBM's AIX Toolbox for Linux page. Note that OpenSSL is on the Cryptographic Tools link on the right side of the site. Don't forget to grab the prngd binary if you are using AIX 4.3.3 or AIX 5.1.
Install the RPMs using the following commands as root. If your AIX does not have the rpm binary download the installp package and install it per IBM's site. The RPMs will install into /opt/freeware so make sure you have enough space there.
If you are using GCC, install/upgrade to the correct release from the downloaded RPM files:
# rpm |
Regardless of compiler, install the necessary library files:
# rpm |
OPTIONAL: Install the prngd RPM the same way if your system is AIX 5.1 or AIX 4.3.3.
# rpm |
Download and extract the Ruby 1.8.4 source distribution. Once downloaded, extract it into a suitable directory with the following:
# gunzip |
Prior to building the Ruby source code, the following environment changes must be enabled for the user who is building the Ruby Source:
GCC should already be in your PATH if you
installed them from the RPM files. You only need to update your path if your
GCC is installed in a non-standard location.
If you are using IBM's Visual Age for C Compilers change your
PATH so that the Visual Age for C Compiler is checked before
anything else (i.e. gcc). On my system I have GCC and VaC so it is vital that
the cc command comes from /usr/vac/bin or
/usr/ibmcxx/bin.
For VaC 6.0 and 7.0:
# export |
For VaC 5.0 or lower:
# export |
Set the CPPFLAGS environment variable
with:
For GCC:
# export |
For IBM's VaC:
# export |
Set the CC environment variable to use the
correct compiler:
For GCC:
# export |
For IBM's VaC:
# export |
Before starting this section be sure to correctly set your
PATH, CC, and
CPPFLAGS as described in the previous sections, especially if
using IBM's Visual Age for C Compiler. Once you have verified your environment
settings proceed with the following steps.
OPTIONAL: For AIX 4.3.3 you will have to add custom macros that are missing in the sys/socket.h header file. AIX 5.1 and higher have these defined correctly.
The socket extension for Ruby is in directory: <build directory>/ruby-1.8.4/ext/socket. The file that needs the extra macro definitions is socket.c, so add the following macros anywhere after the #include lines in this file:
|
|
Build the Makefiles with the configure script:
For GCC:
# ./configure |
For IBM's VaC:
# ./configure |
Before invoking any builds, and after the configure script has been run, certain *.c source files need to me modified by having their #include <unistd.h> lines commented out with /* */. Simply edit each of the files listed below, search for unistd.h, and comment it out.
<build directory>/ext/openssl/ossl_ssl.c
<build directory>/ext/openssl/ossl_bio.c
<build directory>/ext/readline/readline.c
If you are building with GCC, the top-level
Makefile specifies an extra
-brtl for LDFLAGS. Edit the
Makefile and change the line that reads:
|
So that it reads:
|
Build the ruby.imp file that is missing from the Makefile as a dependency.
# gmake |
Invoke the main build with GNU Make. Be warned, it is not the cleanest build as there are a lot of warnings but it should complete successfully.
# gmake |
After successful compilation, test the Ruby build with:
# gmake |
Installation of the Ruby binaries is fairly straightforward; however, one thing that is often overlooked is the Ruby Documentation install for usage with ri. I have found several pre-packaged Linux Rubies that do not include it and it drives me nuts, so be good to yourself and install it.
Install your newly compiled Ruby binaries with the following:
# gmake |
Be sure to install the Ruby Documentation (RDoc) files with:
# gmake |