{
    "content": [
        {
            "type": "text",
            "text": "# ExtUtils::Liblist (perldoc)\n\n## NAME\n\nExtUtils::Liblist - determine libraries to use and how to use them\n\n## SYNOPSIS\n\nrequire ExtUtils::Liblist;\n$MM->ext($potentiallibs, $verbose, $neednames);\n# Usually you can get away with:\nExtUtils::Liblist->ext($potentiallibs, $verbose, $neednames)\n\n## DESCRIPTION\n\nThis utility takes a list of libraries in the form \"-llib1 -llib2 -llib3\" and returns lines\nsuitable for inclusion in an extension Makefile. Extra library paths may be included with the\nform \"-L/another/path\" this will affect the searches for all subsequent libraries.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PORTABILITY** (1 subsections)\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "ExtUtils::Liblist",
        "section": "",
        "mode": "perldoc",
        "summary": "ExtUtils::Liblist - determine libraries to use and how to use them",
        "synopsis": "require ExtUtils::Liblist;\n$MM->ext($potentiallibs, $verbose, $neednames);\n# Usually you can get away with:\nExtUtils::Liblist->ext($potentiallibs, $verbose, $neednames)",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 40,
                "subsections": []
            },
            {
                "name": "PORTABILITY",
                "lines": 33,
                "subsections": [
                    {
                        "name": "Win32 implementation",
                        "lines": 94
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "ExtUtils::Liblist - determine libraries to use and how to use them\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "require ExtUtils::Liblist;\n\n$MM->ext($potentiallibs, $verbose, $neednames);\n\n# Usually you can get away with:\nExtUtils::Liblist->ext($potentiallibs, $verbose, $neednames)\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This utility takes a list of libraries in the form \"-llib1 -llib2 -llib3\" and returns lines\nsuitable for inclusion in an extension Makefile. Extra library paths may be included with the\nform \"-L/another/path\" this will affect the searches for all subsequent libraries.\n\nIt returns an array of four or five scalar values: EXTRALIBS, BSLOADLIBS, LDLOADLIBS,\nLDRUNPATH, and, optionally, a reference to the array of the filenames of actual libraries.\nSome of these don't mean anything unless on Unix. See the details about those platform specifics\nbelow. The list of the filenames is returned only if $neednames argument is true.\n\nDependent libraries can be linked in one of three ways:\n\n* For static extensions\n\nby the ld command when the perl binary is linked with the extension library. See EXTRALIBS\nbelow.\n\n* For dynamic extensions at build/link time\n\nby the ld command when the shared object is built/linked. See LDLOADLIBS below.\n\n* For dynamic extensions at load time\n\nby the DynaLoader when the shared object is loaded. See BSLOADLIBS below.\n\nEXTRALIBS\nList of libraries that need to be linked with when linking a perl binary which includes this\nextension. Only those libraries that actually exist are included. These are written to a file\nand used when linking perl.\n\nLDLOADLIBS and LDRUNPATH\nList of those libraries which can or must be linked into the shared library when created using\nld. These may be static or dynamic libraries. LDRUNPATH is a colon separated list of the\ndirectories in LDLOADLIBS. It is passed as an environment variable to the process that links the\nshared library.\n\nBSLOADLIBS\nList of those libraries that are needed but can be linked in dynamically at run time on this\nplatform. SunOS/Solaris does not need this because ld records the information (from LDLOADLIBS)\ninto the object file. This list is used to create a .bs (bootstrap) file.\n",
                "subsections": []
            },
            "PORTABILITY": {
                "content": "This module deals with a lot of system dependencies and has quite a few architecture specific\n\"if\"s in the code.\n\nVMS implementation\nThe version of ext() which is executed under VMS differs from the Unix-OS/2 version in several\nrespects:\n\n* Input library and path specifications are accepted with or without the \"-l\" and \"-L\" prefixes\nused by Unix linkers. If neither prefix is present, a token is considered a directory to\nsearch if it is in fact a directory, and a library to search for otherwise. Authors who wish\ntheir extensions to be portable to Unix or OS/2 should use the Unix prefixes, since the\nUnix-OS/2 version of ext() requires them.\n\n* Wherever possible, shareable images are preferred to object libraries, and object libraries to\nplain object files. In accordance with VMS naming conventions, ext() looks for files named\n*lib*shr and *lib*rtl; it also looks for *lib*lib and lib*lib* to accommodate Unix conventions\nused in some ported software.\n\n* For each library that is found, an appropriate directive for a linker options file is\ngenerated. The return values are space-separated strings of these directives, rather than\nelements used on the linker command line.\n\n* LDLOADLIBS contains both the libraries found based on $potentiallibs and the CRTLs, if any,\nspecified in Config.pm. EXTRALIBS contains just those libraries found based on\n$potentiallibs. BSLOADLIBS and LDRUNPATH are always empty.\n\nIn addition, an attempt is made to recognize several common Unix library names, and filter them\nout or convert them to their VMS equivalents, as appropriate.\n\nIn general, the VMS version of ext() should properly handle input from extensions originally\ndesigned for a Unix or VMS environment. If you encounter problems, or discover cases where the\nsearch could be improved, please let us know.\n",
                "subsections": [
                    {
                        "name": "Win32 implementation",
                        "content": "The version of ext() which is executed under Win32 differs from the Unix-OS/2 version in several\nrespects:\n\n* If $potentiallibs is empty, the return value will be empty. Otherwise, the libraries\nspecified by $Config{perllibs} (see Config.pm) will be appended to the list of\n$potentiallibs. The libraries will be searched for in the directories specified in\n$potentiallibs, $Config{libpth}, and in \"$Config{installarchlib}/CORE\". For each library that\nis found, a space-separated list of fully qualified library pathnames is generated.\n\n* Input library and path specifications are accepted with or without the \"-l\" and \"-L\" prefixes\nused by Unix linkers.\n\nAn entry of the form \"-La:\\foo\" specifies the \"a:\\foo\" directory to look for the libraries\nthat follow.\n\nAn entry of the form \"-lfoo\" specifies the library \"foo\", which may be spelled differently\ndepending on what kind of compiler you are using. If you are using GCC, it gets translated to\n\"libfoo.a\", but for other win32 compilers, it becomes \"foo.lib\". If no files are found by\nthose translated names, one more attempt is made to find them using either \"foo.a\" or\n\"libfoo.lib\", depending on whether GCC or some other win32 compiler is being used,\nrespectively.\n\nIf neither the \"-L\" or \"-l\" prefix is present in an entry, the entry is considered a directory\nto search if it is in fact a directory, and a library to search for otherwise. The\n$Config{libext} suffix will be appended to any entries that are not directories and don't\nalready have the suffix.\n\nNote that the \"-L\" and \"-l\" prefixes are not required, but authors who wish their extensions\nto be portable to Unix or OS/2 should use the prefixes, since the Unix-OS/2 version of ext()\nrequires them.\n\n* Entries cannot be plain object files, as many Win32 compilers will not handle object files in\nthe place of libraries.\n\n* Entries in $potentiallibs beginning with a colon and followed by alphanumeric characters are\ntreated as flags. Unknown flags will be ignored.\n\nAn entry that matches \"/:nodefault/i\" disables the appending of default libraries found in\n$Config{perllibs} (this should be only needed very rarely).\n\nAn entry that matches \"/:nosearch/i\" disables all searching for the libraries specified after\nit. Translation of \"-Lfoo\" and \"-lfoo\" still happens as appropriate (depending on compiler\nbeing used, as reflected by $Config{cc}), but the entries are not verified to be valid files\nor directories.\n\nAn entry that matches \"/:search/i\" reenables searching for the libraries specified after it.\nYou can put it at the end to enable searching for default libraries specified by\n$Config{perllibs}.\n\n* The libraries specified may be a mixture of static libraries and import libraries (to link\nwith DLLs). Since both kinds are used pretty transparently on the Win32 platform, we do not\nattempt to distinguish between them.\n\n* LDLOADLIBS and EXTRALIBS are always identical under Win32, and BSLOADLIBS and LDRUNPATH are\nalways empty (this may change in future).\n\n* You must make sure that any paths and path components are properly surrounded with\ndouble-quotes if they contain spaces. For example, $potentiallibs could be (literally):\n\n\"-Lc:\\Program Files\\vc\\lib\" msvcrt.lib \"la test\\foo bar.lib\"\n\nNote how the first and last entries are protected by quotes in order to protect the spaces.\n\n* Since this module is most often used only indirectly from extension \"Makefile.PL\" files, here\nis an example \"Makefile.PL\" entry to add a library to the build process for an extension:\n\nLIBS => ['-lgl']\n\nWhen using GCC, that entry specifies that MakeMaker should first look for \"libgl.a\" (followed\nby \"gl.a\") in all the locations specified by $Config{libpth}.\n\nWhen using a compiler other than GCC, the above entry will search for \"gl.lib\" (followed by\n\"libgl.lib\").\n\nIf the library happens to be in a location not in $Config{libpth}, you need:\n\nLIBS => ['-Lc:\\gllibs -lgl']\n\nHere is a less often used example:\n\nLIBS => ['-lgl', ':nosearch -Ld:\\mesalibs -lmesa -luser32']\n\nThis specifies a search for library \"gl\" as before. If that search fails to find the library,\nit looks at the next item in the list. The \":nosearch\" flag will prevent searching for the\nlibraries that follow, so it simply returns the value as \"-Ld:\\mesalibs -lmesa -luser32\",\nsince GCC can use that value as is with its linker.\n\nWhen using the Visual C compiler, the second item is returned as \"-libpath:d:\\mesalibs\nmesa.lib user32.lib\".\n\nWhen using the Borland compiler, the second item is returned as \"-Ld:\\mesalibs mesa.lib\nuser32.lib\", and MakeMaker takes care of moving the \"-Ld:\\mesalibs\" to the correct place in\nthe linker command line.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "ExtUtils::MakeMaker\n",
                "subsections": []
            }
        }
    }
}