VirtualBox

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

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

win qt4 frontend build fix

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