1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24PRJ := ..$/..$/..
25PRJNAME := bridges
26
27TARGET := test_javauno_nativethreadpool
28PACKAGE := test$/javauno$/nativethreadpool
29
30ENABLE_EXCEPTIONS := TRUE
31
32#TODO:
33.IF "$(OS)" == "LINUX"
34JVM_LIB_URL := file:///net/grande.germany/develop6/update/dev/Linux_JDK_1.4.1_03/jre/lib/i386/client/libjvm.so
35.ELSE
36ERROR -- missing platform
37.ENDIF
38
39.INCLUDE: settings.mk
40
41DLLPRE = # no leading "lib" on .so files
42INCPRE += $(MISC)$/$(TARGET)$/inc
43
44SHL1TARGET = $(TARGET)_client.uno
45SHL1OBJS = $(SLO)$/testnativethreadpoolclient.obj
46SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB)
47SHL1VERSIONMAP = version.map
48SHL1IMPLIB = i$(TARGET)_client
49
50SHL2TARGET = $(TARGET)_server.uno
51SHL2OBJS = $(SLO)$/testnativethreadpoolserver.obj
52SHL2STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB)
53SHL2VERSIONMAP = version.map
54SHL2IMPLIB = i$(TARGET)_server
55
56SLOFILES = $(SHL1OBJS) $(SHL2OBJS)
57
58JAVAFILES = Relay.java
59JARFILES = java_uno.jar juh.jar jurt.jar ridl.jar
60
61.INCLUDE: target.mk
62
63ALLTAR: test
64
65EXEC_CLASSPATH_TMP = $(foreach,i,$(JARFILES) $(SOLARBINDIR)$/$i)
66EXEC_CLASSPATH = \
67    $(strip $(subst,!,$(PATH_SEPERATOR) $(EXEC_CLASSPATH_TMP:s/ /!/)))
68
69$(MISC)$/$(TARGET)$/types.rdb: types.idl
70    - rm $@
71    - $(MKDIR) $(MISC)$/$(TARGET)
72    - $(MKDIR) $(MISC)$/$(TARGET)$/inc
73    $(IDLC) -I$(SOLARIDLDIR) -O$(MISC)$/$(TARGET) $<
74    $(REGMERGE) $@ /UCR $(MISC)$/$(TARGET)$/types.urd
75    $(CPPUMAKER) -BUCR -C -O$(MISC)$/$(TARGET)$/inc $@ -X$(SOLARBINDIR)$/types.rdb
76    $(JAVAMAKER) -BUCR -nD -O$(CLASSDIR) $@ -X$(SOLARBINDIR)$/types.rdb
77
78$(SLOFILES) $(JAVACLASSFILES): $(MISC)$/$(TARGET)$/types.rdb
79
80$(BIN)$/$(TARGET).uno.jar: $(JAVACLASSFILES) relay.manifest
81    jar cfm $@ relay.manifest -C $(CLASSDIR) test/javauno/nativethreadpool
82
83$(BIN)$/$(TARGET).rdb .ERRREMOVE: $(MISC)$/$(TARGET)$/types.rdb \
84        $(BIN)$/$(TARGET).uno.jar
85	cp $(MISC)$/$(TARGET)$/types.rdb $@
86    $(REGMERGE) $@ / $(SOLARBINDIR)$/types.rdb
87    $(REGCOMP) -register -r $@ -c acceptor.uno$(DLLPOST) \
88        -c bridgefac.uno$(DLLPOST) -c connector.uno$(DLLPOST) \
89        -c remotebridge.uno$(DLLPOST) -c uuresolver.uno$(DLLPOST) \
90        -c javaloader.uno$(DLLPOST) -c javavm.uno$(DLLPOST) \
91        -c stocservices.uno$(DLLPOST)
92    cp $(SOLARBINDIR)$/types.rdb $(MISC)$/$(TARGET)$/bootstrap.rdb
93    $(REGCOMP) -register -r $(MISC)$/$(TARGET)$/bootstrap.rdb \
94        -c javaloader.uno$(DLLPOST) -c javavm.uno$(DLLPOST) \
95        -c stocservices.uno$(DLLPOST)
96.IF "$(GUI)" == "WNT"
97    ERROR -- missing platform
98.ELSE # GUI, WNT
99    + export OO_JAVA_PROPERTIES='RuntimeLib=$(JVM_LIB_URL)' && \
100        $(REGCOMP) -register -r $@ -c file://$(PWD)/$(BIN)$/$(TARGET).uno.jar \
101        -br $(MISC)$/$(TARGET)$/bootstrap.rdb -classpath $(EXEC_CLASSPATH) \
102        -env:URE_INTERNAL_JAVA_DIR=file://$(SOLARBINDIR)
103.ENDIF # GUI, WNT
104
105test .PHONY: $(SHL1TARGETN) $(BIN)$/$(TARGET).uno.jar $(BIN)$/$(TARGET).rdb
106.IF "$(GUI)" == "WNT"
107    ERROR -- missing platform
108.ELSE # GUI, WNT
109    $(AUGMENT_LIBRARY_PATH) uno -c test.javauno.nativethreadpool.server \
110        -l $(SHL2TARGETN) -ro $(BIN)$/$(TARGET).rdb \
111        -u 'uno:socket,host=localhost,port=3830;urp;test' --singleaccept &
112    + $(AUGMENT_LIBRARY_PATH) OO_JAVA_PROPERTIES='RuntimeLib=$(JVM_LIB_URL)' \
113        CLASSPATH=$(EXEC_CLASSPATH)$(PATH_SEPERATOR)$(BIN)$/$(TARGET).uno.jar \
114        uno -c test.javauno.nativethreadpool.client -l $(SHL1TARGETN) \
115        -ro $(BIN)$/$(TARGET).rdb \
116        -env:URE_INTERNAL_JAVA_DIR=file://$(SOLARBINDIR)
117.ENDIF # GUI, WNT
118