xref: /unit/auto/modules/java (revision 1938:418e225f58e4)
1977Smax.romanov@gmail.com
2977Smax.romanov@gmail.com# Copyright (C) NGINX, Inc.
3977Smax.romanov@gmail.com
4977Smax.romanov@gmail.com
5977Smax.romanov@gmail.comshift
6977Smax.romanov@gmail.com
7977Smax.romanov@gmail.comNXT_JAVA_HOME=${JAVA_HOME-}
81339Smax.romanov@nginx.comNXT_JAR_REPO=https://repo1.maven.org/maven2/
9977Smax.romanov@gmail.comNXT_JAR_LOCAL_REPO=$HOME/.m2/repository/
10977Smax.romanov@gmail.com
11977Smax.romanov@gmail.comfor nxt_option; do
12977Smax.romanov@gmail.com
13977Smax.romanov@gmail.com    case "$nxt_option" in
14977Smax.romanov@gmail.com        -*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'`     ;;
15977Smax.romanov@gmail.com           *) value="" ;;
16977Smax.romanov@gmail.com    esac
17977Smax.romanov@gmail.com
18977Smax.romanov@gmail.com    case "$nxt_option" in
19977Smax.romanov@gmail.com
20977Smax.romanov@gmail.com        --module=*)     NXT_JAVA_MODULE="$value"                              ;;
21977Smax.romanov@gmail.com        --home=*)       NXT_JAVA_HOME="$value"                                ;;
22977Smax.romanov@gmail.com        --lib-path=*)   NXT_JAVA_LIB_PATH="$value"                            ;;
23977Smax.romanov@gmail.com        --repo=*)       NXT_JAR_REPO="$value"                                 ;;
24977Smax.romanov@gmail.com        --local-repo=*) NXT_JAR_LOCAL_REPO="$value"                           ;;
251340Smax.romanov@nginx.com        --sha512=*)     NXT_SHA512_TOOL="$value"                              ;;
26977Smax.romanov@gmail.com        --jars=*)       NXT_JARS="$value"                                     ;;
27977Smax.romanov@gmail.com
28977Smax.romanov@gmail.com        --help)
29977Smax.romanov@gmail.com            cat << END
30977Smax.romanov@gmail.com
31977Smax.romanov@gmail.com    --module=NAME         set unit Java module name
32977Smax.romanov@gmail.com    --home=DIR            set Java home directory
33977Smax.romanov@gmail.com    --lib-path=DIRECTORY  set directory path to libjvm.so library
34977Smax.romanov@gmail.com    --repo=URL            set Maven remote repository URL
35977Smax.romanov@gmail.com                          default: "$NXT_JAR_REPO"
36977Smax.romanov@gmail.com    --local-repo=DIR      set local repository directory
37977Smax.romanov@gmail.com                          default: "$NXT_JAR_LOCAL_REPO"
381340Smax.romanov@nginx.com    --sha512=SHA512       set command for SHA512 check
39977Smax.romanov@gmail.com    --jars=DIR            set jars install/search directory
40977Smax.romanov@gmail.com
41977Smax.romanov@gmail.comEND
42977Smax.romanov@gmail.com            exit 0
43977Smax.romanov@gmail.com        ;;
44977Smax.romanov@gmail.com
45977Smax.romanov@gmail.com        *)
46977Smax.romanov@gmail.com            echo
47977Smax.romanov@gmail.com            echo $0: error: invalid Java option \"$nxt_option\"
48977Smax.romanov@gmail.com            echo
49977Smax.romanov@gmail.com            exit 1
50977Smax.romanov@gmail.com        ;;
51977Smax.romanov@gmail.com    esac
52977Smax.romanov@gmail.com
53977Smax.romanov@gmail.comdone
54977Smax.romanov@gmail.com
55977Smax.romanov@gmail.com
56977Smax.romanov@gmail.comif [ ! -f $NXT_AUTOCONF_DATA ]; then
57977Smax.romanov@gmail.com   echo
58977Smax.romanov@gmail.com   echo Please run common $0 before configuring module \"$nxt_module\".
59977Smax.romanov@gmail.com   echo
60977Smax.romanov@gmail.com   exit 1
61977Smax.romanov@gmail.comfi
62977Smax.romanov@gmail.com
63977Smax.romanov@gmail.com. $NXT_AUTOCONF_DATA
64977Smax.romanov@gmail.com
65977Smax.romanov@gmail.com
66977Smax.romanov@gmail.comNXT_JARS=${NXT_JARS=$NXT_MODULES}
67977Smax.romanov@gmail.comNXT_JAVA_MODULE=${NXT_JAVA_MODULE=java}
68977Smax.romanov@gmail.comNXT_JAVA_LIB_PATH=${NXT_JAVA_LIB_PATH=}
69977Smax.romanov@gmail.com
70977Smax.romanov@gmail.com$echo "configuring Java module"
71977Smax.romanov@gmail.com$echo "configuring Java module ..." >> $NXT_AUTOCONF_ERR
72977Smax.romanov@gmail.com
73977Smax.romanov@gmail.comif [ -n "${NXT_JAVA_HOME}" ]; then
74977Smax.romanov@gmail.com    $echo "using java.home ${NXT_JAVA_HOME}"
75977Smax.romanov@gmail.com    $echo "using java.home ${NXT_JAVA_HOME}" >> $NXT_AUTOCONF_ERR
76977Smax.romanov@gmail.com
77977Smax.romanov@gmail.com    if [ ! -d "${NXT_JAVA_HOME}" ]; then
78977Smax.romanov@gmail.com        $echo
79977Smax.romanov@gmail.com        $echo $0: error: Java home directory not found.
80977Smax.romanov@gmail.com        $echo
81977Smax.romanov@gmail.com        exit 1
82977Smax.romanov@gmail.com    fi
83977Smax.romanov@gmail.com
84977Smax.romanov@gmail.com    NXT_JAVA="${NXT_JAVA_HOME}/bin/java"
85977Smax.romanov@gmail.com
86977Smax.romanov@gmail.comelse
871341Smax.romanov@nginx.com    $echo -n "checking for java executable ..."
88977Smax.romanov@gmail.com    $echo "checking for java executable ..." >> $NXT_AUTOCONF_ERR
89977Smax.romanov@gmail.com
90977Smax.romanov@gmail.com    NXT_JAVA=`which java || :`
91977Smax.romanov@gmail.com    if [ -z "$NXT_JAVA" -o ! -x "$NXT_JAVA" ]; then
921341Smax.romanov@nginx.com        $echo " not found"
93977Smax.romanov@gmail.com        $echo
94977Smax.romanov@gmail.com        $echo $0: error: java executable not found.
95977Smax.romanov@gmail.com        $echo
96977Smax.romanov@gmail.com        exit 1
97977Smax.romanov@gmail.com    fi
98977Smax.romanov@gmail.com
99977Smax.romanov@gmail.com    $echo " found $NXT_JAVA"
100977Smax.romanov@gmail.com    $echo "found $NXT_JAVA" >> $NXT_AUTOCONF_ERR
101977Smax.romanov@gmail.com
102977Smax.romanov@gmail.com    "$NXT_JAVA" -version
103977Smax.romanov@gmail.com
1041341Smax.romanov@nginx.com    $echo -n "checking java.home ..."
105977Smax.romanov@gmail.com    $echo "checking java.home ..." >> $NXT_AUTOCONF_ERR
106977Smax.romanov@gmail.com
107977Smax.romanov@gmail.com    NXT_JAVA_HOME=`$NXT_JAVA -XshowSettings 2>&1 | grep -F -e java.home | sed -e 's/^.*= //'`
108977Smax.romanov@gmail.com    if [ -z "$NXT_JAVA_HOME" ]; then
1091341Smax.romanov@nginx.com        $echo " not found"
110977Smax.romanov@gmail.com        $echo
111977Smax.romanov@gmail.com        $echo $0: error: java.home not found.
112977Smax.romanov@gmail.com        $echo
113977Smax.romanov@gmail.com        exit 1
114977Smax.romanov@gmail.com    fi
115977Smax.romanov@gmail.com
116977Smax.romanov@gmail.com    $echo " $NXT_JAVA_HOME"
117977Smax.romanov@gmail.com    $echo "got java.home $NXT_JAVA_HOME" >> $NXT_AUTOCONF_ERR
118977Smax.romanov@gmail.com
119977Smax.romanov@gmail.com    if [ ! -x "${NXT_JAVA_HOME}/bin/javac" ]; then
120977Smax.romanov@gmail.com        NXT_JAVA_HOME_=${NXT_JAVA_HOME%/jre}
121977Smax.romanov@gmail.com        if [ -x "${NXT_JAVA_HOME_}/bin/javac" ]; then
122977Smax.romanov@gmail.com            $echo "adjust java.home $NXT_JAVA_HOME_"
123977Smax.romanov@gmail.com            $echo "adjust java.home $NXT_JAVA_HOME_" >> $NXT_AUTOCONF_ERR
124977Smax.romanov@gmail.com
125977Smax.romanov@gmail.com            NXT_JAVA_HOME="$NXT_JAVA_HOME_"
126977Smax.romanov@gmail.com        fi
127977Smax.romanov@gmail.com    fi
128977Smax.romanov@gmail.comfi
129977Smax.romanov@gmail.com
130977Smax.romanov@gmail.comNXT_JAVAC="${NXT_JAVA_HOME}/bin/javac"
131977Smax.romanov@gmail.com
132977Smax.romanov@gmail.comif [ ! -x "$NXT_JAVAC" ]; then
133977Smax.romanov@gmail.com    $echo
134977Smax.romanov@gmail.com    $echo $0: error: javac not found.
135977Smax.romanov@gmail.com    $echo
136977Smax.romanov@gmail.com    exit 1
137977Smax.romanov@gmail.comfi
138977Smax.romanov@gmail.com
139977Smax.romanov@gmail.comNXT_JAVA_INCLUDE="-I${NXT_JAVA_HOME}/include"
140977Smax.romanov@gmail.com
141977Smax.romanov@gmail.comcase "$NXT_SYSTEM" in
142977Smax.romanov@gmail.com    Linux)
143977Smax.romanov@gmail.com        NXT_JAVA_INCLUDE="${NXT_JAVA_INCLUDE} -I${NXT_JAVA_HOME}/include/linux"
144977Smax.romanov@gmail.com        ;;
145977Smax.romanov@gmail.com    Darwin)
146977Smax.romanov@gmail.com        NXT_JAVA_INCLUDE="${NXT_JAVA_INCLUDE} -I${NXT_JAVA_HOME}/include/darwin"
147977Smax.romanov@gmail.com        ;;
148977Smax.romanov@gmail.com    FreeBSD)
149977Smax.romanov@gmail.com        NXT_JAVA_INCLUDE="${NXT_JAVA_INCLUDE} -I${NXT_JAVA_HOME}/include/freebsd"
150977Smax.romanov@gmail.com        ;;
151977Smax.romanov@gmail.comesac
152977Smax.romanov@gmail.com
153977Smax.romanov@gmail.comif [ -z "$NXT_JAVA_LIB_PATH" ]; then
1541341Smax.romanov@nginx.com    $echo -n "checking library path ..."
155977Smax.romanov@gmail.com    $echo "checking library path ..." >> $NXT_AUTOCONF_ERR
156977Smax.romanov@gmail.com
157977Smax.romanov@gmail.com    if [ ! -x "$NXT_JAVA" ]; then
1581341Smax.romanov@nginx.com        $echo " not found"
159977Smax.romanov@gmail.com        $echo
160977Smax.romanov@gmail.com        $echo $0: error: java executable not found.
161977Smax.romanov@gmail.com        $echo
162977Smax.romanov@gmail.com        exit 1
163977Smax.romanov@gmail.com    fi
164977Smax.romanov@gmail.com
165977Smax.romanov@gmail.com    NXT_JAVA_LIB_PATH=`$NXT_JAVA -XshowSettings 2>&1 | grep -F -e sun.boot.library.path | sed -e 's/^.*= //'`
166977Smax.romanov@gmail.com
167977Smax.romanov@gmail.com    if [ -z "$NXT_JAVA_LIB_PATH" ]; then
1681341Smax.romanov@nginx.com        $echo " not found"
169977Smax.romanov@gmail.com        $echo
170977Smax.romanov@gmail.com        $echo $0: error: library path not found.
171977Smax.romanov@gmail.com        $echo
172977Smax.romanov@gmail.com        exit 1
173977Smax.romanov@gmail.com    fi
174977Smax.romanov@gmail.com
175977Smax.romanov@gmail.com    $echo " $NXT_JAVA_LIB_PATH"
176977Smax.romanov@gmail.com    $echo "got library path $NXT_JAVA_LIB_PATH" >> $NXT_AUTOCONF_ERR
177977Smax.romanov@gmail.comfi
178977Smax.romanov@gmail.com
1791496St.nateldemoura@f5.comNXT_JAVA_LIB_SERVER_PATH="${NXT_JAVA_LIB_PATH}/server"
1801496St.nateldemoura@f5.com
1811655Svbart@nginx.comNXT_JAVA_LDFLAGS="-L${NXT_JAVA_LIB_SERVER_PATH} -Wl,-rpath,${NXT_JAVA_LIB_SERVER_PATH} -ljvm"
182977Smax.romanov@gmail.com
183977Smax.romanov@gmail.com
184977Smax.romanov@gmail.comnxt_found=no
185977Smax.romanov@gmail.com
186977Smax.romanov@gmail.comnxt_feature="JNI"
187977Smax.romanov@gmail.comnxt_feature_name=""
188977Smax.romanov@gmail.comnxt_feature_run=no
189977Smax.romanov@gmail.comnxt_feature_incs="${NXT_JAVA_INCLUDE}"
190977Smax.romanov@gmail.comnxt_feature_libs="${NXT_JAVA_LDFLAGS}"
191977Smax.romanov@gmail.comnxt_feature_test="
192977Smax.romanov@gmail.com    #include <jni.h>
193977Smax.romanov@gmail.com
194977Smax.romanov@gmail.com    int main() {
195977Smax.romanov@gmail.com        JNI_CreateJavaVM(NULL, NULL, NULL);
196977Smax.romanov@gmail.com        return 0;
197977Smax.romanov@gmail.com    }"
198977Smax.romanov@gmail.com
199977Smax.romanov@gmail.com. auto/feature
200977Smax.romanov@gmail.com
201977Smax.romanov@gmail.com
202977Smax.romanov@gmail.comif [ $nxt_found = no ]; then
203977Smax.romanov@gmail.com    $echo
204977Smax.romanov@gmail.com    $echo $0: error: no JNI found.
205977Smax.romanov@gmail.com    $echo
206977Smax.romanov@gmail.com    exit 1;
207977Smax.romanov@gmail.comfi
208977Smax.romanov@gmail.com
209977Smax.romanov@gmail.comNXT_JAVA_VERSION=`$NXT_JAVAC -version 2>&1`
210977Smax.romanov@gmail.comNXT_JAVA_VERSION=${NXT_JAVA_VERSION#javac }
211977Smax.romanov@gmail.comNXT_JAVA_INCLUDE="$NXT_JAVA_INCLUDE -I$NXT_BUILD_DIR/$NXT_JAVA_MODULE -DNXT_JAVA_VERSION=$NXT_JAVA_VERSION"
212977Smax.romanov@gmail.com
213977Smax.romanov@gmail.comif grep ^$NXT_JAVA_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
214977Smax.romanov@gmail.com    $echo
215977Smax.romanov@gmail.com    $echo $0: error: duplicate \"$NXT_JAVA_MODULE\" module configured.
216977Smax.romanov@gmail.com    $echo
217977Smax.romanov@gmail.com    exit 1;
218977Smax.romanov@gmail.comfi
219977Smax.romanov@gmail.com
220977Smax.romanov@gmail.com. ./version
221977Smax.romanov@gmail.com
222977Smax.romanov@gmail.comNXT_UNIT_JAR=nginx-unit-jsc-${NXT_JAVA_MODULE}-$NXT_VERSION.jar
2231157Smax.romanov@nginx.comNXT_WS_API_JAR=websocket-api-${NXT_JAVA_MODULE}-$NXT_VERSION.jar
224977Smax.romanov@gmail.com
225977Smax.romanov@gmail.comNXT_JAVA_BUILD_CP=$NXT_BUILD_DIR/$NXT_JAVA_MODULE
226977Smax.romanov@gmail.comNXT_JAVA_INSTALL_JARS=
227977Smax.romanov@gmail.comNXT_JAVA_UNINSTALL_JARS=
228977Smax.romanov@gmail.com
229977Smax.romanov@gmail.comNXT_JAVA_JARS=$NXT_BUILD_DIR/$NXT_JAVA_MODULE/nxt_jars.h
230977Smax.romanov@gmail.commkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE
231977Smax.romanov@gmail.com
232977Smax.romanov@gmail.comcat << END > $NXT_JAVA_JARS
233977Smax.romanov@gmail.com#ifndef _NXT_JAVA_JARS_INCLUDED_
234977Smax.romanov@gmail.com#define _NXT_JAVA_JARS_INCLUDED_
235977Smax.romanov@gmail.com
236977Smax.romanov@gmail.com#define NXT_JARS "$NXT_JARS"
237977Smax.romanov@gmail.com
238977Smax.romanov@gmail.comstatic const char *nxt_java_system_jars[] = {
239977Smax.romanov@gmail.comEND
240977Smax.romanov@gmail.com
241*1938Smax.romanov@nginx.comNXT_TOMCAT_VERSION=9.0.52
242977Smax.romanov@gmail.com
243977Smax.romanov@gmail.comNXT_JAR_VERSION=$NXT_TOMCAT_VERSION
244977Smax.romanov@gmail.com
245977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-servlet-api
246977Smax.romanov@gmail.comNXT_JAR_NAMESPACE=org/apache/tomcat/
247977Smax.romanov@gmail.com. auto/modules/java_get_jar
248977Smax.romanov@gmail.com
249977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-el-api
250977Smax.romanov@gmail.com. auto/modules/java_get_jar
251977Smax.romanov@gmail.com
252977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-jsp-api
253977Smax.romanov@gmail.com. auto/modules/java_get_jar
254977Smax.romanov@gmail.com
255977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-jasper
256977Smax.romanov@gmail.com. auto/modules/java_get_jar
257977Smax.romanov@gmail.com
258977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-jasper-el
259977Smax.romanov@gmail.com. auto/modules/java_get_jar
260977Smax.romanov@gmail.com
261977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-juli
262977Smax.romanov@gmail.com. auto/modules/java_get_jar
263977Smax.romanov@gmail.com
264977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-api
265977Smax.romanov@gmail.com. auto/modules/java_get_jar
266977Smax.romanov@gmail.com
267977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-util-scan
268977Smax.romanov@gmail.com. auto/modules/java_get_jar
269977Smax.romanov@gmail.com
270977Smax.romanov@gmail.comNXT_JAR_NAME=tomcat-util
271977Smax.romanov@gmail.com. auto/modules/java_get_jar
272977Smax.romanov@gmail.com
273977Smax.romanov@gmail.comNXT_JAR_NAME=ecj
2741931Smax.romanov@nginx.comNXT_JAR_VERSION=3.26.0
275977Smax.romanov@gmail.comNXT_JAR_NAMESPACE=org/eclipse/jdt/
276977Smax.romanov@gmail.com. auto/modules/java_get_jar
277977Smax.romanov@gmail.com
278977Smax.romanov@gmail.comcat << END >> $NXT_JAVA_JARS
2791157Smax.romanov@nginx.com    "$NXT_WS_API_JAR",
280977Smax.romanov@gmail.com    NULL
281977Smax.romanov@gmail.com};
282977Smax.romanov@gmail.com
283977Smax.romanov@gmail.comstatic const char *nxt_java_unit_jars[] = {
284977Smax.romanov@gmail.com    "$NXT_UNIT_JAR",
285977Smax.romanov@gmail.comEND
286977Smax.romanov@gmail.com
2871931Smax.romanov@nginx.comNXT_JAR_VERSION=9.4.43.v20210629
288977Smax.romanov@gmail.comNXT_JAR_NAMESPACE=org/eclipse/jetty/
289977Smax.romanov@gmail.com
290977Smax.romanov@gmail.comNXT_JAR_NAME=jetty-util
291977Smax.romanov@gmail.com. auto/modules/java_get_jar
292977Smax.romanov@gmail.com
293977Smax.romanov@gmail.comNXT_JAR_NAME=jetty-server
294977Smax.romanov@gmail.com. auto/modules/java_get_jar
295977Smax.romanov@gmail.com
296977Smax.romanov@gmail.comNXT_JAR_NAME=jetty-http
297977Smax.romanov@gmail.com. auto/modules/java_get_jar
298977Smax.romanov@gmail.com
299977Smax.romanov@gmail.comNXT_JAR_NAME=classgraph
300*1938Smax.romanov@nginx.comNXT_JAR_VERSION=4.8.112
301977Smax.romanov@gmail.comNXT_JAR_NAMESPACE=io/github/classgraph/
302977Smax.romanov@gmail.com. auto/modules/java_get_jar
303977Smax.romanov@gmail.com
304977Smax.romanov@gmail.comcat << END >> $NXT_JAVA_JARS
305977Smax.romanov@gmail.com    NULL
306977Smax.romanov@gmail.com};
307977Smax.romanov@gmail.com
308977Smax.romanov@gmail.com#endif /* _NXT_JAVA_JARS_INCLUDED_ */
309977Smax.romanov@gmail.comEND
310977Smax.romanov@gmail.com
3111489St.nateldemoura@f5.comNXT_JAVA_LIBJVM="$NXT_JAVA_LIB_SERVER_PATH/libjvm.so"
3121489St.nateldemoura@f5.com
3131489St.nateldemoura@f5.comif [ "$NXT_SYSTEM" = "Darwin" ]; then
3141489St.nateldemoura@f5.comNXT_JAVA_LIBC_DIR="/usr/lib"
3151489St.nateldemoura@f5.comelse
3161696Smax.romanov@nginx.comNXT_JAVA_LIBC_DIR=`ldd "$NXT_JAVA_LIBJVM" | grep -F libc. | cut -d' ' -f3`
3171489St.nateldemoura@f5.comNXT_JAVA_LIBC_DIR=`dirname $NXT_JAVA_LIBC_DIR`
3181489St.nateldemoura@f5.comfi
3191489St.nateldemoura@f5.com
3201532St.nateldemoura@f5.com
3211532St.nateldemoura@f5.comNXT_JAVA_MOUNTS_HEADER=nxt_${NXT_JAVA_MODULE}_mounts.h
3221532St.nateldemoura@f5.com
3231532St.nateldemoura@f5.comcat << END > $NXT_BUILD_DIR/$NXT_JAVA_MOUNTS_HEADER
3241489St.nateldemoura@f5.com#ifndef _NXT_JAVA_MOUNTS_H_INCLUDED_
3251489St.nateldemoura@f5.com#define _NXT_JAVA_MOUNTS_H_INCLUDED_
3261489St.nateldemoura@f5.com
3271489St.nateldemoura@f5.com
3281489St.nateldemoura@f5.comstatic const nxt_fs_mount_t  nxt_java_mounts[] = {
3291489St.nateldemoura@f5.com    {(u_char *) "$NXT_JAVA_LIBC_DIR", (u_char *) "$NXT_JAVA_LIBC_DIR",
3301673St.nateldemoura@f5.com     NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
3311489St.nateldemoura@f5.com    {(u_char *) "$NXT_JAVA_HOME", (u_char *) "$NXT_JAVA_HOME",
3321673St.nateldemoura@f5.com     NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
3331489St.nateldemoura@f5.com};
3341489St.nateldemoura@f5.com
3351489St.nateldemoura@f5.com
3361489St.nateldemoura@f5.com#endif /* _NXT_JAVA_MOUNTS_H_INCLUDED_ */
3371489St.nateldemoura@f5.comEND
3381489St.nateldemoura@f5.com
339977Smax.romanov@gmail.com$echo " + Java module: ${NXT_JAVA_MODULE}.unit.so"
340977Smax.romanov@gmail.com
341977Smax.romanov@gmail.com. auto/cc/deps
342977Smax.romanov@gmail.com
343977Smax.romanov@gmail.com$echo >> $NXT_MAKEFILE
344977Smax.romanov@gmail.com
345977Smax.romanov@gmail.comNXT_JAVA_MODULE_SRCS=" \
346977Smax.romanov@gmail.com    src/nxt_java.c \
347977Smax.romanov@gmail.com    src/java/nxt_jni.c \
348977Smax.romanov@gmail.com    src/java/nxt_jni_Context.c \
349977Smax.romanov@gmail.com    src/java/nxt_jni_HeaderNamesEnumeration.c \
350977Smax.romanov@gmail.com    src/java/nxt_jni_HeadersEnumeration.c \
351977Smax.romanov@gmail.com    src/java/nxt_jni_InputStream.c \
352977Smax.romanov@gmail.com    src/java/nxt_jni_OutputStream.c \
353977Smax.romanov@gmail.com    src/java/nxt_jni_Request.c \
354977Smax.romanov@gmail.com    src/java/nxt_jni_Response.c \
355977Smax.romanov@gmail.com    src/java/nxt_jni_Thread.c \
356977Smax.romanov@gmail.com    src/java/nxt_jni_URLClassLoader.c \
357977Smax.romanov@gmail.com"
358977Smax.romanov@gmail.com
359977Smax.romanov@gmail.com# The Java module object files.
360977Smax.romanov@gmail.com
361977Smax.romanov@gmail.comnxt_objs=$NXT_BUILD_DIR/src/nxt_unit.o
362977Smax.romanov@gmail.com
363977Smax.romanov@gmail.comfor nxt_src in $NXT_JAVA_MODULE_SRCS; do
364977Smax.romanov@gmail.com
365977Smax.romanov@gmail.com    nxt_obj=${nxt_src%.c}-$NXT_JAVA_MODULE.o
366977Smax.romanov@gmail.com    nxt_dep=${nxt_src%.c}-$NXT_JAVA_MODULE.dep
367977Smax.romanov@gmail.com    nxt_dep_flags=`nxt_gen_dep_flags`
368977Smax.romanov@gmail.com    nxt_dep_post=`nxt_gen_dep_post`
369977Smax.romanov@gmail.com    nxt_objs="$nxt_objs $NXT_BUILD_DIR/$nxt_obj"
370977Smax.romanov@gmail.com
371977Smax.romanov@gmail.com    cat << END >> $NXT_MAKEFILE
372977Smax.romanov@gmail.com
3731217Smax.romanov@nginx.com$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
374977Smax.romanov@gmail.com	mkdir -p $NXT_BUILD_DIR/src/java
3751532St.nateldemoura@f5.com	\$(CC) -c \$(CFLAGS) -DNXT_JAVA_MOUNTS_H=\"$NXT_JAVA_MOUNTS_HEADER\" \\
3761532St.nateldemoura@f5.com           \$(NXT_INCS) $NXT_JAVA_INCLUDE \\
377977Smax.romanov@gmail.com	$nxt_dep_flags \\
378977Smax.romanov@gmail.com	-o $NXT_BUILD_DIR/$nxt_obj $nxt_src
379977Smax.romanov@gmail.com	$nxt_dep_post
380977Smax.romanov@gmail.com
381977Smax.romanov@gmail.com-include $NXT_BUILD_DIR/$nxt_dep
382977Smax.romanov@gmail.com
383977Smax.romanov@gmail.comEND
384977Smax.romanov@gmail.com
385977Smax.romanov@gmail.comdone
386977Smax.romanov@gmail.com
387977Smax.romanov@gmail.comNXT_JAVA_SRCS=" \
388977Smax.romanov@gmail.com    src/java/nginx/unit/Context.java \
389977Smax.romanov@gmail.com    src/java/nginx/unit/DynamicDispatcherRequest.java \
390977Smax.romanov@gmail.com    src/java/nginx/unit/DynamicPathRequest.java \
391977Smax.romanov@gmail.com    src/java/nginx/unit/ForwardRequestWrapper.java \
392977Smax.romanov@gmail.com    src/java/nginx/unit/HeaderNamesEnumeration.java \
393977Smax.romanov@gmail.com    src/java/nginx/unit/HeadersEnumeration.java \
394977Smax.romanov@gmail.com    src/java/nginx/unit/IncludeRequestWrapper.java \
395977Smax.romanov@gmail.com    src/java/nginx/unit/IncludeResponseWrapper.java \
396977Smax.romanov@gmail.com    src/java/nginx/unit/InitParams.java \
397977Smax.romanov@gmail.com    src/java/nginx/unit/InputStream.java \
398977Smax.romanov@gmail.com    src/java/nginx/unit/JspPropertyGroup.java \
399977Smax.romanov@gmail.com    src/java/nginx/unit/OutputStream.java \
400977Smax.romanov@gmail.com    src/java/nginx/unit/Request.java \
401977Smax.romanov@gmail.com    src/java/nginx/unit/RequestAttrProxy.java \
402977Smax.romanov@gmail.com    src/java/nginx/unit/Response.java \
403977Smax.romanov@gmail.com    src/java/nginx/unit/Session.java \
404977Smax.romanov@gmail.com    src/java/nginx/unit/SessionAttrProxy.java \
405977Smax.romanov@gmail.com    src/java/nginx/unit/Taglib.java \
406977Smax.romanov@gmail.com    src/java/nginx/unit/UnitSessionCookieConfig.java \
4071157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/AsyncChannelGroupUtil.java \
4081157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/AsyncChannelWrapper.java \
4091157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/AsyncChannelWrapperNonSecure.java \
4101157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/AsyncChannelWrapperSecure.java \
4111157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/AuthenticationException.java \
4121157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/Authenticator.java \
4131157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/AuthenticatorFactory.java \
4141157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/BackgroundProcess.java \
4151157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/BackgroundProcessManager.java \
4161157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/BasicAuthenticator.java \
4171157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/Constants.java \
4181157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/DecoderEntry.java \
4191157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/DigestAuthenticator.java \
4201157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/FutureToSendHandler.java \
4211157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/MessageHandlerResult.java \
4221157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/MessageHandlerResultType.java \
4231157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/MessagePart.java \
4241157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/PerMessageDeflate.java \
4251157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/ReadBufferOverflowException.java \
4261157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/Transformation.java \
4271157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/TransformationFactory.java \
4281157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/TransformationResult.java \
4291157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/Util.java \
4301157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WrappedMessageHandler.java \
4311157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsContainerProvider.java \
4321157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsExtension.java \
4331157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsExtensionParameter.java \
4341157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsFrameBase.java \
4351157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsFrameClient.java \
4361157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsHandshakeResponse.java \
4371157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsIOException.java \
4381157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsPongMessage.java \
4391157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsRemoteEndpointAsync.java \
4401157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsRemoteEndpointBase.java \
4411157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsRemoteEndpointBasic.java \
4421157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsRemoteEndpointImplBase.java \
4431157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsRemoteEndpointImplClient.java \
4441157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsSession.java \
4451157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/WsWebSocketContainer.java \
4461157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/Constants.java \
4471157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoEndpointBase.java \
4481157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoEndpointClient.java \
4491157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoEndpointServer.java \
4501157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMessageHandlerBase.java \
4511157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialBase.java \
4521157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialBinary.java \
4531157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialText.java \
4541157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeBase.java \
4551157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeBinary.java \
4561157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholePong.java \
4571157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeText.java \
4581157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoMethodMapping.java \
4591157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/PojoPathParam.java \
4601157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/pojo/package-info.java \
4611157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/Constants.java \
4621157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/DefaultServerEndpointConfigurator.java \
4631157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/UpgradeUtil.java \
4641157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/UriTemplate.java \
4651157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsContextListener.java \
4661157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsFilter.java \
4671157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsHandshakeRequest.java \
4681157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsHttpUpgradeHandler.java \
4691157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsMappingResult.java \
4701157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsPerSessionServerEndpointConfig.java \
4711157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsRemoteEndpointImplServer.java \
4721157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsSci.java \
4731157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsServerContainer.java \
4741157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsSessionListener.java \
4751157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/WsWriteTimeout.java \
4761157Smax.romanov@nginx.com    src/java/nginx/unit/websocket/server/package-info.java \
4771157Smax.romanov@nginx.com"
4781157Smax.romanov@nginx.com
4791157Smax.romanov@nginx.comNXT_JAVA_WS_API_SRCS=" \
4801157Smax.romanov@nginx.com    src/java/javax/websocket/ClientEndpoint.java \
4811157Smax.romanov@nginx.com    src/java/javax/websocket/ClientEndpointConfig.java \
4821157Smax.romanov@nginx.com    src/java/javax/websocket/CloseReason.java \
4831157Smax.romanov@nginx.com    src/java/javax/websocket/ContainerProvider.java \
4841157Smax.romanov@nginx.com    src/java/javax/websocket/DecodeException.java \
4851157Smax.romanov@nginx.com    src/java/javax/websocket/Decoder.java \
4861157Smax.romanov@nginx.com    src/java/javax/websocket/DefaultClientEndpointConfig.java \
4871157Smax.romanov@nginx.com    src/java/javax/websocket/DeploymentException.java \
4881157Smax.romanov@nginx.com    src/java/javax/websocket/EncodeException.java \
4891157Smax.romanov@nginx.com    src/java/javax/websocket/Encoder.java \
4901157Smax.romanov@nginx.com    src/java/javax/websocket/Endpoint.java \
4911157Smax.romanov@nginx.com    src/java/javax/websocket/EndpointConfig.java \
4921157Smax.romanov@nginx.com    src/java/javax/websocket/Extension.java \
4931157Smax.romanov@nginx.com    src/java/javax/websocket/HandshakeResponse.java \
4941157Smax.romanov@nginx.com    src/java/javax/websocket/MessageHandler.java \
4951157Smax.romanov@nginx.com    src/java/javax/websocket/OnClose.java \
4961157Smax.romanov@nginx.com    src/java/javax/websocket/OnError.java \
4971157Smax.romanov@nginx.com    src/java/javax/websocket/OnMessage.java \
4981157Smax.romanov@nginx.com    src/java/javax/websocket/OnOpen.java \
4991157Smax.romanov@nginx.com    src/java/javax/websocket/PongMessage.java \
5001157Smax.romanov@nginx.com    src/java/javax/websocket/RemoteEndpoint.java \
5011157Smax.romanov@nginx.com    src/java/javax/websocket/SendHandler.java \
5021157Smax.romanov@nginx.com    src/java/javax/websocket/SendResult.java \
5031157Smax.romanov@nginx.com    src/java/javax/websocket/Session.java \
5041157Smax.romanov@nginx.com    src/java/javax/websocket/SessionException.java \
5051157Smax.romanov@nginx.com    src/java/javax/websocket/WebSocketContainer.java \
5061157Smax.romanov@nginx.com    src/java/javax/websocket/server/DefaultServerEndpointConfig.java \
5071157Smax.romanov@nginx.com    src/java/javax/websocket/server/HandshakeRequest.java \
5081157Smax.romanov@nginx.com    src/java/javax/websocket/server/PathParam.java \
5091157Smax.romanov@nginx.com    src/java/javax/websocket/server/ServerApplicationConfig.java \
5101157Smax.romanov@nginx.com    src/java/javax/websocket/server/ServerContainer.java \
5111157Smax.romanov@nginx.com    src/java/javax/websocket/server/ServerEndpoint.java \
5121157Smax.romanov@nginx.com    src/java/javax/websocket/server/ServerEndpointConfig.java \
513977Smax.romanov@gmail.com"
514977Smax.romanov@gmail.com
515977Smax.romanov@gmail.comcat << END >> $NXT_MAKEFILE
516977Smax.romanov@gmail.com
517977Smax.romanov@gmail.com.PHONY: ${NXT_JAVA_MODULE}
518977Smax.romanov@gmail.com.PHONY: ${NXT_JAVA_MODULE}-install
519977Smax.romanov@gmail.com.PHONY: ${NXT_JAVA_MODULE}-uninstall
520977Smax.romanov@gmail.com
521977Smax.romanov@gmail.comall: ${NXT_JAVA_MODULE}
522977Smax.romanov@gmail.com
523977Smax.romanov@gmail.com${NXT_JAVA_MODULE}: $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \
5241157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_UNIT_JAR \
5251157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_WS_API_JAR
526977Smax.romanov@gmail.com
527977Smax.romanov@gmail.com$NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so: $nxt_objs
528977Smax.romanov@gmail.com	\$(NXT_MODULE_LINK) -o $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
529977Smax.romanov@gmail.com	$nxt_objs $NXT_JAVA_LDFLAGS $NXT_LD_OPT
530977Smax.romanov@gmail.com
531977Smax.romanov@gmail.com
532977Smax.romanov@gmail.cominstall: ${NXT_JAVA_MODULE}-install
533977Smax.romanov@gmail.com
534977Smax.romanov@gmail.com${NXT_JAVA_MODULE}-install: $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
5351157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_UNIT_JAR \\
5361157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_WS_API_JAR \\
5371157Smax.romanov@nginx.com    java-shared-install
538977Smax.romanov@gmail.com	install -d \$(DESTDIR)$NXT_MODULES
539977Smax.romanov@gmail.com	install -p $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
540977Smax.romanov@gmail.com		\$(DESTDIR)$NXT_MODULES/
541977Smax.romanov@gmail.com	install -d \$(DESTDIR)$NXT_JARS
542977Smax.romanov@gmail.com	install -p -m 0644 $NXT_BUILD_DIR/$NXT_UNIT_JAR \$(DESTDIR)$NXT_JARS/
5431157Smax.romanov@nginx.com	install -p -m 0644 $NXT_BUILD_DIR/$NXT_WS_API_JAR \$(DESTDIR)$NXT_JARS/
544977Smax.romanov@gmail.com
545977Smax.romanov@gmail.com
546977Smax.romanov@gmail.comuninstall: ${NXT_JAVA_MODULE}-uninstall
547977Smax.romanov@gmail.com
548977Smax.romanov@gmail.com${NXT_JAVA_MODULE}-uninstall: java-shared-uninstall
549977Smax.romanov@gmail.com	rm -f \$(DESTDIR)$NXT_MODULES/${NXT_JAVA_MODULE}.unit.so
550977Smax.romanov@gmail.com	@rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
551977Smax.romanov@gmail.com	rm -f \$(DESTDIR)$NXT_JARS/$NXT_UNIT_JAR
5521157Smax.romanov@nginx.com	rm -f \$(DESTDIR)$NXT_JARS/$NXT_WS_API_JAR
553977Smax.romanov@gmail.com	@rmdir -p \$(DESTDIR)$NXT_JARS 2>/dev/null || true
554977Smax.romanov@gmail.com
555977Smax.romanov@gmail.comEND
556977Smax.romanov@gmail.com
557977Smax.romanov@gmail.comif ! grep ^$NXT_BUILD_DIR/$NXT_UNIT_JAR: $NXT_MAKEFILE 2>&1 > /dev/null; then
558977Smax.romanov@gmail.com
559977Smax.romanov@gmail.com    cat << END >> $NXT_MAKEFILE
560977Smax.romanov@gmail.com
561977Smax.romanov@gmail.comNXT_JAVA_SRCS = $NXT_JAVA_SRCS
562977Smax.romanov@gmail.com
5631157Smax.romanov@nginx.com$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes: \$(NXT_JAVA_SRCS) \\
5641157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_WS_API_JAR
5651157Smax.romanov@nginx.com	rm -rf $NXT_BUILD_DIR/$NXT_JAVA_MODULE/nginx/unit
5661157Smax.romanov@nginx.com	$NXT_JAVAC -d $NXT_BUILD_DIR/$NXT_JAVA_MODULE \\
5671157Smax.romanov@nginx.com		-cp $NXT_JAVA_BUILD_CP:$NXT_BUILD_DIR/$NXT_WS_API_JAR \\
568977Smax.romanov@gmail.com		\$(NXT_JAVA_SRCS)
5691157Smax.romanov@nginx.com	touch \$@
570977Smax.romanov@gmail.com
571977Smax.romanov@gmail.com$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE: LICENSE
572977Smax.romanov@gmail.com	mkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF
573977Smax.romanov@gmail.com	cp -p LICENSE \$@
574977Smax.romanov@gmail.com
575977Smax.romanov@gmail.com$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE: NOTICE
576977Smax.romanov@gmail.com	mkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF
577977Smax.romanov@gmail.com	cp -p NOTICE \$@
578977Smax.romanov@gmail.com
5791157Smax.romanov@nginx.com$NXT_BUILD_DIR/$NXT_UNIT_JAR: \\
5801157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes \\
581977Smax.romanov@gmail.com    $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE \\
582977Smax.romanov@gmail.com    $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE
583977Smax.romanov@gmail.com	$NXT_JAVA_HOME/bin/jar c -C $NXT_BUILD_DIR/$NXT_JAVA_MODULE META-INF \\
584977Smax.romanov@gmail.com		-C $NXT_BUILD_DIR/$NXT_JAVA_MODULE nginx/unit > \$@
585977Smax.romanov@gmail.com
5861157Smax.romanov@nginx.comNXT_JAVA_WS_API_SRCS = $NXT_JAVA_WS_API_SRCS
5871157Smax.romanov@nginx.com
5881157Smax.romanov@nginx.com$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.javax.websocket.classes: \$(NXT_JAVA_WS_API_SRCS)
5891157Smax.romanov@nginx.com	rm -rf $NXT_BUILD_DIR/$NXT_JAVA_MODULE/javax/websocket
5901157Smax.romanov@nginx.com	$NXT_JAVAC -d $NXT_BUILD_DIR/$NXT_JAVA_MODULE -cp $NXT_JAVA_BUILD_CP \\
5911157Smax.romanov@nginx.com		\$(NXT_JAVA_WS_API_SRCS)
5921157Smax.romanov@nginx.com	touch \$@
5931157Smax.romanov@nginx.com
5941157Smax.romanov@nginx.com$NXT_BUILD_DIR/$NXT_WS_API_JAR: \\
5951157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_JAVA_MODULE/.javax.websocket.classes \\
5961157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE \\
5971157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE
5981157Smax.romanov@nginx.com	$NXT_JAVA_HOME/bin/jar c -C $NXT_BUILD_DIR/$NXT_JAVA_MODULE META-INF \\
5991157Smax.romanov@nginx.com		-C $NXT_BUILD_DIR/$NXT_JAVA_MODULE javax/websocket > \$@
6001157Smax.romanov@nginx.com
601977Smax.romanov@gmail.comEND
602977Smax.romanov@gmail.com
6031157Smax.romanov@nginx.comNXT_PROPS="\
6041157Smax.romanov@nginx.com    nginx/unit/websocket/LocalStrings.properties \
6051157Smax.romanov@nginx.com    nginx/unit/websocket/pojo/LocalStrings.properties \
6061157Smax.romanov@nginx.com    nginx/unit/websocket/server/LocalStrings.properties \
6071157Smax.romanov@nginx.com"
6081157Smax.romanov@nginx.com
6091157Smax.romanov@nginx.comfor nxt_prop in $NXT_PROPS ; do
6101157Smax.romanov@nginx.com
6111157Smax.romanov@nginx.com    cat << END >> $NXT_MAKEFILE
6121157Smax.romanov@nginx.com$NXT_BUILD_DIR/$NXT_JAVA_MODULE/$nxt_prop: src/java/$nxt_prop \\
6131157Smax.romanov@nginx.com    $NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes
6141157Smax.romanov@nginx.com	cp src/java/$nxt_prop \$@
6151157Smax.romanov@nginx.com
6161157Smax.romanov@nginx.com$NXT_BUILD_DIR/$NXT_UNIT_JAR: $NXT_BUILD_DIR/$NXT_JAVA_MODULE/$nxt_prop
6171157Smax.romanov@nginx.com
6181157Smax.romanov@nginx.comEND
6191157Smax.romanov@nginx.com
6201157Smax.romanov@nginx.comdone
6211157Smax.romanov@nginx.com
622977Smax.romanov@gmail.comfi
623977Smax.romanov@gmail.com
624977Smax.romanov@gmail.comif ! grep ^java-shared-install: $NXT_MAKEFILE 2>&1 > /dev/null; then
625977Smax.romanov@gmail.com
626977Smax.romanov@gmail.com    cat << END >> $NXT_MAKEFILE
627977Smax.romanov@gmail.com
628977Smax.romanov@gmail.com.PHONY: java-shared-install
629977Smax.romanov@gmail.com.PHONY: java-shared-uninstall
630977Smax.romanov@gmail.com
631977Smax.romanov@gmail.comjava-shared-install: $NXT_JAVA_INSTALL_JARS
632977Smax.romanov@gmail.com	install -d \$(DESTDIR)$NXT_JARS
633977Smax.romanov@gmail.com	install -p -m 0644 $NXT_JAVA_INSTALL_JARS \$(DESTDIR)$NXT_JARS/
634977Smax.romanov@gmail.com
635977Smax.romanov@gmail.comjava-shared-uninstall:
636977Smax.romanov@gmail.com	rm -f $NXT_JAVA_UNINSTALL_JARS
637977Smax.romanov@gmail.com	@rmdir -p \$(DESTDIR)$NXT_JARS 2>/dev/null || true
638977Smax.romanov@gmail.com
639977Smax.romanov@gmail.comEND
640977Smax.romanov@gmail.com
641977Smax.romanov@gmail.comfi
642