tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dibyendu Majumdar" <dibye...@mazumdar.demon.co.uk>
Subject Building mod_jk on AIX 4.3.3
Date Thu, 12 Sep 2002 22:15:23 GMT
I recently built mod_jk on AIX 4.3.3, and would like to share my experience
with you in the hope that it may be useful to some of you.

I used the following tool-set/platform:

gcc 2.95.2
gmake 3.79
automake 1.6
autoconf 1.53
m4 1.4
libtool 1.4.2
apache 1.3.26
jakarta tomcat 4.1.10
jakarta tomcat connectors 4.1.10
jakarta ant 1.4.1
java 1.3.0
perl 5.005_003
AIX 4.3.3

1. In my first attempt, I was unable to build mod_jk.so. As I investigated,
I discovered the following reason for it.

The build process invoked "cc" rather than "gcc", even though gcc was in the
path first. I worked around this problem by creating a symbolic link called
"cc" to "gcc".

2. I ran "ant native" from the jk sub-directory. However, this failed
eventually because my Java installation didnot have the JNI bits.

To ensure that I build only mod_jk and nothing else, I changed the build.xml
file in jk/native, as follows:

<project name="jk_native" default="apache13" basedir=".">

The build then failed trying to build native2. So I commented out the line
in jk/build.xml that builds native2 as follows:

    <!-- It's better to call it directly with individual tags -->
    <target name="native" depends="jkant,detect,report" >
        <ant  dir="native" antfile="build.xml"  />
        <!-- <ant  dir="native2" antfile="build.xml"  /> -->
    </target>

This time the build was successful. However, I could not find any mod_jk.so.
Instead, I found two files - libmod_jk.a, and mod_jk.la in
jk/build/jk/apache13 sub-directory. I also found the following files in the
jk/build/jk/apache13/.libs sub-directory :
libmod_jk.a
libmod_jk.exp
libmod_jk.so.0
mod_jk.la
mod_jk.lai

I manually copied libmod_jk.so.0 to apache/libexec/mod_jk.so, and tried
running (after appropriate changes to httpd.conf):

apachectl configtest

I got a coredmp as follows:

33 terptech[]/teur/cre/erptech/wrk/dibyendu/apache/bin: apachectl configtest
/teur/cre/erptech/wrk/dibyendu/apache/bin/apachectl[145]: 35908 Segmentation
fault(coredump)

At this point, I gave up on this approach and tried another route.

3. My next attempt was to build mod_jk using configure/make combination.
After a number of false starts (due to problems in my installation of
libtool and automake), I was able to execute following:

cd jk/native
./buildconf.sh
./configure --with-apxs=$APACHE_HOME/bin/apxs
make

The build succeeded but, I could find no mod_jk.so. When I looked in
jk/native/apache-1.3 sub-directory, I found:

libjk.a
libjk.la
libjk.module
libmod_jk.a
mod_jk.c
mod_jk.dsp
mod_jk.la
mod_jk.lo
mod_jk.o

At this point, I gave up this approach as well, and decided to try another.

4. My final attempt succeeded and this is what I did.

I decided to build mod_jk.so directly using apxs and bypass the make/ant
tools. I decided this because I found that the real problem was in "libtool"
which was broken and didnot know how to build shared libraries on AIX.
Hence, it was just not able to build mod_jk.so.

My first attempt was as follows:

cd jk/native/common
$APACHE_HOME/bin/apxs -c -o mod_jk.so -I. *.c ../apache-1.3/mod_jk.c

This failed to compile two files which appeared to be related to jni. I
removed these two files (jk_jni_worker.c  jk_jni_worker.h), and tried again.
This time, the link failed with errors. Apparently, the AIX linker expected
a .exp file containing a list of exported functions. Since I didnot have
this, I decided to try the following linker options:
-bexpall -berok -bnogc

I added these options to apxs, as follows:

my $CFG_LDFLAGS_SHLIB =
q(-bexpall -berok -bnogc -H512 -T512 -bhalt:4 -bM:SRE -b
noentry -bI:/teur/cre/erptech/wrk/dibyendu/apache/libexec/httpd.exp -lc); #
subs
tituted via Makefile.tmpl

I ran the apxs command again. It succeeded and finally built mod_jk.so.

I have tested mod_jk.so with the example servlets in tomcat - so far its
worked okay without any problems.

Regards
Dibyendu








--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message