Attached is a patch to allow Gtkmm to built in a Cygwin environment.
The patch isn't intended to be applied "as-is", since some things are
broken.
On the whole, the source assumes that:
- A UNIX environment is using the X11 backend
- Win32 means MinGW
- but Cygwin behaves like a UNIX environment, while requiring
-no-undefined as a linker option, and may optionally use the win32 GDK
backend rather than X11.
gtkmm-2.2.9.old/build_shared/Makefile_build.am_fragment:
Essential to build DLLs with Cygwin. Will not break MinGW.
gtkmm-2.2.9.old/gtk/gtkmm/plug.cc } None of these should be
gtkmm-2.2.9.old/gtk/gtkmm/plug.h } applied. The build is
gtkmm-2.2.9.old/gtk/gtkmm/socket.cc } buggy when using a
gtkmm-2.2.9.old/gtk/gtkmm/socket.h } win32 GDK backend, since
gtkmm-2.2.9.old/gtk/src/plug.ccg } Gtk::Plug and Gtk::Socket
gtkmm-2.2.9.old/gtk/src/plug.hg } don't exist, but they are
gtkmm-2.2.9.old/gtk/src/socket.ccg } built and linked anyway
gtkmm-2.2.9.old/gtk/src/socket.hg } (linking fails, naturally).
I don't have a fix for this, but Gtk::Plug and Gtk::Socket should only
be built if GDK_WINDOWING_X11 is defined, and not if
GDK_WINDOWING_WIN32 is defined. The assumption that a UNIX
environment == X11 needs to be removed. I'm not familiar enough with
the intricacies of your build system to do this, unfortunately.
gtkmm-2.2.9.old/gtk/gtkmm/wrap_init.cc }
gtkmm-2.2.9.old/tools/extra_defs_gen/generate_defs_gtk.cc }
gtkmm-2.2.9.old/tools/generate_wrap_init.pl.in }
Essential to build with a GDK win32 backend on Cygwin. Will not break
MinGW.
After applying this patch, the build proceeds properly, and I get a
working set of Cygwin DLLS (cygatkmm, cygpangomm, cygglibmm and
cyggtkmm etc.). The tests and demos all work just fine, with a single
exception: in gtk-demo, the "Images" demo fails with
Failed to load image: Unrecognized image file format
and the images are replaced with the "no image" icon. In addition,
the "Pixbufs" and "Text Widget" demo also fail:
$ ./demo
Aborted (core dumped)
I've tried running in a debugger
(gdb) run
Starting program:
/cygdrive/c/tmp/build/gtkmm-2.2.9/demos/gtk-demo/.libs/demo.exe
5 [sig] demo 2424 open_stackdumpfile: Dumping stack trace to
demo.exe.stackdump
Program exited with code 0303000.
but there's no stack to examine. I'm sure the problem is with
gdk-pixbuf, but I'm unsure where (gtk-demo works flawlessly). I've
built against GTK+ 2.2.4. The "demo.exe.stackdump" looks like this:
Stack trace:
Frame Function Args
0022DF08 77E7AC21 (00000000, 00000008, 0022DF38, 610A0108)
0022DF68 61087E49 (00000978, 00000006, 0022DF98, 610883B3)
0022DF78 61087EFC (00000006, 00000000, 77E75A65, 610A008D)
0022DF98 610883B3 (0022DFB0, DF0DF047, 00000000, 6109E8BE)
0022DFE8 61086211 (00A99930, 0022E144, 0022E018, 0076174E)
0022DFF8 00763425 (10231C60, 0022E040, 77E75A65, 10294068)
0022E018 0076174E (0022E040, DF0DF047, 00000000, 6109E8BE)
0022E078 0074CEA4 (00796030, DF0DF046, 0022E098, 6109B72B)
0022E118 0074D2FF (102A6338, 0022E140, 1028A3A8, 01A7CFA0)
0022E198 01A50D64 (1025E8F0, 102943B8, 102856F8, 1028A1F0)
0022E1C8 0131E2D3 (1028A3D8, 00000000, 00000003, 0022E3C0)
0022E218 00DB39DD (1028A3D8, 00000000, 00000003, 0022E3C0)
0022E2F8 00DC7BB8 (102587A8, 00000000, 1025E8F0, 00000000)
0022E558 00DC6E18 (1025E8F0, 00000052, 00000000, 0022E594)
0022E578 00DC7026 (1025E8F0, 00000052, 00000000, 102946A0)
0022E5A8 013F7446 (1025E8F0, 102946A0, 102856F8, 0022E604)
End of stack trace (more stack frames may be present)
but this doesn't look too informative...
Any suggestions about how to debug this further would be greatly
appreciated!
Many thanks,
Roger
--
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
Attachment:
rl-gtkmm-2.2.9-cygwin-patch.bz2
Description: Patch to build under cygwin