Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^11: gmake error on Glib compile

by swl (Parson)
on Sep 05, 2023 at 03:33 UTC ( #11154253=note: print w/replies, xml ) Need Help??


in reply to Re^10: gmake error on Glib compile
in thread gmake error on Glib compile

I just had a go with the different pkg-config utilities. The difference appears to be that the MSYS2 version prepends the relevant path when run outside of the MSYS2 environment. I guess the pure-perl version could be taught to work with such paths but it's perhaps only an issue because these builds are using mingw64 files?

Windows cmd shell:

C:\path>set PKG_CONFIG_PATH=C:\msys64\mingw64\lib\pkgconfig C:\path>pkg-config --libs glib-2.0 -L/mingw64/lib -lglib-2.0 -lintl C:\path>\msys64\mingw64\bin\pkg-config.exe --libs glib-2.0 -LC:/msys64/mingw64/lib -lglib-2.0 -lintl

MSYS2 mingw64 shell:

$ pkg-config --libs glib-2.0 -lglib-2.0 -lintl

Replies are listed 'Best First'.
Re^12: gmake error on Glib compile
by syphilis (Archbishop) on Sep 05, 2023 at 12:07 UTC
    The difference appears to be that the MSYS2 version prepends the relevant path when run outside of the MSYS2 environment

    I found that if the "${prefix}" in the pc files is replaced with the actual (hard coded) directory, then Strawberry's pkg-config.bat worked fine.
    IOW, I think you're right - and I think it's because pkg-config.bat doesn't understand "${prefix}" like MSYS2 does.

    I had originally set CPATH and LIBRARY_PATH environment variables to point to the relevant headers and libs when building with pkg-config.bat.
    I think that worked because it then meant that pkg-config.bat did not have to locate those files. (They just automatically get found anyway.)

    Cheers,
    Rob

      I think it's because pkg-config.bat doesn't understand "${prefix}" like MSYS2 does.

      It's not so much that the pure perl pkg-config does not understand ${prefix}. It's more that it does not correct for the MSYS2 paths.

      The mingw64 glib-2.0.pc file is below. The prefix is set to a location that only MSYS2 knows how to convert to a "normal" windows path.

      If the prefix is set to prefix=${pcfiledir}/../.. then the issue might disappear. FWIW, this approach is used for all but one of the .pc files under strawberry perl 5.38 (that file being zlib.pc).

      prefix=/mingw64 includedir=${prefix}/include libdir=${prefix}/lib bindir=${prefix}/bin glib_genmarshal=${bindir}/glib-genmarshal gobject_query=${bindir}/gobject-query glib_mkenums=${bindir}/glib-mkenums Name: GLib Description: C Utility Library Version: 2.76.4 Requires.private: libpcre2-8 >= 10.32 Libs: -L${libdir} -lglib-2.0 -lintl Libs.private: -lws2_32 -lole32 -lwinmm -lshlwapi -luuid -lm Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include
        The prefix is set to a location that only MSYS2 knows how to convert to a "normal" windows path.

        Yes - that nails it nicely as "the clear, concise and accurate explanation".

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11154253]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2023-12-11 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?