VirtualBox

Changeset 65185 in vbox for trunk/src


Ignore:
Timestamp:
Jan 6, 2017 3:32:57 PM (8 years ago)
Author:
vboxsync
Message:

scm: fixed a loop, added support for Linux distributions which have the path in /usr/lib/*-linux-gnu and also look for .so.0 and .so.1 libraries (if the -dev/-devel package is not installed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bldprogs/scmsubversion.cpp

    r62854 r65185  
    691691            { "../lib/lib", ".so" },
    692692            { "../lib/lib", "-1.so" },
     693# ifdef RT_ARCH_X86
     694            { "../lib/i386-linux-gnu/lib", ".so" },
     695            { "../lib/i386-linux-gnu/lib", "-1.so" },
     696# else
     697            { "../lib/x86_64-linux-gnu/lib", ".so" },
     698            { "../lib/x86_64-linux-gnu/lib", "-1.so" },
     699# endif
    693700# endif
    694701        };
    695         for (unsigned iVar = 0; RT_ELEMENTS(s_aVariations); iVar++)
     702        for (unsigned iVar = 0; iVar < RT_ELEMENTS(s_aVariations); iVar++)
    696703        {
    697704            /*
     
    705712            for (iLib = 0; iLib < RT_ELEMENTS(s_apszLibraries) && RT_SUCCESS(rc); iLib++)
    706713            {
    707                 *pszEndPath = '\0';
    708                 rc = RTPathAppend(szPath, sizeof(szPath), s_aVariations[iVar].pszPrefix);
    709                 if (RT_SUCCESS(rc))
    710                     rc = RTStrCat(szPath, sizeof(szPath), s_apszLibraries[iLib]);
    711                 if (RT_SUCCESS(rc))
    712                     rc = RTStrCat(szPath, sizeof(szPath), s_aVariations[iVar].pszSuffix);
    713                 if (RT_SUCCESS(rc))
     714                static const char * const s_apszSuffixes[] = { "", ".0", ".1" };
     715                for (unsigned iSuff = 0; iSuff < RT_ELEMENTS(s_apszSuffixes); iSuff++)
    714716                {
     717                    *pszEndPath = '\0';
     718                    rc = RTPathAppend(szPath, sizeof(szPath), s_aVariations[iVar].pszPrefix);
     719                    if (RT_SUCCESS(rc))
     720                        rc = RTStrCat(szPath, sizeof(szPath), s_apszLibraries[iLib]);
     721                    if (RT_SUCCESS(rc))
     722                        rc = RTStrCat(szPath, sizeof(szPath), s_aVariations[iVar].pszSuffix);
     723                    if (RT_SUCCESS(rc))
     724                        rc = RTStrCat(szPath, sizeof(szPath), s_apszSuffixes[iSuff]);
     725                    if (RT_SUCCESS(rc))
     726                    {
    715727# ifdef RT_OS_WINDOWS
    716                     RTPathChangeToDosSlashes(pszEndPath, false);
     728                        RTPathChangeToDosSlashes(pszEndPath, false);
    717729# endif
    718                     rc = RTLdrLoadEx(szPath, &ahMods[iLib], RTLDRLOAD_FLAGS_NT_SEARCH_DLL_LOAD_DIR , NULL);
     730                        rc = RTLdrLoadEx(szPath, &ahMods[iLib], RTLDRLOAD_FLAGS_NT_SEARCH_DLL_LOAD_DIR , NULL);
     731                        if (RT_SUCCESS(rc))
     732                            break;
     733                    }
    719734                }
    720735            }
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