tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian P Millett <...@ec-group.com>
Subject Makefiles for static compile of mod_jk & apache contrib
Date Tue, 26 Sep 2000 15:09:10 GMT
Well, Here are some items you all might be able to use for users like me who need a staticly
compiled Apache.

I am using Solaris 8 x86, Apache/1.3.12 (Unix) mod_perl/1.24 secured_by_Raven/1.5.2,
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode),
gcc version 2.95.2 19991024 (release)
I did this with tomcat 3.2b5

1) created a dir <apache>/src/modules/jk
2) copied all files from jakarta-tomcat/src/native/jk to <apache>/src/modules/jk
3) copied mod_jk.* files from jakarta-tomcat/src/native/apache1.3 to <apache>/src/modules/jk
4) created the following files

Makefile.tmpl (I'm sure these can/should be cleaned up)
----BEGIN--
##
##  Apache 1.3 Makefile template for Tomcat mod_jk
##  [src/modules/jk/Makefile.tmpl]
##
## You need to edit this file - configure later :-)
JAVA_HOME=/usr/java
##APACHE_HOME=/home/bpm/compile_area/apache/src
OS_NAME=solaris
OS_TYPE=unix

#   the parametrized target
LIB=jk.$(LIBEXT)

#   objects for building the static library
OBJS_LIB=libmod_jk.a

#   objects for building the shared object library
SHLIB_OBJS_LIB=libmod_jk.so

##A13_FLAGS=-I${APACHE_HOME}/include -I${APACHE_HOME}/os/${TYPE}

## I assume this one is set up already
# JAVA_HOME=

JAVA_INCL=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/${OS_NAME}
JAVA_LIB=-L${JAVA_HOME}/jre/lib/${ARCH} -L${JAVA_HOME}/lib/${ARCH}/native_threads

JK_CFLAGS=-DHAVE_CONFIG_H -g -fpic  -DSHARED_MODULE -O2 -D_REENTRANT -DSOLARIS

##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: %.c
 ${CC} -c ${CFLAGS} ${JK_CFLAGS} ${JAVA_INCL} ${INCLUDES} $< -o $@

.c.o:
 ${CC} -c ${CFLAGS} ${JK_CFLAGS} ${JAVA_INCL} ${INCLUDES} -I. $<

all: mod_jk.so libmod_jk.a lib

libmod_jk.a: ${OBJS} mod_jk.o
 -rm -f libmod_jk.a
 ${AR} cru libmod_jk.a ${OBJS} mod_jk.o
 ${RANLIB} libmod_jk.a

mod_jk.so: ${OBJS} mod_jk.o
 $(CC) -shared -o mod_jk.so ${OBJS} mod_jk.o

lib: $(LIB)

#   static library
jk.a: $(OBJS_LIB)
 cp $(OBJS_LIB) libjk.a
 $(RANLIB) $@

#   shared library
jk.so: $(SHLIB_OBJS_LIB)
 cp $(SHLIB_OBJS_LIB) libjk.so


.SUFFIXES: .o .so

# nothing to clean from here
clean:
 rm -f *.o *.so *.a



# no dependencies
depend:
 true

#Dependencies

$(LIB): Makefile

# DO NOT REMOVE
--END--

jk.module
--BEGIN--
Name: jk_module
ConfigStart
 CFLAGS="$CFLAGS -DMOD_JK"
ConfigEnd
--END--

5) Configured apache as follows (Yes, this is for modperl & raven, but you get the point)
CC="gcc" \
LIBS="-lrt" \
./configure \
"--prefix=/opt/apache" \
"--with-layout=GNU" \
"--activate-module=src/modules/perl/libperl.a" \
"--activate-module=src/modules/jk/libjk.a" \
"--activate-module=src/modules/raven_ssl/libraven_ssl.a" \
"--enable-module=most" \
"--enable-module=auth_dbm"

And so now I have an apache/tomcat/modperl/raven server

Also, here is a Makefile.solaris for the jakarta-tomcat/src/native/apache1.3 src.  This worked
just
fine to create the libraries

Makefile.solaris
--BEGIN--
## You need to edit this file - configure later :-)
JAVA_HOME=/usr/java
APACHE_HOME=/home/bpm/compile_area/apache/src
OS=solaris
TYPE=unix
RANLIB=/bin/true

A13_FLAGS=-I${APACHE_HOME}/include -I${APACHE_HOME}/os/${TYPE}

## I assume this one is set up already
# JAVA_HOME=

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 -DSOLARIS

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:
 ${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} -I../jk $<

all: mod_jk.so libmod_jk.a

libmod_jk.a: ${OBJS} mod_jk.o
 -rm -f libmod_jk.a
 ${AR} cru libmod_jk.a ${OBJS} mod_jk.o
 ${RANLIB} libmod_jk.a

mod_jk.so: ${OBJS} mod_jk.o
 $(CC) -shared -o mod_jk.so ${OBJS} mod_jk.o

clean:
 rm *.o *.so
--END--
--
Brian Millett
Enterprise Consulting Group   "Shifts in paradigms
(314) 205-9030               often cause nose bleeds."
bpm@ec-group.com                           Greg Glenn



Mime
View raw message