After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768357 - Build the gio tool on Windows/MSVC
Build the gio tool on Windows/MSVC
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.49.x
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-07-04 04:48 UTC by Fan, Chun-wei
Modified: 2016-07-18 02:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio tool: Fix build on Windows/Visual Studio (1.92 KB, patch)
2016-07-04 08:31 UTC, Fan, Chun-wei
committed Details | Review
Update the build files to build the gio tool with Visual Studio (33.02 KB, patch)
2016-07-04 08:38 UTC, Fan, Chun-wei
committed Details | Review

Description Fan, Chun-wei 2016-07-04 04:48:53 UTC
Hi,

There was a recent addition of the gio-tool that is meant to be built for all platforms that GIO supports, but in order that it builds for Windows under Visual Studio, a few simple changes need to be made.  I will attach patches for this purpose in a bit.

With blessings, thank you!
Comment 1 Fan, Chun-wei 2016-07-04 08:31:47 UTC
Created attachment 330831 [details] [review]
gio tool: Fix build on Windows/Visual Studio

Hi,

First up is the patch to allow the code to  build under Visual Studio, since:

-There isn't unistd.h on any Visual Studio, and we ought to
 include io.h instead on Windows (for read()/write()).
-As a result, there is no STDIN_FILENO and STDOUT_FILENO, so we need to
 define those as needed as well.
-Use gssize instead of ssize_t, as ssize_t is not available on at least
 older Visual Studio...
Comment 2 Fan, Chun-wei 2016-07-04 08:38:01 UTC
Created attachment 330833 [details] [review]
Update the build files to build the gio tool with Visual Studio

Hi,

Next up is the patch for the Visual Studio build files (and gio/Makefile.am), so that we use a template to generate build/win32/vs9/gio-tool.vcproj and build/win32/vs10/gio-tool.[vcxproj|vcxproj.filters], which will definitely depend on the previous patch to work.  This will need to be applied with --ignore-whitespace as the .sln files in there need to have Windows CR/LF line endings.

Oh, I decided to re-arrange the items in gio/Makefile.am a little bit so that things are grouped better.

Please note that the mime and open commands don't work, presumably that there are things in GIO that needs to be done for Windows and/or need to be fixed, which I think is better covered by another bug report, as well as monitor, which most probably needs further work for it to be complete on Windows.

With blessings, thank you!
Comment 3 Matthias Clasen 2016-07-17 03:05:10 UTC
Comment on attachment 330831 [details] [review]
gio tool: Fix build on Windows/Visual Studio

I've pushed the first patch (with some cosmetic changes); the second one didn't apply.
Comment 4 Fan, Chun-wei 2016-07-18 02:43:57 UTC
Hi Matthias,

Thanks!

The reason the second patch did not apply is that the build/win32/vs[9|10]/glib.sln must use Windows/DOS line endings, unlike the rest of the code which have unix line endings, and --ignore-whitespace hence must be used as a result (please see comment 2).  I applied it myself as a result, hope you don't mind, as c6aee1b.

With blessings, thank you!