Commit Graph

192 Commits

Author SHA1 Message Date
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
a0b4e87f44 build/Makefile-newvs.am: Update Comments for Usage
Update the notes that this is also used for Visual Studio 2015 support,
and correct the MSVC_VER_LONG for MSVC 2015, which is 14, not 2015.

Also add a note that this can be used for other projects that have
Visual Studio build support.
2015-09-25 19:41:21 +08:00
Chun-wei Fan
762437c849 Build: Make Makefile.msvcproj A Bit More Generic
Handle also the situation where $(srcdir) == $(top_srcdir), so that this
can also be used in cases like librsvg and gobject-introspection.
2015-09-25 19:41:11 +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
ea93847a7d MSVC Build: Make Re-use Comment of Autotools Module Clearer 2015-09-17 09:15:27 +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
700983c8c9 build: Add Common Autotools Module for MSVC Projects
This adds a common autotools module that can be used by various
projects to generate the Visual Studio projects as needed, and
if necessary, generate the headers listings to "install" for that
project, based on items passed in to this.  This is modelled on the
Makefile.introspection autotools file that is used by many GNOME
projects to generate the introspection files.

https://bugzilla.gnome.org/show_bug.cgi?id=735429
2015-09-03 19:08:55 +08:00
Chun-wei Fan
cf940b66bc build/Makefile-newvs.am: Fix %.vcxproj Rule
The if-else statement added in commit 9bc3ae9 was missing a '\' after the
'else', causing 'make dist/distcheck' to break with "unexpected
end-of-file" errors.

Fix this-didn't notice this when reviewing that patch.  My fault. :|
2015-04-22 16:36:13 +08:00
Simon McVittie
9bc3ae9207 Makefile-newvs: some .vcxproj.filters files are in builddir, some in srcdir
Without this change, out-of-tree distcheck doesn't get very far.

Similarly, allow *.vcxproj, *.props to be in either the builddir or
the srcdir.

Finally, since I'm touching these lines anyway, eliminate some
useless uses of cat: "cat x | sed 's/foo/bar/' > y" is
equivalent to "sed 's/foo/bar/' < x > y".

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=748176
Reviewed-by: Chun-wei Fan <fanchunwei@src.gnome.org>
2015-04-20 15:55:29 +01:00
Chun-wei Fan
68bb63e3ee build/Makfile-newvs.am: Use Pattern Rules
Make use of pattern rules when generating the Visual Studio 2012/2013
Projects from the Visual Studio 2010 projects, which will help to clean up
the file and also avoid problems when running items like 'make -jN dist'.
2015-04-17 19:17:13 +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
98d37f203e MSVC 2012/2013 Support: Update Property Sheet Creation
Be a bit more careful when copying and updating the property sheets, so that
we don't accidently change fields with '10' in them that are actually not
indicating the Visual Studio version.
2014-07-01 16:08:21 +08: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
Chun-wei Fan
16c41f0c36 Drop the testglib MSVC Projects
There are many test programs that are shipped with GLib, and this project
is a one-to-one project, which does not make sense to keep as various test
programs may have different CFLAGS, etc, which will require different build
options.
2014-01-06 11:22:39 +08:00
Chun-wei Fan
cda4080af0 MSVC 2012 Projects: Rename a Property Sheet
Forgot to update the property sheet file name from the Visual Studio 2010
update... Sorry!
2014-01-02 09:54:18 +08:00
Chun-wei Fan
ddc29a9036 Visual Studio Projects: Cleanup Property Sheets
Make the projects include a single property sheet as necessary, which will
in turn include the other property sheet(s) as needed, so that we can avoid
warnings where we include the same property sheets twice in a single
project.

Also make the copying of pre-configured headers into custom build rules so
that they can be removed upon the clean command from the IDE and that they
can be re-copied if their counterpart *.h.win32 are updated.
2013-12-27 12:25:18 +08:00