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_acquire
28PACKAGE := test$/javauno$/acquire
29
30ENABLE_EXCEPTIONS := TRUE
31
32.INCLUDE: settings.mk
33
34DLLPRE = # no leading "lib" on .so files
35INCPRE += $(MISC)$/$(TARGET)$/inc
36
37SLOFILES = $(SLO)$/testacquire.obj
38
39SHL1TARGET = testacquire.uno
40SHL1OBJS = $(SLOFILES)
41SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB)
42SHL1VERSIONMAP = $(SOLARENV)/src/component.map
43SHL1IMPLIB = itestacquire
44
45JAVAFILES = TestAcquire.java
46JARFILES = OOoRunner.jar juh.jar jurt.jar ridl.jar
47
48.INCLUDE: target.mk
49
50ALLTAR: \
51    $(BIN)$/testacquire-java-client \
52    $(BIN)$/testacquire-java-server \
53    $(BIN)$/testacquire-native-client \
54    $(BIN)$/testacquire-native-server
55
56.IF "$(GUI)" == "WNT"
57GIVE_EXEC_RIGHTS = @echo
58.ELSE # GUI, WNT
59GIVE_EXEC_RIGHTS = chmod +x
60.ENDIF # GUI, WNT
61
62EXEC_CLASSPATH_TMP = $(foreach,i,$(JARFILES) $(SOLARBINDIR)$/$i)
63EXEC_CLASSPATH = \
64    $(strip $(subst,!,$(PATH_SEPERATOR) $(EXEC_CLASSPATH_TMP:s/ /!/)))
65
66$(BIN)$/$(TARGET).rdb: types.idl
67    - rm $@
68    - $(MKDIR) $(MISC)$/$(TARGET)
69    - $(MKDIR) $(MISC)$/$(TARGET)$/inc
70    $(IDLC) -I$(SOLARIDLDIR) -O$(MISC)$/$(TARGET) $<
71    $(REGMERGE) $@ /UCR $(MISC)$/$(TARGET)$/types.urd
72    $(CPPUMAKER) -BUCR -C -O$(MISC)$/$(TARGET)$/inc $@ -X$(SOLARBINDIR)$/types.rdb
73    $(JAVAMAKER) -BUCR -nD -O$(CLASSDIR) $@ -X$(SOLARBINDIR)$/types.rdb
74    $(REGMERGE) $@ / $(SOLARBINDIR)$/types.rdb
75    $(REGCOMP) -register -r $@ -c acceptor.uno$(DLLPOST) \
76        -c bridgefac.uno$(DLLPOST) -c connector.uno$(DLLPOST) \
77        -c remotebridge.uno$(DLLPOST) -c uuresolver.uno$(DLLPOST)
78
79$(SLOFILES) $(JAVACLASSFILES): $(BIN)$/$(TARGET).rdb
80
81# Use "127.0.0.1" instead of "localhost", see #i32281#:
82TEST_JAVAUNO_ACQUIRE_UNO_URL := \
83    \"'uno:socket,host=127.0.0.1,port=2002;urp;test'\"
84
85$(BIN)$/testacquire-java-client:
86    echo java -classpath \
87        ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)\
88..$/class$/java_uno.jar$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \
89        test.javauno.acquire.TestAcquire client \
90        $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@
91    $(GIVE_EXEC_RIGHTS) $@
92
93$(BIN)$/testacquire-java-server:
94    echo java -classpath \
95        ..$/class$/test$(PATH_SEPERATOR)..$/class$(PATH_SEPERATOR)\
96..$/class$/java_uno.jar$(PATH_SEPERATOR)$(EXEC_CLASSPATH) \
97        test.javauno.acquire.TestAcquire server \
98        $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@
99    $(GIVE_EXEC_RIGHTS) $@
100
101$(BIN)$/testacquire-native-client:
102    echo '$(AUGMENT_LIBRARY_PATH)' uno \
103        -c com.sun.star.test.bridges.testacquire.impl \
104        -l ../lib/$(SHL1TARGETN:f) -ro $(TARGET).rdb -- \
105        $(TEST_JAVAUNO_ACQUIRE_UNO_URL) > $@
106    $(GIVE_EXEC_RIGHTS) $@
107
108$(BIN)$/testacquire-native-server:
109    echo '$(AUGMENT_LIBRARY_PATH)' uno \
110        -c com.sun.star.test.bridges.testacquire.impl \
111        -l ../lib/$(SHL1TARGETN:f) -ro $(TARGET).rdb \
112        -u $(TEST_JAVAUNO_ACQUIRE_UNO_URL) --singleaccept > $@
113    $(GIVE_EXEC_RIGHTS) $@
114