Commit Graph

194 Commits

Author SHA1 Message Date
Philip Withnall
a131134918 build: Drop nmake/MSC build system for GLib
It hasn’t been seriously maintained for the best part of 10 years and is
very outdated. The recommended way to build GLib on Windows is now
Visual Studio:

https://wiki.gnome.org/Projects/GTK%2B/Win32/MSVCCompilationOfGTKStack#GLib

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=722047
2017-07-10 11:22:40 +01:00
Chun-wei Fan
6dfc6fee7b Visual Studio builds: Move project files to win32/
It was suggested that the project files be moved here as we don't actually
need to go two directory layers from $(srcroot), and would help us to
standardize on things in the future across the board.
2017-01-09 14:00:46 +08:00
Chun-wei Fan
673036d609 Visual Studio builds: Update gio-2.0.pc generation
We don't have libmount on Windows, so just make the entry for it blank.
2016-11-23 11:12:00 +08:00
Chun-wei Fan
acd07cfc55 build/Makefile-newvs.am: Do not hardcode the baseline MSVC version
This is to allow specification of the baseline Visual Studio 201x version as
the baseline version may not be 2010 anymore as we begin to require C99
features that will require Visual Studio 2013 or later.
2016-11-01 15:39:16 +08:00
Chun-wei Fan
c718bf881a build/win32/vs10/Makefile.am: Delete glib-install.props's on re-generation
This is to ensure the changes that is applied to glib-install.props here is
applied to the projects files in build/win32/vs[11|12|14] as well.
2016-10-19 15:31:24 +08:00
Chun-wei Fan
fc0567780b MSVC Builds: Fix gio-tool projects
We need to look in $(srcroot)\gmodule for the up-to-date gmodule.h.

Pointed out by Ignacio Casal Quinteiro.
2016-09-20 15:08:42 +08:00
Chun-wei Fan
c6aee1bf15 Visual Studio builds: Build the gio tool
https://bugzilla.gnome.org/show_bug.cgi?id=768357
2016-07-18 10:39:20 +08:00
Chun-wei Fan
bbf07fb15e Visual Studio builds: Fix .pc generation
The previous update did not account for when no exec_prefix is spcified,
so update that, and use ${prefix} by default.  Clean up a bit as well.
2016-06-20 10:52:06 +08:00
Chun-wei Fan
39a22880b6 Visual Studio builds: Improve flexibility of .pc generation
Allow the use of shorthands using ${prefix} for exec_prefix, and
${exec_prefix} for includedir and libdir, which makes the generated .pc
files a bit cleaner and more flexible.
2016-06-15 17:30:24 +08:00
Chun-wei Fan
be16115e67 Visual Studio projects: Clean up a little bit
For the Visual Studio 201x projects, we can force the "install" projects
to always run in a simpler way, by specifying an output file that will
never exist.  Makes things look a bit cleaner.
2016-06-15 16:31:40 +08:00
Chun-wei Fan
33549086bc Visual Studio builds: Refine .pc creation
We may not have $(CopyDir) created, which the script that generates the
.pc files check for, so create it if it is not there.  This makes things a
bit more convenient for people.
2016-06-15 16:23:27 +08:00
Chun-wei Fan
bd0911afda build/win32/pc_base.py: Allow custom options
Some packages might have some parts that are built for certain build
configs, meaning that they could have .pc files of their own, such as
Pango, where PangoFT2 is optionally built.  Allow such an option if
needed.

Also remove some trailing whitespaces.
2016-04-21 19:12:25 +08:00
Chun-wei Fan
98ab9fa94f MSVC builds: Update string replacement util script
This makes the replace-single function make use of the replace-multi
function, that was just added, to ease future maintenance.
2016-03-11 16:54:39 +08:00
Chun-wei Fan
374a61f245 MSVC builds: Add scripts to generate .pc files
Add a generic script, pc_base.py, which can be utilized to obtain path
info, along with user-input version info, which can be used to generate
pkg-config .pc files.  Also enhance replace.py a bit so that it can also
be used in the future to replace multiple items in a file in one shot.
This is done to make building introspection files easier, as it depends
much on the pkg-config .pc files to work.

Update the project files so that when Python is available, we can generate
the full, usable .pc files when we complete and 'install' the builds, and
copy them to appropriate locations so that pkg-config can be set to find
them easily.
2016-03-10 20:33:35 +08:00
Chun-wei Fan
99b30f389e Visual Studio builds: Move @GLIB_VERSION@ usage
... from glib-gen-srcs.[vsprops|props].in to
glib-version-paths.[vsprops|props].in, and instead let autotools generate
glib-version-paths.[vsprops|props] rather than
glib-gen-srcs.[vsprops|props], as this will need to be referenced for
other items as well, namely generating the .pc files which will become
useful for introspection builds.
2016-02-25 18:37:01 +08:00
Chun-wei Fan
57f9c590f9 Visual Studio builds: Include pcre_version.c in build
... for builds using the PCRE bundled with the GLib sources, so that
pcre_version() will also be defined, and be exported so that the regex test program
will properly link when the bundled PCRE sources are used.

This is a follow-up commit to 476f30a.
2016-01-20 17:20:27 +08:00
Chun-wei Fan
e3ab6ab38a Visual Studio builds: Rearrange build configs
This is a follow-up commit for commit 82c2461, where the default build is
to use the PCRE that is installed in the system, if it is available and is
not overridden with --with-internal-pcre.

For Visual Studio builds, this means that the new 'Debug' and 'Release'
configs will now use PCRE that is found on the system, which were renamed
from the '*_ExtPCRE' configs; and that there are now 'Debug_BundledPCRE'
and 'Release_BundledPCRE' configs which make use of the PCRE that is
supplied with the GLib sources, which, replaces the former 'Debug' and
'Release' configs.
2016-01-18 16:04:45 +08:00
Chun-wei Fan
244f9e66f9 build/win32: Add NMake Makefile module for building tests and introspection
This adds a NMake Makefile module that can be used for building tests and
introspection using, NMake.  This is not yet distributed in the main GLib
tarballs, but this is placed here as the base location as this is
intended to be used in projects that support Visual Studio builds and
support the build of tests and/or introspection under Visual Studio using
NMake.
2015-12-02 21:23:10 +08:00
Chun-wei Fan
c50bb218de MSVC 2010+ builds: Do not explicitly use /LTCG
This partially reverts dc4361f.

As we now ensure that items using GResources and GConstructors are always
referenced so that the linker does not optimize them out in a default
Release build, we no longer need to enforce the use of /LTCG, so
/LTCG:incremental will work as well.
2015-11-12 15:26:20 +08:00
Dan Winship
263aac125e .gitignore updates 2015-10-23 11:28:03 -04:00
Chun-wei Fan
dc4361f4cb MSVC 2010+ builds: Explicitly use /LTCG
The Visual Studio projects used a default setting for link-time code
generation, which is a part of the various linker optimizations that is
available, which is set as /LTCG for Visual Studio 2013 and earlier.

This changed in Visual Studio 2015 to become /LTCG:incremental, which would
cause GResources-generated code to be optimized out during linking, unless
they were referred to directly in the main line code (such as when the
GResource is manually registered), causing programs to crash as a result as
they can't find the needed code/data at run time.

Fix this by explicitly setting /LTCG for all release builds, for Visual
Studio 2010 and later.

https://bugzilla.gnome.org/show_bug.cgi?id=752837
2015-10-13 19:30:22 +08:00
Chun-wei Fan
b7e2973048 gobject: Further optimize MSVC builds
Use /ltcg (link time code generation) for linking as well.

In fact, whole program optimization and /ltcg are the default for Release
builds, so we don't really have to set them explicitly in the projects, so
as a result, we can clean up the projects a little bit.

https://bugzilla.gnome.org/show_bug.cgi?id=752837
2015-10-12 16:56:46 +08:00
Chun-wei Fan
670400ee33 gobject: MSVC builds-improve optimization a bit
Use whole program optimization (/GL) as we now use DllMain() to
initialize the library on Windows builds.

https://bugzilla.gnome.org/show_bug.cgi?id=752837
2015-10-12 15:05:23 +08:00
Chun-wei Fan
ecd2652883 build/win32/replace.py: Add Note On Its Reusability
Add a note stating that this script can be copied for use to replace
strings in files when necessary, such as replacing autotools variables
in non-autotools builds, such as Visual Studio builds.
2015-09-25 17:47:33 +08:00
Chun-wei Fan
aef2d0c56d build/win32: Make "Install" Property Sheet Generation More Robust
List the files that are generated in the process to generate the
glib-install property sheets, so that we can use that list as a
depedency, as well as deleting those files in one shot after the
property sheet is generated, so we don't need to worry about those
in 'make distclean' or so.
2015-09-23 18:33:28 +08:00
Chun-wei Fan
4025b5a54f MSVC Builds: "Add" MSVC 2015 Projects
This "adds" the Visual Studio 2015 Project files by doing what we did
before: copying the Visual Studio 2010 projects and replacing items
in them, as the formats of the Visual Studio 201x projects are largely
the same.
2015-09-09 15:21:26 +08:00
Chun-wei Fan
9c7df09c3b MSVC Builds: Simplify Script to Generate glib-mkenums
Use a simple all-purpose utility script to generate the glib-mkenums
PERL script with the version info, and stop using the script that
tries to parse the autotools files.  Move the things that
were taken out from build/win32/setup.py back there.
2015-09-09 15:21:12 +08:00
Chun-wei Fan
0be6766d9b MSVC Builds: Prepare For Visual Studio 2015
Update the autotools module so that we can use it to upgrade the
Visual Studio 2010 projects to become Visual Studio 2015-compatible.

Note that this will make the MSVC 2015 builds use the the the latest
VC140 CRT.
2015-09-08 15:51:58 +08:00
Chun-wei Fan
1387a16bf4 MSVC Builds: Remove Static Items
... which are now generated with the new autotools module, so we just
need to ensure the generated items are being dist'ed.

https://bugzilla.gnome.org/show_bug.cgi?id=735429
2015-09-03 19:10:26 +08:00
Chun-wei Fan
041e77249a Cleanup and Enhance the MSVC Project Generation
Make use of the common autotools module that is used to generate the MSVC
project files from their respective templates so that the main build files
beccome cleaner, and enhance them in a way that the headers that should be
installed can be written to the property sheets during 'make dist', so that
the chances of missing headers for MSVC builds can be greatly reduced.

Also use this autotools module to fill in the projects for
glib-compile-schemas and glib-compile-resources.

https://bugzilla.gnome.org/show_bug.cgi?id=735429
2015-09-03 19:10:06 +08:00
Chun-wei Fan
74c9eaac11 MSVC Builds: Few More Enahncements
Update the .pdb file generation for the MSVC 2010+ DLLs (and the x64 gspawn
helper programs), so that they match the names of the DLLs/EXEs that are
built.  Also update the .lib generation so that all will use -$(ApiVersion)
from the property sheets instead of the -2.0 which was previously hard
coded (as we will eventually move into GLib 3.x in the future, for example)
2015-03-04 20:11:43 +08:00
Chun-wei Fan
6be1e678dc Visual Studio Builds: "Install" .pdb files
They are helpful in debugging in a stack.
2015-03-03 19:21:40 +08:00
Chun-wei Fan
6e117b3fcc MSVC Builds: GIO: Standardize zlib Linking
Link to zlib1.lib for all builds, as:
-The notion of zlib1d.lib is rather not standardized across the board for
 most cases.
-Easier for the grand all-in-one solution file.
2015-03-03 18:24:58 +08:00
Chun-wei Fan
d76ac1560e Visual Studio 2008 Builds: Speed Up Release Builds
Use the /MP option so that each project can build multiple sources in
parallel, which can cut down release build times by quite a bit.  This will
cause a brief warning for debug builds due to their use of /Gm, and builds
would otherwise proceed as they did before.

Unfortunately Visual Studio 2008 is too old to support the /d2Zi+ flag, so
we can't make a better debug situation for it at the moment.
2015-03-03 18:09:42 +08:00
Chun-wei Fan
7b1729f3c0 MSVC Builds: Improve Build Speed and Debugging
Use Multiprocessor compilation which can cut down build times by quite a
bit and use the /d2Zi+ flag to have better debugging info being logged to
the .pdb for release builds.

These are only applicable for Visual Studio 2010/2012 and later.
2015-03-03 13:52:22 +08:00
Chun-wei Fan
94b9d87a43 MSVC Builds: Fix and Update "Installation"
The gobjectnotifyqueue.c was accidently dropped from the files to copy, and
a new public header for GIO was added, so address these parts.
2015-03-03 12:06:22 +08:00
Chun-wei Fan
642f7a5c79 Visual Studio 2008 Builds: Fix Header "Installation"
Apparently I did not fix the "installation" of gliststore.h and
glistmodel.h fully for Visual Studio 2008 builds.  Fix that.  Doh!
2015-02-04 16:00:52 +08:00
Chun-wei Fan
dee57faa6c MSVC Builds: Fix "Installation" of GListModel Headers
Somehow I had the wrong path for getting the headers... oops.
2015-02-02 14:27:29 +08:00
Chun-wei Fan
25e26ea034 MSVC Builds: Update vs11|vs12/Makefile.am
The rename of install.vxproj to glib-install.vcxproj needs to be applied
here as well for dist'ing the project files correctly.
2015-02-02 14:16:18 +08:00
Chun-wei Fan
444a5fcd4a MSVC Builds: Rename "install" Projects
Rename the project to "install" the GLib files, as we are planning to have
a grand solution file that would build the entire GTK+ stack with its deps,
to ease the process for people building the GTK+ stack from a stock
installation of Visual Studio.
2015-02-02 12:49:42 +08:00
Chun-wei Fan
65f4bd17a2 One More Update For MSVC Builds
We also need to "install" the headers for Lars' new APIs for GListModel/
GListStore.
2015-02-02 11:14:07 +08:00
Chun-wei Fan
50012fb426 MSVC Builds: "Install" the Autocleanup Headers
We are including the autocleanup headers as public headers for all builds,
although they work only for GCC in reality, so "install" them.

Also clean up a bit as we are having "\\" in places, where we only need
"\".
2015-02-02 10:51:25 +08:00
Chun-wei Fan
d2f3e11907 MSVC Builds: Update "Installation"
This updates the glib-install.[props|vsprops] so that the headers to
"install" for the build are kept up-to-date.  Note that this has been
generated by a script, so that this hopefully means that the header
"installation" can be maintained along with the autotools files for most
uses, to simplify maintenance.
2014-09-12 15:51:49 +08:00
Chun-wei Fan
52b5a06dea Visual C++ Builds: Update README.txt's
Update notes about usage of PCRE and for people attempting to build GLib
on a Chinese, Japanese or Korean locale.
2014-08-13 09:55:11 +08:00
Chun-wei Fan
3d89041220 MSVC Builds: Generate glib-mkenums If Possible
As glib-mkenums would likely be used in the building of the other
components of the stack, such as Cogl, Clutter and
gsettings-desktop-schemas, generate that using a Python script (if Python
can be found) and "install" it.
2014-08-08 17:39:48 +08:00
Michael Catanzaro
c3842d1969 Fix old wiki links 2014-07-01 23:52:19 -05:00
Chun-wei Fan
91b9aef0c9 MSVC 2010+ Projects: Update "Installation" Process
Currently, due to the way that Visual Studio 2010+ projects are handled,
the "install" project does not re-build upon changes to the sources, as it
does not believe that its dependencies have changed, although the changed
sources are automatically recompiled.  This means that if a part or more
of the solution does not build, or if the sources need some other fixes
or enhancements, the up-to-date build is not copied automatically, which
can be misleading.

Improve on the situation by forcing the "install" project to trigger its
rebuild, so that the updated binaries can be copied.  This does trigger an
MSBuild warning, but having that warning is way better than not having an
up-to-date build, especially during testing and development.
2014-06-09 10:27:36 +08:00
Chun-wei Fan
6eb55b9a33 Support Building Using Visual Studio 2013
Like the Visual Studio 2012 project files, the Visual Studio 2013 files are
largely the same as the Visual Studio 2010 project files, so support
Visual Studio 2013 by updating the autotools scripts that is used for
Visual Studio 2012.  This means that project files for Visual Studio 2012
and Visual Studio 2013 can be maintained by simply maintaining the Visual
Studio 2010 project files, adding minimal maintenance overhead.
2014-06-03 15:50:37 +08:00
Chun-wei Fan
eb7ef594de Fix GLib MSVC Project
The glib/gthread-win32.c was accidently removed from the last commit, sorry
2014-01-06 12:31:18 +08:00
Chun-wei Fan
940b3c2250 Tidy Up the glib MSVC Project
Move the per-source define/undefine cflags into the property sheets, and
apply the cflags for the bundled PCRE sources to the PCRE sources only
2014-01-06 12:21:46 +08:00