VirtualBox

Changeset 35218 in vbox


Ignore:
Timestamp:
Dec 17, 2010 12:45:16 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69063
Message:

Introduced RTPathAppPrivateArchTop for hacking around the /opt/VirtualBox/amd64 and /opt/VirtualBox/i386 issues with RTPathAppPrivateArch. Changed RTPathAppDocs to returned the same directory name.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/param.h

    r32036 r35218  
    117117/**
    118118 * Host max path (the reasonable value).
     119 * @remarks defined both by iprt/param.h and iprt/path.h.
    119120 */
    120 #define RTPATH_MAX   (4096 + 4)      /* (PATH_MAX + 1) on linux w/ some alignment */
     121#if !defined(___iprt_path_h) || defined(DOXYGEN_RUNNING)
     122# define RTPATH_MAX         (4096 + 4)    /* (PATH_MAX + 1) on linux w/ some alignment */
     123#endif
    121124
    122125/** @} */
  • trunk/include/iprt/path.h

    r34230 r35218  
    4242 */
    4343
     44/**
     45 * Host max path (the reasonable value).
     46 * @remarks defined both by iprt/param.h and iprt/path.h.
     47 */
     48#if !defined(___iprt_param_h) || defined(DOXYGEN_RUNNING)
     49# define RTPATH_MAX         (4096 + 4)    /* (PATH_MAX + 1) on linux w/ some alignment */
     50#endif
    4451
    4552/** @def RTPATH_SLASH
     
    604611 *
    605612 * This is not the same as RTPathAppPrivateArch() as Linux depends all shared
    606  * libraries in a common global directory where ld.so can found them.
     613 * libraries in a common global directory where ld.so can find them.
    607614 *
    608615 * Linux:    /usr/lib
     616 * Solaris:  /opt/@<application@>/@<arch>@ or something
    609617 * Windows:  @<program files directory@>/@<application@>
    610618 * Old path: same as RTPathExecDir()
     
    621629 *
    622630 * Linux:    /usr/shared/@<application@>
     631 * Solaris:  /opt/@<application@>
    623632 * Windows:  @<program files directory@>/@<application@>
    624633 * Old path: same as RTPathExecDir()
     
    635644 *
    636645 * Linux:    /usr/lib/@<application@>
     646 * Solaris:  /opt/@<application@>/@<arch>@ or something
    637647 * Windows:  @<program files directory@>/@<application@>
    638648 * Old path: same as RTPathExecDir()
     
    645655
    646656/**
     657 * Gets the toplevel directory for architecture-dependent application data.
     658 *
     659 * This differs from RTPathAppPrivateArch on Solaris only where it will work
     660 * around the /opt/@<application@>/amd64 and /opt/@<application@>/i386 multi
     661 * architecture installation style.
     662 *
     663 * Linux:    /usr/lib/@<application@>
     664 * Solaris:  /opt/@<application@>
     665 * Windows:  @<program files directory@>/@<application@>
     666 * Old path: same as RTPathExecDir()
     667 *
     668 * @returns iprt status code.
     669 * @param   pszPath     Buffer where to store the path.
     670 * @param   cchPath     Buffer size in bytes.
     671 */
     672RTDECL(int) RTPathAppPrivateArchTop(char *pszPath, size_t cchPath);
     673
     674/**
    647675 * Gets the directory for documentation.
    648676 *
    649677 * Linux:    /usr/share/doc/@<application@>
     678 * Solaris:  /opt/@<application@>
    650679 * Windows:  @<program files directory@>/@<application@>
    651680 * Old path: same as RTPathExecDir()
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r34163 r35218  
    10731073            return VERR_NO_MEMORY;
    10741074
    1075         rc = RTPathAppPrivateArch(pThis->pszEfiRomFile, RTPATH_MAX);
     1075        rc = RTPathAppPrivateArchTop(pThis->pszEfiRomFile, RTPATH_MAX);
    10761076        AssertRCReturn(rc, rc);
    10771077        rc = RTPathAppend(pThis->pszEfiRomFile, RTPATH_MAX, "VBoxEFI32.fd");
  • trunk/src/VBox/Installer/solaris/Makefile.kmk

    r35216 r35218  
    601601        $(QUIET)$(if $(VBOX_WITH_QTGUI),$(LN_SYMLINK) -f ../additions                                                        $(SOLARIS_VBOXINST_DIR_32)/additions,)
    602602        $(QUIET)$(if $(VBOX_WITH_QTGUI),$(LN_SYMLINK) -f ../additions                                                        $(SOLARIS_VBOXINST_DIR_64)/additions,)
    603         $(QUIET)$(if $(VBOX_WITH_QTGUI),$(LN_SYMLINK) -f ../VirtualBox.chm                                                   $(SOLARIS_VBOXINST_DIR_32)/VirtualBox.chm,)
    604         $(QUIET)$(if $(VBOX_WITH_QTGUI),$(LN_SYMLINK) -f ../VirtualBox.chm                                                   $(SOLARIS_VBOXINST_DIR_64)/VirtualBox.chm,)
    605         $(QUIET)$(if $(VBOX_WITH_EFIFW_PACKING),$(LN_SYMLINK) -f ../VBoxEFI32.fd                                             $(SOLARIS_VBOXINST_DIR_64)/VBoxEFI32.fd,)
    606         $(QUIET)$(if $(VBOX_WITH_EFIFW_PACKING),$(LN_SYMLINK) -f ../VBoxEFI32.fd                                             $(SOLARIS_VBOXINST_DIR_32)/VBoxEFI32.fd,)
    607         $(QUIET)$(if $(VBOX_WITH_EFIFW_PACKING),$(LN_SYMLINK) -f ../VBoxEFI64.fd                                             $(SOLARIS_VBOXINST_DIR_64)/VBoxEFI64.fd,)
    608         $(QUIET)$(if $(VBOX_WITH_EFIFW_PACKING),$(LN_SYMLINK) -f ../VBoxEFI64.fd                                             $(SOLARIS_VBOXINST_DIR_32)/VBoxEFI64.fd,)
    609603else
    610604 ifndef VBOX_OSE
     
    620614        $(QUIET)$(if $(VBOX_WITH_QTGUI),$(LN_SYMLINK) -f ../rdesktop-vrdp-keymaps                                            $(SOLARIS_VBOXINST_DIR_ISA)/rdesktop-vrdp-keymaps,)
    621615        $(QUIET)$(if $(VBOX_WITH_QTGUI),$(LN_SYMLINK) -f ../additions                                                        $(SOLARIS_VBOXINST_DIR_ISA)/additions,)
    622         $(QUIET)$(if $(VBOX_WITH_QTGUI),$(LN_SYMLINK) -f ../VirtualBox.chm                                                   $(SOLARIS_VBOXINST_DIR_ISA)/VirtualBox.chm,)
    623         $(QUIET)$(if $(VBOX_WITH_EFIFW_PACKING),$(LN_SYMLINK) -f ../VBoxEFI32.fd                                             $(SOLARIS_VBOXINST_DIR_ISA)/VBoxEFI32.fd,)
    624         $(QUIET)$(if $(VBOX_WITH_EFIFW_PACKING),$(LN_SYMLINK) -f ../VBoxEFI64.fd                                             $(SOLARIS_VBOXINST_DIR_ISA)/VBoxEFI64.fd,)
    625616endif
    626617        $(QUIET)$(LN_SYMLINK) -f ./pkginstall.sh                                                                             $(SOLARIS_VBOXINST_DIR)/ipsinstall.sh
  • trunk/src/VBox/Main/ExtPackManagerImpl.cpp

    r35191 r35218  
    17451745     */
    17461746    char szBaseDir[RTPATH_MAX];
    1747     int rc = RTPathAppPrivateArch(szBaseDir, sizeof(szBaseDir));
     1747    int rc = RTPathAppPrivateArchTop(szBaseDir, sizeof(szBaseDir));
    17481748    AssertLogRelRCReturn(rc, E_FAIL);
    17491749    rc = RTPathAppend(szBaseDir, sizeof(szBaseDir), VBOX_EXTPACK_INSTALL_DIR);
  • trunk/src/VBox/Main/VBoxExtPackHelperApp.cpp

    r35204 r35218  
    176176     */
    177177    char szCorrect[RTPATH_MAX];
    178     int rc = RTPathAppPrivateArch(szCorrect, sizeof(szCorrect));
     178    int rc = RTPathAppPrivateArchTop(szCorrect, sizeof(szCorrect));
    179179    if (RT_FAILURE(rc))
    180180        return false;
  • trunk/src/VBox/Runtime/r3/path.cpp

    r33454 r35218  
    3939
    4040
     41#ifdef RT_OS_SOLARIS
     42/**
     43 * Hack to strip of the architecture subdirectory from the exec dir.
     44 *
     45 * @returns See RTPathExecDir.
     46 * @param   pszPath             See RTPathExecDir.
     47 * @param   cchPath             See RTPathExecDir.
     48 */
     49static int rtPathSolarisArchHack(char *pszPath, size_t cchPath)
     50{
     51    int rc = RTPathExecDir(pszPath, cchPath);
     52    if (RT_SUCCESS(rc))
     53    {
     54        const char *pszLast = RTPathFilename(pszPath);
     55        if (   !strcmp(pszLast, "amd64")
     56            || !strcmp(pszLast, "i386"))
     57            RTPathStripFilename(pszPath);
     58    }
     59    return rc;
     60}
     61#endif
     62
     63
    4164RTDECL(int) RTPathExecDir(char *pszPath, size_t cchPath)
    4265{
     
    5982
    6083
    61 /**
    62  * Gets the directory for architecture-independent application data, for
    63  * example NLS files, module sources, ...
    64  *
    65  * Linux:    /usr/shared/@<application@>
    66  * Windows:  @<program files directory@>/@<application@>
    67  * Old path: same as RTPathExecDir()
    68  *
    69  */
    7084RTDECL(int) RTPathAppPrivateNoArch(char *pszPath, size_t cchPath)
    7185{
    7286#if !defined(RT_OS_WINDOWS) && defined(RTPATH_APP_PRIVATE)
    7387    return RTStrCopy(pszPath, cchPath, RTPATH_APP_PRIVATE);
     88#elif defined(RT_OS_SOLARIS) && 0 /// @todo fix this
     89    return rtPathSolarisArchHack(pszPath, cchPath);
    7490#else
    7591    return RTPathExecDir(pszPath, cchPath);
     
    7894
    7995
    80 /**
    81  * Gets the directory for architecture-dependent application data, for
    82  * example modules which can be loaded at runtime.
    83  *
    84  * Linux:    /usr/lib/@<application@>
    85  * Windows:  @<program files directory@>/@<application@>
    86  * Old path: same as RTPathExecDir()
    87  *
    88  * @returns iprt status code.
    89  * @param   pszPath     Buffer where to store the path.
    90  * @param   cchPath     Buffer size in bytes.
    91  */
    9296RTDECL(int) RTPathAppPrivateArch(char *pszPath, size_t cchPath)
    9397{
     
    100104
    101105
    102 /**
    103  * Gets the directory of shared libraries. This is not the same as
    104  * RTPathAppPrivateArch() as Linux depends all shared libraries in
    105  * a common global directory where ld.so can found them.
    106  *
    107  * Linux:    /usr/lib
    108  * Windows:  @<program files directory@>/@<application@>
    109  * Old path: same as RTPathExecDir()
    110  *
    111  * @returns iprt status code.
    112  * @param   pszPath     Buffer where to store the path.
    113  * @param   cchPath     Buffer size in bytes.
    114  */
     106RTDECL(int) RTPathAppPrivateArchTop(char *pszPath, size_t cchPath)
     107{
     108#if !defined(RT_OS_WINDOWS) && defined(RTPATH_APP_PRIVATE_ARCH)
     109    return RTStrCopy(pszPath, cchPath, RTPATH_APP_PRIVATE_ARCH);
     110#elif defined(RT_OS_SOLARIS)
     111    return rtPathSolarisArchHack(pszPath, cchPath);
     112#else
     113    return RTPathExecDir(pszPath, cchPath);
     114#endif
     115}
     116
     117
    115118RTDECL(int) RTPathSharedLibs(char *pszPath, size_t cchPath)
    116119{
     
    123126
    124127
    125 /**
    126  * Gets the directory for documentation.
    127  *
    128  * Linux:    /usr/share/doc/@<application@>
    129  * Windows:  @<program files directory@>/@<application@>
    130  * Old path: same as RTPathExecDir()
    131  *
    132  * @returns iprt status code.
    133  * @param   pszPath     Buffer where to store the path.
    134  * @param   cchPath     Buffer size in bytes.
    135  */
    136128RTDECL(int) RTPathAppDocs(char *pszPath, size_t cchPath)
    137129{
    138130#if !defined(RT_OS_WINDOWS) && defined(RTPATH_APP_DOCS)
    139131    return RTStrCopy(pszPath, cchPath, RTPATH_APP_DOCS);
     132#elif defined(RT_OS_SOLARIS)
     133    return rtPathSolarisArchHack(pszPath, cchPath);
    140134#else
    141135    return RTPathExecDir(pszPath, cchPath);
     
    144138
    145139
    146 /**
    147  * Gets the temporary directory path.
    148  *
    149  * @returns iprt status code.
    150  *
    151  * @param   pszPath     Buffer where to store the path.
    152  * @param   cchPath     Buffer size in bytes.
    153  */
    154140RTDECL(int) RTPathTemp(char *pszPath, size_t cchPath)
    155141{
  • trunk/src/VBox/VMM/PDMLdr.cpp

    r35188 r35218  
    11121112     * Use the default location.
    11131113     */
    1114     rc = fShared ? RTPathSharedLibs(szPath, sizeof(szPath))
    1115                  : RTPathAppPrivateArch(szPath, sizeof(szPath));
     1114    rc = fShared
     1115       ? RTPathSharedLibs(    szPath, sizeof(szPath))
     1116       : RTPathAppPrivateArch(szPath, sizeof(szPath));
    11161117    if (!RT_SUCCESS(rc))
    11171118    {
Note: See TracChangeset for help on using the changeset viewer.

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