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