VirtualBox

source: vbox/trunk/src/VBox/Installer/freebsd/Makefile.kmk@ 79804

Last change on this file since 79804 was 78408, checked in by vboxsync, 6 years ago

Additions,GuestHost/OpenGL,HostServices/SharedOpenGL: Get rid of the individual SPU shared libraries and merge them into the VBoxSharedCrOpenGL shared libraries on the host and VBoxOGL{,-x86} shared libraries for the guest additions, bugref:9435

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.7 KB
Line 
1# $Id: Makefile.kmk 78408 2019-05-06 21:31:01Z vboxsync $
2## @file
3# Makefile for the FreeBSD installer.
4#
5
6#
7# Copyright (C) 2006-2019 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
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21ifneq ($(KBUILD_HOST),freebsd)
22 $(error "The FreeBSD installer can only be built on FreeBSD!")
23endif
24
25#
26# Globals and targets.
27#
28VBOX_PATH_FBSD_INST_SRC := $(PATH_SUB_CURRENT)
29VBOX_FBSD_INST_OUT_DIR := $(PATH_TARGET)/Installer/freebsd
30VBOX_FBSD_INST_STAGE_DIR := $(PATH_TARGET)/Installer/freebsd/install
31VBOX_FBSD_DBG_PATH := usr/lib/debug/opt/VirtualBox
32VBOX_FBSD_PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).tbz
33VBOX_FBSD_INST_LIB_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/lib
34VBOX_FBSD_INST_BIN_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/bin
35VBOX_FBSD_INST_LIBVBOX_DIR := $(VBOX_FBSD_INST_LIB_DIR)/virtualbox
36VBOX_FBSD_INST_SHARE_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/share
37VBOX_FBSD_INST_SHAREAPP_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/applications
38VBOX_FBSD_INST_SHAREICON_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/pixmaps
39VBOX_FBSD_INST_SHAREVBOX_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/virtualbox
40
41# Unset this to speed up things during makefile hacking.
42VBOX_FBSD_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
43
44BLDDIRS += $(VBOX_FBSD_INST_OUT_DIR) $(VBOX_FBSD_INST_STAGE_DIR)
45PACKING += $(PATH_STAGE_BIN)/$(VBOX_FBSD_PACKAGE_NAME)
46
47OTHER_CLEAN += \
48 $(addprefix $(VBOX_FBSD_INST_STAGE_DIR)/,\
49 pkg_plist \
50 LICENSE) \
51 $(wildcard $(VBOX_FBSD_INST_OUT_DIR)/VirtualBox-*)
52
53#
54# FreeBSD installs.
55#
56INSTALLS += freebsd-misc
57freebsd-misc_INST = bin/
58freebsd-misc_MODE = a+r,u+w
59freebsd-misc_SOURCES = \
60 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
61 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
62 $(if $(VBOX_WITH_QTGUI),$(freebsd-misc_0_OUTDIR)/virtualbox.desktop,)
63freebsd-misc_CLEAN = $(freebsd-misc_0_OUTDIR)/virtualbox.desktop
64
65$$(PATH_freebsd-misc)/virtualbox.desktop: $(PATH_SUB_CURRENT)/virtualbox.desktop $(VBOX_VERSION_STAMP) | $$(dir $$@)
66 $(call MSG_GENERATE,,$@,$<)
67ifdef VBOX_PATH_PACKAGE_DOCS
68 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+$(VBOX_PATH_PACKAGE_DOCS)+" --output $@ $<
69else
70 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+/opt/VirtualBox+" --output $@ $<
71endif
72
73
74
75#
76# The files residing in bin/ that we'll ship.
77#
78
79# Strip these binaries
80VBOX_FBSD_STRIP_BIN = \
81 VBoxDD.so \
82 VBoxDD2.so \
83 VBoxREM.so \
84 VBoxDDU.so \
85 VBoxVMM.so \
86 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,) \
87 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,) \
88 VBoxRT.so \
89 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
90 $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
91 $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
92 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
93 $(if $(VBOX_WITH_GUEST_CONTROL),VBoxGuestControlSvc.so,) \
94 VBoxHostChannel.so \
95 $(if $(VBOX_WITH_MAIN), \
96 VBoxManage \
97 VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
98 VBoxNetAdpCtl \
99 VBoxSVC \
100 VBoxXPCOM.so \
101 VBoxXPCOMC.so \
102 VBoxXPCOMIPCD \
103 components/VBoxXPCOMIPCC.so \
104 components/VBoxSVCM.so \
105 components/VBoxC.so,) \
106 $(if $(VBOX_WITH_CROGL),\
107 VBoxTestOGL \
108 VBoxSharedCrOpenGL.so,) \
109 $(if $(VBOX_WITH_PYTHON),VBoxPython.so,) \
110 $(if $(VBOX_WITH_DTRACE),VBoxDTrace,)
111
112# Do not remove relocation information of these binaries
113VBOX_FBSD_STRIP_OBJ = \
114 VBoxDDRC.rc \
115 VBoxDDR0.r0 \
116 VMMRC.rc \
117 VMMR0.r0
118
119# Do not strip anything of these files
120VBOX_FBSD_NO_STRIP = \
121 $(if $(VBOX_OSE),,LICENSE) \
122 $(if $(VBOX_WITH_MAIN), \
123 components/VBoxXPCOMBase.xpt \
124 components/VirtualBox_XPCOM.xpt) \
125 vboxdrv.tar.gz
126
127# EFI firmware
128ifdef VBOX_WITH_EFIFW_PACKING
129 VBOX_FBSD_NO_STRIP += \
130 VBoxEFI32.fd \
131 VBoxEFI64.fd
132endif
133
134# Symlinks residing in bin/
135VBOX_FBSD_SYMLINKS = \
136 $(if $(VBOX_WITH_MAIN), \
137 VBoxManage \
138 VBoxSVC) \
139 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL,) \
140 $(if $(VBOX_WITH_DTRACE),VBoxDTrace,)
141
142# Qt GUI
143ifdef VBOX_WITH_QTGUI
144 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
145 VBOX_FBSD_STRIP_BIN += \
146 VBoxKeyboard.so \
147 VirtualBox \
148 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
149 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so DbgPlugInDiggers.so,)
150 VBOX_FBSD_SYMLINKS += \
151 VirtualBox
152 VBOX_FBSD_NO_STRIP += \
153 $(VBOX_LICENSE_FILES) \
154 $(if $(VBOX_WITH_ORACLE_QT),$(notdir $(wildcard $(PATH_STAGE_BIN)/lib*VBox*)),) \
155 $(if $(VBOX_WITH_ORACLE_QT),accessible/libqtaccessiblewidgets.so,) \
156 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm)
157 VBOX_FBSD_DESKTOP_FILE = \
158 virtualbox.desktop
159 VBOX_FBSD_ICON_FILE = \
160 VBox.png
161endif
162
163# Guest Additions
164ifdef VBOX_WITH_ADDITIONS_PACKING
165 VBOX_FBSD_NO_STRIP += \
166 additions/VBoxGuestAdditions.iso
167endif
168
169# Documentation
170ifdef VBOX_WITH_DOCS_PACKING
171 VBOX_FBSD_NO_STRIP += \
172 VirtualBox.chm UserManual.pdf \
173 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm UserManual_$(f).pdf)
174 VBOX_FBSD_STRIP_BIN += \
175 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
176endif
177
178# VRDP
179ifdef VBOX_WITH_VRDP
180 VBOX_FBSD_STRIP_BIN += \
181 VBoxVRDP.so \
182 VBoxAuth.so
183 VBOX_FBSD_NO_STRIP += \
184 rdesktop-vrdp.tar.gz
185 ifdef VBOX_WITH_VRDP_RDESKTOP
186# VBOX_FBSD_NO_STRIP += \
187# rdesktop-vrdp-keymaps
188 VBOX_FBSD_STRIP_BIN += \
189 rdesktop-vrdp
190 endif
191endif
192
193# Headless
194ifdef VBOX_WITH_HEADLESS
195 VBOX_FBSD_STRIP_BIN += \
196 VBoxHeadless \
197 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
198 VBOX_FBSD_SYMLINKS += \
199 VBoxHeadless
200endif
201
202# Webservices
203ifdef VBOX_WITH_WEBSERVICES
204 VBOX_FBSD_STRIP_BIN += \
205 vboxwebsrv
206 VBOX_FBSD_SYMLINKS += \
207 vboxwebsrv
208endif
209
210# DTrace library, testcase and scripts (as the rest of this file, this makes bold
211# ASSUMPTIONS about VBPX_INST_XXX variable values).
212ifdef VBOX_WITH_DTRACE
213 VBOX_FBSD_NO_STRIP += \
214 $(addprefix dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
215 $(addprefix dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
216 $(addprefix dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES))
217endif
218
219#
220# All the bin files that goes into the archives.
221#
222VBOX_FBSD_ARCH_FILES := $(VBOX_FBSD_STRIP_BIN) $(VBOX_FBSD_STRIP_OBJ) $(VBOX_FBSD_NO_STRIP)
223
224# Cleanup of the files we copy/symlink from bin.
225OTHER_CLEAN += $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_ARCH_FILES))
226
227#
228# The module source archive
229#
230$(PATH_STAGE_BIN)/vboxdrv.tar.gz: \
231 src
232 $(call MSG_TOOL, export_modules.sh,,$@)
233 $(QUIET)$(PATH_STAGE_BIN)/export_modules.sh $@
234
235#
236# The generic installer.
237## @todo r=aeichner: Create pkg_plist dynamically based on the available features
238#
239$(PATH_STAGE_BIN)/$(VBOX_FBSD_PACKAGE_NAME): \
240 $(VBOX_VERSION_STAMP) \
241 $(VBOX_FBSD_INST_OUT_DIR)/pkg_plist \
242 $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_ARCH_FILES)) \
243 $(addprefix $(VBOX_FBSD_INST_BIN_DIR)/,$(VBOX_FBSD_SYMLINKS)) \
244 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
245 $(if $(VBOX_WITH_QTGUI),$(addprefix $(VBOX_FBSD_INST_SHAREAPP_DIR)/,$(VBOX_FBSD_DESKTOP_FILE)),) \
246 $(if $(VBOX_WITH_QTGUI),$(addprefix $(VBOX_FBSD_INST_SHAREICON_DIR)/,$(VBOX_FBSD_ICON_FILE)),) \
247 $(VBOX_PATH_FBSD_INST_SRC)/postinstall.sh \
248 $(VBOX_PATH_FBSD_INST_SRC)/postdeinstall.sh
249 $(call MSG_TOOL,pkg_create,,$@)
250 $(QUIET)$(RM) -f $@
251 $(QUIET)pkg_create \
252 -I $(VBOX_PATH_FBSD_INST_SRC)/postinstall.sh \
253 -K $(VBOX_PATH_FBSD_INST_SRC)/postdeinstall.sh \
254 -c $(VBOX_PATH_FBSD_INST_SRC)/pkg-comment \
255 -d $(VBOX_PATH_FBSD_INST_SRC)/pkg-descr \
256 -f $(VBOX_FBSD_INST_OUT_DIR)/pkg_plist \
257 -p /usr/local \
258 -s $(VBOX_FBSD_INST_STAGE_DIR) \
259 $@
260 $(QUIET)$(RM) -Rf $(VBOX_FBSD_INST_STAGE_DIR)
261
262$(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_STRIP_BIN)): \
263 $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
264 $(call MSG_INST_FILE,$<,$@)
265 $(QUIET)$(INSTALL) -d $(dir $@)
266 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
267
268# pattern rule for striping and copying the VBOX_FBSD_STRIP_OBJ files to install/lib/virtualbox
269$(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_STRIP_OBJ)): \
270 $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
271 $(call MSG_INST_FILE,$<,$@)
272 $(QUIET)$(INSTALL) -d $(dir $@)
273ifeq ($(VBOX_DO_STRIP),)
274 $(QUIET)$(INSTALL) -m 0644 $< $@
275else # strip to temp file because of umask.
276 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
277 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
278 $(QUIET)$(RM) -f -- [email protected]
279endif
280
281# pattern rule for linking the VBOX_FBSD_NO_STRIP into lib/virtualbox/
282$(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_NO_STRIP)): \
283 $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
284 $(call MSG_INST_FILE,$<,$@)
285 $(QUIET)$(INSTALL) -d $(dir $@)
286 $(QUIET)$(RM) -f $@
287 $(QUIET)$(INSTALL) -m 0644 $< $@
288
289# pattern rule for symlinking the VBOX_FBSD_SYMLINKS into bin/
290$(addprefix $(VBOX_FBSD_INST_BIN_DIR)/,$(VBOX_FBSD_SYMLINKS)): \
291 $(VBOX_FBSD_INST_BIN_DIR)/% : $(PATH_STAGE_BIN)/%
292 $(call MSG_INST_SYM,$<,$@)
293 $(QUIET)$(INSTALL) -d $(dir $@)
294 $(QUIET)$(RM) -f $@
295 $(QUIET)$(LN_SYMLINK) ../lib/virtualbox/$(notdir $@) $@
296
297# pattern rule for copying the VBOX_FBSD_DESKTOP_FILE into share/applications/
298$(addprefix $(VBOX_FBSD_INST_SHAREAPP_DIR)/,$(VBOX_FBSD_DESKTOP_FILE)): \
299 $(VBOX_FBSD_INST_SHAREAPP_DIR)/% : $(PATH_STAGE_BIN)/%
300 $(call MSG_INST_FILE,$<,$@)
301 $(QUIET)$(INSTALL) -d $(dir $@)
302 $(QUIET)$(RM) -f $@
303 $(QUIET)$(INSTALL) -m 0644 $< $@
304
305# pattern rule for copying the VBOX_FBSD_ICON_FILE into share/pixmaps/
306$(addprefix $(VBOX_FBSD_INST_SHAREICON_DIR)/,$(VBOX_FBSD_ICON_FILE)): \
307 $(VBOX_FBSD_INST_SHAREICON_DIR)/% : $(PATH_STAGE_BIN)/%
308 $(call MSG_INST_FILE,$<,$@)
309 $(QUIET)$(INSTALL) -d $(dir $@)
310 $(QUIET)$(RM) -f $@
311 $(QUIET)$(INSTALL) -m 0644 $< $@
312
313# Create pkg_plist
314$(VBOX_FBSD_INST_OUT_DIR)/pkg_plist: \
315 $(VBOX_PATH_FBSD_INST_SRC)/pkg_plist
316 $(call MSG_INST_FILE,$<,$@)
317 $(QUIET)$(INSTALL) -d $(dir $@)
318 $(QUIET)$(SED) \
319 -e "s;_VBOX_REM_32BIT_MODULE_;$(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,);g" \
320 -e "s;_VBOX_REM_64BIT_MODULE_;$(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,);g" \
321 --output $@ \
322 $<
323ifdef VBOX_WITH_DTRACE
324 $(QUIET)$(APPEND) -n "$@" "@mode 644" \
325 $(addprefix lib/virtualbox/dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
326 $(addprefix lib/virtualbox/dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
327 $(addprefix lib/virtualbox/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
328 "@mode 755" \
329 "bin/VBoxDTrace"
330endif
331
332include $(FILE_KBUILD_SUB_FOOTER)
333
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette