Hi,

I have started a configure.in and makefile(s).in for the
jakarta-tomcat-connectors.
Currently I have just prepared it for Apache2.0 and Apache1.3, before going on I
have some questions:

- The idea is to have one configure.in in
jakarta-tomcat-connectors/jk/src/native and a makefile.in for each supported
WebServer. Does it sound Ok?

- Should I already think of using APR? - Just that some of my plateform are not
(yet) supported and I am reluctant of adding more #idef in the code -

- What should I do with the other WebServers (netscape, jni etc)?

The configure.in assumes that the Apache connectors sub-directories are
apache-1.3 and apache-2.0. I think that more consistant with mod_webapp.

Please, have a look to the attached files and make comments :=) 

Cheers

Jean-frederic
SUBDIRS = @WEBSERVER@

all:
        target="all"; \
        list='$(SUBDIRS)'; \
        for i in $$list; do \
            echo "Making $$target in $$i"; \
            if test "$$i" != "."; then \
               (cd $$i && $(MAKE) $$target) || exit 1; \
            fi; \
        done;
dnl
dnl Process this file with autoconf to produce a configure script
dnl

AC_PREREQ(2.13)
AC_INIT(common/jk_ajp13.h)

AC_PROG_CC

AC_PATH_PROG(TEST,test,$PATH)dnl
AC_SUBST(TEST)

AC_PATH_PROG(RM,rm,$PATH)dnl
AC_SUBST(RM)

WEBSERVER=""
AC_ARG_WITH(apxs,
[  --with-apxs[=FILE]      Build shared Apache module. FILE is the optional
                        pathname to the apxs tool; defaults to finding
                        apxs in your PATH.],
[
    case "${withval}" in 
        y | yes | true) find_apxs=true ;;
        n | no | false) find_apxs=false ;;
        *) find_apxs=false ;;
    esac

    if ${TEST} ${find_apxs} ; then    
        AC_MSG_RESULT([need to check for Perl first, apxs depends on it...])
        AC_PATH_PROG(PERL,perl,$PATH)dnl
    
        if ${TEST} ${find_apxs} ; then
            APXS=${withval}
        else
            AC_PATH_PROG(APXS,apxs,$PATH)dnl
        fi
    
        if ${TEST} -n "${APXS}" ; then
            dnl Seems that we have it, but have to check if it is OK first        
            if ${TEST} ! -x "${APXS}" ; then
                AC_MSG_ERROR(Invalid location for apxs: '${APXS}')
            fi
            
            $APXS -q PREFIX >/dev/null 2>/dev/null || apxs_support=false
    
            if ${TEST} "${apxs_support}" = "false" ; then
                AC_MSG_RESULT(could not find apxs)
                AC_MSG_ERROR(You must specify a valid --with-apxs path)
            fi

            dnl test apache version
            $RM -rf test
            $APXS -n test -g
            APA=`grep STANDARD20 test/mod_test.c`
            $RM -rf test
            if ${TEST} -z "$APA" ; then
                WEBSERVER="apache-1.3"
            else
                WEBSERVER="apache-2.0"
            fi
            AC_MSG_RESULT([building connector for \"$WEBSERVER\"])
    
            AC_SUBST(APXS)
        fi
    fi
],
[
        AC_MSG_RESULT(no apxs given)
])

if ${TEST} -z "$WEBSERVER" ; then
        AC_MSG_ERROR(Cannot find the WebServer)
fi

AC_SUBST(WEBSERVER)

AC_OUTPUT([
        Makefile
        $WEBSERVER/Makefile
        ])
## configure should make the Makefile out of this file.

APXS=@APXS@

JK=../common/
SRCS=${JK}/jk_ajp12_worker.c ${JK}/jk_connect.c ${JK}/jk_msg_buff.c ${JK}/jk_util.c 
${JK}/jk_ajp13.c \
     ${JK}/jk_jni_worker.c ${JK}/jk_pool.c ${JK}/jk_worker.c ${JK}/jk_ajp13_worker.c 
${JK}/jk_lb_worker.c \
     ${JK}/jk_sockbuf.c  ${JK}/jk_map.c ${JK}/jk_uri_worker_map.c          


all: mod_jk.so

mod_jk.so: 
        $(APXS) -I ${JK} -c -o $@ mod_jk.c $(SRCS) 

clean:
        rm *.o *.so
## 

APXS=@APXS@

JK=../common
SRCS=${JK}/jk_ajp12_worker.c ${JK}/jk_connect.c ${JK}/jk_msg_buff.c ${JK}/jk_util.c 
${JK}/jk_ajp13.c \
     ${JK}/jk_jni_worker.c ${JK}/jk_pool.c ${JK}/jk_worker.c ${JK}/jk_ajp13_worker.c 
${JK}/jk_lb_worker.c \
     ${JK}/jk_sockbuf.c  ${JK}/jk_map.c ${JK}/jk_uri_worker_map.c          

LSRCS=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          


all: mod_jk.so

mod_jk.so: 
        $(APXS) -I ${JK} ${JAVA_INCL} -c -o mod_jk.la mod_jk.c $(SRCS) 
        mv .libs/mod_jk.so .

clean:
        rm -f *.o *.so *.lo *.la *.slo ${JK}/*.o ${JK}/*.so ${JK}/*.lo ${JK}/*.la 
${JK}/*.slo
        rm -rf .libs

Reply via email to