Date: Sat, 10 Mar 2001 08:42:24 +1030 From: Greg Lewis <glewis@eyesbeyond.com> To: Daichi GOTO <daichi@ongs.gr.jp> Cc: Tim Zingelman <zingelman@fnal.gov>, freebsd-java@FreeBSD.ORG Subject: Re: Tomcat for BSD (was: RE: Trying to Create a simple Bean) Message-ID: <20010310084224.B64357@misty.eyesbeyond.com> In-Reply-To: <84744572.984140838459.JavaMail.daichi@localhost>; from daichi@ongs.gr.jp on Fri, Mar 09, 2001 at 09:27:18PM %2B0900 References: <Pine.GSO.4.30.0103081437590.15709-400000@nova.fnal.gov> <84744572.984140838459.JavaMail.daichi@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 09, 2001 at 09:27:18PM +0900, Daichi GOTO wrote: > (snip) > > You will also need to build a mod_jk.o shared library to hook tomcat to > > apache... here's the diff to the makefile included in the apache tarball: > > jakarta-tomcat-3.2.1-src.tar.gz > (snip) > > jakarta-tomcat-3.2.1-src/src/native/apache1.3/Makefile.freebsd > > > (snip) > > +OS=linux > > +APXS=/usr/local/sbin/apxs > (snip) > > -CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT > > -pthread -DLINUX -Wall > > +CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -pthread -DFREEBSD > > -Wall > (snip) > > %.o: ../jk/%.c > > - ${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} $< -o $@ > > + ${CC} -c ${CFLAGS} ${JAVA_INCL} $< -o $@ > > > > .c.o: > > - ${APXS} -c ${JAVA_INCL} -DFREEBSD ${A13_FLAGS} -I../jk $< > > + ${APXS} -c ${JAVA_INCL} -DFREEBSD -I../jk $< > > Please teach me why your patch leads success to run apache-tomcat on FreeBSD. > I am wondering that your patch leads success without pthread install. > I have made patch to run apache-tomcat as follow: > > ------------ > diff -urP native/apache1.3/Makefile.orig native/apache1.3/Makefile > --- native/apache1.3/Makefile.orig Thu Jan 1 09:00:00 1970 > +++ native/apache1.3/Makefile Sun Mar 4 03:42:30 2001 > @@ -0,0 +1,39 @@ > +## You need to edit this file - configure later :-) > + > +#APACHE_HOME=/usr/local/apache > +OS=freebsd > +APXS=/usr/local/sbin/apxs > + > +A13_FLAGS=-I/usr/local/include/apache > + > +## I assume this one is set up already > +JAVA_HOME=/usr/local/jdk1.2.2 > + > +JAVA_INCL=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/${OS} > +JAVA_LIB=-L${JAVA_HOME}/jre/lib/${ARCH} -L${JAVA_HOME}/lib/${ARCH}/native_threads > + > +CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall > + > +JK=../jk/ > +SRCS=jk_ajp12_worker.c jk_connect.c jk_msg_buff.c jk_util.c jk_ajp13.c \ > + jk_jni_worker.c jk_pool.c jk_worker.c jk_ajp13_worker.c jk_lb_worker.c \ > + jk_sockbuf.c jk_map.c jk_uri_worker_map.c > + > + > +OBJS=${patsubst %.c,%.o,${SRCS}} > + > +%.o: ../jk/%.c > + ${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} $< -o $@ > + > +.c.o: > + ${APXS} -c ${JAVA_INCL} -DFREEBSD ${A13_FLAGS} -I../jk $< > + > +all: mod_jk.so > + > +mod_jk.so: ${OBJS} mod_jk.o > + $(APXS) -L/usr/local/lib -lpthread -c -o mod_jk.so ${OBJS} mod_jk.o > + > +# $(CC) -shared -o mod_jk.so ${OBJS} mod_jk.o > + > +clean: > + rm *.o *.so > diff -urP native/jk/jk_util.c.orig native/jk/jk_util.c > --- native/jk/jk_util.c.orig Wed Dec 13 07:51:56 2000 > +++ native/jk/jk_util.c Sun Mar 4 03:42:21 2001 > @@ -90,6 +90,8 @@ > #define HUGE_BUFFER_SIZE (8*1024) > #define LOG_LINE_SIZE (1024) > > +#define fdatasync(param1) (fsync(param1)) > + > struct file_logger { > FILE *logfile; > }; > ------------ > > And this patch requres pth(/usr/deve/pth) before gmake all. And the mod_jk.so genereted > by above works fine. > But your patch do not requre pthead. But that works fine. Gah. You only need to change two lines. The first change allows you to set APACHE_HOME as an environment variable for wherever you have it installed. The second change means you don't need any thread packages and fixes the compile of jk_util.c (-DLINUX in Makefile.freebsd must be a bug). --- Makefile.freebsd.orig Sat Mar 10 08:32:57 2001 +++ Makefile.freebsd Sat Mar 10 08:34:24 2001 @@ -1,6 +1,6 @@ ## You need to edit this file - configure later :-) -APACHE_HOME=/usr/local/apache +APACHE_HOME?=/usr/local/apache OS=freebsd APXS=${APACHE_HOME}/bin/apxs @@ -12,7 +12,7 @@ JAVA_INCL=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/${OS} JAVA_LIB=-L${JAVA_HOME}/jre/lib/${ARCH} -L${JAVA_HOME}/lib/${ARCH}/native_threads -CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall +CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -DFREEBSD -Wall JK=../jk/ SRCS=jk_ajp12_worker.c jk_connect.c jk_msg_buff.c jk_util.c jk_ajp13.c \ -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Mobile: 0419 868 494 Information Technology Web : http://www.eyesbeyond.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010310084224.B64357>