VirtualBox

Changeset 12172 in vbox


Ignore:
Timestamp:
Sep 6, 2008 4:23:45 AM (16 years ago)
Author:
vboxsync
Message:

Makefiles: Moved the Qt4 templates to Config.kmk and the qt4-bin install target to the root makefile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk

    r12171 r12172  
    4141# Disable the debugger for now, this is another story.
    4242VBOX_WITH_DEBUGGER_GUI :=
    43 
    44 # Guess VBOX_WITH_QT4_SUN
    45 ifndef VBOX_WITH_QT4_SUN
    46  ifndef VBOX_OSE
    47   if1of ($(KBUILD_TARGET), darwin solaris win)
    48    VBOX_WITH_QT4_SUN := 1
    49   endif
    50  endif
    51 endif
    52 
    53 #
    54 # Handmade configuration of qt4 - very annoying, this needs to
    55 # be cleaned up properly later some time (not important now).
    56 #
    57 ifeq ($(VBOX_PATH_QT4),)
    58  ifeq ($(KBUILD_TARGET),darwin)
    59   VBOX_PATH_QT4 := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
    60   ifeq ($(VBOX_PATH_QT4),)
    61    ifneq ($(wildcard /Library/Frameworks/QtCore.framework),)
    62     # Using the global installation (for OSE).
    63     VBOX_PATH_QT4 ?= /usr
    64     VBOX_PATH_QT4_FRAMEWORKS ?= /Library/Frameworks
    65    endif
    66   endif
    67  else if1of ($(KBUILD_TARGET),win)
    68   VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
    69  else if1of ($(KBUILD_TARGET),solaris)
    70   VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
    71   ifneq ($(VBOX_PATH_QT4),)
    72    VBOX_WITH_QT4_SUN = 1
    73   endif
    74  endif
    75 endif
    76 ifeq ($(VBOX_PATH_QT4),)
    77  if1of ($(USERNAME), bird)
    78   # gentoo (64-bit)
    79   VBOX_PATH_QT4          ?= /usr
    80   VBOX_PATH_QT4_LIB      ?= /usr/lib/qt4
    81  endif
    82 endif
    83 VBOX_PATH_QT4            ?= /usr
    84 VBOX_PATH_QT4_LIB        ?= $(VBOX_PATH_QT4)/lib
    85 
    86 # Hack LD_LIBRARY_PATH for stuff in tools.
    87 ifdef VBOX_WITH_QT4_SUN
    88  if1of ($(KBUILD_TARGET), linux)
    89   export LD_LIBRARY_PATH := $(VBOX_PATH_QT4_LIB):$(LD_LIBRARY_PATH)
    90  endif
    91 endif
    92 
    93 
    94 ifdef VBOX_WITH_QT4_SUN
    95 #
    96 # Install our Qt DLLs / Shared Objects / Frameworks.
    97 #
    98 ## @todo move to the root Makefile.kmk, and remove qt4-bin from INSTALLS below.
    99  INSTALLS += qt4-bin
    100  qt4-bin_MODE = 644
    101  ifeq ($(KBUILD_TARGET),darwin)
    102   qt4-bin_INST = $(INST_VIRTUALBOX)Contents/Frameworks/
    103   qt4-bin_SOURCES = \
    104         $(VBOX_PATH_QT4)/Frameworks/QtCore.framework/Versions/4/QtCore=>QtCore.framework/Versions/4/QtCore \
    105         $(VBOX_PATH_QT4)/Frameworks/QtGui.framework/Versions/4/QtGui=>QtGui.framework/Versions/4/QtGui
    106  else ifeq ($(KBUILD_TARGET),win)
    107   qt4-bin_INST = $(INST_BIN)
    108   qt4-bin_SOURCES = \
    109         $(VBOX_PATH_QT4_LIB)/VBoxQtCore4.dll \
    110         $(VBOX_PATH_QT4_LIB)/VBoxQtGui4.dll
    111  else
    112   qt4-bin_INST = $(INST_BIN)
    113   qt4-bin_SOURCES = \
    114         $(VBOX_PATH_QT4_LIB)/libVBoxQtCore.so.4 \
    115         $(VBOX_PATH_QT4_LIB)/libVBoxQtGui.so.4
    116  endif
    117 endif # VBOX_WITH_QT4_SUN
    118 
    119 
    120 # Template copy from the qt3 stuff. Appended a "4" on the
    121 # relevant places.
    122 
    123 #
    124 # Template for building Qt GUI executables.
    125 #
    126 
    127 TEMPLATE_VBOXQT4GUIEXE = VBox Qt4 GUI Executable
    128 USES += qt4
    129 TEMPLATE_VBOXQT4GUIEXE_USES = qt4
    130 TEMPLATE_VBOXQT4GUIEXE_QTTOOL = QT4
    131 TEMPLATE_VBOXQT4GUIEXE_MOCTOOL = QT4
    132 TEMPLATE_VBOXQT4GUIEXE_UICTOOL = QT4
    133 TEMPLATE_VBOXQT4GUIEXE_RCCTOOL = QT4
    134 TEMPLATE_VBOXQT4GUIEXE_LRCTOOL = QT4
    135 TEMPLATE_VBOXQT4GUIEXE_SDKS = QT4
    136 ifdef VBOX_WITH_QT4_SUN
    137  ifneq ($(KBUILD_TARGET),darwin) ## @todo The next darwin build should also make use the prefix just to make things more uniform.
    138   TEMPLATE_VBOXQT4GUIEXE_QT_PREFIX = VBox
    139  endif
    140 endif
    141 TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT QT_SHARED HAVE_CONFIG_H $(ARCH_BITS_DEFS)
    142 
    143 ifeq ($(KBUILD_TARGET),win)
    144  TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_VCC_TOOL)
    145  TEMPLATE_VBOXQT4GUIEXE_DEFS += \
    146     _WIN32_WINNT=0x0500 UNICODE _UNICODE \
    147     QT_DLL _CRT_SECURE_NO_DEPRECATE \
    148     $(QMAKE_PRL_DEFINES)
    149  ## @todo VCC70 flags?
    150  ifdef VBOX_USE_VCC80
    151   TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
    152         -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
    153   TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -RTCsu
    154  else
    155   TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
    156         -nologo -Zm200 -W3 -MD -Zi -GX
    157   TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -GZ
    158  endif
    159  TEMPLATE_VBOXQT4GUIEXE_INCS += \
    160         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
    161  TEMPLATE_VBOXQT4GUIEXE_LDFLAGS = \
    162         /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
    163         /DELAYLOAD:oleaut32.dll
    164  TEMPLATE_VBOXQT4GUIEXE_SDKS += WINPSDK
    165  TEMPLATE_VBOXQT4GUIEXE_LIBS = \
    166         $(VBOX_LIBS_QT4) \
    167         $(LIB_RUNTIME) \
    168         $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
    169         $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
    170         $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
    171         $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
    172         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
    173  TEMPLATE_VBOXQT4GUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
    174 
    175 else # the gcc guys:
    176  TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_GCC_TOOL)
    177  TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
    178 
    179  TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
    180 
    181  TEMPLATE_VBOXQT4GUIEXE_INCS += \
    182         $(LIB_SDL_INC)
    183  TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
    184         -g -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
    185         -Wno-long-long -fshort-wchar -fno-strict-aliasing \
    186         $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
    187  TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86 = -m32
    188  TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64 = -m64
    189  TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
    190  TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.x86 = -m32
    191  TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.amd64 = -m64
    192  TEMPLATE_VBOXQT4GUIEXE_LIBS = \
    193         $(VBOX_LIBS_QT4) \
    194         $(LIB_SDL) \
    195         $(LIB_RUNTIME) \
    196         $(LIB_REM) \
    197         $(LIB_VMM)
    198 
    199  ifeq ($(KBUILD_TARGET),linux)
    200   TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
    201   TEMPLATE_VBOXQT4GUIEXE_LIBS += \
    202     $(VBOX_XCURSOR_LIBS) \
    203         Xext
    204   TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
    205     $(VBOX_LIBPATH_X11)
    206  else ifeq ($(KBUILD_TARGET),darwin)
    207   TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.darwin += -bind_at_load
    208   TEMPLATE_VBOXQT4GUIEXE_LIBS +=
    209   TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
    210  else
    211   TEMPLATE_VBOXQT4GUIEXE_INCS += \
    212         $(VBOX_XCURSOR_INCS)
    213   TEMPLATE_VBOXQT4GUIEXE_LIBS += \
    214     $(VBOX_XCURSOR_LIBS) \
    215         Xext \
    216         X11 \
    217         m \
    218         $(LIB_PTHREAD)
    219   TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
    220         $(VBOX_LIBPATH_X11)
    221   ifeq ($(KBUILD_TARGET),freebsd)
    222    TEMPLATE_VBOXQT4GUIEXE_INCS += \
    223         /usr/include \
    224         /usr/X11R6/include \
    225         /usr/local/include
    226   endif
    227   ifeq ($(KBUILD_TARGET),solaris)
    228    TEMPLATE_VBOXQT4GUIEXE_LIBS += \
    229         rt socket nsl
    230   endif
    231  endif
    232  # Assume the Qt shared objects are in the same directory as the executable, on Solaris too.
    233  ifdef VBOX_WITH_RUNPATH
    234   TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)'
    235  else ifdef VBOX_WITH_ORIGIN
    236   TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)'
    237  endif
    238 
    239 endif
    240 
    241 # Add COM/XPCOM stuff
    242 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
    243         $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
    244 ifdef VBOX_WITH_XPCOM
    245  ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM.
    246  TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM
    247  ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
    248   TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
    249  endif
    250  TEMPLATE_VBOXQT4GUIEXE_INCS += \
    251         $(VBOX_XPCOM_INCS)
    252  TEMPLATE_VBOXQT4GUIEXE_LIBS += \
    253         $(LIB_XPCOM)
    254 else  # COM
    255  TEMPLATE_VBOXQT4GUIEXE_INCS += \
    256         $(VBOX_PATH_SDK)/bindings/mscom/include
    257 endif # COM
    258 
    259 #
    260 # Template for building Qt GUI components.
    261 #
    262 TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
    263 TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQT4GUIEXE
    264 TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
    265 ifeq ($(KBUILD_TARGET),darwin)
    266  TEMPLATE_VBOXQT4GUI_LDFLAGS.darwin += $(filter-out -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.darwin)) \
    267         -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
    268 endif
    269 ifeq ($(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
    276 endif
    277 
    27843
    27944#
Note: See TracChangeset for help on using the changeset viewer.

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