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