tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgo...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/support jk_java.m4
Date Mon, 03 Nov 2003 09:49:58 GMT
hgomez      2003/11/03 01:49:58

  Modified:    jk/native2 configure.in
               jk/support jk_java.m4
  Log:
  Avoid checking for Java env if --with-jni is not specified in configure.
  
  Provided by Kurt Miller
  
  Revision  Changes    Path
  1.11      +3 -3      jakarta-tomcat-connectors/jk/native2/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/configure.in,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- configure.in	25 Sep 2003 15:23:23 -0000	1.10
  +++ configure.in	3 Nov 2003 09:49:58 -0000	1.11
  @@ -184,9 +184,9 @@
   
   dnl Java settings
   
  +JK_JNI()
   JK_JDK()
   JK_JDK_OS()
  -JK_JNI()
   JK_PCRE()
   
   AC_SUBST(JAVA_HOME)
  
  
  
  1.4       +141 -137  jakarta-tomcat-connectors/jk/support/jk_java.m4
  
  Index: jk_java.m4
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/support/jk_java.m4,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_java.m4	25 Sep 2003 15:23:56 -0000	1.3
  +++ jk_java.m4	3 Nov 2003 09:49:58 -0000	1.4
  @@ -71,73 +71,98 @@
   dnl 
   dnl --------------------------------------------------------------------------
   AC_DEFUN(
  +  [JK_JNI],
  +  [
  +    AC_ARG_WITH(jni,
  +      [  --with-jni               Build jni support],
  +      [
  +		case "${withval}" in
  +		  y | yes | true) use_jni=true ;;
  +		  n | no | false) use_jni=false ;;
  +	    *) use_jni=true ;;
  +	      esac
  +
  +		if ${TEST} ${use_jni} ; then
  +		  HAVE_JNI="-DHAVE_JNI"
  +		fi
  +      ])
  +  ])
  +
  +AC_DEFUN(
     [JK_JDK],
     [
  -    tempval=""
  -    AC_MSG_CHECKING([for JDK location (please wait)])
  -    if ${TEST} -n "${JAVA_HOME}" ; then
  -      JAVA_HOME_ENV="${JAVA_HOME}"
  -    else
  -      JAVA_HOME_ENV=""
  -    fi
  +    if ${TEST} "${use_jni}" = "true"; then
  +      tempval=""
  +      AC_MSG_CHECKING([for JDK location (please wait)])
  +      if ${TEST} -n "${JAVA_HOME}" ; then
  +        JAVA_HOME_ENV="${JAVA_HOME}"
  +      else
  +        JAVA_HOME_ENV=""
  +      fi
   
  -    JAVA_HOME=""
  -    JAVA_PLATFORM=""
  +      JAVA_HOME=""
  +      JAVA_PLATFORM=""
   
  -    AC_ARG_WITH(
  -      [java-home],
  -      [  --with-java-home=DIR     Location of JDK directory.],
  -      [
  +      AC_ARG_WITH(
  +        [java-home],
  +        [  --with-java-home=DIR     Location of JDK directory.],
  +        [
   
  -      # This stuff works if the command line parameter --with-java-home was
  -      # specified, so it takes priority rightfully.
  +        # This stuff works if the command line parameter --with-java-home was
  +        # specified, so it takes priority rightfully.
     
  -      tempval=${withval}
  +        tempval=${withval}
   
  -      if ${TEST} ! -d "${tempval}" ; then
  -          AC_MSG_ERROR(Not a directory: ${tempval})
  -      fi
  +        if ${TEST} ! -d "${tempval}" ; then
  +            AC_MSG_ERROR(Not a directory: ${tempval})
  +        fi
     
  -      JAVA_HOME=${tempval}
  -      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
  -    ])
  +        JAVA_HOME=${tempval}
  +        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
   
  -    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 /usr/java ; do
  +
  +          for JAVA_PLATFORM in 4 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
   
  -      # 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 /usr/java ; do
  -
  -        for JAVA_PLATFORM in 4 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
  +              if ${TEST} -n "${JAVA_HOME}" ; then
  +                break;
                 fi
  +
               done
   
               if ${TEST} -n "${JAVA_HOME}" ; then
  @@ -152,103 +177,82 @@
   
           done
   
  -        if ${TEST} -n "${JAVA_HOME}" ; then
  -          break;
  +        if ${TEST} ! -n "${JAVA_HOME}" ; then
  +          AC_MSG_ERROR(can't locate a valid JDK location)
           fi
   
  -      done
  -
  -      if ${TEST} ! -n "${JAVA_HOME}" ; then
  -        AC_MSG_ERROR(can't locate a valid JDK location)
         fi
   
  -    fi
  -
  -    if ${TEST} -n "${JAVA_PLATFORM}"; then
  -      AC_MSG_RESULT(Java Platform detected - 1.${JAVA_PLATFORM})
  -    else
  -      AC_MSG_CHECKING(Java platform)
  -    fi
  +      if ${TEST} -n "${JAVA_PLATFORM}"; then
  +        AC_MSG_RESULT(Java Platform detected - 1.${JAVA_PLATFORM})
  +      else
  +        AC_MSG_CHECKING(Java platform)
  +      fi
   
  -    AC_ARG_WITH(java-platform,
  -     [  --with-java-platform[=2] Force the Java platorm
  -                                 (value is 1 for 1.1.x or 2 for 1.2.x or greater)],
  -     [
  -        case "${withval}" in
  -          "1"|"2")
  -            JAVA_PLATFORM=${withval}
  -            ;;
  -          *)
  -            AC_MSG_ERROR(invalid java platform provided)
  -            ;;
  -        esac
  -     ],
  -     [
  -        if ${TEST} -n "${JAVA_PLATFORM}"; then
  -          AC_MSG_RESULT(Java Platform detected - 1.${JAVA_PLATFORM})
  -        else
  -          AC_MSG_CHECKING(Java platform)
  -        fi
  -     ])
  +      AC_ARG_WITH(java-platform,
  +       [  --with-java-platform[=2] Force the Java platorm
  +                                   (value is 1 for 1.1.x or 2 for 1.2.x or greater)],
  +       [
  +          case "${withval}" in
  +            "1"|"2")
  +              JAVA_PLATFORM=${withval}
  +              ;;
  +            *)
  +              AC_MSG_ERROR(invalid java platform provided)
  +              ;;
  +          esac
  +       ],
  +       [
  +          if ${TEST} -n "${JAVA_PLATFORM}"; then
  +            AC_MSG_RESULT(Java Platform detected - 1.${JAVA_PLATFORM})
  +          else
  +            AC_MSG_CHECKING(Java platform)
  +          fi
  +       ])
   
  -     AC_MSG_RESULT(${JAVA_PLATFORM})
  +       AC_MSG_RESULT(${JAVA_PLATFORM})
   
  -    unset tempval
  +      unset tempval
  +    fi
     ])
   
   
   AC_DEFUN(
     [JK_JDK_OS],
     [
  -    tempval=""
  -    OS=""
  -    AC_ARG_WITH(os-type,
  -      [  --with-os-type[=SUBDIR]  Location of JDK os-type subdirectory.],
  -      [
  -        tempval=${withval}
  +    if ${TEST} "${use_jni}" = "true"; then
  +      tempval=""
  +      OS=""
  +      AC_ARG_WITH(os-type,
  +        [  --with-os-type[=SUBDIR]  Location of JDK os-type subdirectory.],
  +        [
  +          tempval=${withval}
   
  -        if ${TEST} ! -d "${JAVA_HOME}/${tempval}" ; then
  -          AC_MSG_ERROR(Not a directory: ${JAVA_HOME}/${tempval})
  -        fi
  +          if ${TEST} ! -d "${JAVA_HOME}/${tempval}" ; then
  +            AC_MSG_ERROR(Not a directory: ${JAVA_HOME}/${tempval})
  +          fi
   
  -        OS = ${tempval}
  -      ],
  -      [   
  -        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}"
  +          OS = ${tempval}
  +        ],
  +        [   
  +          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
  -          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
  -      ])
  -  ])
  -
  -AC_DEFUN(
  -  [JK_JNI],
  -  [
  -    AC_ARG_WITH(jni,
  -      [  --with-jni               Build jni support],
  -      [
  -		case "${withval}" in
  -		  y | yes | true) use_jni=true ;;
  -		  n | no | false) use_jni=false ;;
  -	    *) use_jni=true ;;
  -	      esac
  -
  -		if ${TEST} ${use_jni} ; then
  -		  HAVE_JNI="-DHAVE_JNI"
  -		fi
  -      ])
  +        ])
  +    fi
     ])
   
   dnl vi:set sts=2 sw=2 autoindent:
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message