Returns the extension for dynamically linked libraries on the
current OS. That is, returns <code>"dylib"</code> on Apple,
<code>"so"</code> on Linux and Sun, and <code>"dll"</code>
on Windows.

@return The library extension
483812
private static String createLibraryExtension()
    {
        OSType osType = calculateOS();
        switch (osType)
        {
            case APPLE:
                return "dylib";
            case ANDROID:
            case LINUX:
            case SUN:
                return "so";
            case WINDOWS:
                return "dll";
            default:
                break;
        }
        return "";
    }
746755
public static String getLibInfo() {
        String info = libInfo.get();
        if (info == null) {
            info = String.format(Locale.ENGLISH, LIB_INFO, C4.getVersion());

            libInfo.compareAndSet(null, info);
        }

        return info;
    }
645654
public LibraryTypeEnum getType() {
    if (isReference()) {
      final LibrarySet master = (LibrarySet) getCheckedRef(LibrarySet.class, "LibrarySet");
      return master.getType();
    }
    return this.libraryType;
  }
930704
public static ProductExtensionInfo getProductExtension(String extensionName) throws IOException {
        ProductExtensionInfo productExtensionInfo = null;

        List<ProductExtensionInfo> productExtensionList = getProductExtensions(Utils.getInstallDir());

        for (ProductExtensionInfo currentProductExtension : productExtensionList) {
            if (currentProductExtension.getName().equalsIgnoreCase(extensionName)) {
                productExtensionInfo = currentProductExtension;
                break;
            }
        }

        return productExtensionInfo;
    }
324201
public static String makeLdLibraryPath() {
    sSoSourcesLock.readLock().lock();
    try {
      assertInitialized();
      Log.d(TAG, "makeLdLibraryPath");
      ArrayList<String> pathElements = new ArrayList<>();
      SoSource[] soSources = sSoSources;
      for (int i = 0; i < soSources.length; ++i) {
        soSources[i].addToLdLibraryPath(pathElements);
      }
      String joinedPaths = TextUtils.join(":", pathElements);
      Log.d(TAG, "makeLdLibraryPath final path: " + joinedPaths);
      return joinedPaths;
    } finally {
      sSoSourcesLock.readLock().unlock();
    }
  }
1139378
public static String getOsType() {
        String osType = "unknown";
        String osName = System.getProperty("os.name");
        if (osName.contains("Windows")) {
            osType = "Windows";
        }
        else if (osName.contains("Linux")) {
            osType = "Linux";
        }
        return osType;
    }
398436
private static URL findLibraryResource(final String libraryFileName) {
    String osName = System.getProperty("os.name").toLowerCase();
    String osArch = System.getProperty("os.arch").toLowerCase();
    String resourceName = null;

    LOG.trace("Load library \"{}\" for os {}:{}", libraryFileName, osName, osArch);

    if (osName.startsWith(OS_WIN)) {
      resourceName = determineWindowsLibrary(libraryFileName, osName, osArch);
    } else if (osName.startsWith(OS_LINUX)) {
      resourceName = determineLinuxLibrary(libraryFileName, osName, osArch);
    } else if (osName.startsWith(OS_FREEBSD)) {
      resourceName = determineFreebsdLibrary(libraryFileName, osName, osArch);
    } else if (osName.startsWith(OS_MAC)) {
      resourceName = determineMacLibrary(libraryFileName);
    } else {
      unsupportedPlatform(osName, osArch);
    }

    URL resource = NativeLoader.class.getResource(resourceName);

    if (null == resource) {
      unsupportedPlatform(osName, osArch, resourceName);
    }

    return resource;
  }
236984
public static String getLibInfo() {
        String info = libInfo.get();
        if (info == null) {
            info = String.format(
                Locale.ENGLISH,
                LIB_INFO,
                (BuildConfig.ENTERPRISE) ? "EE" : "CE",
                BuildConfig.BUILD_TYPE,
                BuildConfig.BUILD_NUMBER,
                BuildConfig.BUILD_COMMIT,
                C4.getVersion());

            libInfo.compareAndSet(null, info);
        }

        return info;
    }
5497
public static Type getType() {
        String osName = System.getProperty("os.name").toLowerCase();

        if (osName.contains("windows")) {
            return Type.WINDOWS;
        } else if (osName.contains("linux")) {
            return Type.LINUX;
        } else if (osName.contains("mac")) {
            return Type.MAC;
        }

        return Type.UNKNOWN;
    }
891324
def _get_lib_name(lib):
    
    # append any extension suffix defined by Python for current platform
    ext_suffix = sysconfig.get_config_var("EXT_SUFFIX")
    # in principle "EXT_SUFFIX" is what we want.
    # "SO" seems to be deprecated on newer python
    # but: older python seems to have empty "EXT_SUFFIX", so we fall back
    if not ext_suffix:
        try:
            ext_suffix = sysconfig.get_config_var("SO")
        except Exception as e:
            msg = ("Empty 'EXT_SUFFIX' encountered while building CDLL "
                   "filename and fallback to 'SO' variable failed "
                   "(%s)." % str(e))
            warnings.warn(msg)
            pass
    if ext_suffix:
        libname = lib + ext_suffix
    return libname
530139
public String getExtension() {
        String extension = getSlingRequest().getRequestPathInfo().getExtension();
        return StringUtils.isBlank(extension) ? "" : ("." + extension);
    }
1292034
private static Sc68Binding loadLibrary()
    {
        try
        {
            Verbose.info("Load library: ", LIBRARY_NAME);
            final Sc68Binding binding = Native.loadLibrary(LIBRARY_NAME, Sc68Binding.class);
            Verbose.info("Library ", LIBRARY_NAME, " loaded");
            return binding;
        }
        catch (final LinkageError exception)
        {
            throw new LionEngineException(exception, ERROR_LOAD_LIBRARY + LIBRARY_NAME);
        }
    }
1029217
def find_linked_dynamic_libraries():
    
    with TaskContext("Find the required dynamic libraries") as log:
        llvm = get_llvm()
        libs = required_link_libraries()
        resolved = []
        for libname in libs:
            if llvm:
                fullpath = os.path.join(llvm, "lib", libname)
                if os.path.isfile(fullpath):
                    resolved.append(fullpath)
                    log.info("Library `%s` found at %s" % (libname, fullpath))
                    continue
                else:
                    log.info("%s does not exist" % fullpath)
            # Rely on the shell `locate` command to find the dynamic libraries.
            proc = subprocess.Popen(["locate", libname], stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE)
            stdout, stderr = proc.communicate()
            if proc.returncode == 0:
                results = stdout.decode().strip().split("\n")
                results = [r for r in results if r]
                if results:
                    results.sort(key=len)
                    fullpath = results[0]
                    assert os.path.isfile(fullpath), "Invalid path: %r" % (fullpath,)
                    resolved.append(fullpath)
                    log.info("Library `%s` found at %s" % (libname, fullpath))
                    continue
                else:
                    log.fatal("Cannot locate dynamic library `%s`" % libname)
            else:
                log.fatal("`locate` command returned the following error:\n%s"
                          % stderr.decode())
        return resolved
372193
private List<String> libCandidates(Platform platform, String name) {
        List<String> candidates = new ArrayList<String>();
        StringBuilder sb = new StringBuilder();

        sb.append(libraryPath).append("/");
        sb.append(platform.arch).append("/");
        sb.append(platform.os).append("/");
        sb.append("lib").append(name);

        switch (platform.os) {
            case darwin:
                candidates.add(sb + ".dylib");
                candidates.add(sb + ".jnilib");
                break;
            case linux:
            case freebsd:
                candidates.add(sb + ".so");
                break;
        }

        return candidates;
    }
546271
def get_libraries():
    ''''''
    # Note that this list does not include libcsamtools.so as there are
    # numerous name conflicts with libchtslib.so.
    dirname = os.path.abspath(os.path.join(os.path.dirname(__file__)))
    pysam_libs = ['libctabixproxies',
                  'libcfaidx',
                  'libcsamfile',
                  'libcvcf',
                  'libcbcf',
                  'libctabix']
    if pysam.config.HTSLIB == "builtin":
        pysam_libs.append('libchtslib')

    so = sysconfig.get_config_var('SO')
    return [os.path.join(dirname, x + so) for x in pysam_libs]
116985
public Optional<Path> findLibraryInstall(String libraryName) {
        return getArduinoDirectory().map(path -> {
            Path libsDir = path.resolve("libraries");
            Path tcMenuDir = libsDir.resolve(libraryName);
            if (Files.exists(tcMenuDir)) {
                return tcMenuDir;
            }
            return null;
        });
    }
604326
public T getExtension(String alias) {
        ExtensionClass<T> extensionClass = getExtensionClass(alias);
        if (extensionClass == null) {
            throw new SofaRpcRuntimeException("Not found extension of " + interfaceName + " named: \"" + alias + "\"!");
        } else {
            if (extensible.singleton() && factory != null) {
                T t = factory.get(alias);
                if (t == null) {
                    synchronized (this) {
                        t = factory.get(alias);
                        if (t == null) {
                            t = extensionClass.getExtInstance();
                            factory.put(alias, t);
                        }
                    }
                }
                return t;
            } else {
                return extensionClass.getExtInstance();
            }
        }
    }