VirtualBox

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

Last change on this file since 10611 was 10597, checked in by vboxsync, 16 years ago

The qt4 unit seems to work, dropping the as much of the old style bits as currently possible.

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