| <?xml version="1.0" ?> |
| |
| <project name="jk_native" default="main" basedir="."> |
| |
| <description>Build the native component of jk.</description> |
| |
| <property file="${user.home}/.ant.properties" /> |
| <property file="${user.home}/build.properties" /> |
| <property file="../build.properties" /> |
| <property file="build.properties" /> |
| |
| <!-- Overriden if called from the main --> |
| <property name="jk.build" location="../build" /> |
| |
| <path id="cp.jkant" > |
| <pathelement location="${jk.build}/lib/jkant.jar"/> |
| </path> |
| |
| <property name="native.dir" location="." /> |
| <property name="apxs13" value="/opt/apache13/bin/apxs" /> |
| <property name="apxs20" value="/opt/apache2/bin/apxs" /> |
| |
| <property name="iplanet.home" location="/opt/iplanet" /> |
| <property name="apache2.home" location="/opt/apache2" /> |
| <property name="apache13.home" location="/opt/apache13" /> |
| |
| <property name="apache2.include" location="${apache2.home}/include" /> |
| <property name="apache13.include" location="${apache13.home}/include" /> |
| |
| <property name="so.debug" value="true" /> |
| <property name="so.optimize" value="false" /> |
| <property name="so.profile" value="false" /> |
| |
| <!-- ==================== Targets ==================== --> |
| |
| <target name="main" depends="init,apache20,apache13,iis,netscape,jni"> |
| </target> |
| |
| <target name="init" > |
| <echo message="${user.home}" /> |
| <taskdef resource="META-INF/ant.tasks" |
| classpathref="cp.jkant" /> |
| <available property="apache13.detect" |
| file="${apache13.home}" /> |
| <available property="apache2.detect" |
| file="${apache2.home}" /> |
| <available property="iis.detect" |
| file="${iis.home}" /> |
| <available property="iplanet.detect" |
| file="${iplanet.home}" /> |
| <available property="HAVE_APR" |
| file="${apr.include}/apr.h" /> |
| <mkdir dir="${jk.build}/jk" /> |
| <condition property="linux"> |
| <equals arg1="${os.name}" arg2="Linux"/> |
| </condition> |
| <condition property="solaris"> |
| <equals arg1="${os.name}" arg2="SunOS"/> |
| </condition> |
| <condition property="win32"> |
| <os family="windows"/> |
| </condition> |
| <condition property="hpux"> |
| <equals arg1="${os.name}" arg2="HP-UX"/> |
| </condition> |
| <!-- I believe they are using cross-compilation, so checking the os.name |
| doesn't help. We'll check if the NDK is installed instead --> |
| <condition property="netware"> |
| <available file="novellndk.home" /> |
| </condition> |
| <echo message="linux=${linux} solaris=${solaris} win32=${win32} hpux=${hpux} netware=${netware}"/> |
| |
| </target> |
| |
| <target name="jni" depends="init"> |
| <mkdir dir="${jk.build}/jk/jni" /> |
| <so sofile="jni_connect" |
| buildDir="${jk.build}/jk/jni" |
| optimize="${so.optimize}" |
| debug="${so.debug}" |
| profile="${so.profile}" |
| > |
| <jniConfig /> |
| <src dir="${native.dir}"> |
| <include name="jni/*.c" /> |
| <include name="common/jk_map.c" /> |
| <include name="common/jk_util.c" /> |
| <include name="common/jk_pool.c" /> |
| <include name="common/jk_logger.c" /> |
| <include name="common/jk_nwmain.c" if="netware" /> |
| <include name="common/apr/*.c" unless="HAVE_APR" /> |
| </src> |
| <includes> |
| <include name="${native.dir}/common" /> |
| <include name="${native.dir}/jni" /> |
| <include name="${java.home}/../include" /> |
| <include name="${build.compiler.base}/include" /> |
| |
| <!-- Platform specific includes --> |
| <include name="${novellndk.home}/include/nlm" if="netware" /> |
| <include name="${novellndk.home}/include" if="netware" /> |
| <include name="${java.home}/../include/netware" if="netware" /> |
| <include name="${java.home}/../include/solaris" if="solaris" /> |
| <include name="${java.home}/../include/hp-ux" if="hpux" /> |
| <include name="${java.home}/../include/linux" if="linux"/> |
| <include name="${java.home}/../include/win32" if="win32" unless="netware" /> |
| </includes> |
| <depends> |
| <fileset dir="${native.dir}/common" includes="*.h" /> |
| </depends> |
| |
| <!-- Platform-specific tags --> |
| <altSoFile value="jni_conn" if="netware" /> |
| |
| <def name="N_PLAT_NLM" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="NETWARE" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="XP_NETWARE" if="netware" |
| info="Building for NetWare platform" /> |
| |
| <import fileName="${novellndk.home}/imports/clib.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/lib0.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/nlmlib.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/threads.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/socklib.imp" if="netware" /> |
| <export fileName="${native.dir}/jni/jk_jnicb.exp" if="netware" /> |
| <linkOpt value="-desc "JNI Natives for Tomcat"" if="netware" /> |
| <linkOpt value="-screenname "System Console"" if="netware" /> |
| <linkOpt value="-nlmversion 1,2,6" if="netware" /> |
| <linkOpt value="-threadname "JK_JNI Thread"" if="netware" /> |
| <linkOpt value="-stacksize 64000" if="netware" /> |
| |
| <def name="HPUX11" if="hpux" /> |
| |
| <def name="WIN32" if="win32" unless="netware" /> |
| <def name="DEBUG" if="win32.debug" unless="netware" /> |
| <def name="NDEBUG" if="win32.release" unless="netware" /> |
| <def name="_WINDOWS" if="win32" unless="netware" /> |
| <def name="_MBCS" if="win32" unless="netware" /> |
| <def name="_USRDLL" if="win32" unless="netware" /> |
| <def name="JNI_CONNECT_EXPORTS" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${build.compiler.base}/lib"" if="win32" unless="netware" /> |
| </so> |
| </target> |
| |
| <target name="apache20" depends="init" if="apache2.detect"> |
| <mkdir dir="${jk.build}/jk/apache2" /> |
| <so sofile="mod_jk" |
| buildDir="${jk.build}/jk/apache2" |
| optimize="${so.optimize}" |
| debug="${so.debug}" |
| taskDebug="0" |
| profile="${so.profile}" > |
| <def name="_REENTRANT" /> |
| <def name="CHANNEL" if="use.channel" |
| info="Use the new (experimental) channel interface" /> |
| <def name="AJP12" if="use.ajp12" |
| info="Build the deprecated ajp12 worker" /> |
| <def name="CHUNK_SIZE" value="4096" |
| info="Read/Write buffer size" /> |
| <def name="REUSE_WORKER" |
| unless="option_no_reuse_worker" |
| info="Reuse the worker endpoint, using per thread data" /> |
| <def name="USE_APACHE_MD5" unless="netware" |
| info="Use the MD5 implementation that is part of apache2" /> |
| <def name="HPUX11" if="hpux" /> |
| <apacheConfig apxs="${apxs20}" /> |
| <jniConfig /> |
| <src dir="."> |
| <include name="apache-2.0/mod_jk.c" /> |
| <include name="common/**/*.c" /> |
| <exclude name="common/ajp12/*.c" unless="use.ajp12" /> |
| <exclude name="common/jk_nwmain.c" unless="netware" /> |
| </src> |
| <includes> |
| <include name="${native.dir}/common" /> |
| <include name="${apache2.include}" /> |
| <include name="${java.home}/../include" /> |
| |
| <!-- Platform specific includes --> |
| <include name="${java.home}/../include/win32" if="win32" unless="netware" /> |
| <include name="${java.home}/../include/hp-ux" if="hpux" /> |
| <include name="${java.home}/../include/netware" if="netware" /> |
| <include name="${java.home}/../include/linux" if="linux"/> |
| <include name="${java.home}/../include/solaris" if="solaris" /> |
| <include name="${novelllibc.home}/include" if="netware" /> |
| <include name="${novelllibc.home}/include/winsock" if="netware" /> |
| </includes> |
| <depends> |
| <fileset dir="${native.dir}/common" includes="*.h" /> |
| </depends> |
| |
| <!-- Platform-specific tags --> |
| <def name="WIN32" if="win32" unless="netware" /> |
| <def name="DEBUG" if="win32.debug" unless="netware" /> |
| <def name="NDEBUG" if="win32.release" unless="netware" /> |
| <def name="_WINDOWS" if="win32" unless="netware" /> |
| <def name="_MBCS" if="win32" unless="netware" /> |
| <def name="_USRDLL" if="win32" unless="netware" /> |
| |
| <import fileName="libapr.lib" if="win32" unless="netware" /> |
| <import fileName="libaprutil.lib" if="win32" unless="netware" /> |
| <import fileName="libhttpd.lib" if="win32" unless="netware" /> |
| <import fileName="wsock32.lib" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${build.compiler.base}/lib"" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${apache2.home}/lib"" if="win32" unless="netware" /> |
| |
| <def name="N_PLAT_NLM" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="NETWARE" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="__NETWARE__" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="__NOVELL_LIBC__" if="netware" |
| info="Building for NetWare platform with LibC libraries" /> |
| |
| <nlmmodule value="Apache2" if="netware" /> |
| <import fileName="${novelllibc.home}/imports/libc.imp" if="netware" /> |
| <import fileName="${novelllibc.home}/imports/ws2nlm.imp" if="netware" /> |
| <import fileName="${apache2.home}/lib/httpd.imp" if="netware" /> |
| <import fileName="${apache2.home}/lib/aprlib.imp" if="netware" /> |
| <export symbol="jk_module" if="netware" /> |
| <linkOpt value="-desc "Apache 2.0 plugin for Tomcat"" if="netware" /> |
| <linkOpt value="-nlmversion 1,2,6" if="netware" /> |
| <linkOpt value="-threadname "mod_jk Module"" if="netware" /> |
| <linkOpt value="-stacksize 8192" if="netware" /> |
| <linkOpt value="-l ${novelllibc.home}/imports" if="netware" /> |
| <linkOpt value="-flags AUTOUNLOAD, PSEUDOPREEMPTION" if="netware" /> |
| <linkOpt value="-entry _LibCPrelude" if="netware" /> |
| <linkOpt value="-exit _LibCPostlude" if="netware" /> |
| </so> |
| |
| </target> |
| |
| |
| <target name="apache13" depends="init" if="apache13.detect"> |
| <mkdir dir="${jk.build}/jk/apache13" /> |
| <so sofile="mod_jk" |
| buildDir="${jk.build}/jk/apache13" |
| optimize="${so.optimize}" |
| debug="${so.debug}" |
| profile="${so.profile}"> |
| <apacheConfig apxs="${apxs13}" /> |
| |
| <src dir="."> |
| <include name="apache-1.3/mod_jk.c" /> |
| <include name="common/*.c" /> |
| <exclude name="common/jk_jni_worker.c" /> |
| <exclude name="common/jk_nwmain.c" unless="netware" /> |
| <include name="common/apr/*.c" unless="HAVE_APR" /> |
| </src> |
| <includes> |
| <include name="${native.dir}/common" /> |
| <include name="${build.compiler.base}/include" /> |
| <include name="${apache13.include}" /> |
| <include name="${java.home}/../include" /> |
| |
| <!-- Platform specific includes --> |
| <include name="${apache13.home}/include" if="netware" /> |
| <include name="${apache13.home}/os/netware" if="netware" /> |
| <include name="${novellndk.home}/include/nlm" if="netware" /> |
| <include name="${novellndk.home}/include" if="netware" /> |
| <include name="${novellndk.home}/include/winsock" if="netware" /> |
| <include name="${java.home}/../include/netware" if="netware" /> |
| |
| <include name="${apache13.home}/os/win32" if="win32" unless="netware" /> |
| <include name="${java.home}/../include/win32" if="win32" unless="netware" /> |
| <include name="${java.home}/../include/hp-ux" if="hpux" /> |
| <include name="${native.dir}/common" if="win32" unless="netware" /> |
| </includes> |
| <depends> |
| <fileset dir="${native.dir}/common" includes="*.h" /> |
| </depends> |
| |
| <!-- Platform-specific tags --> |
| <def name="N_PLAT_NLM" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="NETWARE" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="XP_NETWARE" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="USE_SPRINTF" if="netware" |
| info="Use the sprintf function to build strings" /> |
| |
| <def name="HPUX11" if="hpux" /> |
| |
| <def name="WIN32" if="win32" unless="netware" /> |
| <def name="DEBUG" if="win32.debug" unless="netware" /> |
| <def name="NDEBUG" if="win32.release" unless="netware" /> |
| <def name="_WINDOWS" if="win32" unless="netware" /> |
| <def name="_MBCS" if="win32" unless="netware" /> |
| <def name="_USRDLL" if="win32" unless="netware" /> |
| <def name="MOD_JK_EXPORTS" if="win32" unless="netware" /> |
| |
| <nlmmodule value="apache" if="netware" /> |
| <import fileName="${novellndk.home}/imports/clib.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/lib0.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/nlmlib.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/threads.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/socklib.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/ws2nlm.imp" if="netware" /> |
| <import fileName="${apache13.home}/os/netware/ApacheCore.imp" if="netware" /> |
| <export symbol="jk_module" if="netware" /> |
| <linkOpt value="-desc "Apache 1.3 plugin for Tomcat"" if="netware" /> |
| <linkOpt value="-screenname "System Console"" if="netware" /> |
| <linkOpt value="-nlmversion 1,2,6" if="netware" /> |
| <linkOpt value="-threadname "mod_jk Thread"" if="netware" /> |
| <linkOpt value="-stacksize 64000" if="netware" /> |
| |
| <import fileName="ApacheCore.lib" if="win32" unless="netware" /> |
| <import fileName="wsock32.lib" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${build.compiler.base}/lib"" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${apache13.home}/CoreR"" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${apache13.home}/Release"" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${apache13.home}/libexec"" if="win32" unless="netware" /> |
| </so> |
| </target> |
| |
| <target name="iis" depends="init" if="iis.detect"> |
| <mkdir dir="${jk.build}/jk/iis" /> |
| <so sofile="isapi_redirector" |
| buildDir="${jk.build}/jk/iis" |
| optimize="${so.optimize}" |
| debug="${so.debug}" |
| profile="${so.profile}"> |
| |
| <src dir="."> |
| <include name="iis/jk_isapi_plugin.c" /> |
| <include name="common/*.c" /> |
| <exclude name="common/jk_nwmain.c" unless="netware" /> |
| <include name="common/apr/*.c" unless="HAVE_APR" /> |
| </src> |
| <includes> |
| <include name="${java.home}/../include" /> |
| <include name="${java.home}/../include/win32" /> |
| <include name="${native.dir}/common" /> |
| <include name="${mssdk.include}" /> |
| <include name="${build.compiler.base}/include" /> |
| </includes> |
| <depends> |
| <fileset dir="${native.dir}/common" includes="*.h" /> |
| </depends> |
| |
| <!-- Platform-specific tags --> |
| <def name="WIN32" /> |
| <def name="DEBUG" if="win32.debug" /> |
| <def name="NDEBUG" if="win32.release" /> |
| <def name="_WINDOWS" /> |
| <def name="_MBCS" /> |
| <def name="_USRDLL" /> |
| <def name="ISAPI_EXPORTS" /> |
| <import fileName="advapi32.lib" /> |
| <import fileName="wsock32.lib" /> |
| <export symbol="HttpFilterProc"/> |
| <export symbol="GetFilterVersion"/> |
| <export symbol="GetExtensionVersion"/> |
| <export symbol="HttpExtensionProc"/> |
| <export symbol="TerminateFilter"/> |
| <export symbol="TerminateExtension"/> |
| <linkOpt value="/libpath:"${mssdk.lib}"" /> |
| <linkOpt value="/libpath:"${build.compiler.base}/lib"" /> |
| </so> |
| </target> |
| |
| <target name="netscape" depends="init" if="iplanet.detect"> |
| <mkdir dir="${jk.build}/jk/netscape" /> |
| <property name="netscape.home" value="${iplanet.home}/plugins" /> |
| <available property="unix" file="/etc/passwd" /> |
| <so sofile="nsapi_redirector" |
| buildDir="${jk.build}/jk/netscape" |
| optimize="${so.optimize}" |
| debug="${so.debug}" |
| profile="${so.profile}"> |
| |
| <src dir="."> |
| <include name="netscape/jk_nsapi_plugin.c" /> |
| <include name="common/*.c" /> |
| <exclude name="common/jk_nwmain.c" unless="netware" /> |
| <include name="common/apr/*.c" unless="HAVE_APR" /> |
| </src> |
| <includes> |
| <include name="${native.dir}/common" /> |
| <include name="${build.compiler.base}/include" /> |
| <include name="${netscape.home}/include" /> |
| <include name="${java.home}/../include" /> |
| |
| <!-- Platform specific includes --> |
| |
| <include name="${novellndk.home}/include/nlm" if="netware" /> |
| <include name="${novellndk.home}/include" if="netware" /> |
| <include name="${java.home}/../include/linux" if="linux" /> |
| <include name="${java.home}/../include/netware" if="netware" /> |
| |
| <include name="${apache13.home}/os/win32" if="win32" unless="netware" /> |
| <include name="${java.home}/../include/win32" if="win32" unless="netware" /> |
| <include name="${native.dir}/common" if="win32" unless="netware" /> |
| </includes> |
| <depends> |
| <fileset dir="${native.dir}/common" includes="*.h" /> |
| </depends> |
| |
| <!-- Platform-specific tags --> |
| <altSoFile value="nsapi_rd" if="netware" /> |
| |
| <def name="XP_UNIX" if="unix" |
| info="Building for unix platform" /> |
| |
| <def name="N_PLAT_NLM" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="NETWARE" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="XP_NETWARE" if="netware" |
| info="Building for NetWare platform" /> |
| <def name="USE_SPRINTF" if="netware" |
| info="Use the sprintf function to build strings" /> |
| |
| <def name="WIN32" if="win32" unless="netware" /> |
| <def name="DEBUG" if="win32.debug" unless="netware" /> |
| <def name="NDEBUG" if="win32.release" unless="netware" /> |
| <def name="_WINDOWS" if="win32" unless="netware" /> |
| <def name="_MBCS" if="win32" unless="netware" /> |
| <def name="_USRDLL" if="win32" unless="netware" /> |
| <def name="XP_WIN32" if="win32" unless="netware" /> |
| <def name="NSAPI_EXPORTS" if="win32" unless="netware" /> |
| |
| <def name="XP_UNIX" if="unix" |
| info="Unix platform - needed for nsapi.h" /> |
| |
| <nlmmodule value="nshttpd" if="netware" /> |
| <import fileName="${novellndk.home}/imports/clib.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/lib0.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/nlmlib.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/threads.imp" if="netware" /> |
| <import fileName="${novellndk.home}/imports/socklib.imp" if="netware" /> |
| <import fileName="${netscape.home}/imports/nsapi.imp" if="netware" /> |
| <export symbol="jk_init" if="netware" /> |
| <export symbol="jk_service" if="netware" /> |
| <linkOpt value="-desc "Netscape Plugin for Tomcat"" if="netware" /> |
| <linkOpt value="-screenname "System Console"" if="netware" /> |
| <linkOpt value="-nlmversion 1,2,6" if="netware" /> |
| <linkOpt value="-threadname "NSTomcat Thread"" if="netware" /> |
| <linkOpt value="-stacksize 64000" if="netware" /> |
| |
| <import fileName="ns-httpd36.lib" if="win32" unless="netware" /> |
| <import fileName="wsock32.lib" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${build.compiler.base}/lib"" if="win32" unless="netware" /> |
| <linkOpt value="/libpath:"${netscape.home}/lib"" if="win32" unless="netware" /> |
| </so> |
| </target> |
| |
| <target name="clean" > |
| <delete dir="${jk.build}/jk"/> |
| </target> |
| |
| </project> |