Andy Armstrong wrote:
> 
> jean-frederic clere wrote:
> >
> > Hi,
> >
> > I have prepared a patch for configure.in to generate JK_EXPOSED_VERSION and
> > JK_VERSION.
> > The result is a file named common/version.h:
> > +++
> > #define JK_EXPOSED_VERSION "mod_jk/1.2.0-dev"
> > #define JK_VERSION (((1) << 16) + ((2) << 8) +
> > (0))
> > +++
> > Any comments? - Otherwise I will commit it tomorrow -
> 
> Decimal fields might be more appropriate to the ranges of numbers
> expected, and I think Henri suggested an additional field for alpha,
> beta etc.

I have VERISRELEASE to mark that it is a developement version, I am not sure we
need the beta number. I would prefer to do it like httpd.
But will this be ok?
mod_jk/1.2.0-beta-01 (for the first beta)
mod_jk/1.2.0 (for the release version).

> 
> How about
> 
>   #define JK_DEV      0
>   #define JK_ALPHA    1
>   #define JK_BETA     2
>   #define JK_RELEASE 99
>   #define JK_MKVER(major, minor, sequence, type) \
>     ((major) * 1000000 + (minor) * 10000 + (sequence) * 100 + (type))
> 
>   #define JK_VERSION JK_MKVER(1, 2, 0, JK_DEV)
What about:
#ifdef RELEASE
#define JK_VERSION JK_MKVER(1, 2, 0, 99)
#else
#define JK_VERSION JK_MKVER(1, 2, 0, JK_BETA)

Hex is a copy + paste from Linux sources. Dec is more easy? - No problem - But I
like to  write 0x010200 and 0x110200 it is easy to see than 10200 and 110200.

> 
> >
> > Cheers
> >
> > Jean-frederic
> >
> > Andy Armstrong wrote:
> > >
> > > jean-frederic clere wrote:
> > > [snip]
> > > > > I'm categorically /not/ suggesting moving anything protocol specific
> > > > > into the Domino connector, but the interface to the protocol code is
> > > > > changing over time -- extra fields are being added and so on. I want the
> > > > > Domino code to work with both the current jk stuff and the legacy 3.2
> > > > > stuff is all.
> > > >
> > > > Yep, that is because it is a developement version ;-)
> > >
> > > Yes, I got that ;-)
> > >
> > > > > Maybe a specific example will explain what I'm talking about. Here's a
> > > > > bit of code that handles parsing the SSL keysize and passing it to the
> > > > > jk stuff. The field ssl_key_size wasn't available until recently so the
> > > > > I have to cope with that case too. Surely that isn't too evil is it?
> > > > >
> > > > >    #if FOR_TOMCAT >= TOMCAT400
> > > > >         /* Read the variable into a dummy variable: we do this for the
> > > > > side
> > > > >          * effect of reading it into workBuf.
> > > > >          */
> > > > >         GETVARIABLEINT("HTTPS_KEYSIZE", &dummy, 0);
> > > > >         if (workBuf[0] == '[')
> > > > >             s->ssl_key_size = atoi(workBuf+1);
> > > > >    #else
> > > > >         (void) dummy;
> > > > >    #endif
> > > >
> > > > Ok, I will put this version information in a commun include file named
> > > > version.h. (On Monday!).
> > > > Of course we will to have to document our internal API so that for each version
> > > > of mod_jk the connectors could know the parameters and the structures used by
> > > > the version.
> > >
> > > Thanks Jean. I don't think the documentation burden necessarily
> > > increases that much. I expect most people writing a new connector to
> > > start with the source of an existing one -- I certainly did -- that
> > > pretty much documents everything you need to know. Perhaps it would be
> > > enough to nominate one connector (mod_jk I guess) as 'state of the art'
> > > and direct connector implementors to it.
> > >
> > > --
> > > Andy Armstrong, Tagish
> >
> >   ------------------------------------------------------------------------
> > dnl
> > dnl Process this file with autoconf to produce a configure script
> > dnl
> > AC_REVISION($Id: configure.in,v 1.5 2001/06/14 14:38:13 jfclere Exp $)dnl
> >
> > AC_PREREQ(2.13)
> > AC_INIT(common/jk_ajp13.h)
> > AC_CONFIG_AUX_DIR(scripts/build/unix)
> >
> > dnl package and version.
> > PACKAGE=mod_jk
> > VERMAJOR=1
> > VERMINOR=2
> > VERFIX=0
> > dnl set VERISRELEASE to 1 when release (do not forget to commit!)
> > VERISRELEASE=0
> >
> > VERSION=${VERMAJOR}.${VERMINOR}.${VERFIX}
> >
> > AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
> >
> > dnl AM_PROG_LIBTOOL often causes problems.
> > dnl I have solved them once using aclocal --acdir=/usr/local/share/aclocal/
> > AM_PROG_LIBTOOL
> >
> > AC_PROG_CC
> >
> > AC_PROG_LD
> >
> > AC_PATH_PROG(TEST,test,$PATH)dnl
> > AC_SUBST(TEST)
> >
> > AC_PATH_PROG(RM,rm,$PATH)dnl
> > AC_SUBST(RM)
> >
> > AC_PATH_PROG(GREP,grep,$PATH)dnl
> > AC_SUBST(GREP)
> >
> > AC_PATH_PROG(ECHO,echo,echo,$PATH)dnl
> > AC_SUBST(ECHO)
> >
> > AC_PATH_PROG(SED,sed,$PATH)dnl
> > AC_SUBST(SED)
> >
> > AC_PATH_PROG(CP,cp,$PATH)dnl
> > AC_SUBST(CP)
> >
> > AC_PATH_PROG(MKDIR,mkdir,$PATH)dnl
> > AC_SUBST(MKDIR)
> >
> > dnl prepare the string and value for mod_jk version logic
> > JK_EXPOSED_VERSION=${PACKAGE}/${VERSION}
> > if ${TEST} ${VERISRELEASE} -eq 0 ; then
> >     JK_EXPOSED_VERSION=${JK_EXPOSED_VERSION}-dev
> > fi
> >
> > AC_SUBST(JK_EXPOSED_VERSION)
> > AC_SUBST(PACKAGE)
> > AC_SUBST(VERSION)
> > AC_SUBST(VERMAJOR)
> > AC_SUBST(VERMINOR)
> > AC_SUBST(VERFIX)
> >
> > WEBSERVER=""
> > apache_dir=""
> > apache_include=""
> > APXS="apxs"
> > 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)
> >
> >             dnl apache_dir and apache_include are also needed.
> >             apache_dir=`$APXS -q PREFIX`
> >             apache_include="-I`$APXS -q INCLUDEDIR`"
> >         fi
> >     fi
> > ],
> > [
> >         AC_MSG_RESULT(no apxs given)
> > ])
> >
> > dnl it is copied from the configure of JServ ;=)
> > dnl and adapted.
> >
> > apache_dir_is_src="false"
> > AC_ARG_WITH(apache,
> > [  --with-apache=DIR      Build static Apache module. DIR is the pathname
> >                         to the Apache source directory.],
> > [
> >     if ${TEST} ! -z "$WEBSERVER" ; then
> >         AC_MSG_ERROR([Sorry cannot use --with-apxs=${APXS} and 
>--with-apache=${withval} togother, please choose one of both])
> >     fi
> >
> >     AC_MSG_CHECKING([for Apache source directory (assume static build)])
> >
> >     if ${TEST} -n "${withval}" && ${TEST} -d "${withval}" ; then
> >         if ${TEST} -d "${withval}/src" ; then
> >            # handle the case where people use relative paths to
> >            # the apache source directory by pre-pending the current
> >            # build directory to the path. there are probably
> >            # errors with this if configure is run while in a
> >            # different directory than what you are in at the time
> >            if ${TEST} -n "`${ECHO} ${withval}|${GREP} \"^\.\.\"`" ; then
> >                withval=`pwd`/${withval}
> >            fi
> >
> >            apache_dir=${withval}
> >            apache_dir_is_src="true"
> >            AC_MSG_RESULT(${apache_dir})
> >
> >            AC_MSG_CHECKING(for Apache include directory)
> >
> >            if ${TEST} -d "${withval}/src/include" ; then
> >                # read osdir from the existing apache.
> >                osdir=`${GREP} '^OSDIR=' ${withval}/src/Makefile.config | ${SED} -e 
>'s:^OSDIR=.*/os:os:'`
> >                if ${TEST} -z "${osdir}" ; then
> >                    osdir=os/unix
> >                fi
> >                apache_include="-I${withval}/src/include \
> >                    -I${withval}/src/${osdir}"
> >                WEBSERVER="apache-1.3"
> >                AC_MSG_RESULT([${apache_include}, version 1.3])
> >            else
> >                AC_MSG_ERROR([Sorry Apache 1.2.x is no longer supported.])
> >            fi
> >         else
> >            if ${TEST} -d "${withval}/include" ; then
> >               # osdir for Apache20.
> >               WEBSERVER="apache-2.0"
> >               apache_dir=${withval}
> >               apache_dir_is_src="true"
> >               AC_MSG_RESULT(${apache_dir})
> >            fi
> >         fi
> >     fi
> >
> >     dnl Make sure we have a result.
> >     if ${TEST} -z "$WEBSERVER" ; then
> >         AC_MSG_ERROR([Directory $apache_dir is not a valid Apache source 
>distribution])
> >     fi
> >
> > # VT: Now, which one I'm supposed to use? Let's figure it out later
> >
> >     configure_apache=true
> >     configure_src=true
> >
> >     AC_MSG_RESULT([building connector for \"$WEBSERVER\"])
> > ],
> > [
> >         AC_MSG_RESULT(no apache given)
> > ])
> > AC_SUBST(apache_include)
> > APACHE_DIR=${apache_dir}
> > AC_SUBST(APACHE_DIR)
> >
> > dnl Check for enable-jni
> > JK_JNI_WORKER=""
> > AC_ARG_ENABLE(jni,
> > [  --enable-jni     Build jni_connect.so and enable jni_worker.],
> > [
> >     AC_MSG_RESULT(jni enable (need JDK))
> >     CFLAGS="${CFLAGS} -DHAVE_JNI"
> >     JK_JNI_WORKER="\${JK}/jk_jni_worker\${OEXT}"
> > ])dnl
> > AC_SUBST(JK_JNI_WORKER)
> >
> > dnl CFLAGS for EAPI mod_ssl (Apache 1.3)
> > dnl it also allows the CFLAGS environment variable.
> > CFLAGS="${CFLAGS}"
> > AC_ARG_ENABLE(
> > EAPI,
> > [  --enable-EAPI           Enable EAPI support (mod_ssl, Apache 1.3)],
> > [
> > case "${enableval}" in
> >     y | Y | YES | yes | TRUE | true )
> >         CFLAGS="${CFLAGS} -DEAPI"
> >         AC_MSG_RESULT([...Enabling EAPI Support...])
> >         ;;
> > esac
> > ])
> > AC_SUBST(CFLAGS)
> >
> > dnl the APXSCFLAGS is given by apxs to the C compiler
> > dnl the APXSLDFLAGS is given to the linker (for APRVARS).
> > APXSLDFLAGS=""
> > APXSCFLAGS=""
> > if ${TEST} -n "${CFLAGS}" ; then
> >         APXSCFLAGS="${CFLAGS}"
> > fi
> > dnl the APXSLDFLAGS is normaly empty but APXSCFLAGS is not.
> > if ${TEST} -n "${LDFLAGS}" ; then
> >         APXSLDFLAGS="-Wl,${LDFLAGS}"
> > fi
> > AC_SUBST(APXSCFLAGS)
> > AC_SUBST(APXSLDFLAGS)
> >
> > if ${TEST} -n "${JK_JNI_WORKER}" ; then
> >
> > dnl Find the JDK
> > dnl Results go in JAVA_HOME
> > dnl Also sets JAVA_PLATFORM to 1 for 1.1 and to 2 for 1.2
> >
> > AC_MSG_CHECKING([for JDK location (please wait)])
> >
> > dnl The order is: --with-java-home first, environment second, guessed value third.
> >
> > dnl This is a safe default. Could screw up on the security features, but
> > dnl oh well, this is what --with-java2 is for.
> >
> > if ${TEST} -n "${JAVA_HOME}" ; then
> >         JAVA_HOME_ENV="${JAVA_HOME}"
> > else
> >         JAVA_HOME_ENV=""
> > fi
> > JAVA_HOME=""
> > JAVA_PLATFORM="1"
> >
> > AC_ARG_WITH(java-home,
> > [  --with-java-home=DIR     Where is your JDK root directory.],
> > [
> >
> >     # This stuff works if the command line parameter --with-java-home was
> >     # specified, so it takes priority rightfully.
> >
> >     JAVA_HOME=${withval}
> >
> >     if ${TEST} ! -d "${JAVA_HOME}" ; then
> >         AC_MSG_ERROR(Not a directory: ${JAVA_HOME})
> >     fi
> >
> >     AC_MSG_RESULT(${JAVA_HOME})
> >
> > ],
> > [
> >     # This works if the parameter was NOT specified, so it's a good time
> >     # to see what the enviroment says.
> >
> >     # Since Sun uses JAVA_HOME a lot, we check it first and ignore the
> >     # JAVA_HOME, otherwise just use whatever JAVA_HOME was specified.
> >
> >     if ${TEST} -n "${JAVA_HOME_ENV}" ; then
> >
> >         JAVA_HOME=${JAVA_HOME_ENV}
> >         AC_MSG_RESULT(${JAVA_HOME_ENV} from environment)
> >     fi
> > ])
> >
> > if ${TEST} -z "${JAVA_HOME}" ; then
> >
> >     # Oh well, nobody set neither JAVA_HOME nor JAVA_HOME, have to guess
> >
> >     # The following code is based on the code submitted by Henner Zeller
> >     # for ${srcdir}/src/scripts/package/rpm/ApacheJServ.spec
> >
> >     # Two variables will be set as a result:
> >     #
> >     # JAVA_HOME
> >     # JAVA_PLATFORM
> >     AC_MSG_CHECKING([Try to guess JDK location])
> >
> >
> >     for JAVA_PREFIX in \
> >             /usr/local \
> >             /usr/local/lib \
> >             /usr \
> >             /usr/lib \
> >             /opt  \
> >             /
> >     do
> >         for JAVA_PLATFORM in 3 2 1 ;
> >         do
> >
> >             for subversion in .9 .8 .7 .6 .5 .4 .3 .2 .1 "" ;
> >                 do
> >                     for VARIANT in IBMJava2- java java- jdk jdk-;
> >                     do
> >                         
>GUESS="${JAVA_PREFIX}/${VARIANT}1.${JAVA_PLATFORM}${subversion}"
> > dnl                        AC_MSG_CHECKING([${GUESS}])
> >                         if ${TEST} -d "${GUESS}/bin" \
> >                         && ${TEST} -d "${GUESS}/include" ; then
> >
> >                             JAVA_HOME="${GUESS}"
> >                             AC_MSG_RESULT([${GUESS}])
> >                             break
> >                         fi
> >
> >                     done
> >
> >                     if ${TEST} -n "${JAVA_HOME}" ; then
> >                         break;
> >                     fi
> >
> >                 done
> >
> >                 if ${TEST} -n "${JAVA_HOME}" ; then
> >                     break;
> >                 fi
> >
> >             done
> >
> >             if ${TEST} -n "${JAVA_HOME}" ; then
> >                 break;
> >             fi
> >
> >         done
> >
> >         if ${TEST} -n "${JAVA_HOME}" ; then
> >
> >             dnl Just to have the messages looking uniformly
> >
> >             AC_MSG_CHECKING(Java platform)
> >             AC_MSG_RESULT([guess ${JAVA_PLATFORM}])
> >         fi
> >
> >
> > else
> >
> >         AC_MSG_CHECKING(Java platform)
> >
> >         AC_ARG_WITH(java-platform,
> >         [  --with-java-platform=VAL Force the Java platorm
> >                           (value is 1 for 1.1.x or 2 for 1.2.x or greater)],
> >         [
> >             dnl This requires a bit of tweaking to be handled properly, but
> >             dnl the default is good enough
> >
> >             JAVA_PLATFORM="2"
> >         ])
> >
> >         AC_MSG_RESULT(forced Java ${JAVA_PLATFORM})
> >
> > fi
> > dnl end of JServ ;=)
> >
> > dnl test if --enable-jni give but not valid JAVA_HOME
> > if ${TEST} -z "${JAVA_HOME}" ; then
> >     AC_MSG_ERROR([JDK home not found, please specify one with --with-java-home 
>option (run ./configure --help for more options)])
> > fi
> >
> > dnl guess OS = OS_TYPE for jni_md.h
> > OS=""
> > AC_ARG_WITH(os-type,
> > [  --with-os-type[=SUBDIR]     Where is your JDK os-type subdirectory.],
> > [
> >     OS=${withval}
> >
> >     if ${TEST} ! -d "${JAVA_HOME}/${OS}" ; then
> >         AC_MSG_ERROR(Not a directory: ${JAVA_HOME}/${OS})
> >     fi
> > ],
> > [
> >     AC_MSG_CHECKING(os_type directory)
> >     if ${TEST} -f ${JAVA_HOME}/include/jni_md.h; then
> >         OS=""
> >     else
> >         for f in ${JAVA_HOME}/include/*/jni_md.h; do
> >             if ${TEST} -f $f; then
> >                 OS=`dirname ${f}`
> >                 OS=`basename ${OS}`
> >                 echo " ${OS}"
> >             fi
> >         done
> >         if ${TEST} -z "${OS}"; then
> >             AC_MSG_RESULT(Cannot find jni_md.h in ${JAVA_HOME}/${OS})
> >             AC_MSG_ERROR(You should retry --with-os-type=SUBDIR)
> >         fi
> >     fi
> > ])
> > fi
> > AC_SUBST(JAVA_HOME)
> > AC_SUBST(OS)
> >
> > dnl Check that  a WEBSERVER has been given
> > if ${TEST} -z "$WEBSERVER" ; then
> >         AC_MSG_ERROR(Cannot find the WebServer)
> > fi
> >
> > dnl Add common to subdir list
> > WEBSERVER="common ${WEBSERVER}"
> >
> > AC_SUBST(WEBSERVER)
> >
> > AM_CONDITIONAL(MAKE_DYNAMIC_APACHE, ${TEST} "${apache_dir_is_src}" = "false")
> >
> > dnl automake needs the path it does not work with $WEBSERVER
> > dnl that why useless Makefiles are build.
> > AC_OUTPUT([
> >         Makefile
> >         apache-1.3/Makefile
> >         apache-1.3/Makefile.apxs
> >         apache-2.0/Makefile
> >         apache-2.0/Makefile.apxs
> >         common/Makefile
> >         common/list.mk
> >         common/version.h
> >         ])
> 
> --
> Andy Armstrong, Tagish

Reply via email to