summaryrefslogtreecommitdiffstats
path: root/src/VBox/Additions/x11/vboxmouse/Makefile.kmk
blob: 8bc81b30a542f2d2d3e3b61e899b09e7cf8649a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the VBox Additions XFree86 and X.org mouse drivers.
#

#
# Copyright (C) 2006-2019 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#

SUB_DEPTH = ../../../../..
include $(KBUILD_PATH)/subheader.kmk

vboxmouse_xorg_INCS = \
	$(VBOX_PATH_X11_ROOT)/inputproto-1.9.99.902 \
	$(VBOX_PATH_X11_ROOT)/libpciaccess-0.10.8 \
	$(VBOX_PATH_X11_ROOT)/pixman-0.16.0 \
	$(VBOX_PATH_X11_ROOT)/xextproto-7.1.1 \
	$(VBOX_PATH_X11_ROOT)/xproto-7.0.18

#
# vboxmouse_drv
#
if1of ($(KBUILD_TARGET), linux)
 SYSMODS += vboxmouse_drv
 vboxmouse_drv_TEMPLATE = VBOXGUESTR3XF86MOD
 vboxmouse_drv_DEFS.linux = linux
 vboxmouse_drv_DEFS.x86 += __i386__
 # This one has to be defined when building server code on systems where
 # unsigned long is 64bits
 vboxmouse_drv_DEFS.amd64 += _XSERVER64
 vboxmouse_drv_DEFS += \
        _POSIX_C_SOURCE=199309L _POSIX_SOURCE _XOPEN_SOURCE _DEFAULT_SOURCE \
	_BSD_SOURCE _SVID_SOURCE _GNU_SOURCE SHAPE XINPUT XKB LBX XAPPGROUP \
	XCSECURITY TOGCUP XF86BIGFONT DPMSExtension PIXPRIV PANORAMIX RENDER \
	GCCUSESGAS AVOID_GLYPHBLT PIXPRIV SINGLEDEPTH XFreeXDGA XvExtension \
	XFree86LOADER XFree86Server XF86VIDMODE XvMCExtension SMART_SCHEDULE \
	BUILDDEBUG X_BYTE_ORDER=X_LITTLE_ENDIAN DNDEBUG FUNCPROTO=15 NARROWPROTO \
	IN_MODULE XFree86Module PNP_MOUSE IN_XF86_MODULE
 vboxmouse_drv_INCS := \
	$(VBOX_PATH_X11_ROOT)/XFree86-4.3 \
	$(VBOX_PATH_X11_ROOT)/XFree86-4.3/X11 \
	$(VBOX_PATH_X11_ROOT)/XFree86-4.3/X11/extensions \
	$(VBOX_PATH_X11_ROOT)/XFree86-4.3/Xserver \
	$(PATH_SUB_CURRENT)
 vboxmouse_drv_SOURCES = \
	vboxmouse.c
 # Any global symbols in the driver object files will be added to XFree86's
 # symbol table, which can cause problems if we e.g. define a symbol in two
 # modules.
 vboxmouse_drv_POST_CMDS = \
	objcopy --keep-global-symbol vboxmouseModuleData $(out) $(out)-objcopy$$(NLTAB) \
	$(MV) -f $(out)-objcopy $(out)
endif


#
# vboxmouse_drv_70
#
DLLS += vboxmouse_drv_70
vboxmouse_drv_70_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_70_DEFS = \
	XFree86Server IN_MODULE XFree86Module XFree86LOADER XINPUT XORG_7X IN_XF86_MODULE DONT_DEFINE_WRAPPERS NO_ANSIC
vboxmouse_drv_70_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.0.1 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_70_SOURCES = \
	vboxmouse.c


#
# vboxmouse_drv_71
#
DLLS += vboxmouse_drv_71
vboxmouse_drv_71_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_71_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_71_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.1.0 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_71_SOURCES = \
	vboxmouse.c


#
# vboxmouse_drv_13
#
DLLS += vboxmouse_drv_13
vboxmouse_drv_13_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_13_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_13_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.3.0.0 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_13_SOURCES = \
	vboxmouse.c


#
# vboxmouse_drv_14
#
DLLS += vboxmouse_drv_14
vboxmouse_drv_14_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_14_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_14_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.4.2 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_14_SOURCES = \
	vboxmouse.c


#
# vboxmouse_drv_15
#
DLLS += vboxmouse_drv_15
vboxmouse_drv_15_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_15_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_15_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.5.3 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_15_SOURCES = \
	vboxmouse.c


#
# vboxmouse_drv_16
#
DLLS += vboxmouse_drv_16
vboxmouse_drv_16_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_16_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_16_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.6.5 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_16_SOURCES = \
	vboxmouse.c


ifneq ($(KBUILD_TARGET), linux)

#
# vboxmouse_drv_17
#
DLLS += vboxmouse_drv_17
vboxmouse_drv_17_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_17_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_17_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.7.7 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_17_SOURCES = \
	vboxmouse.c


#
# vboxmouse_drv_18
#
DLLS += vboxmouse_drv_18
vboxmouse_drv_18_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_18_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_18_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.8.0 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_18_SOURCES = \
	vboxmouse.c


#
# vboxmouse_drv_19
#
DLLS += vboxmouse_drv_19
vboxmouse_drv_19_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_19_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_19_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.9.0 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_19_SOURCES = \
	vboxmouse.c


#
# vboxmouse_drv_110
#
DLLS += vboxmouse_drv_110
vboxmouse_drv_110_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_110_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_110_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.10.0 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_110_SOURCES = \
	vboxmouse.c

DLLS += vboxmouse_drv_111
vboxmouse_drv_111_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_111_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_111_INCS := \
	$(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.11.0 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_111_SOURCES = \
	vboxmouse.c

DLLS += vboxmouse_drv_112
vboxmouse_drv_112_TEMPLATE = VBOXGUESTR3XORGMOD
vboxmouse_drv_112_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
vboxmouse_drv_112_INCS := \
    $(vboxmouse_xorg_INCS) \
	$(VBOX_PATH_X11_ROOT)/xorg-server-1.12.0 \
	$(PATH_SUB_CURRENT)
vboxmouse_drv_112_SOURCES = \
	vboxmouse.c

endif # neq ($(KBUILD_TARGET),linux)


ifdef VBOX_USE_SYSTEM_XORG_HEADERS
 # As vboxmouse_drv is not needed at all for X.Org Server 1.7 and later do not
 # build it in this case.
 DLLS    := $(filter-out vboxmouse_drv_%,$(DLLS))
 SYSMODS := $(filter-out vboxmouse_drv%,$(SYSMODS))
endif


# Check the undefined symbols in the X.Org modules against lists of allowed
# symbols.  Not very elegant, but it will catch problems early.

ifdef VBOX_WITH_TESTCASES
# ifndef VBOX_ONLY_ADDITIONS
 ifndef VBOX_USE_SYSTEM_XORG_HEADERS
  ifeq ($(KBUILD_TARGET),linux)
   ifeq ($(KBUILD_HOST_ARCH),$(KBUILD_TARGET_ARCH))
    ifndef VBOX_ONLY_SDK
     VBOXMOUSE_SRC_PATH := $(PATH_SUB_CURRENT)

     ifeq ($(KBUILD_TARGET),linux)
      TESTING += $(vboxmouse_drv_0_OUTDIR)/tstvboxmouse68.run
      OTHERS += $(vboxmouse_drv_0_OUTDIR)/tstvboxmouse68.run
$$(vboxmouse_drv_0_OUTDIR)/tstvboxmouse68.run: $$(vboxmouse_drv_1_STAGE_TARGET)
	$(QUIET)$(call MSG_L1,Checking for unresolved symbols in $<)
	$(QUIET)/bin/sh $(PATH_ROOT)/src/bldprogs/checkUndefined.sh $(KBUILD_HOST) \
	    "$(vboxmouse_drv_1_STAGE_TARGET)" --static "$(VBOXMOUSE_SRC_PATH)/../undefined_xfree86" "$(VBOXMOUSE_SRC_PATH)/../undefined_xfree86_modules"
	$(QUIET)$(APPEND) -t "$@" "done"
     endif

##
# Using the extra expansion to replace $(ver) before eval, thus everything
# else needs escaped dollars.
     define def_vboxmouse_test
      TESTING += $$(vboxmouse_drv$(ver)_0_OUTDIR)/tstvboxmouse$(ver).run
      OTHERS  += $$(vboxmouse_drv$(ver)_0_OUTDIR)/tstvboxmouse$(ver).run
      $$$$(vboxmouse_drv$(ver)_0_OUTDIR)/tstvboxmouse$(ver).run: $$$$(vboxmouse_drv$(ver)_1_STAGE_TARGET)
	$$(QUIET)$$(call MSG_L1,Checking for unresolved symbols in $$<)
	$$(QUIET)$$(ASH) $$(PATH_ROOT)/src/bldprogs/checkUndefined.sh $$(KBUILD_HOST)  \
	        $$(vboxmouse_drv$(ver)_1_STAGE_TARGET) $$(VBOXMOUSE_SRC_PATH)/../undefined_xfree86 $(VBOXMOUSE_SRC_PATH)/../undefined_xfree86_modules $$(VBOXMOUSE_SRC_PATH)/../undefined_xorg
	$$(QUIET)$$(APPEND) -t "$$@" "done"
    endef

     $(foreach ver, _70 _71 _13 _14 _15 _16, $(eval $(def_vboxmouse_test)))

     ifneq ($(KBUILD_TARGET), linux)
      $(foreach ver, _17 _18 _19 _110 _111 _112 _113, $(eval $(def_vboxmouse_test)))

     endif # neq ($(KBUILD_TARGET),linux)

    endif # ! VBOX_ONLY_SDK
   endif # eq ($(KBUILD_HOST_ARCH),$(KBUILD_TARGET_ARCH))
  endif # eq ($(KBUILD_TARGET),linux)
 endif # ! VBOX_USE_SYSTEM_XORG_HEADERS
# endif # ! VBOX_ONLY_ADDITIONS
endif # VBOX_WITH_TESTCASES

include $(FILE_KBUILD_SUB_FOOTER)