[OTR-dev] Cross compile pidgin-otr for windows

Ian Goldberg ian at cypherpunks.ca
Sun Jul 19 16:41:56 EDT 2009


On Sun, Jul 19, 2009 at 07:33:54PM -0000, Sec wrote:
> It was looking for X11 stuff due to some header file in
> /usr/include/gtk-2.0/gdk/gdkx.h I think. I thought it will get the gtk
> paths from GTK_HDRS ?= `pkg-config --cflags glib-2.0 gtk+-2.0` (in
> Makefile.mingw) and we dont need have them in
> /usr/i586-mingw32msvc/include ? 

The problem is that the GTK header files in /usr/include reference X11
stuff (as they should).  You need the Windows version (no X11) installed
in /usr/i586-mingw32msvc/include.

This is what I see.

$ ls -R /usr/i586-mingw32msvc/include/gtk-2.0
/usr/i586-mingw32msvc/include/gtk-2.0:
gdk  gdk-pixbuf  gtk

/usr/i586-mingw32msvc/include/gtk-2.0/gdk:
gdkalias.h           gdkdrawable.h   gdkimage.h    gdkprivate.h    gdktypes.h
gdkcairo.h           gdkenumtypes.h  gdkinput.h    gdkproperty.h   gdkvisual.h
gdkcolor.h           gdkevents.h     gdkkeys.h     gdkregion.h     gdkwin32.h
gdkcursor.h          gdkfont.h       gdkkeysyms.h  gdkrgb.h        gdkwindow.h
gdkdisplay.h         gdkgc.h         gdkpango.h    gdkscreen.h
gdkdisplaymanager.h  gdk.h           gdkpixbuf.h   gdkselection.h
gdkdnd.h             gdki18n.h       gdkpixmap.h   gdkspawn.h

/usr/i586-mingw32msvc/include/gtk-2.0/gdk-pixbuf:
gdk-pixbuf-animation.h   gdk-pixbuf.h          gdk-pixbuf-simple-anim.h
gdk-pixbuf-core.h        gdk-pixbuf-io.h       gdk-pixbuf-transform.h
gdk-pixbuf-enum-types.h  gdk-pixbuf-loader.h   gdk-pixdata.h
gdk-pixbuf-features.h    gdk-pixbuf-marshal.h

/usr/i586-mingw32msvc/include/gtk-2.0/gtk:
gtkaboutdialog.h           gtk.h                       gtkrecentfilter.h
gtkaccelgroup.h            gtkhandlebox.h              gtkrecentmanager.h
gtkaccellabel.h            gtkhbbox.h                  gtkruler.h
gtkaccelmap.h              gtkhbox.h                   gtkscale.h
gtkaccessible.h            gtkhpaned.h                 gtkscrollbar.h
gtkactiongroup.h           gtkhruler.h                 gtkscrolledwindow.h
gtkaction.h                gtkhscale.h                 gtkselection.h
gtkadjustment.h            gtkhscrollbar.h             gtkseparator.h
gtkalignment.h             gtkhseparator.h             gtkseparatormenuitem.h
gtkarrow.h                 gtkiconfactory.h            gtkseparatortoolitem.h
gtkaspectframe.h           gtkicontheme.h              gtksettings.h
gtkassistant.h             gtkiconview.h               gtksignal.h
gtkbbox.h                  gtkimage.h                  gtksizegroup.h
gtkbindings.h              gtkimagemenuitem.h          gtksocket.h
gtkbin.h                   gtkimcontext.h              gtkspinbutton.h
gtkbox.h                   gtkimcontextsimple.h        gtkstatusbar.h
gtkbutton.h                gtkimmodule.h               gtkstatusicon.h
gtkcalendar.h              gtkimmulticontext.h         gtkstock.h
gtkcelleditable.h          gtkinputdialog.h            gtkstyle.h
gtkcelllayout.h            gtkinvisible.h              gtktable.h
gtkcellrendereraccel.h     gtkitemfactory.h            gtktearoffmenuitem.h
gtkcellrenderercombo.h     gtkitem.h                   gtktextbuffer.h
gtkcellrenderer.h          gtklabel.h                  gtktextbufferrichtext.h
gtkcellrendererpixbuf.h    gtklayout.h                 gtktextchild.h
gtkcellrendererprogress.h  gtklinkbutton.h             gtktextdisplay.h
gtkcellrendererspin.h      gtklist.h                   gtktext.h
gtkcellrenderertext.h      gtklistitem.h               gtktextiter.h
gtkcellrenderertoggle.h    gtkliststore.h              gtktextlayout.h
gtkcellview.h              gtkmain.h                   gtktextmark.h
gtkcheckbutton.h           gtkmarshal.h                gtktexttag.h
gtkcheckmenuitem.h         gtkmenubar.h                gtktexttagtable.h
gtkclipboard.h             gtkmenu.h                   gtktextview.h
gtkclist.h                 gtkmenuitem.h               gtktipsquery.h
gtkcolorbutton.h           gtkmenushell.h              gtktoggleaction.h
gtkcolorseldialog.h        gtkmenutoolbutton.h         gtktogglebutton.h
gtkcolorsel.h              gtkmessagedialog.h          gtktoggletoolbutton.h
gtkcomboboxentry.h         gtkmisc.h                   gtktoolbar.h
gtkcombobox.h              gtkmodules.h                gtktoolbutton.h
gtkcombo.h                 gtknotebook.h               gtktoolitem.h
gtkcontainer.h             gtkobject.h                 gtktooltips.h
gtkctree.h                 gtkoldeditable.h            gtktreednd.h
gtkcurve.h                 gtkoptionmenu.h             gtktree.h
gtkdebug.h                 gtkpagesetup.h              gtktreeitem.h
gtkdialog.h                gtkpaned.h                  gtktreemodelfilter.h
gtkdnd.h                   gtkpapersize.h              gtktreemodel.h
gtkdrawingarea.h           gtkpixmap.h                 gtktreemodelsort.h
gtkeditable.h              gtkplug.h                   gtktreeselection.h
gtkentrycompletion.h       gtkpreview.h                gtktreesortable.h
gtkentry.h                 gtkprintcontext.h           gtktreestore.h
gtkenums.h                 gtkprintoperation.h         gtktreeviewcolumn.h
gtkeventbox.h              gtkprintoperationpreview.h  gtktreeview.h
gtkexpander.h              gtkprintsettings.h          gtktypebuiltins.h
gtkfilechooserbutton.h     gtkprivate.h                gtktypeutils.h
gtkfilechooserdialog.h     gtkprogressbar.h            gtkuimanager.h
gtkfilechooser.h           gtkprogress.h               gtkvbbox.h
gtkfilechooserwidget.h     gtkradioaction.h            gtkvbox.h
gtkfilefilter.h            gtkradiobutton.h            gtkversion.h
gtkfilesel.h               gtkradiomenuitem.h          gtkviewport.h
gtkfilesystem.h            gtkradiotoolbutton.h        gtkvpaned.h
gtkfixed.h                 gtkrange.h                  gtkvruler.h
gtkfontbutton.h            gtkrc.h                     gtkvscale.h
gtkfontsel.h               gtkrecentchooserdialog.h    gtkvscrollbar.h
gtkframe.h                 gtkrecentchooser.h          gtkvseparator.h
gtkgamma.h                 gtkrecentchoosermenu.h      gtkwidget.h
gtkgc.h                    gtkrecentchooserwidget.h    gtkwindow.h

> Should I have compiled gtk also in the mingw environment instead ?
> (Looking the above pkg-config in the Makefile.mingw I though native
> one should do). I tried also compiling gtk using the same configure
> method as in libotr (./configure --with-pic --build=`./config.guess`
> --host=i586mingw32msvc --prefix=/usr/i586-mingw32msvc) but not with
> much luck.

I certainly didn't compile gtk myself.  I'm sure I found a
tarball/zipfile of the Windows GTK headers somewhere.  But it was years
ago, so I have no memory of where, unfortunately.

> Also I think the pidgin source is same for windows or linux (?)

Yes, that's probably true.

> I had extracted the tarball into my home directory and set the paths
> in Makefile.mingw of the pidgin-otr to directory that contained
> pidgin-source-root/pidgin and pidgin-source-root/libpurple
> respectively (this make it get the header files except gtkwin32dep.h
> which was in pidgin-source-root/pidgin/win32 and win32dep.h which was
> in pidgin-source-root/libpurple/win32. So simply copied these two
> *win32dep.h one directory up and compiled). 

I do have files names /usr/i586-mingw32msvc/include/pidgin/gtkwin32dep.h
and /usr/i586-mingw32msvc/include/libpurple/win32dep.h on my system.

   - Ian



More information about the OTR-dev mailing list