summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/Makefile.am6
-rw-r--r--build/gen-file-list-pango.py161
-rw-r--r--build/introspection-msvc.mak65
-rw-r--r--build/pango-introspection-msvc.mak97
-rw-r--r--build/win32/Makefile.am30
-rw-r--r--build/win32/detectenv-msvc.mak (renamed from build/detectenv-msvc.mak)21
-rw-r--r--build/win32/introspection-msvc.mak94
-rw-r--r--build/win32/pango-introspection-msvc.mak53
-rw-r--r--pango/Makefile.am47
9 files changed, 238 insertions, 336 deletions
diff --git a/build/Makefile.am b/build/Makefile.am
index d562d7a3..73e7a6f6 100644
--- a/build/Makefile.am
+++ b/build/Makefile.am
@@ -1,9 +1,3 @@
SUBDIRS = win32
-EXTRA_DIST = \
- pango-introspection-msvc.mak \
- introspection-msvc.mak \
- detectenv-msvc.mak \
- gen-file-list-pango.py
-
-include $(top_srcdir)/git.mk
diff --git a/build/gen-file-list-pango.py b/build/gen-file-list-pango.py
deleted file mode 100644
index fa438c0b..00000000
--- a/build/gen-file-list-pango.py
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/python
-# vim: encoding=utf-8
-# Generate the file lists for processing with g-ir-scanner
-import os
-import sys
-import re
-import string
-import subprocess
-import optparse
-
-def gen_pango_filelist(srcroot, subdir, dest):
- vars = read_vars_from_AM(os.path.join(srcroot, subdir, 'Makefile.am'),
- vars = {},
- conds = {},
- filters = ['pango_introspection_files'])
-
- files = vars['pango_introspection_files'].split()
-
- sources = [i for i in files \
- if not (i.endswith('-private.h')) \
- and i != 'pango-color-table.h' ]
-
- with open(dest, 'w') as d:
- for i in sources:
- d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
-
-def gen_pangoft_filelist(srcroot, subdir, dest):
- vars = read_vars_from_AM(os.path.join(srcroot, subdir, 'Makefile.am'),
- vars = {},
- conds = {},
- filters = ['pangoft2_introspection_files'])
-
- files = vars['pangoft2_introspection_files'].split()
-
- sources = [i for i in files \
- if not (i.endswith('-private.h'))]
-
- with open(dest, 'w') as d:
- for i in sources:
- d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
-
-def gen_pangocairo_filelist(srcroot, subdir, dest, is_fc_used):
- cond_pangocairo = {}
- if is_fc_used == 1:
- cond_pangocairo = {'HAVE_CAIRO_WIN32': True, 'PLATFORM_WIN32': True, 'HAVE_CAIRO_FREETYPE': True}
- else:
- cond_pangocairo = {'HAVE_CAIRO_WIN32': True, 'PLATFORM_WIN32': True}
- vars = read_vars_from_AM(os.path.join(srcroot, subdir, 'Makefile.am'),
- vars = {},
- conds = cond_pangocairo,
- filters = ['libpangocairo_1_0_la_SOURCES', 'pangocairo_headers'])
-
- files = vars['libpangocairo_1_0_la_SOURCES'].split() + \
- vars['pangocairo_headers'].split()
-
- sources = [i for i in files \
- if not (i.endswith('-private.h'))]
-
- with open(dest, 'w') as d:
- for i in sources:
- d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
-
-def read_vars_from_AM(path, vars = {}, conds = {}, filters = None):
- '''
- path: path to the Makefile.am
- vars: predefined variables
- conds: condition variables for Makefile
- filters: if None, all variables defined are returned,
- otherwise, it is a list contains that variables should be returned
- '''
- cur_vars = vars.copy()
- RE_AM_VAR_REF = re.compile(r'\$\((\w+?)\)')
- RE_AM_VAR = re.compile(r'^\s*(\w+)\s*=(.*)$')
- RE_AM_INCLUDE = re.compile(r'^\s*include\s+(\w+)')
- RE_AM_VAR_ADD = re.compile(r'^\s*(\w+)\s*\+=(.*)$')
- RE_AM_CONTINUING = re.compile(r'\\\s*$')
- RE_AM_IF = re.compile(r'^\s*if\s+(\w+)')
- RE_AM_ELSE = re.compile(r'^\s*else')
- RE_AM_ENDIF = re.compile(r'^\s*endif')
- def am_eval(cont):
- return RE_AM_VAR_REF.sub(lambda x: cur_vars.get(x.group(1), ''), cont)
- with open(path, 'r') as f:
- contents = f.readlines()
- #combine continuing lines
- i = 0
- ncont = []
- while i < len(contents):
- line = contents[i]
- if RE_AM_CONTINUING.search(line):
- line = RE_AM_CONTINUING.sub('', line)
- j = i + 1
- while j < len(contents) and RE_AM_CONTINUING.search(contents[j]):
- line += RE_AM_CONTINUING.sub('', contents[j])
- j += 1
- else:
- if j < len(contents):
- line += contents[j]
- i = j
- else:
- i += 1
- ncont.append(line)
-
- #include, var define, var evaluation
- i = -1
- skip = False
- oldskip = []
- while i < len(ncont) - 1:
- i += 1
- line = ncont[i]
- mo = RE_AM_IF.search(line)
- if mo:
- oldskip.append(skip)
- skip = False if mo.group(1) in conds and conds[mo.group(1)] \
- else True
- continue
- mo = RE_AM_ELSE.search(line)
- if mo:
- skip = not skip
- continue
- mo = RE_AM_ENDIF.search(line)
- if mo:
- skip = oldskip.pop()
- continue
- if not skip:
- mo = RE_AM_INCLUDE.search(line)
- if mo:
- cur_vars.update(read_vars_from_AM(am_eval(mo.group(1)), cur_vars, conds, None))
- continue
- mo = RE_AM_VAR.search(line)
- if mo:
- cur_vars[mo.group(1)] = am_eval(mo.group(2).strip())
- continue
- mo = RE_AM_VAR_ADD.search(line)
- if mo:
- try:
- cur_vars[mo.group(1)] += ' '
- except KeyError:
- cur_vars[mo.group(1)] = ''
- cur_vars[mo.group(1)] += am_eval(mo.group(2).strip())
- continue
-
- #filter:
- if filters != None:
- ret = {}
- for i in filters:
- ret[i] = cur_vars.get(i, '')
- return ret
- else:
- return cur_vars
-
-def main(argv):
- srcroot = '..'
- subdir = 'pango'
- gen_pango_filelist(srcroot, subdir, 'pango_list')
- gen_pangoft_filelist(srcroot, subdir, 'pangoft_list')
- gen_pangocairo_filelist(srcroot, subdir, 'pangocairo_list', 0)
- gen_pangocairo_filelist(srcroot, subdir, 'pangocairoft_list', 1)
- return 0
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/build/introspection-msvc.mak b/build/introspection-msvc.mak
deleted file mode 100644
index 55eec457..00000000
--- a/build/introspection-msvc.mak
+++ /dev/null
@@ -1,65 +0,0 @@
-# Common Utility NMake Makefile Template
-# Used to Generate Introspection files for various Projects
-
-# Can Override with env vars as needed
-# You will need to have built gobject-introspection for this to work.
-# Change or pass in or set the following to suit your environment
-
-BASEDIR = ..\..\vs$(VSVER)\$(PLAT)
-GIR_SUBDIR = share\gir-1.0
-GIR_TYPELIBDIR = lib\girepository-1.0
-G_IR_SCANNER = $(BASEDIR)\bin\g-ir-scanner
-G_IR_COMPILER = $(BASEDIR)\bin\g-ir-compiler.exe
-G_IR_INCLUDEDIR = $(BASEDIR)\$(GIR_SUBDIR)
-G_IR_TYPELIBDIR = $(BASEDIR)\$(GIR_TYPELIBDIR)
-
-# Note: The PYTHON2 must be a Python 2.6.x or 2.7.x Interpretor!
-# Either having python.exe from Python 2.6.x/2.7.x in your PATH will work
-# or passing in PYTHON2=<full path to your Python 2.6.x/2.7.x interpretor> will do
-
-# This is required, and gobject-introspection needs to be built
-# before this can be successfully run.
-PYTHON2=python
-
-# Don't change anything following this line!
-VALID_PKG_CONFIG_PATH = FALSE
-VALID_GCC_INSTPATH = FALSE
-
-MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH
-MSG_INVALID_CFG = You need to specify or set CFG to be release or debug to use this Makefile to build the Introspection Files
-
-ERROR_MSG =
-
-BUILD_INTROSPECTION = TRUE
-
-!if ![pkg-config --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x] \
- && ![setlocal] \
- && ![set file="pkgconfig.x"] \
- && ![FOR %A IN (%file%) DO @echo PKG_CHECK_SIZE=%~zA > pkgconfig.chksize] \
- && ![del $(ERRNUL) /q/f pkgconfig.x]
-!endif
-
-!include pkgconfig.chksize
-!if "$(PKG_CHECK_SIZE)" == "0"
-VALID_PKG_CONFIG_PATH = TRUE
-!else
-VALID_PKG_CONFIG_PATH = FALSE
-!endif
-
-!if ![del $(ERRNUL) /q/f pkgconfig.chksize]
-!endif
-
-VALID_CFGSET = FALSE
-!if "$(CFG)" == "release" || "$(CFG)" == "debug"
-VALID_CFGSET = TRUE
-!endif
-
-!if "$(VALID_PKG_CONFIG_PATH)" != "TRUE"
-BUILD_INTROSPECTION = FALSE
-ERROR_MSG = $(MSG_INVALID_PKGCONFIG)
-!endif
-
-!if "$(VALID_CFGSET)" != "TRUE"
-BUILD_INTROSPECTION = FALSE
-ERROR_MSG = $(MSG_INVALID_CFG)
-!endif
diff --git a/build/pango-introspection-msvc.mak b/build/pango-introspection-msvc.mak
deleted file mode 100644
index 52ec8063..00000000
--- a/build/pango-introspection-msvc.mak
+++ /dev/null
@@ -1,97 +0,0 @@
-# NMake Makefile to build Introspection Files for Pango
-
-!include detectenv-msvc.mak
-
-APIVERSION = 1.0
-
-CHECK_PACKAGE = gobject-2.0 cairo
-
-!include introspection-msvc.mak
-
-!if "$(BUILD_INTROSPECTION)" == "TRUE"
-!if "$(BUILD_PANGOFT2_INTROSPECTION)" == "1"
-
-# Build of PangoFT2 introspection files is not currently supported.
-PangoFT2LIBS = --library=pangoft2-1.0
-PangoFT2GIR = --include-uninstalled=./PangoFT2-$(APIVERSION)
-
-all: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoFT2-$(APIVERSION).gir PangoFT2-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib
-
-!else
-
-PangoFT2LIBS =
-PangoFT2GIR =
-
-all: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib
-
-install-introspection: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib
- @-copy Pango-$(APIVERSION).gir $(G_IR_INCLUDEDIR)
- @-copy /b Pango-$(APIVERSION).typelib $(G_IR_TYPELIBDIR)
- @-copy PangoCairo-$(APIVERSION).gir $(G_IR_INCLUDEDIR)
- @-copy /b PangoCairo-$(APIVERSION).typelib $(G_IR_TYPELIBDIR)
-!endif
-
-setbuildenv:
- @set PYTHONPATH=$(BASEDIR)\lib\gobject-introspection
- @set PATH=win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(BASEDIR)\bin;$(PATH)
- @set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
- @set LIB=win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(BASEDIR)\lib;$(LIB)
-
-Pango-$(APIVERSION).gir: pango_list
- @-echo Generating Pango-$(APIVERSION).gir...
- $(PYTHON2) $(G_IR_SCANNER) --verbose -I.. \
- -I$(BASEDIR)\include\glib-2.0 -I$(BASEDIR)\lib\glib-2.0\include \
- --namespace=Pango --nsversion=$(APIVERSION) \
- --include=GObject-2.0 --include=cairo-1.0 \
- --no-libtool --pkg=gobject-2.0 --pkg=cairo --pkg=glib-2.0 --library=pango-1.0 \
- --reparse-validate --add-include-path=$(G_IR_INCLUDEDIR) \
- --pkg-export pango --warn-all --c-include "pango/pango.h" \
- -DG_LOG_DOMAIN=\"Pango\" -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE \
- -DSYSCONFDIR=\"/dummy/etc\" -DLIBDIR=\"/dummy/lib\" \
- --filelist=pango_list -o Pango-$(APIVERSION).gir
-
-PangoCairo-$(APIVERSION).gir: Pango-$(APIVERSION).gir
- @-echo Generating PangoCairo-$(APIVERSION).gir...
- $(PYTHON2) $(G_IR_SCANNER) --verbose -I.. \
- -I$(BASEDIR)\include\glib-2.0 -I$(BASEDIR)\lib\glib-2.0\include -I$(BASEDIR)\include \
- --namespace=PangoCairo --nsversion=$(APIVERSION) \
- --include=GObject-2.0 --include=cairo-1.0 \
- --no-libtool --pkg=gobject-2.0 --pkg=cairo --library=pangocairo-1.0 $(PangoFT2LIBS) --library=pango-1.0 \
- --reparse-validate --add-include-path=$(G_IR_INCLUDEDIR) --add-include-path=. \
- --pkg-export pangocairo --warn-all $(PangoFT2GIR) --include-uninstalled=./Pango-$(APIVERSION).gir \
- --c-include "pango/pangocairo.h" \
- -I..\.. -DG_LOG_DOMAIN=\"Pango\" -DPANGO_ENABLE_BACKEND \
- -DPANGO_ENABLE_ENGINE -DSYSCONFDIR=\"/dummy/etc\" -DLIBDIR=\"/dummy/lib\" \
- --filelist=pangocairo_list -o PangoCairo-$(APIVERSION).gir
-
-pangocairo_list: pango_list
-
-pango_list:
- @-echo Generating Filelist to Introspect for Pango...
- $(PYTHON2) gen-file-list-pango.py
-
-Pango-$(APIVERSION).typelib: Pango-$(APIVERSION).gir
- @-echo Compiling Pango-$(APIVERSION).typelib...
- $(G_IR_COMPILER) --includedir=. --debug --verbose Pango-$(APIVERSION).gir -o Pango-$(APIVERSION).typelib
-
-PangoCairo-$(APIVERSION).typelib: PangoCairo-$(APIVERSION).gir Pango-$(APIVERSION).typelib
- @-echo Compiling PangoCairo-$(APIVERSION).typelib...
- $(G_IR_COMPILER) --includedir=. --debug --verbose PangoCairo-$(APIVERSION).gir -o PangoCairo-$(APIVERSION).typelib
-
-!else
-all:
- @-echo $(ERROR_MSG)
-!endif
-
-clean:
- @-del /f/q PangoCairo-$(APIVERSION).typelib
- @-del /f/q PangoCairo-$(APIVERSION).gir
- @-del /f/q PangoFT2-$(APIVERSION).typelib
- @-del /f/q PangoFT2-$(APIVERSION).gir
- @-del /f/q Pango-$(APIVERSION).typelib
- @-del /f/q Pango-$(APIVERSION).gir
- @-del /f/q pangocairoft_list
- @-del /f/q pangocairo_list
- @-del /f/q pangoft_list
- @-del /f/q pango_list
- @-del /f/q *.pyc
diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am
index 0a33798c..71e5b477 100644
--- a/build/win32/Makefile.am
+++ b/build/win32/Makefile.am
@@ -1,3 +1,27 @@
+if HAVE_INTROSPECTION
+GENERATED_ITEMS = \
+ introspection.body.mak \
+ Pango_1_0_gir_list \
+ PangoCairo_1_0_gir_list
+
+MSVC_INTROSPECTION_INTERMEDIATE_FILES = PangoCairo-1.0.gir.msvc.introspect Pango-1.0.gir.msvc.introspect
+
+introspection.body.mak: $(MSVC_INTROSPECTION_INTERMEDIATE_FILES)
+ -$(RM) introspection.body.mak
+ for F in `ls *.msvc.introspect`; do \
+ case $$F in \
+ *) cat $(top_builddir)/build/win32/$$F >>introspection.body.mak \
+ ;; \
+ esac; \
+ done
+ $(RM) $(MSVC_INTROSPECTION_INTERMEDIATE_FILES)
+
+DISTCLEANFILES = $(GENERATED_ITEMS)
+
+else
+GENERATED_ITEMS =
+endif
+
SUBDIRS = \
vs9 \
vs10 \
@@ -6,6 +30,10 @@ SUBDIRS = \
vs14
EXTRA_DIST = \
- unistd.h
+ unistd.h \
+ pango-introspection-msvc.mak \
+ introspection-msvc.mak \
+ detectenv-msvc.mak \
+ $(GENERATED_ITEMS)
-include $(top_srcdir)/git.mk
diff --git a/build/detectenv-msvc.mak b/build/win32/detectenv-msvc.mak
index 020548af..61f979d4 100644
--- a/build/detectenv-msvc.mak
+++ b/build/win32/detectenv-msvc.mak
@@ -1,3 +1,8 @@
+# Common NMake Makefile module for checking the build environment
+# This can be copied from $(glib_srcroot)\build\win32 for GNOME items
+# that support MSVC builds and introspection under MSVC, and can be used
+# for building test programs as well.
+
# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or
# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir)
!if !defined(VCINSTALLDIR) && !defined(WINDOWSSDKDIR)
@@ -35,6 +40,8 @@ VSVER = 10
VSVER = 11
!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
VSVER = 12
+!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000
+VSVER = 14
!else
VSVER = 0
!endif
@@ -42,20 +49,24 @@ VSVER = 0
!if "$(VSVER)" == "0"
MSG = ^
This NMake Makefile set supports Visual Studio^
-9 (2008) through 12 (2013). Your Visual Studio^
+9 (2008) through 14 (2015). Your Visual Studio^
version is not supported.
!error $(MSG)
!endif
VALID_CFGSET = FALSE
-!if "$(CFG)" == "release" || "$(CFG)" == "debug"
+!if "$(CFG)" == "release" || "$(CFG)" == "debug" || "$(CFG)" == "Release" || "$(CFG)" == "Debug"
VALID_CFGSET = TRUE
!endif
-!if "$(CFG)" == "release"
-CFLAGS_ADD = /MD /O2
+# We want debugging symbols logged for all builds,
+# using .pdb files for release builds
+CFLAGS_BASE = /Zi
+
+!if "$(CFG)" == "release" || "$(CFG)" == "Release"
+CFLAGS_ADD = /MD /O2 $(CFLAGS_BASE)
!else
-CFLAGS_ADD = /MDd /Od /Zi
+CFLAGS_ADD = /MDd /Od $(CFLAGS_BASE)
!endif
!if "$(PLAT)" == "x64"
diff --git a/build/win32/introspection-msvc.mak b/build/win32/introspection-msvc.mak
new file mode 100644
index 00000000..87398442
--- /dev/null
+++ b/build/win32/introspection-msvc.mak
@@ -0,0 +1,94 @@
+# Common NMake Makefile module for checking the build environment is sane
+# for building introspection files under MSVC/NMake.
+# This can be copied from $(gi_srcroot)\build\win32 for GNOME items
+# that support MSVC builds and introspection under MSVC.
+
+# Can override with env vars as needed
+# You will need to have built gobject-introspection for this to work.
+# Change or pass in or set the following to suit your environment
+
+!if "$(PREFIX)" == ""
+PREFIX = ..\..\..\vs$(VSVER)\$(PLAT)
+!endif
+
+!if ![setlocal] && \
+ ![set PFX=$(PREFIX)] && \
+ ![for %P in (%PFX%) do @echo PREFIX_FULL=%~dpnfP > pfx.x]
+!endif
+!include pfx.x
+
+!if "$(PKG_CONFIG_PATH)" == ""
+PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig
+!else
+PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig;$(PKG_CONFIG_PATH)
+!endif
+
+!if ![del $(ERRNUL) /q/f pfx.x]
+!endif
+
+# Note: The PYTHON must be the Python release series that was used to build
+# the GObject-introspection scanner Python module!
+# Either having python.exe your PATH will work or passing in
+# PYTHON=<full path to your Python interpretor> will do
+
+# This is required, and gobject-introspection needs to be built
+# before this can be successfully run.
+!if "$(PYTHON)" == ""
+PYTHON=python
+!endif
+
+# Path to the pkg-config tool, if not already in the PATH
+!if "$(PKG_CONFIG)" == ""
+PKG_CONFIG=pkg-config
+!endif
+
+# Don't change anything following this line!
+
+GIR_SUBDIR = share\gir-1.0
+GIR_TYPELIBDIR = lib\girepository-1.0
+G_IR_SCANNER = $(PREFIX)\bin\g-ir-scanner
+G_IR_COMPILER = $(PREFIX)\bin\g-ir-compiler.exe
+G_IR_INCLUDEDIR = $(PREFIX)\$(GIR_SUBDIR)
+G_IR_TYPELIBDIR = $(PREFIX)\$(GIR_TYPELIBDIR)
+
+VALID_PKG_CONFIG_PATH = FALSE
+
+MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH
+MSG_INVALID_CFG = You need to specify or set CFG to be release or debug to use this Makefile to build the Introspection Files
+
+ERROR_MSG =
+
+BUILD_INTROSPECTION = TRUE
+
+!if ![set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)] \
+ && ![$(PKG_CONFIG) --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x] \
+ && ![setlocal] \
+ && ![set file="pkgconfig.x"] \
+ && ![FOR %A IN (%file%) DO @echo PKG_CHECK_SIZE=%~zA > pkgconfig.chksize] \
+ && ![del $(ERRNUL) /q/f pkgconfig.x]
+!endif
+
+!include pkgconfig.chksize
+!if "$(PKG_CHECK_SIZE)" == "0"
+VALID_PKG_CONFIG_PATH = TRUE
+!else
+VALID_PKG_CONFIG_PATH = FALSE
+!endif
+
+!if ![del $(ERRNUL) /q/f pkgconfig.chksize]
+!endif
+
+VALID_CFGSET = FALSE
+!if "$(CFG)" == "release" || "$(CFG)" == "debug" || "$(CFG)" == "Release" || "$(CFG)" == "Debug"
+VALID_CFGSET = TRUE
+!endif
+
+!if "$(VALID_PKG_CONFIG_PATH)" != "TRUE"
+BUILD_INTROSPECTION = FALSE
+ERROR_MSG = $(MSG_INVALID_PKGCONFIG)
+!endif
+
+!if "$(VALID_CFGSET)" != "TRUE"
+BUILD_INTROSPECTION = FALSE
+ERROR_MSG = $(MSG_INVALID_CFG)
+!endif
diff --git a/build/win32/pango-introspection-msvc.mak b/build/win32/pango-introspection-msvc.mak
new file mode 100644
index 00000000..b2961a76
--- /dev/null
+++ b/build/win32/pango-introspection-msvc.mak
@@ -0,0 +1,53 @@
+# NMake Makefile to build Introspection Files for Pango
+
+!include detectenv-msvc.mak
+
+APIVERSION = 1.0
+
+CHECK_PACKAGE = gobject-2.0 cairo
+
+!include introspection-msvc.mak
+
+!if "$(BUILD_INTROSPECTION)" == "TRUE"
+!if "$(BUILD_PANGOFT2_INTROSPECTION)" == "1"
+
+# Build of PangoFT2 introspection files is not currently supported.
+PangoFT2LIBS = --library=pangoft2-1.0
+PangoFT2GIR = --include-uninstalled=./PangoFT2-$(APIVERSION)
+
+all: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoFT2-$(APIVERSION).gir PangoFT2-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib
+
+!else
+
+PangoFT2LIBS =
+PangoFT2GIR =
+
+all: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib
+
+install-introspection: setbuildenv Pango-$(APIVERSION).gir Pango-$(APIVERSION).typelib PangoCairo-$(APIVERSION).gir PangoCairo-$(APIVERSION).typelib
+ @-copy Pango-$(APIVERSION).gir $(G_IR_INCLUDEDIR)
+ @-copy /b Pango-$(APIVERSION).typelib $(G_IR_TYPELIBDIR)
+ @-copy PangoCairo-$(APIVERSION).gir $(G_IR_INCLUDEDIR)
+ @-copy /b PangoCairo-$(APIVERSION).typelib $(G_IR_TYPELIBDIR)
+!endif
+
+setbuildenv:
+ @set PYTHONPATH=$(PREFIX)\lib\gobject-introspection
+ @set PATH=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(PREFIX)\bin;$(PATH)
+ @set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
+ @set LIB=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(PREFIX)\lib;$(LIB)
+
+!include introspection.body.mak
+
+!else
+all:
+ @-echo $(ERROR_MSG)
+!endif
+
+clean:
+ @-del /f/q PangoCairo-$(APIVERSION).typelib
+ @-del /f/q PangoCairo-$(APIVERSION).gir
+ @-del /f/q PangoFT2-$(APIVERSION).typelib
+ @-del /f/q PangoFT2-$(APIVERSION).gir
+ @-del /f/q Pango-$(APIVERSION).typelib
+ @-del /f/q Pango-$(APIVERSION).gir
diff --git a/pango/Makefile.am b/pango/Makefile.am
index 832df3fa..eca0d8b2 100644
--- a/pango/Makefile.am
+++ b/pango/Makefile.am
@@ -495,12 +495,57 @@ pangocairo_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
+if HAVE_INTROSPECTION
+# Introspection Items for MSVC
+MSVC_INTROSPECT_GIRS = Pango-1.0.gir PangoCairo-1.0.gir
+
+BASE_MSVC_GIR_CFLAGS = \
+ -DG_LOG_DOMAIN=\"Pango\" \
+ -DPANGO_ENABLE_BACKEND \
+ -DPANGO_ENABLE_ENGINE
+
+INTROSPECTION_INTERMEDIATE_ITEMS = \
+ $(top_builddir)/build/win32/Pango-1.0.gir.msvc.introspect \
+ $(top_builddir)/build/win32/Pango_1_0_gir_list \
+ $(top_builddir)/build/win32/PangoCairo-1.0.gir.msvc.introspect \
+ $(top_builddir)/build/win32/PangoCairo_1_0_gir_list
+
+Pango_1_0_gir_MSVC_FILES = $(Pango_1_0_gir_FILES)
+Pango_1_0_gir_MSVC_PACKAGES = gobject-2.0 cairo glib-2.0
+Pango_1_0_gir_MSVC_EXPORT_PACKAGES = $(Pango_1_0_gir_EXPORT_PACKAGES)
+Pango_1_0_gir_MSVC_INCLUDE_GIRS = $(Pango_1_0_gir_INCLUDES)
+Pango_1_0_gir_MSVC_LIBS = pango-1.0
+Pango_1_0_gir_MSVC_CFLAGS = -I../.. $(BASE_MSVC_GIR_CFLAGS)
+Pango_1_0_gir_MSVC_SCANNERFLAGS = $(Pango_1_0_gir_SCANNERFLAGS)
+
+pangocairo_msvc_introspection_files = \
+ $(pangocairo_core_sources) \
+ pangocairo-win32font.c \
+ pangocairo-win32fontmap.c \
+ pangocairo-win32.h \
+ $(pangocairo_headers)
+
+PangoCairo_1_0_gir_MSVC_FILES = $(filter-out %-private.h, $(pangocairo_msvc_introspection_files))
+PangoCairo_1_0_gir_MSVC_GIR_DEPS = Pango-1.0.gir
+PangoCairo_1_0_gir_MSVC_PACKAGES = $(PangoCairo_1_0_gir_PACKAGES)
+PangoCairo_1_0_gir_MSVC_EXPORT_PACKAGES = $(PangoCairo_1_0_gir_EXPORT_PACKAGES)
+PangoCairo_1_0_gir_MSVC_INCLUDE_GIRS = $(PangoCairo_1_0_gir_INCLUDES) win32-1.0
+PangoCairo_1_0_gir_MSVC_LIBS = $(Pango_1_0_gir_MSVC_LIBS) pangocairo-1.0
+PangoCairo_1_0_gir_MSVC_CFLAGS = $(Pango_1_0_gir_MSVC_CFLAGS)
+PangoCairo_1_0_gir_MSVC_SCANNERFLAGS = --include-uninstalled=./Pango-1.0.gir --c-include "pango/pangocairo.h"
+
+include $(top_srcdir)/build/Makefile.msvc-introspection
+else
+INTROSPECTION_INTERMEDIATE_ITEMS =
+endif
+
dist-hook: \
$(top_builddir)/build/win32/vs9/pango.vcproj \
$(top_builddir)/build/win32/vs9/pangowin32.vcproj \
$(top_builddir)/build/win32/vs9/pangoft2.vcproj \
$(top_builddir)/build/win32/vs9/pangocairo.vcproj \
- $(top_builddir)/build/win32/vs9/pango.headers
+ $(top_builddir)/build/win32/vs9/pango.headers \
+ $(INTROSPECTION_INTERMEDIATE_ITEMS)
TESTS = check.defs