VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk@ 10617

Last change on this file since 10617 was 10617, checked in by vboxsync, 17 years ago

qt4 unit: part 3; clean ups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 26.0 KB
Line 
1# $Id: Makefile.kmk 10617 2008-07-14 21:33:52Z vboxsync $
2## @file
3# Makefile for the VirtualBox Qt GUI.
4#
5
6#
7# Copyright (C) 2006-2007 Sun Microsystems, Inc.
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# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18# Clara, CA 95054 USA or visit http://www.sun.com if you need
19# additional information or have any questions.
20#
21
22DEPTH = ../../../..
23include $(KBUILD_PATH)/header.kmk
24
25#
26# Globals.
27#
28VBOX_VIRTUALBOX4_SRC := $(PATH_SUB_CURRENT)
29
30VBOX_WITH_REGISTRATION := 1
31
32# Ask the user to register at Sun. If this setting is disabled the user can
33# still register using the menu if desired.
34VBOX_WITH_REGISTRATION_REQUEST := 1
35
36# Show the update notifier dialog during startup. If this setting is disabled
37# the user can still update using the menu if desired.
38VBOX_WITH_UPDATE_REQUEST := 1
39
40
41# Disable the debugger for now, this is another story.
42VBOX_WITH_DEBUGGER_GUI :=
43DEFS := $(filter-out VBOX_WITH_DEBUGGER_GUI,$(DEFS))
44
45# Guess VBOX_WITH_QT4_SUN
46ifndef VBOX_WITH_QT4_SUN
47 ifndef VBOX_OSE
48 if1of ($(KBUILD_TARGET), darwin solaris win)
49 VBOX_WITH_QT4_SUN := 1
50 endif
51 endif
52endif
53
54#
55# Handmade configuration of qt4 - very annoying, this needs to
56# be cleaned up properly later some time (not important now).
57#
58ifeq ($(VBOX_PATH_QT4),)
59 ifeq ($(KBUILD_TARGET),darwin)
60 VBOX_PATH_QT4 := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
61 ifeq ($(VBOX_PATH_QT4),)
62 ifneq ($(wildcard /Library/Frameworks/QtCore.framework),)
63 # Using the global installation (for OSE).
64 VBOX_PATH_QT4 ?= /usr
65 VBOX_PATH_QT4_FRAMEWORKS ?= /Library/Frameworks
66 endif
67 endif
68 else if1of ($(KBUILD_TARGET),win)
69 VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
70 else if1of ($(KBUILD_TARGET),solaris)
71 VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
72 ifneq ($(VBOX_PATH_QT4),)
73 VBOX_WITH_QT4_SUN = 1
74 endif
75 endif
76endif
77ifeq ($(VBOX_PATH_QT4),)
78 if1of ($(USERNAME), bird)
79 # gentoo (64-bit)
80 VBOX_PATH_QT4 ?= /usr
81 VBOX_PATH_QT4_INCLUDE ?= /usr/include/qt4
82 VBOX_PATH_QT4_LIB ?= /usr/lib/qt4
83 VBOX_PATH_QT4_LIB64 ?= /usr/lib/qt4
84 VBOX_PATH_QT4_SHARE ?= /usr/share/qt4
85 endif
86endif
87VBOX_PATH_QT4 ?= /usr
88VBOX_PATH_QT4_INCLUDE ?= $(VBOX_PATH_QT4)/include
89VBOX_PATH_QT4_LIB ?= $(VBOX_PATH_QT4)/lib
90VBOX_PATH_QT4_LIB64 ?= $(VBOX_PATH_QT4)/lib64
91VBOX_PATH_QT4_FRAMEWORKS ?= $(VBOX_PATH_QT4)/Frameworks
92VBOX_PATH_QT4_SHARE ?= $(VBOX_PATH_QT4)
93
94ifneq ($(KBUILD_TARGET),darwin)
95ifndef USE_KBUILD_QT4_UNIT_PART_3
96 VBOX_INCS_QT4 += $(VBOX_PATH_QT4_INCLUDE) ## @todo add this to the qt4 unit.
97endif
98
99 ifeq (disabled,yes) # Adding mkspecs to the INCS is hopefully not really necessary... Will try disable it later.
100 ifeq ($(KBUILD_TARGET),win)
101 ifeq ($(KBUILD_TARGET_ARCH),amd64)
102 ## @todo This is the correct one here: VBOX_INCS_QT4 += $(VBOX_PATH_QT4_SHARE)/mkspecs/win32-msvc2005
103 VBOX_INCS_QT4 += $(VBOX_PATH_QT4_SHARE)/mkspecs/win32-msvc.net
104 else
105 VBOX_INCS_QT4 += $(VBOX_PATH_QT4_SHARE)/mkspecs/win32-msvc.net
106 endif
107 else ifeq ($(KBUILD_TARGET),linux)
108 VBOX_INCS_QT4 += $(VBOX_PATH_QT4_SHARE)/mkspecs/linux-g++
109 endif
110 endif
111
112 ifndef USE_KBUILD_QT4_UNIT_PART_3
113 # Move down.
114 ifeq ($(KBUILD_TARGET),win)
115 VBOX_LIBS_QT4 := VBoxqtmain.lib
116 endif
117 endif
118
119endif
120
121# Hack LD_LIBRARY_PATH for stuff in tools.
122ifdef VBOX_WITH_QT4_SUN
123 if1of ($(KBUILD_TARGET), linux)
124 export LD_LIBRARY_PATH := $(VBOX_PATH_QT4_LIB):$(LD_LIBRARY_PATH)
125 endif
126endif
127
128# Some default defs
129VBOX_DEFS_QT4 += QT_SHARED HAVE_CONFIG_H QT_NO_DEBUG
130
131ifdef VBOX_WITH_QT4_SUN
132#
133# Install our Qt DLLs / Shared Objects / Frameworks.
134#
135## @todo move to the root Makefile.kmk, and remove qt4-bin from INSTALLS below.
136 INSTALLS += qt4-bin
137 qt4-bin_MODE = 644
138 ifeq ($(KBUILD_TARGET),darwin)
139 qt4-bin_INST = $(INST_VIRTUALBOX)Contents/Frameworks/
140 qt4-bin_SOURCES = \
141 $(VBOX_PATH_QT4)/Frameworks/QtCore.framework/Versions/4/QtCore=>QtCore.framework/Versions/4/QtCore \
142 $(VBOX_PATH_QT4)/Frameworks/QtGui.framework/Versions/4/QtGui=>QtGui.framework/Versions/4/QtGui
143 else ifeq ($(KBUILD_TARGET),win)
144 qt4-bin_INST = $(INST_BIN)
145 qt4-bin_SOURCES = \
146 $(VBOX_PATH_QT4_LIB)/VBoxQtCore4.dll \
147 $(VBOX_PATH_QT4_LIB)/VBoxQtGui4.dll
148 else
149 qt4-bin_INST = $(INST_BIN)
150 qt4-bin_SOURCES = \
151 $(VBOX_PATH_QT4_LIB)/libVBoxQtCore.so.4 \
152 $(VBOX_PATH_QT4_LIB)/libVBoxQtGui.so.4
153 endif
154endif # VBOX_WITH_QT4_SUN
155
156
157# Template copy from the qt3 stuff. Appended a "4" on the
158# relevant places.
159
160#
161# Template for building Qt GUI executables.
162#
163
164TEMPLATE_VBOXQT4GUIEXE = VBox Qt4 GUI Executable
165USES += qt4
166TEMPLATE_VBOXQT4GUIEXE_USES = qt4
167TEMPLATE_VBOXQT4GUIEXE_QTTOOL = QT4
168TEMPLATE_VBOXQT4GUIEXE_MOCTOOL = QT4
169TEMPLATE_VBOXQT4GUIEXE_UICTOOL = QT4
170TEMPLATE_VBOXQT4GUIEXE_RCCTOOL = QT4
171TEMPLATE_VBOXQT4GUIEXE_LRCTOOL = QT4
172TEMPLATE_VBOXQT4GUIEXE_SDKS = QT4
173ifdef VBOX_WITH_QT4_SUN
174 ifneq ($(KBUILD_TARGET),darwin) ## @todo The next darwin build should also make use the prefix just to make things more uniform.
175 TEMPLATE_VBOXQT4GUIEXE_QT_PREFIX = VBox
176 endif
177endif
178TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS) $(VBOX_DEFS_QT4)
179TEMPLATE_VBOXQT4GUIEXE_INCS = \
180 $(VBOX_PATH_SDK)/include \
181 $(VBOX_INCS_QT4)
182
183ifeq ($(KBUILD_TARGET),win)
184 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_VCC_TOOL)
185 TEMPLATE_VBOXQT4GUIEXE_DEFS += \
186 _WIN32_WINNT=0x0500 UNICODE _UNICODE \
187 QT_DLL _CRT_SECURE_NO_DEPRECATE \
188 $(QMAKE_PRL_DEFINES)
189 ## @todo VCC70 flags?
190 ifdef VBOX_USE_VCC80
191 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
192 -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
193 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -RTCsu
194 else
195 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
196 -nologo -Zm200 -W3 -MD -Zi -GX
197 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -GZ
198 endif
199 TEMPLATE_VBOXQT4GUIEXE_INCS += \
200 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
201 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS = \
202 /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
203 /DELAYLOAD:oleaut32.dll
204 TEMPLATE_VBOXQT4GUIEXE_SDKS += WINPSDK
205 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
206 $(VBOX_LIBS_QT4) \
207 $(LIB_RUNTIME) \
208 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
209 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
210 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
211 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
212 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
213 TEMPLATE_VBOXQT4GUIEXE_LIBPATH = $(VBOX_PATH_QT4_LIB)
214 TEMPLATE_VBOXQT4GUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
215
216else # the gcc guys:
217 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_GCC_TOOL)
218 TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
219
220 TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
221
222 TEMPLATE_VBOXQT4GUIEXE_INCS += \
223 $(LIB_SDL_INC)
224 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
225 -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
226 -Wno-long-long -fshort-wchar -fno-strict-aliasing \
227 $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
228 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86 = -m32
229 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64 = -m64
230 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
231 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.x86 = -m32
232 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.amd64 = -m64
233 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
234 $(VBOX_LIBS_QT4) \
235 $(LIB_SDL) \
236 $(LIB_RUNTIME) \
237 $(LIB_REM) \
238 $(LIB_VMM)
239
240ifeq (disabled,yes)
241 ifeq ($(KBUILD_TARGET_ARCH),amd64)
242 TEMPLATE_VBOXQT4GUIEXE_LIBPATH = \
243 $(VBOX_PATH_QT4_LIB64) $(VBOX_PATH_QT4_LIB)
244 else
245 TEMPLATE_VBOXQT4GUIEXE_LIBPATH = \
246 $(VBOX_PATH_QT4_LIB)
247 endif
248endif
249
250 ifeq ($(KBUILD_TARGET),linux)
251 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
252 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
253 $(VBOX_XCURSOR_LIBS)
254 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
255 $(VBOX_LIBPATH_X11)
256 else ifeq ($(KBUILD_TARGET),darwin)
257ifndef USE_KBUILD_QT4_UNIT_PART_3
258 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS += -F$(VBOX_PATH_QT4_FRAMEWORKS) ## @todo fix in the qt unit. Somehow this fixes the #include <QtCore/qstring.h> stuff.
259endif
260 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += -framework Carbon -framework QuickTime -bind_at_load
261 TEMPLATE_VBOXQT4GUIEXE_LIBS +=
262 TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
263 else
264 TEMPLATE_VBOXQT4GUIEXE_INCS += \
265 $(VBOX_XCURSOR_INCS)
266 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
267 $(VBOX_XCURSOR_LIBS) \
268 Xext \
269 X11 \
270 m \
271 $(LIB_PTHREAD)
272 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
273 $(VBOX_LIBPATH_X11)
274 ifeq ($(KBUILD_TARGET),freebsd)
275 TEMPLATE_VBOXQT4GUIEXE_INCS += \
276 /usr/include \
277 /usr/X11R6/include \
278 /usr/local/include
279 endif
280 ifeq ($(KBUILD_TARGET),solaris)
281 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
282 rt socket nsl
283 endif
284 ifdef VBOX_WITH_ORIGIN
285 # Assume the Qt shared objects are in the same directory as the executable, on Solaris too.
286 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)'
287 endif
288 endif
289
290endif
291
292# Add COM/XPCOM stuff
293TEMPLATE_VBOXQT4GUIEXE_LIBS += \
294 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
295ifdef VBOX_WITH_XPCOM
296 ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM.
297 TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM
298 TEMPLATE_VBOXQT4GUIEXE_INCS += \
299 $(VBOX_XPCOM_INCS)
300 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
301 $(LIB_XPCOM)
302endif
303
304#
305# Template for building Qt GUI components.
306#
307TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
308TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQTGUIEXE
309TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
310ifeq ($(KBUILD_TARGET),darwin)
311 TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS))
312endif
313ifeq ($(filter-out solaris.x86 %.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),)
314 ifneq ($(KBUILD_TARGET),win)
315 TEMPLATE_VBOXQT4GUI_DEFS = PIC $(TEMPLATE_VBOXQT4GUIEXE_DEFS)
316 TEMPLATE_VBOXQT4GUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CFLAGS)
317 TEMPLATE_VBOXQT4GUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS)
318 TEMPLATE_VBOXQT4GUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)
319 endif
320endif
321
322
323#
324# The targets.
325#
326PROGRAMS += VirtualBox4
327ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
328 DLLS += VBoxKeyboard
329 ## @todo convert to install target.
330 OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
331 CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
332endif
333INSTALLS += VirtualBox4.nls
334
335
336#
337# VBoxKeyboard - keyboard library for X11.
338#
339VBoxKeyboard_TEMPLATE = VBOXR3
340VBoxKeyboard_SOURCES = \
341 src/linux/keyboard-new.c
342VBoxKeyboard_LIBS = X11
343VBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
344
345
346#
347# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
348# redistributed with usable sources.
349#
350# This rule will link create a temporary symlink to src/linux/ and tar
351# up the selected files into a tarball that is installed into the
352# bin directory (probably belongs in /usr/shared/somewhere really,
353# but wtf, it's not like we're even trying to be FHS compliant).
354#
355## @todo this should be tar'ed down into the output directory and installed using an install target.
356$(PATH_BIN)/vboxkeyboard.tar.gz: \
357 $(VBoxKeyboard_SOURCES) \
358 src/linux/COPYING.LIB \
359 src/linux/keyboard.h \
360 src/linux/keyboard-layouts.h \
361 src/linux/keyboard-list.h \
362 src/linux/keyboard-tables.h \
363 src/linux/keyboard-types.h \
364 src/linux/Makefile
365 $(call MSG_TOOL,tar/gzip,,$@)
366 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard $@
367 $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/linux/ $(PATH_TARGET)/vboxkeyboard
368 $(QUIET)cd $(PATH_TARGET) \
369 && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
370 | gzip - > $@
371 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard
372
373
374#
375# Include Qt project file, we'll use FORMS and TRANSLATIONS in
376# the VirtualBox4 setup below.
377#
378SAVED_TEMPLATE := $(TEMPLATE)
379include $(PATH_SUB_CURRENT)/VBoxUI.pro
380
381
382#
383# VirtualBox4 - The GUI program.
384#
385VirtualBox4_TEMPLATE = VBOXQT4GUIEXE
386VirtualBox4_NAME = VirtualBox
387VirtualBox4_SDKS.win = WINPSDK DXSDK
388ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
389 VirtualBox4_SDKS += LIBSDL
390endif
391
392ifeq ($(KBUILD_TARGET),darwin)
393 # For the launch trick we need different inode numbers.
394 VirtualBox4_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
395
396 # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
397 ifdef VBOX_WITH_ICHAT_THEATER
398 VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
399 endif
400endif # darwin
401
402VirtualBox4_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
403VirtualBox4_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
404VirtualBox4_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
405VirtualBox4_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
406VirtualBox4_DEFS.linux = VBOX_GUI_USE_SDL
407VirtualBox4_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
408VirtualBox4_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
409VirtualBox4_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
410VirtualBox4_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
411VirtualBox4_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
412#ifndef VBOX_OSE
413## @todo VBOX_WITH_HACKED_QT doesn't apply to Qt4, so why is this still here?
414 VirtualBox4_DEFS.darwin += VBOX_WITH_HACKED_QT
415#endif
416ifdef VBOX_WITH_ICHAT_THEATER
417 VirtualBox4_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
418endif
419ifneq ($(KBUILD_TYPE),release)
420 # non-release builds has some extra features.
421 VirtualBox4_DEFS.win += VBOX_GUI_USE_DDRAW
422 VirtualBox4_DEFS.linux += VBOX_GUI_USE_QIMAGE
423endif
424ifdef VBOX_WITH_REGISTRATION
425 VirtualBox4_DEFS += VBOX_WITH_REGISTRATION
426endif
427ifdef VBOX_WITH_REGISTRATION_REQUEST
428 VirtualBox4_DEFS += VBOX_WITH_REGISTRATION_REQUEST
429endif
430ifdef VBOX_WITH_UPDATE_REQUEST
431 VirtualBox4_DEFS += VBOX_WITH_UPDATE_REQUEST
432endif
433ifdef VBOX_WITH_ALSA
434 VirtualBox4_DEFS += VBOX_WITH_ALSA
435endif
436ifdef VBOX_WITH_PULSE
437 VirtualBox4_DEFS += VBOX_WITH_PULSE
438endif
439ifdef VBOX_WITH_E1000
440 VirtualBox4_DEFS += VBOX_WITH_E1000
441endif
442ifdef VBOX_OSE
443 VirtualBox4_DEFS += VBOX_OSE
444endif
445ifdef VBOX_WITH_DEBUGGER_GUI
446 VirtualBox4_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
447endif
448
449VirtualBox4_INCS = \
450 ./include \
451 $(PATH_VirtualBox4)/include
452
453ifeq ($(KBUILD_TYPE),release)
454 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
455else
456 VirtualBox4_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
457 ifeq ($(USERNAME),dmik)
458 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
459 else
460 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:console
461 endif
462endif
463# r=bird: what is -lz doing here? it belongs in LIBS
464VirtualBox4_LDFLAGS.darwin = -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -lz
465ifdef VBOX_WITH_ICHAT_THEATER
466 VirtualBox4_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
467endif
468VirtualBox4_LIBS.win = \
469 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
470 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
471 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
472ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
473 VirtualBox4_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
474endif
475
476ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
477 ifeq ($(KBUILD_TARGET),win)
478 VirtualBox4_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
479 else
480 VirtualBox4_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
481 endif
482endif
483
484
485# Headers containing definitions of classes that use the Q_OBJECT macro.
486VirtualBox4_QT_MOCHDRS = \
487 include/QIWidgetValidator.h \
488 include/QIHotKeyEdit.h \
489 include/QIStatusBar.h \
490 include/QIStateIndicator.h \
491 include/QIMessageBox.h \
492 include/QILabel.h \
493 include/QILabel_p.h \
494 include/QIAbstractWizard.h \
495 include/QIListView.h \
496 include/QITreeWidget.h \
497 include/QIMainDialog.h \
498 include/QIHelpButton.h \
499 include/VBoxUtils.h \
500 include/VBoxGlobalSettings.h \
501 include/VBoxGlobal.h \
502 include/VBoxVMListView.h \
503 include/VBoxMediaComboBox.h \
504 include/VBoxSelectorWnd.h \
505 include/VBoxConsoleWnd.h \
506 include/VBoxConsoleView.h \
507 include/VBoxProblemReporter.h \
508 include/VBoxDownloaderWgt.h \
509 include/VBoxNetworkFramework.h \
510 include/VBoxAboutDlg.h \
511 include/VBoxCloseVMDlg.h \
512 include/VBoxNewVMWzd.h \
513 include/VBoxNewHDWzd.h \
514 include/VBoxVMFirstRunWzd.h \
515 include/VBoxRegistrationDlg.h \
516 include/VBoxUpdateDlg.h \
517 include/VBoxSnapshotDetailsDlg.h \
518 include/VBoxVMInformationDlg.h \
519 include/VBoxTakeSnapshotDlg.h \
520 include/VBoxSnapshotsWgt.h \
521 include/VBoxVMLogViewer.h \
522 include/VBoxDiskImageManagerDlg.h \
523 include/VBoxSettingsUtils.h \
524 include/VBoxVMSettingsGeneral.h \
525 include/VBoxVMSettingsHD.h \
526 include/VBoxVMSettingsCD.h \
527 include/VBoxVMSettingsFD.h \
528 include/VBoxVMSettingsAudio.h \
529 include/VBoxVMSettingsNetwork.h \
530 include/VBoxVMSettingsSerial.h \
531 include/VBoxVMSettingsParallel.h \
532 include/VBoxVMSettingsUSB.h \
533 include/VBoxVMSettingsSF.h \
534 include/VBoxVMSettingsVRDP.h \
535 include/VBoxGLSettingsGeneral.h \
536 include/VBoxGLSettingsInput.h \
537 include/VBoxGLSettingsUpdate.h \
538 include/VBoxGLSettingsLanguage.h \
539 include/VBoxSettingsDialog.h \
540 include/VBoxSettingsDialogSpecific.h \
541 include/VBoxSettingsPage.h \
542 include/VBoxSettingsSelector.h
543
544# Sources containing local definitions of classes that use the Q_OBJECT macro.
545VirtualBox4_QT_MOCSRCS = \
546 src/VBoxSelectorWnd.cpp
547ifdef VBOX_WITH_XPCOM
548 VirtualBox4_QT_MOCSRCS += \
549 src/COMDefs.cpp
550endif
551
552VirtualBox4_SOURCES = \
553 src/main.cpp \
554 src/COMDefs.cpp \
555 src/QIWidgetValidator.cpp \
556 src/QIHotKeyEdit.cpp \
557 src/QIStateIndicator.cpp \
558 src/QIStatusBar.cpp \
559 src/QIMessageBox.cpp \
560 src/QILabel.cpp \
561 src/QIAbstractWizard.cpp \
562 src/QIDialog.cpp \
563 src/QIDialogButtonBox.cpp \
564 src/QIListView.cpp \
565 src/QITreeWidget.cpp \
566 src/QIMainDialog.cpp \
567 src/QILineEdit.cpp \
568 src/QIHelpButton.cpp \
569 src/VBoxDefs.cpp \
570 src/VBoxGlobalSettings.cpp \
571 src/VBoxGlobal.cpp \
572 src/VBoxMediaComboBox.cpp \
573 src/VBoxProblemReporter.cpp \
574 src/VBoxSelectorWnd.cpp \
575 src/VBoxConsoleView.cpp \
576 src/VBoxConsoleWnd.cpp \
577 src/VBoxDownloaderWgt.cpp \
578 src/VBoxVMListView.cpp \
579 src/VBoxFrameBuffer.cpp \
580 src/HappyHttp.cpp \
581 src/VBoxNetworkFramework.cpp \
582 src/VBoxAboutDlg.cpp \
583 src/VBoxCloseVMDlg.cpp \
584 src/VBoxNewVMWzd.cpp \
585 src/VBoxNewHDWzd.cpp \
586 src/VBoxVMFirstRunWzd.cpp \
587 src/VBoxRegistrationDlg.cpp \
588 src/VBoxUpdateDlg.cpp \
589 src/VBoxSnapshotDetailsDlg.cpp \
590 src/VBoxVMInformationDlg.cpp \
591 src/VBoxTakeSnapshotDlg.cpp \
592 src/VBoxSnapshotsWgt.cpp \
593 src/VBoxVMLogViewer.cpp \
594 src/VBoxDiskImageManagerDlg.cpp \
595 src/VBoxVMSettingsGeneral.cpp \
596 src/VBoxVMSettingsHD.cpp \
597 src/VBoxVMSettingsCD.cpp \
598 src/VBoxVMSettingsFD.cpp \
599 src/VBoxVMSettingsAudio.cpp \
600 src/VBoxVMSettingsNetwork.cpp \
601 src/VBoxVMSettingsSerial.cpp \
602 src/VBoxVMSettingsParallel.cpp \
603 src/VBoxVMSettingsUSB.cpp \
604 src/VBoxVMSettingsSF.cpp \
605 src/VBoxVMSettingsVRDP.cpp \
606 src/VBoxGLSettingsGeneral.cpp \
607 src/VBoxGLSettingsInput.cpp \
608 src/VBoxGLSettingsUpdate.cpp \
609 src/VBoxGLSettingsLanguage.cpp \
610 src/VBoxSettingsDialog.cpp \
611 src/VBoxSettingsDialogSpecific.cpp \
612 src/VBoxSettingsSelector.cpp
613
614ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
615 ifndef VBOX_OSE
616 VirtualBox4_QT_MOCHDRS += \
617 include/VBoxLicenseViewer.h
618 VirtualBox4_SOURCES += \
619 src/VBoxLicenseViewer.cpp
620 endif
621 VirtualBox4_SOURCES += \
622 src/linux/XKeyboard-new.cpp
623endif
624
625VirtualBox4_SOURCES.win += \
626 src/VBoxFBDDRAW.cpp \
627 $(PATH_TARGET)/VirtualBox4.rc
628
629VirtualBox4_SOURCES.darwin = \
630 src/darwin/DarwinKeyboard.cpp \
631 src/darwin/DarwinCursor.cpp \
632 src/darwin/VBoxUtils-darwin.cpp \
633 src/VBoxFBQuartz2D.cpp
634# src/darwin/VBoxAquaStyle.cpp
635
636ifdef VBOX_WITH_ICHAT_THEATER
637 VirtualBox4_SOURCES.darwin += \
638 src/darwin/VBoxIChatTheaterWrapper.m
639endif
640
641# The Qt modules we're using.
642# (The include directory and lib/framework for each module will be added by the Qt4 unit.)
643VirtualBox4_QT_MODULES = Core Gui
644
645# Import QDesigner UI sources and translations from VBoxUI.pro.
646# Note that the OSE about dialog is always required by lupdate/lrelease.
647ifndef VBOX_WITH_REGISTRATION
648 FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
649endif
650VirtualBox4_SOURCES := \
651 $(VirtualBox4_SOURCES) \
652 $(FORMS) \
653 ui/VBoxAboutDlg.ui
654
655# Resource files with some OSE differences.
656VirtualBox4_SOURCES += VirtualBox.qrc
657ifdef VBOX_OSE
658 VirtualBox4_SOURCES += VirtualBox_OSE.qrc
659else
660 VirtualBox4_SOURCES += VirtualBox_NonOSE.qrc
661 VirtualBox4_SOURCES += src/VBoxAboutNonOSEDlg.cpp
662 VirtualBox4_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
663endif
664VirtualBox_OSE.qrc_RCCFLAGS = -name OSE
665VirtualBox_NonOSE.qrc_RCCFLAGS = -name NonOSE
666
667
668# Import the translation source from VBoxUI.pro and add the qt_xx_YY counterparts
669VirtualBox4_QT_TRANSLATIONS := $(TRANSLATIONS) \
670 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts, $(filter nls/VirtualBox_%.ts,$(TRANSLATIONS)))
671# Compress the translation units.
672VirtualBox4_LRCFLAGS = -compress
673# Where to install the translations (a separate install target, VirtualBox4-nls-inst is created).
674VirtualBox4_QT_TRANSLATIONS_INST = $(INST_BIN)nls/
675
676
677
678# Some flag hacks (should go away).
679ifneq ($(KBUILD_TARGET),win)
680 src/HappyHttp.cpp_CXXFLAGS += -fexceptions
681 src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
682 src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
683endif
684src/HappyHttp.cpp_CXXFLAGS.linux += -O2
685
686## @todo how to detect what tool is used?
687## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
688# more generic -Wno-extra
689# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
690ifdef VBOX_WITH_XPCOM
691 src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
692endif
693
694
695
696#
697# On Windows we'll have to generate/edit the resource file.
698# The IDI_ICON1 name is Qt specific.
699#
700$(PATH_TARGET)/VirtualBox4.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
701 $(RM) -f $@
702 $(APPEND) $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
703
704VirtualBox4_CLEAN.win += $(PATH_TARGET)/VirtualBox4.rc
705
706
707#
708# Other stuff.
709#
710VBOX_WRAPPERS_FILE4 = $(PATH_VirtualBox4)/include/COMWrappers.h
711VirtualBox4_BLDDIRS += $(PATH_VirtualBox4)/include/
712VirtualBox4_INTERMEDIATES = $(VBOX_WRAPPERS_FILE4)
713
714VBOX_WRAPPERS_INC_FILE4 = include/COMDefs.h
715VBOX_WRAPPERS_TEMPLATE4 = include/COMWrappers.xsl
716VBOX_WRAPPERS_XIDLFILE4 = ../../Main/idl/VirtualBox.xidl
717
718
719
720# generated files we need to clean manually
721OTHER_CLEAN = \
722 $(VirtualBox4_GENSRCS) \
723 $(VirtualBox4_GENHDRS) \
724 $(VBOX_WRAPPERS_FILE4) \
725 $(PATH_BIN)/vboxkeyboard.tar.gz
726
727
728#
729# On OS X (darwin) we need to install icon resources and compusory bundle contents.
730# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
731#
732INSTALLS.darwin += VirtualBox.app
733VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
734VirtualBox.app_MODE = 644
735VirtualBox.app_SOURCES = \
736 src/darwin/PkgInfo \
737 $(PATH_TARGET)/Info.plist \
738 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
739
740$(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
741 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
742 $(QUIET)$(RM) -f $@
743 $(QUIET)$(SED) \
744 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
745 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
746 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
747 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
748 $< > $@
749
750INSTALLS.darwin += VirtualBoxVM.app
751VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
752VirtualBoxVM.app_MODE = 644
753VirtualBoxVM.app_SOURCES = \
754 src/darwin/VM-PkgInfo=>PkgInfo \
755 $(PATH_TARGET)/VM-Info.plist=>Info.plist \
756 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
757VirtualBoxVM.app_SYMLINKS = \
758 MacOS=>../../../MacOS/
759
760$(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
761 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
762 $(QUIET)$(RM) -f $@
763 $(QUIET)$(SED) \
764 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
765 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
766 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
767 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
768 --output $@ $<
769
770#
771# Testcase for the darwin keyboard routines.
772#
773ifdef VBOX_WITH_TESTCASES
774PROGRAMS.darwin += tstDarwinKeyboard4
775tstDarwinKeyboard4_NAME = tstDarwinKeyboard
776tstDarwinKeyboard4_TEMPLATE = VBOXR3TSTEXE
777tstDarwinKeyboard4_INCS = include
778tstDarwinKeyboard4_SOURCES = \
779 src/darwin/tstDarwinKeyboard.cpp \
780 src/darwin/DarwinKeyboard.cpp
781tstDarwinKeyboard4_LDFLAGS = -framework IOKit -framework Carbon
782tstDarwinKeyboard4_LIBS = \
783 $(LIB_RUNTIME)
784endif
785
786
787#
788# Install the license file. Belongs in the root makefile really.
789#
790# Note: I'm doing this right here because the GUI will _not_ run
791# without that file which might be annoying for developers!
792#
793ifndef VBOX_OSE
794ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),)
795$(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
796 $(call MSG_GENERATE,,$@)
797 $(QUIET)$(CP) $< $@
798
799$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
800endif
801endif
802
803
804
805# Unset everything that was loaded from VBoxUI.pro.
806TEMPLATE := $(SAVED_TEMPLATE)
807SAVED_TEMPLATE :=
808LANGUAGE :=
809FORMS :=
810TRANSLATIONS :=
811IMAGES :=
812
813
814# Commit the magic.
815# (note: before custom rules that make usage of generated variables!).
816include $(KBUILD_PATH)/footer.kmk
817
818
819#
820# Generate the COM wrappers.
821#
822$(VBOX_WRAPPERS_INC_FILE4): $(VBOX_WRAPPERS_FILE4)
823
824$(VBOX_WRAPPERS_FILE4): $(VBOX_WRAPPERS_XIDLFILE4) $(VBOX_WRAPPERS_TEMPLATE4) | $(call DIRDEP,$(PATH_VirtualBox4)/include/)
825 $(call MSG_TOOL,xsltproc,VirtualBox4,$<,$@)
826 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_WRAPPERS_TEMPLATE4) $<
827
828
829#
830# Update all known NLS translation (.ts) files in the nls/ subdirectory.
831#
832# NOTE: This target is intened to be run only by the GUI maintainer shortly
833# before a new product release. VirtualBox_xx_YY.ts is a template for new
834# languages and should never be actually translated or installed.
835#
836updatenls:: \
837 $(VirtualBox4_QT_UISRCS) \
838 $(filter-out %.qrc,$(VirtualBox4_SOURCES)) \
839 $(wildcard include/*.h)
840 $(call MSG_L1,lupdate all languages (nls/*.ts))
841 $(QUIET)$(TOOL_QT4_LUPDATE) \
842 $^ \
843 -ts \
844 $(filter-out nls/qt_%.ts,$(VirtualBox4_QT_TRANSLATIONS)) \
845 nls/VirtualBox_xx_YY.ts
846
847
848# alias for generating the COM Wrappers file.
849testwrappers:: $(VBOX_WRAPPERS_FILE4)
850
Note: See TracBrowser for help on using the repository browser.

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