Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 80437 invoked from network); 30 Aug 2002 15:17:37 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Aug 2002 15:17:37 -0000 Received: (qmail 26657 invoked by uid 97); 30 Aug 2002 15:17:12 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 26621 invoked by uid 97); 30 Aug 2002 15:17:11 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 28850 invoked by uid 98); 30 Aug 2002 14:52:52 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Subject: Compiling mod_jk, mod_jk2 on Solaris To: tomcat-user@jakarta.apache.org X-Mailer: Lotus Notes Versione 5.0.4 Giugno 30, 2000 Message-ID: From: gabriele.garuglieri@infoblu.it Date: Fri, 30 Aug 2002 16:52:22 +0200 X-MIMETrack: Serialize by Router on ntsinfi04/infoblu/it(Release 5.0.6a |January 17, 2001) at 08/30/2002 04:52:25 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N For anyone who may be interested, i have managed to compile mod_jk and mod_jk2 of jakarta-tomcat-connectors-4.1.9 for apache 2.0.39 under Solaris 2.8, using both configure and ant methods. The tools used were: ant 1.5 gcc 2.95.2 libtool 1.4.2 Autoconf 2.53 automake 1.6 JDK 1.4.0_01 If you download libtool package from one of the sunfreeware sites, i don't know in what environment it was built, but it produces wrong flags for ld and the link phase will fail. Libtool to produce reliable results is highly sensitive to the environment so in any case i suggest to start with source and build it on your machine. Here's what i did. I'm assuming jakarta-tomcat-connectors-4.1.9-src/jk as base directory, so any reference will be relative to this. ** mod_jk, configure method ** This compiles right out of the box so within native dir i run buildconf.sh then ./configure \ --with-apxs=/usr/local/apache2/bin/apxs \ --with-java-home=${JAVA_HOME} \ --with-java-platform=2 \ --enable-jni then make and that's it. ** mod_jk2, configure method ** Here things start to complicate. native2/include/jk_global.h includes sys/ioctl.h that to expand correctly in solaris needs the BSD_COMP define to be set. So as the easy option you can buildconf.sh ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-tomcat41=/usr/local/jakarta-tomcat-4.1.9 \ --with-java-home=${JAVA_HOME} \ --with-java-platform=2 \ --with-jni make CPPFLAGS=-DBSD_COMP Otherwise if you are really brave you can modify support/jk_apxs.m4 changing the following two lines APXS$1_CFLAGS="`${APXS$1} -q CFLAGS` `${APXS$1} -q EXTRA_CFLAGS`" APXS$1_CPPFLAGS="`${APXS$1} -q EXTRA_CPPFLAGS`" into APXS$1_CFLAGS="`${APXS$1} -q CFLAGS` `${APXS$1} -q EXTRA_CFLAGS` ${CFLAGS}" APXS$1_CPPFLAGS="`${APXS$1} -q EXTRA_CPPFLAGS` ${CPPFLAGS}" This allow to pass additional CFLAGS and CPPFLAGS during the configure step that will be merged with those produced by configure and apxs. After this, again buildconf.sh ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-tomcat41=/usr/local/jakarta-tomcat-4.1.9 \ --with-java-home=${JAVA_HOME} \ --with-java-platform=2 \ --with-jni \ CPPFLAGS=-DBSD_COMP make I know that for this the first line of jk_apxs.m4 is not really needed to be modified, but i have included it as a nice to have suggestion for the developers. *** mod_jk, ant method *** WARNING: be aware that running ./configure into native or native2 dirs rewrites build.properties, so if you customize it remember to save it if you ever think to use ./configure. (i learned it the hard way) Here you need to customize build.properties as indicated in the README then add the following lines: build.native.cc=gcc the compiler defaults to cc so if you don't have installed Sun official compiler or have an alias or link from cc to gcc you need the previous line. solaris=true j2sdk1.4.0_01/include/jni.h includes the platform dependent jni_md.h that for solaris is in j2sdk1.4.0_01/include/solaris, so to allow the include to succeed you should modify native/build.xml adding to the "apache20" and "jni" targets where the comment says the following line build.native.extra_cflags=-pthreads -DNO_DBM_REWRITEMAP -DSOLARIS2=8 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DBSD_COMP (this is broken in the mail but it must be a single line) The values in this line are those used in my compilation but you should get yours as the merge of the output of these commands /bin/apxs -q CFLAGS /bin/apxs -q EXTRA_CFLAGS /bin/apxs -q EXTRA_CPPFLAGS plus the -DBSD_COMP define as previuosly explained. (in the output of those commands you will possibly find "-g" and "-O" flags if they were set when apache was compiled. You should not use them since they are controlled by so.debug and so.optimize properties) This is needed because apacheConfig, that will extract those options from apxs, is not yet working and if you want to compile with the same options as the configure method you need to extract them manually from apxs. After this from jk dir just run ant native *** mod_jk2, ant method *** Running ant native actually builds both mod_jk and mod_jk2. For jk2 there would be no need to add solaris=true line into build.properties nor to modify native2/build.xml because into it already are steps necessary to guess os and set the necessary includes, but since the native target is always executed before you need to add this line. Otherwise you can split the native target as follows The same consideration apply to the -DBSD_COMP option added to the build.native.extra_cflags property. It is only needed to compile jk2 but without splitting the native target you need to set it also when compiling jk. To conclude, if i'm allowed to make another suggestion to the developers, it would be very nice if you could extend the guess.os target to the native build and split the native target as above. I hope my english has not confused everything Thanks for the great work you are doing. Gabriele. gabriele.garuglieri@infoblu.it 055-420 2832 388-9473323 -- To unsubscribe, e-mail: For additional commands, e-mail: