1 | # $Id: Makefile.kmk 72124 2018-05-04 21:24:22Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VirtualBox Guest Addition X11 Client.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2017 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 | #
|
---|
22 | # VBoxClient - clipboard and seamless.
|
---|
23 | #
|
---|
24 | PROGRAMS += VBoxClient
|
---|
25 |
|
---|
26 | VBoxClient_TEMPLATE = NewVBoxGuestR3Exe
|
---|
27 | VBoxClient_DEFS += VBOX_X11_CLIPBOARD VBOX_WITH_HGCM
|
---|
28 | ifdef VBOX_WITH_DBUS
|
---|
29 | VBoxClient_DEFS += VBOX_WITH_DBUS
|
---|
30 | endif
|
---|
31 | VBoxClient_DEFS.linux += _GNU_SOURCE
|
---|
32 | VBoxClient_INCS = $(VBOX_GRAPHICS_INCS)
|
---|
33 | VBoxClient_SOURCES = \
|
---|
34 | main.cpp
|
---|
35 | VBoxClient_SOURCES += \
|
---|
36 | $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-helper.cpp \
|
---|
37 | $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp \
|
---|
38 | clipboard.cpp \
|
---|
39 | display-svga.cpp \
|
---|
40 | display-svga-x11.cpp
|
---|
41 | VBoxClient_LIBPATH = \
|
---|
42 | $(VBOX_LIBPATH32_X11)
|
---|
43 | VBoxClient_LIBS.freebsd = \
|
---|
44 | iconv
|
---|
45 | VBoxClient_LIBS.linux = \
|
---|
46 | dl
|
---|
47 | VBoxClient_LIBS.solaris = \
|
---|
48 | dl
|
---|
49 | VBoxClient_LIBS = \
|
---|
50 | X11 \
|
---|
51 | Xrandr \
|
---|
52 | Xt
|
---|
53 |
|
---|
54 | # XXX: -L comes from the template, but not rpath
|
---|
55 | VBoxClient_LDFLAGS.netbsd = \
|
---|
56 | -Wl,-rpath /usr/X11R7/lib
|
---|
57 |
|
---|
58 | ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
59 | ifdef VBOX_DND_WITH_XTEST
|
---|
60 | VBoxClient_DEFS += VBOX_DND_WITH_XTEST
|
---|
61 | VBoxClient_LIBS += \
|
---|
62 | Xtst
|
---|
63 | endif
|
---|
64 | endif
|
---|
65 |
|
---|
66 | # These are static replacements for gcc-specific parts of libstdc++
|
---|
67 | VBoxClient_LIBS += \
|
---|
68 | supc++ \
|
---|
69 | gcc_eh
|
---|
70 | # This has to be in LIBS, so as to be linked in after supc++ and gcc_eh, which
|
---|
71 | # depend on the symbols it provides. Static supc++ and gcc_eh on at least
|
---|
72 | # Ubuntu 17.04 contain references to __sprintf_chk and __stack_chk_fail.
|
---|
73 | # Furthermore, they contain references to memcpy, which needs to be resolved
|
---|
74 | # to memcpy@GLIBC_2.2.5, which we solve in a not-very-satisfactory way with a
|
---|
75 | # wrapper.
|
---|
76 | ##
|
---|
77 | ## @todo r=bird: With all due respect, what are you smoking?? The above does not compute,
|
---|
78 | ## so there is either some other reason which you fail to describe or you've got it all wrong.
|
---|
79 | ## It cannot be for reasons of symbol resolution, because puttin chk_stubs.c in SOURCES would
|
---|
80 | ## make absolutely sure the symbols in it would always be part of the link and present in the
|
---|
81 | ## symbol table before any library searching is done. I cannot see how the --wrap-memcpy could
|
---|
82 | ## have anything to do with this either.
|
---|
83 | ##
|
---|
84 | ## Your query on IRC why chk_stubs.c is treated as C++, that's because the linker is called g++.
|
---|
85 | ##
|
---|
86 | ## Please explain why this nonsese is required or I will revert it and leave you deal with the consequences.
|
---|
87 | ##
|
---|
88 | ## -bird
|
---|
89 | ##
|
---|
90 | ifeq ($(KBUILD_TARGET),linux)
|
---|
91 | VBoxClient_LIBS += \
|
---|
92 | $(PATH_ROOT)/src/VBox/Additions/x11/VBoxClient/chk_stubs.c
|
---|
93 | VBoxClient_LDFLAGS.amd64 += \
|
---|
94 | -Wl,--wrap=memcpy
|
---|
95 | endif
|
---|
96 |
|
---|
97 | ifdef VBOX_X11_SEAMLESS_GUEST
|
---|
98 | VBoxClient_DEFS += SEAMLESS_GUEST DYNAMIC_RESIZE
|
---|
99 | VBoxClient_SOURCES += \
|
---|
100 | seamless.cpp \
|
---|
101 | seamless-x11.cpp \
|
---|
102 | display.cpp \
|
---|
103 | hostversion.cpp \
|
---|
104 | check3d.cpp
|
---|
105 | VBoxClient_LIBS += \
|
---|
106 | Xext Xmu
|
---|
107 | endif
|
---|
108 | ifdef VBOX_WITH_GUEST_PROPS
|
---|
109 | VBoxClient_DEFS += VBOX_WITH_GUEST_PROPS
|
---|
110 | endif
|
---|
111 | ifdef VBOX_WITH_DRAG_AND_DROP
|
---|
112 | VBoxClient_DEFS += \
|
---|
113 | VBOX_WITH_DRAG_AND_DROP \
|
---|
114 | $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,)
|
---|
115 | VBoxClient_SOURCES += \
|
---|
116 | draganddrop.cpp
|
---|
117 | VBoxClient_LIBS += \
|
---|
118 | $(PATH_STAGE_LIB)/additions/VBoxDnDGuestR3Lib$(VBOX_SUFF_LIB)
|
---|
119 | endif
|
---|
120 |
|
---|
121 | ifdef VBOX_X11_SEAMLESS_GUEST
|
---|
122 | if defined(VBOX_WITH_TESTCASES) && !defined(VBOX_ONLY_ADDITIONS) && !defined(VBOX_ONLY_SDK)
|
---|
123 | if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris)
|
---|
124 |
|
---|
125 | # Set this in LocalConfig.kmk if you are working on the X11 clipboard service
|
---|
126 | # to automatically run the unit test at build time.
|
---|
127 | # OTHERS += $(tstSeamlessX11-auto_0_OUTDIR)/tstSeamlessX11-auto.run
|
---|
128 |
|
---|
129 | PROGRAMS += tstSeamlessX11-auto
|
---|
130 | tstSeamlessX11-auto_TEMPLATE = VBOXR3TSTEXE
|
---|
131 | tstSeamlessX11-auto_SOURCES = \
|
---|
132 | testcase/tstSeamlessX11-auto.cpp \
|
---|
133 | seamless-x11.cpp
|
---|
134 | tstSeamlessX11-auto_DEFS = TESTCASE
|
---|
135 | tstSeamlessX11-auto_LIBS = \
|
---|
136 | $(LIB_RUNTIME)
|
---|
137 |
|
---|
138 | TESTING += $(tstSeamlessX11-auto_0_OUTDIR)/tstSeamlessX11-auto
|
---|
139 | $$(tstSeamlessX11-auto_0_OUTDIR)/tstSeamlessX11-auto.run: \
|
---|
140 | $$(tstSeamlessX11-auto_1_STAGE_TARGET)
|
---|
141 | export VBOX_LOG_DEST=nofile; $(tstSeamlessX11-auto_1_STAGE_TARGET) quiet
|
---|
142 | $(QUIET)$(APPEND) -t "$@" "done"
|
---|
143 |
|
---|
144 | #
|
---|
145 | # Additional testcase designed to be run manually, which initiates and starts the Linux
|
---|
146 | # guest client part of the seamless additions in the host, faking seamless events from
|
---|
147 | # the host and writing information about guest events to standard output.
|
---|
148 | #
|
---|
149 | PROGRAMS += tstSeamlessX11
|
---|
150 | tstSeamlessX11_TEMPLATE = VBOXR3TSTEXE
|
---|
151 | tstSeamlessX11_SOURCES = \
|
---|
152 | testcase/tstSeamlessX11.cpp \
|
---|
153 | seamless.cpp \
|
---|
154 | seamless-x11.cpp
|
---|
155 | tstSeamlessX11_LIBPATH = \
|
---|
156 | $(VBOX_LIBPATH_X11)
|
---|
157 | tstSeamlessX11_LIBS = \
|
---|
158 | $(LIB_RUNTIME) \
|
---|
159 | Xext \
|
---|
160 | Xmu \
|
---|
161 | X11
|
---|
162 | endif
|
---|
163 | endif
|
---|
164 | endif
|
---|
165 |
|
---|
166 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
167 |
|
---|