Ticket #23080: virtualbox-remove-darwin.patch

File virtualbox-remove-darwin.patch, 13.1 KB (added by mmitar@…, 14 years ago)

A patch which links VirtualBox against non-framework Qt4

  • VirtualBox-4.0.0_OSE

    diff -Naur VirtualBox-4.0.0_OSE/AutoConfig.kmk VirtualBox-4.0.0_OSE.new/AutoConfig.kmk
    old new  
     1# -*- Makefile -*-
     2#
     3# automatically generated by
     4#
     5#   './configure --disable-hardening --disable-docs --with-openssl-dir=/opt/local'
     6#
     7# It will be completely overwritten if configure is executed again.
     8#
     9
     10VBOX_OSE                       := 1
     11VBOX_WITH_TESTSUITE            :=
     12VBOX_WITH_WIN32_ADDITIONS      :=
     13VBOX_WITH_LINUX_ADDITIONS      :=
     14
     15VBOX_WITH_SECURELABEL          :=
     16VBOX_WITHOUT_HARDENING         := 1
     17VBOX_MACOS_10_5_WORKAROUND     := 1
     18TOOL_GCC32_CC                  := gcc
     19TOOL_GCC32_AS                  := gcc
     20TOOL_GCC32_LD                  := gcc
     21TOOL_GXX32_CC                  := gcc
     22TOOL_GXX32_AS                  := gcc
     23TOOL_GCC32_CXX                 := g++
     24TOOL_GXX32_CXX                 := g++
     25TOOL_GXX32_LD                  := g++
     26VBOX_LIBIDL_CONFIG             := PKG_CONFIG_PATH=/opt/local/lib/pkgconfig /opt/local/bin/libIDL-config-2
     27SDK_VBOX_OPENSSL_INCS          := /opt/local/include
     28SDK_VBOX_OPENSSL_LIBS          := /opt/local/lib/libcrypto.a
     29SDK_VBOX_BLD_OPENSSL_LIBS      := /opt/local/lib/libcrypto.a
     30SDK_VBOX_LIBCURL_LIBS          := curl
     31SDK_VBOX_LIBCURL_INCS          :=
     32VBOX_WITH_CROGL                := 1
     33VBOX_PATH_QT4_LIB              := /opt/local/lib
     34SDK_QT4_LIBPATH                := /opt/local/lib
     35PATH_SDK_QT4_INC               := /opt/local/include
     36PATH_SDK_QT4_LIB               := /opt/local/lib
     37VBOX_WITH_PYTHON               := 1
     38VBOX_WITH_WEBSERVICES          :=
     39VBOX_WITH_DOCS                 :=
     40VBOX_WITH_DOCS_PACKING         :=
  • VirtualBox-4.0.0_OSE

    diff -Naur VirtualBox-4.0.0_OSE/Config.kmk VirtualBox-4.0.0_OSE.new/Config.kmk
    old new  
    584584 if1of ($(KBUILD_TARGET), linux solaris)
    585585  VBOX_PATH_APP_PRIVATE      = /opt/VirtualBox
    586586 else ifeq ($(KBUILD_TARGET),darwin)
    587   VBOX_PATH_APP_PRIVATE      = /Applications/VirtualBox.app/Contents/MacOS
     587  VBOX_PATH_APP_PRIVATE      = /Applications/Utilities/VirtualBox.app/Contents/MacOS
    588588 else ifeq ($(KBUILD_TARGET),freebsd)
    589589  VBOX_PATH_APP_PRIVATE      = /usr/local/lib/virtualbox
    590590 endif
     
    37353735 # be cleaned up properly later some time (not important now).
    37363736 #
    37373737 ifeq ($(VBOX_PATH_QT4),)
    3738   ifeq ($(KBUILD_TARGET),darwin)
    3739    VBOX_PATH_QT4 := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
    3740    ifeq ($(VBOX_PATH_QT4),)
    3741     ifneq ($(wildcard /Library/Frameworks/QtCore.framework),)
    3742      # Using the global installation (for OSE).
    3743      VBOX_PATH_QT4 ?= /usr
    3744      VBOX_PATH_QT4_FRAMEWORKS ?= /Library/Frameworks
    3745     endif
    3746    endif
    3747   else if1of ($(KBUILD_TARGET), win)
    3748    VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
    3749   else if1of ($(KBUILD_TARGET), solaris)
    3750    VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
    3751    ifneq ($(VBOX_PATH_QT4),)
    3752     VBOX_WITH_QT4_SUN = 1
    3753    endif
    3754   endif
    3755  endif
    3756  ifeq ($(VBOX_PATH_QT4),)
    37573738  if1of ($(USERNAME), bird)
    37583739   # gentoo (64-bit)
    37593740   VBOX_PATH_QT4          ?= /usr
  • VirtualBox-4.0.0_OSE

    diff -Naur VirtualBox-4.0.0_OSE/LocalConfig.kmk VirtualBox-4.0.0_OSE.new/LocalConfig.kmk
    old new  
     1VBOX_DEF_MACOSX_VERSION_MIN = 10.6
     2VBOX_DARWIN_NO_COMPACT_LINKEDIT =
     3VBOX_MACOS_10_5_WORKAROUND =
  • VirtualBox-4.0.0_OSE

    diff -Naur VirtualBox-4.0.0_OSE/Makefile.kmk VirtualBox-4.0.0_OSE.new/Makefile.kmk
    old new  
    182182# Install our Qt DLLs / Shared Objects / Frameworks.
    183183# Note: The installer fixes the darwin .dylibs when hardening is enabled.
    184184#
    185 ifeq ($(KBUILD_TARGET),darwin)
    186  INSTALLS += qt4-bin
    187  qt4-bin_MODE = 755
    188  qt4-bin_INST = $(INST_VIRTUALBOX)Contents/
    189  qt4-bin_SOURCES = $(foreach qtmod,$(VBOX_QT4_MOD_NAMES) \
    190         ,$(PATH_SDK_QT4_LIB)/$(qtmod).framework/Versions/4/$(qtmod)=>Frameworks/$(qtmod).framework/Versions/4/$(qtmod))
    191  ifdef VBOX_WITH_COCOA_QT
    192   qt4-bin_SOURCES += \
    193         $(PATH_SDK_QT4_LIB)/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/classes.nib=>Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/classes.nib \
    194         $(PATH_SDK_QT4_LIB)/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/info.nib=>Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/info.nib \
    195         $(PATH_SDK_QT4_LIB)/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib=>Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib
    196  endif
    197  ifneq ($(wildcard $(VBOX_PATH_QT4)/plugins/accessible/libqtaccessiblewidgets.dylib),)
    198   qt4-bin_SOURCES += \
    199         $(VBOX_PATH_QT4)/plugins/accessible/libqtaccessiblewidgets.dylib=>MacOS/accessible/libqtaccessiblewidgets.dylib
    200  endif
    201  qt4-bin_SYMLINKS = $(foreach qtmod, $(VBOX_QT4_MOD_NAMES) \
    202                 ,Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod))
    203  ifdef VBOX_WITH_COCOA_QT
    204   qt4-bin_SYMLINKS += \
    205         Frameworks/QtGui$(VBOX_QT4_INFIX).framework/Resources=>Versions/4/Resources/
    206  endif
    207 else
    208  ifdef VBOX_WITH_QT4_SUN
    209   ifeq ($(KBUILD_TARGET),win)
    210    INSTALLS += qt4-bin
    211    qt4-bin_MODE = 755
    212    qt4-bin_INST = $(INST_BIN)
    213    qt4-bin_SOURCES = \
    214         $(foreach qtmod,$(VBOX_QT4_MOD_NAMES),$(VBOX_PATH_QT4_LIB)/$(qtmod)4$(SUFF_DLL)) \
    215         $(VBOX_PATH_QT4)/plugins/accessible/qtaccessiblewidgets4$(SUFF_DLL)=>accessible/qtaccessiblewidgets4$(SUFF_DLL)
    216   else
    217    INSTALLS += qt4-bin
    218    qt4-bin_MODE = 755
    219    qt4-bin_INST = $(INST_BIN)
    220    qt4-bin_SOURCES = \
    221         $(foreach qtmod,$(VBOX_QT4_MOD_NAMES),$(VBOX_PATH_QT4_LIB)/lib$(qtmod)$(SUFF_DLL).4) \
    222         $(VBOX_PATH_QT4)/plugins/accessible/libqtaccessiblewidgets$(SUFF_DLL)=>accessible/libqtaccessiblewidgets$(SUFF_DLL)
    223   endif
    224  endif # VBOX_WITH_QT4_SUN
    225 endif
    226185
    227186
    228187#
  • VirtualBox-4.0.0_OSE

    diff -Naur VirtualBox-4.0.0_OSE/configure VirtualBox-4.0.0_OSE.new/configure
    old new  
    14241424{
    14251425  foundqt4=
    14261426  test_header Qt4
    1427   if [ "$OS" = "darwin" ]; then
    1428     # First check if there is the internal version of Qt. If yes nothing else
    1429     # has to be done.
    1430     QT_INTERNAL=`/bin/ls -rd1 $PWD/tools/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
    1431     for t in $QT_INTERNAL; do
    1432         if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
    1433           cnf_append "VBOX_WITH_QT4_SUN" "1"
    1434           log_success "use internal version"
    1435           return
    1436         fi
    1437     done
    1438     # Now try the user provided directory and some of the standard directories.
    1439     QT_TRIES="$QT4DIR /System/Library /Library"
    1440     for t in $QT_TRIES; do
    1441         if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
    1442           PATH_SDK_QT4="$t"
    1443           break
    1444         fi
    1445     done
    1446     # Add the necessary params for building the test application
    1447     if [ -n "$PATH_SDK_QT4" ]; then
    1448       foundqt4=1
    1449       INCQT4=-I$PATH_SDK_QT4/Frameworks/QtCore.framework/Headers
    1450       LIBQT4=-F$PATH_SDK_QT4/Frameworks
    1451       FLGQT4="-framework QtCore"
    1452     else
    1453       log_failure "Qt4 framework not found (can be disabled using --disable-qt4)"
    1454       fail
    1455     fi
    1456   else
    14571427    if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
    14581428      # default is to use pkg-config
    14591429      if which_wrapper pkg-config > /dev/null; then
    14601430        # this braindead path is necessary for mdv2008.1
    14611431        qt4_ver=`\
    1462             PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
     1432            PKG_CONFIG_PATH=/opt/local/lib/pkgconfig \
    14631433            pkg-config QtCore --modversion 2>> $LOG`
    14641434        if [ $? -ne 0 ]; then
    14651435          log_failure "QtCore not found"
    14661436          fail
    14671437        else
    14681438          FLGQT4=`\
    1469               PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
     1439              PKG_CONFIG_PATH=/opt/local/lib/pkgconfig \
    14701440              pkg-config QtCore --cflags`
    14711441          INCQT4=`strip_I "$FLGQT4"`
    14721442          LIBQT4=`\
    1473               PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
     1443              PKG_CONFIG_PATH=/opt/local/lib/pkgconfig \
    14741444              PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
    14751445              pkg-config QtCore --libs`
    14761446          foundqt4=1
     
    15121482        fi
    15131483      done
    15141484    fi
    1515   fi
    15161485  if [ -n "$foundqt4" ]; then
    15171486    cat > $ODIR.tmp_src.cc << EOF
    15181487#include <cstdio>
     
    15321501    [ -n "$INCQT4" ] && I_INCQT4=`prefix_I "$INCQT4"`
    15331502    if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
    15341503      if test_execute_path "`strip_L "$LIBQT4"`"; then
    1535         if [ "$OS" = "darwin" ]; then
    1536           # Successful build & run the test application so add the necessary
    1537           # params to AutoConfig.kmk
    1538           cnf_append "PATH_SDK_QT4_INC" "$PATH_SDK_QT4/Frameworks"
    1539           cnf_append "PATH_SDK_QT4_LIB" "$PATH_SDK_QT4/Frameworks"
    1540           cnf_append "PATH_SDK_QT4" "$PATH_SDK_QT4/Frameworks"
    1541           # Check for the moc tool in the Qt directory found & some standard
    1542           # directories.
    1543           for q in $PATH_SDK_QT4 /usr /Developer/Tools/Qt; do
    1544             if which_wrapper "$q/bin/moc" > /dev/null; then
    1545               cnf_append "PATH_TOOL_QT4" "$q"
    1546               cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
    1547             fi
    1548           done
    1549         else
    15501504          # strip .../QtCore as we add components ourself
    15511505          INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
    15521506          # store only the first path, remove all other pathes
     
    15921546              fi
    15931547            fi
    15941548          done
    1595         fi
    15961549      fi
    15971550    else
    15981551      log_failure "qt4 not working"
  • kBuild/units/qt4.kmk

    diff -Naur VirtualBox-4.0.0_OSE/kBuild/units/qt4.kmk VirtualBox-4.0.0_OSE.new/kBuild/units/qt4.kmk
    old new  
    7070 ifeq ($(PATH_SDK_QT4),)
    7171  # If target == host, try look for Qt in the various platform specific places.
    7272  ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
    73    ifeq ($(KBUILD_TARGET),darwin)
    74     PATH_SDK_QT4 := $(patsubst %/Frameworks/QtCore.framework/Versions/4,%,$(firstword $(wildcard /Library/Frameworks/QtCore.framework/Versions/4)))
    75    else ifeq ($(KBUILD_TARGET),win)
    76     # No idea here yet...
    77    else ifeq ($(KBUILD_TARGET),ose)
    78     # No port...
    79    else
    8073    # The Unices. Includes and esp. libs are tricky, so override the PATH_SDK_QT4_LIB* stuff if it doesn't work.
    8174    # Try find the general root of thing by looking for the qt3to4 program, if not found, then look for rcc.
    8275    PATH_SDK_QT4 := $(patsubst %/bin/qt3to4,%,$(firstword $(wildcard \
     
    163156     endif
    164157
    165158    endif
    166    endif # Unices
    167159  endif
    168160  # Found it?
    169161  ifeq ($(PATH_SDK_QT4),)
     
    178170
    179171# Libraries can be in either Frameworks or lib depending on how you
    180172# build it on the mac. The .dmg installs into Frameworks but builds into lib.
    181 ifeq ($(KBUILD_TARGET),darwin)
    182  ifndef PATH_SDK_QT4_LIB
    183   ifneq ($(wildcard $(PATH_SDK_QT4)/Frameworks),)
    184    PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/Frameworks
    185   else
    186    PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/lib
    187   endif
    188  endif
    189 else
    190  PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/lib
    191  PATH_SDK_QT4_INC ?= $(PATH_SDK_QT4)/include
    192 endif
     173PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/lib
     174PATH_SDK_QT4_INC ?= $(PATH_SDK_QT4)/include
    193175
    194176# The bits that kBuild picks up.
    195177#  (nothing here)
     
    953935        $($(target)_QT_INFIX.$(bld_trg_cpu)) \
    954936        $($(target)_QT_INFIX.$(bld_type)) \
    955937        $($(target)_QT_INFIX))
    956 ifeq ($(bld_trg),darwin)
    957  # Adding -F to CXXFLAGS is necessary to make #include <QtCore/qstring.h> stuff work...
    958  $(eval $(target)_CXXFLAGS += -F$(PATH_SDK_QT4_LIB) )
    959  $(eval $(target)_OBJCXXFLAGS += -F$(PATH_SDK_QT4_LIB) )
    960  $(eval $(target)_LDFLAGS  += -F$(PATH_SDK_QT4_LIB) $(foreach module,$(qt_modules), -framework $(qt_prefix)Qt$(module)$(qt_infix)) )
    961  $(eval $(target)_INCS     += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/$(qt_prefix)Qt$(module)$(qt_infix).framework/Versions/4/Headers) )
    962 else
    963  ifeq ($(bld_trg),win)
    964   $(eval $(target)_LIBS    += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/$(qt_prefix)Qt$(module)$(qt_infix)4$(SUFF_LIB)) )
    965   ifeq ($(tool_do),LINK_PROGRAM)
    966    $(eval $(target)_LIBS   += $(PATH_SDK_QT4_LIB)/$(qt_prefix)qtmain$(qt_infix)$(SUFF_LIB) )
    967   endif
    968  else
    969   $(eval $(target)_LIBS    += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/lib$(qt_prefix)Qt$(module)$(qt_infix)$(SUFF_DLL)) )
    970  endif
    971  $(eval $(target)_INCS     += $(addprefix $(PATH_SDK_QT4_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT4_INC) )
    972 endif
     938$(eval $(target)_LIBS    += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/lib$(qt_prefix)Qt$(module)$(qt_infix)$(SUFF_DLL)) )
     939$(eval $(target)_INCS     += $(addprefix $(PATH_SDK_QT4_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT4_INC) )
    973940$(eval $(target)_DEFS      += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) )
    974941
    975942