1 | # $Id: Makefile.kmk 87685 2021-02-10 13:13:31Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VirtualBox Guest Addition X11 Client.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2020 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | # Use header files from our tree for randr and xinerama. and don't link but rather dlopen libXrand
|
---|
22 | VBOX_WITH_DISTRO_XRAND_XINERAMA=
|
---|
23 |
|
---|
24 | # We don't yet have a seamless mode compilation flag, so define it here unconditionally.
|
---|
25 | VBOX_WITH_SEAMLESS:=1
|
---|
26 |
|
---|
27 | #
|
---|
28 | # VBoxClient - clipboard and seamless.
|
---|
29 | #
|
---|
30 | PROGRAMS += VBoxClient
|
---|
31 | #
|
---|
32 | # Please make sure that you grep the source tree and modify all occurences accordingly
|
---|
33 | # if you rename the following program name.
|
---|
34 | #
|
---|
35 | PROGRAMS += VBoxDRMClient
|
---|
36 |
|
---|
37 | VBoxClient_TEMPLATE = NewVBoxGuestR3Exe
|
---|
38 | VBoxClient_DEFS += VBOX_X11_CLIPBOARD VBOX_WITH_HGCM
|
---|
39 | VBoxClient_DEFS += VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
|
---|
40 | ifdef VBOX_WITH_DBUS
|
---|
41 | VBoxClient_DEFS += VBOX_WITH_DBUS
|
---|
42 | endif
|
---|
43 |
|
---|
44 | VBoxClient_DEFS.linux += _GNU_SOURCE
|
---|
45 | VBoxClient_INCS = $(VBOX_GRAPHICS_INCS)
|
---|
46 | VBoxClient_INCS += ../x11include/panoramiXproto-1.1
|
---|
47 | VBoxClient_INCS += ../x11include/libXrandr-1.5.2
|
---|
48 | VBoxClient_INCS += ../x11include/randrproto-1.6.0
|
---|
49 | VBoxClient_SOURCES = \
|
---|
50 | main.cpp \
|
---|
51 | logging.cpp
|
---|
52 |
|
---|
53 | VBoxDRMClient_TEMPLATE = NewVBoxGuestR3Exe
|
---|
54 | VBoxDRMClient_DEFS += VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
|
---|
55 | VBoxDRMClient_SOURCES = \
|
---|
56 | display-drm.cpp \
|
---|
57 | logging.cpp
|
---|
58 |
|
---|
59 |
|
---|
60 | VBoxClient_SOURCES.linux = \
|
---|
61 | chk_stubs.c
|
---|
62 | VBoxClient_LIBPATH = \
|
---|
63 | $(VBOX_LIBPATH32_X11)
|
---|
64 | VBoxClient_LIBS.freebsd = \
|
---|
65 | iconv
|
---|
66 | VBoxClient_LIBS.linux = \
|
---|
67 | dl
|
---|
68 | VBoxClient_LIBS.netbsd = \
|
---|
69 | crypt
|
---|
70 | VBoxClient_LIBS.solaris = \
|
---|
71 | dl
|
---|
72 | VBoxClient_LIBS = \
|
---|
73 | X11 Xt Xext Xmu
|
---|
74 | ifdef VBOX_WITH_DISTRO_XRAND_XINERAMA
|
---|
75 | VBoxClient_DEFS += WITH_DISTRO_XRAND_XINERAMA
|
---|
76 | VBoxClient_LIBS += Xrandr
|
---|
77 | endif
|
---|
78 |
|
---|
79 | # XXX: -L comes from the template, but not rpath
|
---|
80 | VBoxClient_LDFLAGS.netbsd = \
|
---|
81 | -Wl,-rpath /usr/X11R7/lib
|
---|
82 |
|
---|
83 | ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
84 | ifdef VBOX_DND_WITH_XTEST
|
---|
85 | VBoxClient_DEFS += VBOX_DND_WITH_XTEST
|
---|
86 | VBoxClient_LIBS += \
|
---|
87 | Xtst
|
---|
88 | endif
|
---|
89 | endif
|
---|
90 |
|
---|
91 | # This forces the memcpy references in the static libraries to go to
|
---|
92 | # __wrap_memcpy, which we can wrap around memcpy@GLIBC_2.2.5. I do not know
|
---|
93 | # how else to do that without recompiling or implementing our own memcpy.
|
---|
94 | ifeq ($(KBUILD_TARGET),linux)
|
---|
95 | VBoxClient_LDFLAGS.amd64 += \
|
---|
96 | -Wl,--wrap=memcpy
|
---|
97 | endif
|
---|
98 |
|
---|
99 | ifdef VBOX_WITH_GUEST_PROPS
|
---|
100 | VBoxClient_DEFS += VBOX_WITH_GUEST_PROPS
|
---|
101 | VBoxClient_SOURCES += \
|
---|
102 | hostversion.cpp
|
---|
103 | endif
|
---|
104 |
|
---|
105 | ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
106 | VBoxClient_DEFS += \
|
---|
107 | VBOX_WITH_DRAG_AND_DROP \
|
---|
108 | $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,)
|
---|
109 | VBoxClient_SOURCES += \
|
---|
110 | draganddrop.cpp
|
---|
111 | VBoxClient_LIBS += \
|
---|
112 | $(VBOX_LIB_VBGL_R3) \
|
---|
113 | $(PATH_STAGE_LIB)/additions/VBoxDnDGuestR3Lib$(VBOX_SUFF_LIB)
|
---|
114 | endif
|
---|
115 |
|
---|
116 | ifdef VBOX_WITH_SEAMLESS
|
---|
117 | VBoxClient_DEFS += VBOX_WITH_SEAMLESS
|
---|
118 | VBoxClient_SOURCES += \
|
---|
119 | seamless.cpp \
|
---|
120 | seamless-x11.cpp
|
---|
121 | endif
|
---|
122 |
|
---|
123 | ifdef VBOX_WITH_VMSVGA
|
---|
124 | VBoxClient_DEFS += VBOX_WITH_VMSVGA
|
---|
125 | VBoxClient_SOURCES += \
|
---|
126 | display-svga-x11.cpp
|
---|
127 | endif
|
---|
128 |
|
---|
129 | ifdef VBOX_WITH_SHARED_CLIPBOARD
|
---|
130 | VBoxClient_DEFS += VBOX_WITH_SHARED_CLIPBOARD
|
---|
131 | VBoxClient_SOURCES += \
|
---|
132 | $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp \
|
---|
133 | $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp \
|
---|
134 | clipboard.cpp
|
---|
135 | ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
|
---|
136 | VBoxClient_DEFS += VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS VBOX_WITH_SHARED_CLIPBOARD_GUEST
|
---|
137 | VBoxClient_SOURCES += \
|
---|
138 | $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp \
|
---|
139 | $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardPath.cpp
|
---|
140 | ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP
|
---|
141 | VBoxClient_DEFS += VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP
|
---|
142 | VBoxClient_SOURCES += \
|
---|
143 | $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-transfers-http.cpp
|
---|
144 | endif
|
---|
145 | ifdef VBOX_WITH_SHARED_CLIPBOARD_FUSE
|
---|
146 | VBoxClient_DEFS += VBOX_WITH_SHARED_CLIPBOARD_FUSE
|
---|
147 | # @todo Make this dynamic loading more generic.
|
---|
148 | VBoxClient_SOURCES += \
|
---|
149 | $(PATH_ROOT)/src/VBox/ImageMounter/vboximg-mount/fuse.cpp \
|
---|
150 | clipboard-fuse.cpp
|
---|
151 | # @todo Ditto.
|
---|
152 | VBoxClient_INCS += \
|
---|
153 | $(PATH_ROOT)/src/VBox/ImageMounter/vboximg-mount
|
---|
154 | endif
|
---|
155 | endif
|
---|
156 | endif
|
---|
157 |
|
---|
158 | if defined(VBOX_WITH_TESTCASES) && !defined(VBOX_ONLY_ADDITIONS) && !defined(VBOX_ONLY_SDK)
|
---|
159 | if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris)
|
---|
160 |
|
---|
161 | # Set this in LocalConfig.kmk if you are working on the X11 clipboard service
|
---|
162 | # to automatically run the unit test at build time.
|
---|
163 | # OTHERS += $(tstSeamlessX11-auto_0_OUTDIR)/tstSeamlessX11-auto.run
|
---|
164 |
|
---|
165 | PROGRAMS += tstSeamlessX11-auto
|
---|
166 | tstSeamlessX11-auto_TEMPLATE = VBOXR3TSTEXE
|
---|
167 | tstSeamlessX11-auto_SOURCES = \
|
---|
168 | testcase/tstSeamlessX11-auto.cpp \
|
---|
169 | seamless-x11.cpp
|
---|
170 | tstSeamlessX11-auto_DEFS = TESTCASE
|
---|
171 | tstSeamlessX11-auto_LIBS = \
|
---|
172 | $(LIB_RUNTIME)
|
---|
173 |
|
---|
174 | TESTING += $(tstSeamlessX11-auto_0_OUTDIR)/tstSeamlessX11-auto
|
---|
175 | $$(tstSeamlessX11-auto_0_OUTDIR)/tstSeamlessX11-auto.run: \
|
---|
176 | $$(tstSeamlessX11-auto_1_STAGE_TARGET)
|
---|
177 | export VBOX_LOG_DEST=nofile; $(tstSeamlessX11-auto_1_STAGE_TARGET) quiet
|
---|
178 | $(QUIET)$(APPEND) -t "$@" "done"
|
---|
179 |
|
---|
180 | #
|
---|
181 | # Additional testcase designed to be run manually, which initiates and starts the Linux
|
---|
182 | # guest client part of the seamless additions in the host, faking seamless events from
|
---|
183 | # the host and writing information about guest events to standard output.
|
---|
184 | #
|
---|
185 | PROGRAMS += tstSeamlessX11
|
---|
186 | tstSeamlessX11_TEMPLATE = VBOXR3TSTEXE
|
---|
187 | tstSeamlessX11_SOURCES = \
|
---|
188 | testcase/tstSeamlessX11.cpp \
|
---|
189 | seamless.cpp \
|
---|
190 | seamless-x11.cpp
|
---|
191 | tstSeamlessX11_DEFS += VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
|
---|
192 | tstSeamlessX11_LIBPATH = \
|
---|
193 | $(VBOX_LIBPATH_X11)
|
---|
194 | tstSeamlessX11_LIBS = \
|
---|
195 | $(LIB_RUNTIME) \
|
---|
196 | Xext \
|
---|
197 | Xmu \
|
---|
198 | X11
|
---|
199 | endif
|
---|
200 | endif
|
---|
201 |
|
---|
202 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|