VirtualBox

Changeset 10333 in vbox for trunk


Ignore:
Timestamp:
Jul 7, 2008 3:16:04 PM (16 years ago)
Author:
vboxsync
Message:

added package type property

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r10309 r10333  
    127127 export VBOX_ADDITIONS_SH_MODE = release
    128128endif
     129
     130
     131#
     132# The VirtualBox package type.
     133#
     134ifeq ($(KBUILD_TARGET),win)
     135  VBOX_PACKAGE_OS = WINDOWS
     136else ifeq ($(KBUILD_TARGET),linux)
     137  VBOX_PACKAGE_OS = LINUX
     138else ifeq ($(KBUILD_TARGET),darwin)
     139  VBOX_PACKAGE_OS = DARWIN
     140else ifeq ($(KBUILD_TARGET),solaris
     141  VBOX_PACKAGE_OS = SOLARIS
     142else if1of ($(KBUILD_TARGET), dragonfly freebsd netbsd openbsd)
     143  VBOX_PACKAGE_OS = BSD
     144else
     145  $(error Cannot determine VBOX_PACKAGE_OS)
     146endif
     147ifeq ($(KBUILD_TARGET_ARCH),x86)
     148  VBOX_PACKAGE_ARCH = 32BITS
     149else
     150  VBOX_PACKAGE_ARCH = 64BITS
     151endif
     152# distribution, mostly for Linux/Solaris where we support different distributions
     153# this strip will be overridden by the Linux packaging scripts
     154VBOX_PACKAGE_DIST ?= GENERIC
     155# Full string
     156VBOX_PACKAGE_STRING = $(VBOX_PACKAGE_OS)_$(VBOX_PACKAGE_ARCH)_$(VBOX_PACKAGE_DIST)
    129157
    130158
     
    28522880        $(QUIET)$(MV) -f [email protected] $@
    28532881
     2882
     2883VBOX_PACKAGE_HEADER = $(PATH_OUT)/package-generated.h
     2884
     2885$(VBOX_PACKAGE_HEADER):
     2886        $(call MSG_GENERATE,,$@)
     2887        $(QUIET)$(MKDIR) -p $(@D)
     2888        $(QUIET)$(RM) -f $@ [email protected]
     2889        $(QUIET)$(APPEND) [email protected] '#ifndef ___package_generated_h___'
     2890        $(QUIET)$(APPEND) [email protected] '#define ___package_generated_h___'
     2891        $(QUIET)$(APPEND) [email protected] ''
     2892        $(QUIET)$(APPEND) [email protected] '#define VBOX_PACKAGE_STRING "$(VBOX_PACKAGE_STRING)"'
     2893        $(QUIET)$(APPEND) [email protected] ''
     2894        $(QUIET)$(APPEND) [email protected] '#endif'
     2895        $(QUIET)$(MV) -f [email protected] $@
     2896
    28542897#
    28552898# Used for external makefiles which cannot include Config.kmk
     
    28832926# the tree. This eliminates the need for manual dependencies on it.
    28842927## @todo there gotta be a better way of doing this.
    2885 Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
    2886 Makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
    2887 makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
     2928Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK) $(VBOX_PACKAGE_HEADER)
     2929Makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK) $(VBOX_PACKAGE_HEADER)
     2930makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK) $(VBOX_PACKAGE_HEADER)
    28882931
    28892932
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r9360 r10333  
    6161#include <VBox/VBoxHDD-new.h>
    6262#include <VBox/version.h>
     63#include <package-generated.h>
    6364
    6465#include <VBox/com/com.h>
     
    9899
    99100// static
     101Bstr VirtualBox::sPackageType;
     102
     103// static
    100104Bstr VirtualBox::sSettingsFormatVersion;
    101105
     
    147151    if (sVersion.isNull())
    148152        sVersion = VBOX_VERSION_STRING;
    149     LogFlowThisFunc (("Version: %ls\n", sVersion.raw()));
     153    if (sPackageType.isNull())
     154        sPackageType = VBOX_PACKAGE_STRING;
     155    LogFlowThisFunc (("Version: %ls, Package: %ls\n", sVersion.raw(), sPackageType.raw()));
    150156
    151157    if (sSettingsFormatVersion.isNull())
     
    472478
    473479    sVersion.cloneTo (aVersion);
     480    return S_OK;
     481}
     482
     483STDMETHODIMP VirtualBox::COMGETTER(PackageType) (BSTR *aPackageType)
     484{
     485    if (!aPackageType)
     486        return E_INVALIDARG;
     487
     488    AutoCaller autoCaller (this);
     489    CheckComRCReturnRC (autoCaller.rc());
     490
     491    sVersion.cloneTo (aPackageType);
    474492    return S_OK;
    475493}
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r10306 r10333  
    911911    </attribute>
    912912
     913    <attribute name="packageType" type="wstring" readonly="yes">
     914      <desc>
     915        A string representing the package type of this product. The
     916        format is OS_ARCH_DIST where OS is either WINDOWS, LINUX,
     917        SOLARIS, DARWIN. ARCH is either 32BITS or 64BITS. DIST
     918        is either GENERIC, UBUNTU_606, UBUNTU_710, or something like
     919        this.
     920      </desc>
     921    </attribute>
     922
    913923    <attribute name="homeFolder" type="wstring" readonly="yes">
    914924      <desc>
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r9360 r10333  
    112112    /* IVirtualBox properties */
    113113    STDMETHOD(COMGETTER(Version)) (BSTR *aVersion);
     114    STDMETHOD(COMGETTER(PackageType)) (BSTR *aPackageType);
    114115    STDMETHOD(COMGETTER(HomeFolder)) (BSTR *aHomeFolder);
    115116    STDMETHOD(COMGETTER(SettingsFilePath)) (BSTR *aSettingsFilePath);
     
    473474
    474475    static Bstr sVersion;
     476    static Bstr sPackageType;
    475477    static Bstr sSettingsFormatVersion;
    476478
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