I used to build Glib and various Gtk2/Gtk3 modules on Windows 7 - and provide binaries of those builds.
From memory, the key to success was to have a working pkg-config.exe in the PATH. (I used MSYS2's pkg-config.exe, but Cygwin's might also be ok.)
With a functional pkg-config.exe in the path, and a correctly set PKG_CONFIG_PATH environment variable, installing Glib was as simple as obtaining and extracting the Glib source, cd'ing to the top-level source directory and running:
perl Makefile.PL
gmake test
gmake install
If you go that trouble and it still doesn't work, please post again, and I'll provide the necessary amendments (which I'm sure will come to mind once I see the error messages).
If you want to persist without a functioning pkg-config.exe (which I don't recommend), or you do already have a functional pkg-config.exe, then the first thing I'd want to see is the full output of your perl Makefile.PL... step.
Further on down the track, I formed the opinion that Strawberry's propensity to produce dlls named with a terminating ".xs.dll" didn't play well with ExtUtils::Depends, thus creating additional hoops to negotiate when building (eg) Cairo.
But I never proved to myself that this opinion was correct - and, anyway, I was using my own builds of perl that built dlls without the ".xs" component in their names.
Still, I'd suggest building your own perl (which is quite easy) if you want to build the Gtk stuff, rather than using Strawberry Perl - because doing so simply eliminates one potential difficulty.
Cheers, Rob
| [reply] [d/l] [select] |
Hi Rob thanks for your reply.
Sorry its taken me while to get back to this. I installed MSYS2 and its pkg-config.exe package. It is definitely in the PATH, I have tested that.
result of echo %PKG_CONFIG_PATH% is C:\gtk+\lib\pkgconfig;c:\gtk+\include\glib-2.0;c:\gtk+\lib\glib-2.0\include;c:\gtk+\lib;
Unfortunately I still get the same when I run gmake test lots of unedified reference.
Is it just the Makefile you would need and am I able to upload it here?
Thanks
Mike
| [reply] |
Hi Mike,
I've just been working through building Glib-1.3293 on my 64-bit perl-5.38.0 on Windows 11.
You'll want the mingw-w64 packages (which will be automatically installed into your MSYS2/mingw64 folder). Here are my notes:
For 64-bit build:
Install Gtk2 in MSYS2
$ pacman -Sy mingw64/mingw-w64-x86_64-gtk2
Install pkg-config.exe
$ pacman -Sy mingw64/mingw-w64-x86_64-pkg-config
Add pkg-config.exe to PATH:
set PATH=%PATH%;D:\msys64\mingw64\bin
set PKG_CONFIG_PATH=D:\msys64\mingw64\lib\pkgconfig
Install ExtUtils::PkgConfig (and ExtUtils::Depends if it's not already
+ installed)
###########
Glib-1.3293
###########
Hide (by changing '.a' extension to '.a_static') for following libs:
"D:\msys64\mingw64\lib\libgobject-2.0.a"
"D:\msys64\mingw64\lib\libglib-2.0.a"
"D:\msys64\mingw64\lib\libintl.a"
"D:\msys64\mingw64\lib\libgthread-2.0.a"
And create a copy of the corresponding import ("*.dll.a") libs
with the ".dll" removed from the name.
Run 'perl Makefile.PL', 'gmake test', 'gmake install'.
(All tests passed for me.)
See how you go with that.
There's some paths there that will need to be modified to match your set up.
The stuff about the renaming of the various libs is a bit of a nuisance. I'm hoping to eventually find a less hackish way of dealing with it.
Basically, you want the Glib build to use the shared libraries (dlls), but EU::MM generates a Makefile that references the static libs - eg .../mingw64/lib/libintl.a instead of .../mingw64/lib/libintl.dll.a.
(If you run 'perl Makefile.PL' and have a look at the EXTRALIBS and LDLOADLIBS entries in the generated Makefile, you'll see what I mean.)
This ought to be fixed properly, but in the meantime I've just renamed libintl.a to libintl.a_static, and copied libintl.dll.a to libintl.a. (And do the same for the other libs I've specified.)
So ... libintl.a and libintl.dll.a end up being the same import library, and libintl.a_static is the (effectively hidden) static lib.
Here's the rest of my notes at this stage:
###########
Cairo-1.109
###########
Hide (by changing '.a' extension to '.a_static') for following libs :
"D:\msys64\mingw64\lib\libcairo.a"
"D:\msys64\mingw64\lib\libfreetype.a"
And create a copy of the corresponding import ("*.dll.a") libs
with the ".dll" removed from the name.
Run 'perl Makefile.PL', 'gmake test', 'gmake install'.
One test failed for me:
~~~~~~~~~~~~~~~~~~~~~~~~~~
t/CairoFont.t ..... 1/29 unknown cairo_font_type_t value 5 encountered
+ at t/CairoFont.t line 79.
# Failed test at t/CairoFont.t line 79.
# Looks like you failed 1 test of 29.
~~~~~~~~~~~~~~~~~~~~~~~~~~
###################
Cairo-GObject-1.005
###################
Hide (by changing '.a' extension to '.a_static') for following libs :
"D:\msys64\mingw64\lib\libcairo-gobject.a"
And create a copy of the corresponding import ("*.dll.a") libs
with the ".dll" removed from the name.
Run 'perl Makefile.PL' and then:
Edit generated Makefile (EXTRALIBS and LDLOADLIBS spec) to start with:
"C:\perl-5.38.0-1310-mcf\site\lib\MSWin32-x64-multi-thread\auto\Glib\G
+lib.dll" "C:\perl-5.38.0-1310-mcf\site\lib\MSWin32-x64-multi-thread\a
+uto\Cairo\Cairo.dll"
ExtUtils::Depends is supposed to pull those in ... actually, it's prob
+ably supposed to pull in
the corresponding '.a' files (Glib.a and Cairo.a), but those files don
+'t exist.
Then run 'gmake test' and 'gmake install'.
All tests passed for me.
###########
Pango-1.227
###########
Hide (by changing '.a' extension to '.a_static') for following libs :
"D:\msys64\mingw64\lib\libpango-1.0.a"
"D:\msys64\mingw64\lib\libharfbuzz.a"
"D:\msys64\mingw64\lib\libpangocairo-1.0.a"
And create a copy of the corresponding import ("*.dll.a") libs
with the ".dll" removed from the name.
Run 'perl Makefile.PL' and then:
Edit generated Makefile (EXTRALIBS and LDLOADLIBS spec) to start with:
"C:\perl-5.38.0-1310-mcf\site\lib\MSWin32-x64-multi-thread\auto\Glib\G
+lib.dll" "C:\perl-5.38.0-1310-mcf\site\lib\MSWin32-x64-multi-thread\a
+uto\Cairo\Cairo.dll"
Then run 'gmake test' and 'gmake install'.
All tests passed for me.
############
Gtk2-1.24993
############
Hide (by changing '.a' extension to '.a_static') for following libs :
"D:\msys64\mingw64\lib\libpangowin32-1.0.a"
"D:\msys64\mingw64\lib\libatk-1.0.a"
"D:\msys64\mingw64\lib\libgdk_pixbuf-2.0.a"
"D:\msys64\mingw64\lib\libgio-2.0.a"
And create a copy of the corresponding import ("*.dll.a") libs
with the ".dll" removed from the name.
Run 'perl Makefile.PL' and then:
Edit generated Makefile (EXTRALIBS and LDLOADLIBS spec) to start with
+(and NOTE addition of "Pango.dll'):
"C:\perl-5.38.0-1310-mcf\site\lib\MSWin32-x64-multi-thread\auto\Cairo\
+Cairo.dll" "C:\perl-5.38.0-1310-mcf\site\lib\MSWin32-x64-multi-thread
+\auto\Glib\Glib.dll" "C:\perl-5.38.0-1310-mcf\site\lib\MSWin32-x64-mu
+lti-thread\auto\Pango\Pango.dll"
Rename t/GtkStyle.t to t/GtkStyle.t_hide as it fails
in a way that aborts the test suite.
Then run 'gmake test' and 'gmake install'.
Apart from the t/GtkStyle failure, we get:
Test Summary Report
-------------------
t/GdkDisplay.t (Wstat: 256 (exited 1) Tests: 27 Fail
+ed: 1)
Failed test: 23
Non-zero exit status: 1
t/GdkImage.t (Wstat: 256 (exited 1) Tests: 23 Fail
+ed: 1)
Failed test: 1
Non-zero exit status: 1
t/GdkKeys.t (Wstat: 1280 (exited 5) Tests: 6 Fail
+ed: 0)
Non-zero exit status: 5
Parse errors: Bad plan. You planned 46 tests but ran 6.
t/GdkPixbuf.t (Wstat: 256 (exited 1) Tests: 112 Fai
+led: 1)
Failed test: 44
Non-zero exit status: 1
t/PangoFontset.t (Wstat: 256 (exited 1) Tests: 7 Faile
+d: 1)
Failed test: 1
Non-zero exit status: 1
Files=227, Tests=4900, 32 wallclock secs ( 0.05 usr + 0.00 sys = 0.0
+5 CPU)
Result: FAIL
Failed 5/227 test programs. 4/4900 subtests failed.
make: *** [Makefile:3727: test_dynamic] Error 255
Install Gtk3:
$ pacman -Sy mingw64/mingw-w64-x86_64-gtk3
Install GObject-Introspection:
$ pacman -Sy mingw64/mingw-w64-x86_64-gobject-introspection
###############################
Glib-Object-Introspection-0.050
###############################
Hide (by changing '.a' extension to '.a_static') for following libs :
"D:\msys64\mingw64\lib\libgmodule-2.0.a"
"D:\msys64\mingw64\lib\libffi.a"
And create a copy of the corresponding import ("*.dll.a") libs
with the ".dll" removed from the name.
Run 'perl Makefile.PL' and then:
Edit generated Makefile (EXTRALIBS and LDLOADLIBS spec) to start with:
"C:\perl-5.38.0-1310-mcf\site\lib\MSWin32-x64-multi-thread\auto\Glib\G
+lib.dll"
Then run 'gmake install'. ('gmake test' can't be run because test scri
+pts aren't generated.)
That's as far as I've got, so far. (Next up is to install Gtk3.)
Sorry - those notes are clear to me, but just ask me about the bits that are unclear to you.
UPDATE: If you're using Strawberry Perl, those "Glib.dll", "Cairo.dll" and "Pango.dll" entries will need to be altered to "Glib.xs.dll", "Cairo.xs.dll" and "Pango.xs.dll"
Cheers, Rob
| [reply] [d/l] [select] |
Hi. What lib file has g_enum_register_static?? | [reply] |
Also only absolute paths are absolute. This is relative LIBS="-LC:gtk+/lib
| [reply] |