Unix Technical Forum

FYI: Building various GPL Stuff on AIX

This is a discussion on FYI: Building various GPL Stuff on AIX within the AIX Operating System forums, part of the Unix Operating Systems category; --> This post and the replies by me shell provide some information about building some GPL apps for AIX 5.1. ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 09:18 AM
Hajo Ehlers
 
Posts: n/a
Default FYI: Building various GPL Stuff on AIX

This post and the replies by me shell provide some information about
building some GPL apps for AIX 5.1.
This post just by itself shell provide the base e.a the software
installed to build the packages and some environment hints.

I hope it will have some help for anybody building apps on AIX

1 )The following AIX RPM Package has been installed

AIX-rpm 5.1.0.51-4
Xaw3d 1.5-3
atk 1.4.0-1
atk-devel 1.4.0-1
autoconf 2.58-1
autoconf213 2.13-1
automake 1.7.9-1
bash 2.05b-1
bash-doc 2.05b-1
binutils 2.14-3
bison 1.875-2
bzip2 1.0.2-2
coreutils 5.0-2
cpio 2.5-1
cvs 1.11.17-2
diffutils 2.8.1-1
emacs 21.1-2
emacs-X11 21.1-2
emacs-el 21.1-2
emacs-leim 21.1-2
emacs-nox 21.1-2
expat 1.95.7-1
expect 5.34-8
findutils 4.1-3
flex 2.5.4a-6
fontconfig 2.2.2-3
freetype2 2.1.7-2
freetype2-devel 2.1.7-2
gawk 3.1.3-1
gcc 3.3.2-4
gcc-c++ 3.3.2-4
gdb 6.0-1
gdbm 1.8.3-1
gdbm-devel 1.8.3-1
gettext 0.10.40-1
glib 1.2.10-2
glib-devel 1.2.10-2
glib2 2.2.3-3
glib2-devel 2.2.3-3
grep 2.5.1-1
gtk+ 1.2.10-4
gtk+-devel 1.2.10-4
gtk2 2.2.4-1
gtk2-devel 2.2.4-1
hexedit 1.2.2-1
info 4.6-1
libgcc 3.3.2-5
libjpeg 6b-6
libpng 1.2.1-6
libpng-devel 1.2.1-6
libtiff 3.6.1-2
libtool 1.5-2
libungif 4.1.2-1
lsof 4.61-3
m4 1.4.1-1
make 3.80-1
openssl 0.9.7d-1
pango 1.2.5-1
pango-devel 1.2.5-1
perl 5.8.2-1
pkgconfig 0.15.0-1
popt 1.7-1
readline 4.3-1
readline-devel 4.3-1
rsync 2.6.2-1
screen 3.9.10-2
sudo 1.6.7p5-2
tar 1.14-1
tcl 8.3.3-8
tcsh 6.11-2
texinfo 4.6-1
tk 8.3.3-8
unzip 5.51-1
vim-X11 6.0.147-5
vim-common 6.0.147-5
vim-enhanced 6.0.147-5
wget 1.9-2
xemacs 21.1.14-1
xemacs-el 21.1.14-1
xemacs-info 21.1.14-1
xft 0.0-0
xrender 0.0-0
zip 2.3-3
zlib 1.2.1-2
zlib-devel 1.2.1-2

2) The following AIX adt Packages has been installed
X11.adt.ext 5.1.0.26
X11.adt.imake 5.1.0.15
X11.adt.include 5.1.0.0
X11.adt.lib 5.1.0.1
X11.adt.motif 5.1.0.0
bos.adt.base 5.1.0.55
bos.adt.data 5.1.0.0
bos.adt.debug 5.1.0.54
bos.adt.graphics 5.1.0.25
bos.adt.include 5.1.0.62
bos.adt.lib 5.1.0.35
bos.adt.libm 5.1.0.27
bos.adt.prof 5.1.0.63
bos.adt.prt_tools 5.1.0.0
bos.adt.samples 5.1.0.55
bos.adt.sccs 5.1.0.25
bos.adt.syscalls 5.1.0.50
bos.adt.utils 5.1.0.3
bos.net.nfs.adt 5.1.0.50
bos.net.tcp.adt 5.1.0.36
ldap.client.adt 3.2.2.0
memdbg.adt 4.4.3.1
memdbg.aix50.adt 4.4.3.4
xlC.adt.include 6.0.0.1

3)
PATH is changed to:
$ export PATH="/usr/local/bin:/opt/freeware/bin:$PATH"
This way the GNU tools are on front of the path and will be used

3)
The following Compiler has been installed
vac.C 6.0.0.13
vac.lic 6.0.0.0
vac.msg.en_US.C 6.0.0.2
vacpp.cmp.aix50.lib 6.0.0.12
vacpp.cmp.aix50.tools 6.0.0.1
vacpp.cmp.core 6.0.0.14
vacpp.cmp.include 6.0.0.12
vacpp.cmp.lib 6.0.0.0
vacpp.cmp.rte 6.0.0.0
vacpp.cmp.tools 6.0.0.12
vacpp.lic 6.0.0.0
vacpp.msg.en_US.cmp.core 6.0.0.8
vacpp.msg.en_US.cmp.tools 6.0.0.0
vac.C 6.0.0.13
vacpp.cmp.core 6.0.0.0

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 09:18 AM
Hajo Ehlers
 
Posts: n/a
Default Re: FYI: Building various GPL Stuff on AIX

Build Python 2.4.2 as an shared library application.

$ cd ./workbench
$ su

# Create build script

$ cat build.python <<EOF
#!/usr/bin/bash
APP=Python-2.4.2
rm -rf ./$APP # Wipeout last build
tar -xvf $APP.tar # unpack Python-2.4.2.tar

# speed up configure and gmake
export CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash

cd $APP
export LDFLAGS="-L/opt/freeware/lib -ltk8.3 -ltcl8.3 " # Needed for
tkinter support
../configure \
--with-gcc=xlc_r --without-cxx --with-thread \
--enable-debug \
--with-pydebug \
--disable-ipv6 \
--mandir=/usr/local/man \
--infodir=/usr/local/info \
&& gmake && gmake install
EOF


At this point we must build a shared lib python version.
Thanks alot to Ulrich Berning from DESY Hamburg/Germany for providing a
script to convert python to an shared library application.

Create conversion script

$ cat ./mkshared.python <<EOF

#!/bin/ksh
# Task: Create a shared/dynamic version of python

user=`whoami`
if [ $user != 'root' ]; then
echo "Try again as root ..."
exit 1
fi
case $1 in
-gcc)
cmd="gcc -o python_shared Modules/python.o \
-Wl,-bE:Modules/python.exp \
-L/usr/local/lib -lpython2.4 -lpthread -ldl -lm -lc"
;;
-xlc)
cmd="cc_r -o python_shared Modules/python.o \
-bE:Modules/python.exp \
-L/usr/local/lib -lpython2.4 -lpthread -ldl -lm -lc"
;;
*)
echo "Usage $0 -gcc|-xlc"
exit 0
;;
esac

echo "Creating temporary directory '.extract' ..."
mkdir -p .extract

echo "Creating a shared object from the static library ..."
ld -o .extract/shr.o libpython2.4.a -bnoentry \
-bM:SRE -bE:Modules/python.exp \
-H512 -T512 -lpthread -ldl -lm -lc
chmod 555 .extract/shr.o

echo "Creating shared library 'libpython2.4.so' ..."
ar vr libpython2.4.so .extract/shr.o

echo "Removing temporary directory '.extract' ..."
rm -rf .extract

echo "Installing shared library 'libpython2.4.so' as 'libpython2.4.a'
in /usr/local/lib ..."
slibclean
cp libpython2.4.so /usr/local/lib/libpython2.4.a
chmod 555 /usr/local/lib/libpython2.4.a
strip /usr/local/lib/libpython2.4.a
rm -f libpython2.4.so

echo "Linking new python executable with shared library ..."
eval $cmd

echo "Removing old executables in /usr/local/bin ..."
rm -f /usr/local/bin/python
rm -f /usr/local/bin/python2.4

echo "Installing new binary in /usr/local/lib ..."
cp python_shared /usr/local/bin/python2.4
strip /usr/local/bin/python2.4
chmod 755 /usr/local/bin/python2.4
ln -f /usr/local/bin/python2.4 /usr/local/bin/python
rm -f python_shared

echo "Calling dump -H on new executable to check the use of the shared
library ..."
dump -H /usr/local/bin/python2.4

echo "All done ..."
EOF

# Clean Up LIBPATH or verify its setting.
unset LIBPATH

# Change into Python build directory
cd ./Python-2.4.2

# Start the converstion script
.../mkshared.python -xlc

Now is /usr/local/bin/python an small executable which load
libpython2.4.so

hth
Hajo

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 09:18 AM
Hajo Ehlers
 
Posts: n/a
Default Python 2.4.2 on AIX 5.1 build with xlc

Build Python 2.4.2 as an shared library application.

$ cd ./workbench
$ su

# Create build script

$ cat build.python <<EOF
#!/usr/bin/bash
APP=Python-2.4.2
rm -rf ./$APP # Wipeout last build
tar -xvf $APP.tar # unpack Python-2.4.2.tar

# speed up configure and gmake
export CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash

cd $APP
export LDFLAGS="-L/opt/freeware/lib -ltk8.3 -ltcl8.3 " # Needed for
tkinter support
../configure \
--with-gcc=xlc_r --without-cxx --with-thread \
--enable-debug \
--with-pydebug \
--disable-ipv6 \
--mandir=/usr/local/man \
--infodir=/usr/local/info \
&& gmake && gmake install
EOF

At this point we must build a shared lib python version.
Thanks alot to Ulrich Berning from DESY Hamburg/Germany for providing a
script to convert python to an shared library application.

Create conversion script

$ cat ./mkshared.python <<EOF

#!/bin/ksh
# Task: Create a shared/dynamic version of python

user=`whoami`
if [ $user != 'root' ]; then
echo "Try again as root ..."
exit 1
fi
case $1 in
-gcc)
cmd="gcc -o python_shared Modules/python.o \
-Wl,-bE:Modules/python.exp \
-L/usr/local/lib -lpython2.4 -lpthread -ldl -lm -lc"
;;
-xlc)
cmd="cc_r -o python_shared Modules/python.o \
-bE:Modules/python.exp \
-L/usr/local/lib -lpython2.4 -lpthread -ldl -lm -lc"
;;
*)
echo "Usage $0 -gcc|-xlc"
exit 0
;;
esac

echo "Creating temporary directory '.extract' ..."
mkdir -p .extract

echo "Creating a shared object from the static library ..."
ld -o .extract/shr.o libpython2.4.a -bnoentry \
-bM:SRE -bE:Modules/python.exp \
-H512 -T512 -lpthread -ldl -lm -lc
chmod 555 .extract/shr.o

echo "Creating shared library 'libpython2.4.so' ..."
ar vr libpython2.4.so .extract/shr.o

echo "Removing temporary directory '.extract' ..."
rm -rf .extract

echo "Installing shared library 'libpython2.4.so' as 'libpython2.4.a'
in /usr/local/lib ..."
slibclean
cp libpython2.4.so /usr/local/lib/libpython2.4.a
chmod 555 /usr/local/lib/libpython2.4.a
strip /usr/local/lib/libpython2.4.a
rm -f libpython2.4.so

echo "Linking new python executable with shared library ..."
eval $cmd

echo "Removing old executables in /usr/local/bin ..."
rm -f /usr/local/bin/python
rm -f /usr/local/bin/python2.4

echo "Installing new binary in /usr/local/lib ..."
cp python_shared /usr/local/bin/python2.4
strip /usr/local/bin/python2.4
chmod 755 /usr/local/bin/python2.4
ln -f /usr/local/bin/python2.4 /usr/local/bin/python
rm -f python_shared

echo "Calling dump -H on new executable to check the use of the shared
library ..."
dump -H /usr/local/bin/python2.4

echo "All done ..."
EOF

# Clean Up LIBPATH or verify its setting.
unset LIBPATH

# Change into Python build directory
cd ./Python-2.4.2

# Start the converstion script
.../mkshared.python -xlc

Now is /usr/local/bin/python an small executable which load
libpython2.4.so

hth
Hajo

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 09:18 AM
Kevin Bowling
 
Posts: n/a
Default Re: FYI: Building various GPL Stuff on AIX

Hajo Ehlers wrote:
> This post and the replies by me shell provide some information about
> building some GPL apps for AIX 5.1.
> This post just by itself shell provide the base e.a the software
> installed to build the packages and some environment hints.
>
> I hope it will have some help for anybody building apps on AIX

Will you be creating a web site with this info? It would be nice to
find somewhere to reference when building GPL software.
Kevin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2008, 09:18 AM
Hajo Ehlers
 
Posts: n/a
Default Re: FYI: Building various GPL Stuff on AIX

Kevin Bowling wrote:
> Hajo Ehlers wrote:
> > This post and the replies by me shell provide some information about
> > building some GPL apps for AIX 5.1.
> > This post just by itself shell provide the base e.a the software
> > installed to build the packages and some environment hints.
> >
> > I hope it will have some help for anybody building apps on AIX


> Will you be creating a web site with this info? It would be nice to
> find somewhere to reference when building GPL software.
> Kevin


I have no thought about it at the moment. In some kind i misuse the NG
as a long term informational storage. The point with websites is for me
that they are often not known, or not reachable and not clusters and
user independend. So you will find this information even in a few years
no matter what i am doing at this time.

cu
Hajo

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-05-2008, 09:22 AM
Hajo Ehlers
 
Posts: n/a
Default Build Apache 2.0.55 on AIX 5.1 with vac V6

Have had no problem to build apache 2.0.55 on AIX 5.1 using IBM C/C++
Compiler v6
But you must configure Apache after the installation.
The slibclean is needed in case a library which shell be replaced is in
use.

Postrequistes:
1. Copy any needed *.conf.sample in /usr/local/apache2/conf
to *.conf

2. Configure the /usr/local/apache2/conf/httpd.conf to your
needs.
At least the group MUST be set. Otherwise Apache will not start on AIX
I have set the Group to: nobody in the httpd.conf

3 Start/test the http server
$ /usr/local/apache2/bin/apachectl start



Build and Install:

$ cd ./workbench
$ su

$ cat apache.build <<EOF
#!/usr/bin/bash
APP=httpd-2.0.55
rm -rf ./$APP
tar -xvf ${APP}.tar
cd $APP

# speed up configure and gmake
export CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash

export CC=cc_r
export CXX=xlC_r
../configure --prefix=/usr/local/apache2 \
--with-thread \
--enable-maintainer-mode \
--enable-debug \
--infodir=/usr/local/info \
--mandir=/usr/local/man \
--enable-mods-shared=most \
--enable-so \
--without-berkeley-db \
&& slibclean \
&& gmake \
&& slibclean \
&& gmake install

EOF

Run Buildscript
$ chmod +x build.apache
$ ./build.apache

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-05-2008, 09:27 AM
Hajo Ehlers
 
Posts: n/a
Default Re: Python 2.4.2 on AIX 5.1 build with xlc

Latest successfull build of python 2.4.2 on AIX 5.1 with xlc v6 and xlc
v5 using cc_r
See build and mkshared.python section for script details

Build with tkinter support , to disable tkinter support please change
the comment in the relevant section

$ cat build
#!/usr/bin/bash
set -e
APP=Python-2.4.2
rm -rf ./$APP
gtar -xvf $APP.tar

export CONFIG_SHELL=/bin/bash
export CONFIGURE_ENV_ARGS=/bin/bash

cd $APP
## For tkinter support/non support
#echo "INFO: Disable tkinter support"
# cp setup.py setup.py.ORIG
# sed 's/self.detect_tkinter(inc_dirs, lib_dirs)/# &/' setup.py.ORIG >
setup.py
echo " Enable tkinter support"
export LDFLAGS="-L/opt/freeware/lib -ltk8.3 -ltcl8.3 "

## Patches before configure
echo "INFO: Patches before configure runs:"
perl -pi -e "s|/usr/lpp/xlC/include/load.h|/usr/vacpp/include/load.h|;"
\
Python/dynload_aix.c configure.in configure

perl -pi -e "s|#include \"mappings_cn.h\"|#include
\"mappings_cn.h\"\n#undef hz|;" \
Modules/cjkcodecs/_codecs_cn.c

echo "INFO: Starting configure"
# --enable-debug \
# --with-pydebug \
export CFLAGS=" -D_LARGE_FILES "
export OPT="-O -qmaxmem=-1 $CFLAGS"
#export LIBS="-lC" # loadAndInit for IBM xlC_r

../configure \
--with-gcc=cc_r --without-cxx \
--without-pymalloc \
--with-thread \
--disable-ipv6 \
--mandir=/usr/local/man \
--infodir=/usr/local/info

echo "INFO: Starting gmake"
gmake

echo "INFO: Starting gmake install"
slibclean
gmake install

echo "INFO: Starting build shared python version"
slibclean
.../mkshared.python -xlc
cd -

echo "INFO: For testing the python installation execute:"
echo "cd /usr/local/lib/python2.4/test
ls test* | xargs -n1 python
cd - "

echo "End of $APP build "
---------------------------------------------------------------------------------------------------------------------------

!$ cat mkshared.python
#!/bin/ksh
# Task: Create a shared/dynamic version of python

user=`whoami`

if [ $user != 'root' ]; then
echo "Try again as root ..."
exit 1
fi

case $1 in
-gcc)
cmd="gcc -o python_shared Modules/python.o
-Wl,-bE:Modules/python.exp \
-L/usr/local/lib -lpython2.4 -lpthread -ldl -lm -lc"
;;
-xlc)
cmd="cc_r -o python_shared Modules/python.o
-bE:Modules/python.exp \
-L/usr/local/lib -lpython2.4 -lpthread -ldl -lm -lc"
;;
*)
echo "Usage $0 -gcc|-xlc"
exit 0
;;
esac


echo "Creating temporary directory '.extract' ..."
mkdir -p .extract

echo "Creating a shared object from the static library ..."
ld -o .extract/shr.o libpython2.4.a -bnoentry -bM:SRE \
-bE:Modules/python.exp -H512 -T512 -lpthread -ldl -lm -lc
chmod 555 .extract/shr.o

echo "Creating shared library 'libpython2.4.so' ..."
ar vr libpython2.4.so .extract/shr.o

echo "Removing temporary directory '.extract' ..."
rm -rf .extract

echo "Installing shared library 'libpython2.4.so' as 'libpython2.4.a'
in /usr/local/lib ..."
slibclean
cp libpython2.4.so /usr/local/lib/libpython2.4.a
chmod 555 /usr/local/lib/libpython2.4.a
strip /usr/local/lib/libpython2.4.a
rm -f libpython2.4.so

echo "Linking new python executable with shared library ..."
eval $cmd

echo "Removing old executables in /usr/local/bin ..."
rm -f /usr/local/bin/python
rm -f /usr/local/bin/python2.4

echo "Installing new binary in /usr/local/lib ..."
cp python_shared /usr/local/bin/python2.4
strip /usr/local/bin/python2.4
chmod 755 /usr/local/bin/python2.4
ln -f /usr/local/bin/python2.4 /usr/local/bin/python
rm -f python_shared

echo "Calling dump -H on new executable to check the use of the shared
library ..."
dump -H /usr/local/bin/python2.4
echo "All done ..."

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:47 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com