Table of Contents
My build hosts
Compiling on AIX5L v5.1
- Main build host
- My main build host for AIX5L v5.1 is running AIX 5.1 ML 04.
- I use the IBM XL C/C++ compiler version 7 with all applicable patches for AIX 5.1 ML 04.
- Secondary build host (if the AIX on the main build host is too low-level, e.g., for some C++ stuff)
- My main build host for AIX5L v5.1 is running AIX 5.1 ML 09.
- I use the IBM XL C/C++ compiler version 7 with all applicable patches for AIX 5.1 ML 09.
Compiling on AIX5L v5.2
- My build host for AIX5L v5.2 is running AIX 5.2 ML 01.
- I use the IBM XL C/C++ compiler version 7 with all applicable patches for AIX 5.2 ML 01.
Compiling on AIX5L v5.3
- My build host for AIX5L v5.3 is running AIX 5.3 ML 01.
- I use the IBM XL C/C++ compiler version 7 with all applicable patches for AIX 5.3 ML 01.
Compiling on AIX v6.1
- My build host for AIX v6.1 is running AIX 6.1 TL 00.
- I use the IBM XL C/C++ compiler version 9 with all applicable patches for AIX 6.1 TL 00.
Compiling on AIX v7.1
- My build host for AIX v7.1 is running AIX 7.1 TL 00.
- I use the IBM XL C/C++ compiler version 11.1 with all applicable patches for AIX 7.1 TL 00.
IBM XLC/C++ vs. GCC
- I always try to use the IBM XL C/C++ compiler.
- Only if it is absolutely not possible to build the software with XLC/C++ I use GCC (e.g., lftp). The "drawback" is that this requires in most cases that libgcc must be installed on the system.
- Some exceptions exist, e.g., Perl is intentionally built with GCC.
Environment settings XL C/C++
- I always use the BASH shell (from this web site).
- For the different AIX versions I use exactly the environment settings listed below, i.e., you need to put those statements in you
.bashrc
so that they are activated.
- If any different settings are required they are explicitely specified in the SPEC file contained in the Source RPM (SRPM) file.
AIX5L v5.1:
export CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIG_ENV_ARGS=/opt/freeware/bin/bash
export CC=cc
export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
export CXX=xlC
export CXXFLAGS=$CFLAGS
export F77=xlf
export FFLAGS="-qmaxmem=16384 -O -I/opt/freeware/include"
export LD=ld
# for 32-bit applications
export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
# for 64-bit applications
export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib \
-Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
export PATH=/usr/bin:/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/vac/bin: \
/usr/vacpp/bin:/usr/ccs/bin:/usr/dt/bin:/usr/opt/perl5/bin:/opt/freeware/bin: \
/opt/freeware/sbin:/usr/local/bin:/usr/lib/instl
|
AIX5L v5.2:
Same as for AIX5L v5.1 except the definition of $CFLAGS
.
export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
|
AIX5L v5.3:
Same as for AIX5L v5.1 except the definition of $CFLAGS
.
export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
|
AIX v6.1:
Same as for AIX5L v5.1 except the definition of $CFLAGS
.
export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
|
AIX v7.1:
Same as for AIX5L v5.1 except the definition of $CFLAGS
.
export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
|
Environment settings GCC
- I always use the BASH shell (from this web site).
- For the different AIX versions I use exactly the environment settings listed below, i.e., you need to put those statements in your
.bashrc
so that they are activated.
- If any different settings are required they are explicitely specified in the SPEC file contained in the Source RPM (SRPM) file.
AIX5L v5.1:
export CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIG_ENV_ARGS=/opt/freeware/bin/bash
export CC=gcc
export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
export CXX=g++
export CXXFLAGS=$CFLAGS
export F77=xlf
export FFLAGS="-O -I/opt/freeware/include"
export LD=ld
# for 32-bit applications
export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
# for 64-bit applications
export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib \
-Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
export PATH=/usr/bin:/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/vac/bin: \
/usr/vacpp/bin:/usr/ccs/bin:/usr/dt/bin:/usr/opt/perl5/bin:/opt/freeware/bin: \
/opt/freeware/sbin:/usr/local/bin:/usr/lib/instl
|
AIX5L v5.2:
Same as for AIX5L v5.1 except the definition of $CFLAGS
.
export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
|
AIX5L v5.3:
Same as for AIX5L v5.1 except the definition of $CFLAGS
.
export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
|
AIX v6.1:
Same as for AIX5L v5.1 except the definition of $CFLAGS
.
export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
|
AIX v7.1:
Same as for AIX5L v5.1 except the definition of $CFLAGS
.
export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 \
-D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
|
Source code and SPEC files
Remarks
- I always provide the source code as well as all patches and the SPEC file. The only exception is GCC where the source code is linked directly to the GCC GNU website as this package is so big in size.
- All this is contained in the SRC RPM file that you find exactly on the same webpages as the binary RPM. Here are direct links to all
- The SRC RPM is installed in the same way as binary RPMs, e.g.,
rpm -ivh <package>-<version>.src.rpm
Afterwards you'll find the sources and patches in /opt/freeware/src/packages/SOURCES
and the SPEC file in /opt/freeware/src/packages/SPECS
.
- Here is an example how you can extract the
abc-1.2.3-1.src.rpm
SRC RPM file into a local directory tmp
:
mkdir tmp
cd tmp
rpm2cpio <path-to-SRPM>/abc-1.2.3-1.src.rpm | /opt/freeware/bin/cpio -idm
Note: You need GNU cpio as AIX cpio produces I/O errors.
Building the binary RPM file
- Start out in the directory
/opt/freeware/src/packages/SPECS
.
- Normally, I use the following command to generate the RPM (binary and source) packages:
rpm -ba <SPEC-file>
- However, whenever there is Perl somewhere involved I use the following command instead:
PATH=/opt/freeware/bin:$PATH rpm -ba <SPEC-file>
- To build only the binary RPM package:
rpm -bb <SPEC-file>
- To build only the SRC RPM package:
rpm -bs <SPEC-file>