[gtksourceviewmm/nmake-3-18] build: Add a set of NMake Makefiles
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceviewmm/nmake-3-18] build: Add a set of NMake Makefiles
- Date: Tue, 16 Nov 2021 09:47:25 +0000 (UTC)
commit e30ec3378a320278ae56668e98cc4cf1e4cf4bbc
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Aug 28 16:57:06 2020 +0800
build: Add a set of NMake Makefiles
This adds a set of NMake Makefiles, which can be used to build gtksourceviewmm
using Visual Studio. This works by sharing the various filelist.am's in
gtksourceview/, so that any source additions or removals can be reflected
immediately.
MSVC_NMake/Makefile.vc | 61 +++++++++++
MSVC_NMake/README | 30 ++++++
MSVC_NMake/build-rules-msvc.mak | 95 +++++++++++++++++
MSVC_NMake/config-msvc.mak | 216 +++++++++++++++++++++++++++++++++++++++
MSVC_NMake/create-lists-msvc.mak | 102 ++++++++++++++++++
MSVC_NMake/create-lists.bat | 42 ++++++++
MSVC_NMake/detectenv-msvc.mak | 163 +++++++++++++++++++++++++++++
MSVC_NMake/filelist.am | 16 +++
MSVC_NMake/gendef/gendef.cc | 106 +++++++++++++++++++
MSVC_NMake/generate-msvc.mak | 49 +++++++++
MSVC_NMake/get-gmmproc-ver.bat | 34 ++++++
MSVC_NMake/info-msvc.mak | 60 +++++++++++
MSVC_NMake/install.mak | 17 +++
Makefile.am | 5 +
14 files changed, 996 insertions(+)
---
diff --git a/MSVC_NMake/Makefile.vc b/MSVC_NMake/Makefile.vc
new file mode 100644
index 0000000..95acf44
--- /dev/null
+++ b/MSVC_NMake/Makefile.vc
@@ -0,0 +1,61 @@
+# NMake Makefile for building libsigc++ on Windows using Visual Studio
+
+# The items below this line should not be changed, unless one is maintaining
+# the NMake Makefiles. Customizations can be done in the following NMake Makefile
+# portions (please see comments in the these files to see what can be customized):
+#
+# detectenv-msvc.mak
+# config-msvc.mak
+
+!include detectenv-msvc.mak
+
+# Include the Makefile portions with the source listings
+!include ..\gtksourceview\src\filelist.am
+!include ..\gtksourceview\gtksourceviewmm\filelist.am
+
+# Include the Makefile portion that enables features based on user input
+!include config-msvc.mak
+
+!if "$(VALID_CFGSET)" == "TRUE"
+
+# We need Visual Studio 2013 or later
+!if $(VSVER) < 12
+VALID_MSC = FALSE
+!else
+VALID_MSC = TRUE
+!endif
+
+!if "$(VALID_MSC)" == "TRUE"
+
+!ifdef GENERATE_VERSIONED_FILES
+!include pkg-ver.mak
+DO_REAL_GEN = 1
+!endif
+
+all: $(TARGETS) all-build-info
+
+# Include the Makefile portion to convert the source and header lists
+# into the lists we need for compilation and introspection
+!include create-lists-msvc.mak
+
+tests: $(gtksourceviewmm_tests) all-build-info
+
+# Include the build rules for sources, DLLs and executables
+!include generate-msvc.mak
+!include build-rules-msvc.mak
+
+!include install.mak
+
+!else # "$(VALID_MSC)" == "TRUE"
+all:
+ @echo You need Visual Studio 2013 or later.
+
+!endif # "$(VALID_MSC)" == "TRUE"
+
+!else # "$(VALID_CFGSET)" == "TRUE"
+all: help
+ @echo You need to specify a valid configuration, via
+ @echo CFG=release or CFG=debug
+!endif # "$(VALID_CFGSET)" == "TRUE"
+
+!include info-msvc.mak
diff --git a/MSVC_NMake/README b/MSVC_NMake/README
new file mode 100644
index 0000000..7a4cc7e
--- /dev/null
+++ b/MSVC_NMake/README
@@ -0,0 +1,30 @@
+Building gtksourceviewmm-3.0 with Visual Studio 2015 or later
+
+* You will need Visual Studio 2015 (MSVC 14.0) or later. Earlier versions of the compiler, including 12.0
+ and earlier will not work. The build can be carried out using the NMake Makefiles supplied in this
+ directory. You will also need to hand-edit $(srcroot)\gtksourceview\gtksourceviewmmconfig.h.in and save
+ it as $(srcroot)\gtksourceview\gtksourceviewmmconfig.h, by changing the lines starting with #undef to
+ reflect the actual version that you are building and on whether to allow building and using deprecated
+ items. Alternatively, if you have a PERL interpreter installed and it is in your PATH, the build
+ process will handle this editing for you.
+* Install the latest Win32 GTK+ Development files from ftp://ftp.gnome.org/pub/GNOME/binaries/win32/gtk+,
+ and build gtksourceview-3.18.0 or later
+* Build libsigc++, glibmm, cairomm atkmm and pangomm from source, with the same compiler version, even if
+ on Visual Studio 2015, 2017 or 2019. If there are strange linker or runtime errors, they are likely
+ caused by mixing different compiler versions.
+* Use the Visual Studio command prompt that is appropriate for your build and navigate to this directory.
+* Run nmake /f Makefile.vc CFG=[debug|release]. Also pass in PREFIX=<path> to this command line if
+ gtksourceview, libsigc++, glibmm, cairomm, atkmm, pangomm and gtkmm are not in
+ $(srcroot)\..\vs[14|15|16]\$(platform).
+ Note that vs14 stands for Visual Studio 2015 and vs15 stands for Visual Studio 2017 and vs16 stands for
+ Visual Studio 2019.
+* Build the tests by appending 'tests' to the NMake command line in the previous step.
+
+Timothy M. Shead & Cedric Gustin
+11/04/2004
+
+Armin Burgmeier
+10/02/2010
+
+Chun-wei Fan
+08/28/2020
diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak
new file mode 100644
index 0000000..d0fa71b
--- /dev/null
+++ b/MSVC_NMake/build-rules-msvc.mak
@@ -0,0 +1,95 @@
+# NMake Makefile portion for compilation rules
+# Items in here should not need to be edited unless
+# one is maintaining the NMake build files. The format
+# of NMake Makefiles here are different from the GNU
+# Makefiles. Please see the comments about these formats.
+
+# Inference rules for compiling the .obj files.
+# Used for libs and programs with more than a single source file.
+# Format is as follows
+# (all dirs must have a trailing '\'):
+#
+# {$(srcdir)}.$(srcext){$(destdir)}.obj::
+# $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<<
+# $<
+# <<
+
+{vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\}.obj::
+ $(CXX) $(LIBGTKSOURCEVIEWMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\
/Fdvs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\ /c @<<
+$<
+<<
+
+{..\gtksourceview\gtksourceviewmm\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\}.obj::
+ $(CXX) $(LIBGTKSOURCEVIEWMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\
/Fdvs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\ /c @<<
+$<
+<<
+
+{..\untracked\gtksourceview\gtksourceviewmm\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\}.obj::
+ $(CXX) $(LIBGTKSOURCEVIEWMM_CFLAGS) $(CFLAGS_NOGL) /Fovs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\
/Fdvs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\ /c @<<
+$<
+<<
+
+{..\gtksourceview\src\}.ccg{vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\}.obj:
+ @if not exist $(@D)\private\ md $(@D)\private
+ @for %%s in ($(<D)\*.ccg) do @if not exist ..\gtksourceview\gtksourceviewmm\%%~ns.cc if not exist
..\untracked\gtksourceview\gtksourceviewmm\%%~ns.cc if not exist $(@D)\%%~ns.cc $(PERL) --
$(GMMPROC_DIR)/gmmproc -I ../codegen/m4 -I $(GMMPROC_GTK_DIR) -I $(GMMPROC_PANGO_DIR) -I $(GMMPROC_ATK_DIR)
--defs $(<D:\=/) %%~ns $(<D:\=/) $(@D)
+ @if exist $(@D)\$(<B).cc $(CXX) $(LIBGTKSOURCEVIEWMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c
$(@D)\$(<B).cc
+ @if exist ..\untracked\gtksourceview\gtksourceviewmm\$(<B).cc if not exist
..\gtksourceview\gtksourceviewmm\$(<B).cc if not exist $(@D)\$(<B).cc $(CXX) $(LIBGTKSOURCEVIEWMM_CFLAGS)
$(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c ..\gtksourceview\gtksourceviewmm\$(<B).cc
+ @if exist ..\gtksourceview\gtksourceviewmm\$(<B).cc if not exist
..\untracked\gtksourceview\gtksourceviewmm\$(<B).cc if not exist $(@D)\$(<B).cc $(CXX)
$(LIBGTKSOURCEVIEWMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(@D)\ /Fd$(@D)\ /c ..\gtksourceview\gtksourceviewmm\$(<B).cc
+
+{.\gtksourceviewmm\}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\}.res:
+ rc /fo$@ $<
+
+# Rules for building .lib files
+$(GTKSOURCEVIEWMM_LIB): $(GTKSOURCEVIEWMM_DLL)
+
+# Rules for linking DLLs
+# Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
+# $(dll_name_with_path): $(dependent_libs_files_objects_and_items)
+# link /DLL [$(linker_flags)] [$(dependent_libs)] [/def:$(def_file_if_used)]
[/implib:$(lib_name_if_needed)] -out:$@ @<<
+# $(dependent_objects)
+# <<
+# @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+$(GTKSOURCEVIEWMM_DLL): ..\gtksourceview\gtksourceviewmmconfig.h $(GTKSOURCEVIEWMM_INT_TARGET)
$(gtksourceviewmm_OBJS)
+ link /DLL $(LDFLAGS_NOLTCG) $(GTKSOURCEVIEWMM_DEP_LIBS) /implib:$(GTKSOURCEVIEWMM_LIB)
$(GTKSOURCEVIEWMM_DEF_LDFLAG) -out:$@ @<<
+$(gtksourceviewmm_OBJS)
+<<
+ @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+
+# Rules for linking Executables
+# Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
+# $(dll_name_with_path): $(dependent_libs_files_objects_and_items)
+# link [$(linker_flags)] [$(dependent_libs)] -out:$@ @<<
+# $(dependent_objects)
+# <<
+# @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+
+# For the gendef tool
+{.\gendef\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\}.exe:
+ @if not exist vs$(VSVER)\$(CFG)\$(PLAT)\gendef\ md vs$(VSVER)\$(CFG)\$(PLAT)\$(@B)
+ $(CXX) $(GTKSOURCEVIEWMM_BASE_CFLAGS) $(CFLAGS) /Fo$(@D)\gendef\ /Fd$(@D)\gendef\ $< /link $(LDFLAGS)
/out:$@
+ @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+
+clean:
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.dll
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.pdb
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.ilk
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exp
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.lib
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm-tests\*.pdb
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm-tests\*.obj
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\private\*.h
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\*.def
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\*.res
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\*.pdb
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\*.obj
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\*.h
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\*.cc
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gendef\*.pdb
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gendef\*.obj
+ @-rd vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm-tests
+ @-rd vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\private
+ @-rd vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm
+ @-rd vs$(VSVER)\$(CFG)\$(PLAT)\gendef
+
+.SUFFIXES: .cc .ccg .h .hg .obj
diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak
new file mode 100644
index 0000000..7529ed6
--- /dev/null
+++ b/MSVC_NMake/config-msvc.mak
@@ -0,0 +1,216 @@
+# NMake Makefile portion for enabling features for Windows builds
+
+# These are the base minimum libraries required for building gtkmm.
+BASE_INCLUDES = /I$(PREFIX)\include
+
+# Please do not change anything beneath this line unless maintaining the NMake Makefiles
+
+# NMake Options
+SAVED_OPTIONS = CFG^=$(CFG)
+
+!ifdef DISABLE_DEPRECATED
+SAVED_OPTIONS = $(SAVED_OPTIONS) DISABLE_DEPRECATED^=$(DISABLE_DEPRECATED)
+!endif
+
+# Debug/Release builds
+!if "$(CFG)" == "debug" || "$(CFG)" == "Debug"
+DEBUG_SUFFIX = -d
+!else
+DEBUG_SUFFIX =
+!endif
+
+!ifndef GMMPROC_DIR
+GMMPROC_DIR=$(PREFIX)\share\glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)\proc
+!endif
+
+!ifndef GMMPROC_PANGO_DIR
+GMMPROC_PANGO_DIR=$(GMMPROC_DIR)\..\..\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\proc\m4
+!endif
+
+!ifndef GMMPROC_ATK_DIR
+GMMPROC_ATK_DIR=$(GMMPROC_DIR)\..\..\atkmm-$(ATKMM_MAJOR_VERSION).$(ATKMM_MINOR_VERSION)\proc\m4
+!endif
+
+!ifndef GMMPROC_GTK_DIR
+GMMPROC_GTK_DIR=$(GMMPROC_DIR)\..\..\gtkmm-$(GTKMM_MAJOR_VERSION).$(GTKMM_MINOR_VERSION)\proc\m4
+!endif
+
+# Dependencies
+
+GLIB_API_VERSION = 2.0
+ATK_API_VERSION = 1.0
+PANGO_API_VERSION = 1.0
+GDK_PIXBUF_API_VERSION = 2.0
+GTK_API_VERSION = 3
+GTKSOURCEVIEW_API_VERSION = 3
+
+LIBSIGC_MAJOR_VERSION = 2
+LIBSIGC_MINOR_VERSION = 0
+CAIROMM_MAJOR_VERSION = 1
+CAIROMM_MINOR_VERSION = 0
+GLIBMM_MAJOR_VERSION = 2
+GLIBMM_MINOR_VERSION = 4
+ATKMM_MAJOR_VERSION = 1
+ATKMM_MINOR_VERSION = 6
+PANGOMM_MAJOR_VERSION = 1
+PANGOMM_MINOR_VERSION = 4
+GTKMM_MAJOR_VERSION = 3
+GTKMM_MINOR_VERSION = 0
+GTKSOURCEVIEWMM_MAJOR_VERSION = 3
+GTKSOURCEVIEWMM_MINOR_VERSION = 0
+
+GTKSOURCEVIEWMM_CXX_INCLUDES = \
+ /I$(PREFIX)\include\gtkmm-$(GTKMM_MAJOR_VERSION).$(GTKMM_MINOR_VERSION) \
+ /I$(PREFIX)\lib\gtkmm-$(GTKMM_MAJOR_VERSION).$(GTKMM_MINOR_VERSION)\include \
+ /I$(PREFIX)\include\gdkmm-$(GDKMM_MAJOR_VERSION).$(GDKMM_MINOR_VERSION) \
+ /I$(PREFIX)\lib\gdkmm-$(GDKMM_MAJOR_VERSION).$(GDKMM_MINOR_VERSION)\include \
+ /I$(PREFIX)\include\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION) \
+ /I$(PREFIX)\lib\pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)\include \
+ /I$(PREFIX)\include\atkmm-$(ATKMM_MAJOR_VERSION).$(ATKMM_MINOR_VERSION) \
+ /I$(PREFIX)\lib\atkmm-$(ATKMM_MAJOR_VERSION).$(ATKMM_MINOR_VERSION)\include \
+ /I$(PREFIX)\include\giomm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION) \
+ /I$(PREFIX)\lib\giomm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)\include \
+ /I$(PREFIX)\include\glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION) \
+ /I$(PREFIX)\lib\glibmm-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)\include \
+ /I$(PREFIX)\include\cairomm-$(CAIROMM_MAJOR_VERSION).$(CAIROMM_MINOR_VERSION) \
+ /I$(PREFIX)\lib\cairomm-$(CAIROMM_MAJOR_VERSION).$(CAIROMM_MINOR_VERSION)\include \
+ /I$(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION) \
+ /I$(PREFIX)\lib\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\include
+
+GTKSOURCEVIEWMM_C_INCLUDES = \
+ /I$(PREFIX)\include\gtksourceview-$(GTK_API_VERSION).0 \
+ /I$(PREFIX)\include\gtk-$(GTK_API_VERSION).0 \
+ /I$(PREFIX)\include\gdk-pixbuf-$(GDK_PIXBUF_API_VERSION) \
+ /I$(PREFIX)\include\atk-$(ATK_API_VERSION) \
+ /I$(PREFIX)\include\pango-$(PANGO_API_VERSION) \
+ /I$(PREFIX)\include\glib-$(GLIB_API_VERSION) \
+ /I$(PREFIX)\lib\glib-$(GLIB_API_VERSION)\include \
+ /I$(PREFIX)\include\harfbuzz \
+ /I$(PREFIX)\include
+
+GTKSOURCEVIEWMM_INCLUDES = \
+ $(GTKSOURCEVIEWMM_CXX_INCLUDES) \
+ $(GTKSOURCEVIEWMM_C_INCLUDES)
+
+GOBJECT_LIBS = gobject-$(GLIB_API_VERSION).lib gmodule-$(GLIB_API_VERSION).lib glib-$(GLIB_API_VERSION).lib
+GIO_LIBS = gio-$(GLIB_API_VERSION).lib $(GOBJECT_LIBS)
+
+ATK_LIB = atk-$(ATK_API_VERSION).lib
+CAIRO_LIBS = cairo-gobject.lib cairo.lib
+GDK_PIXBUF_LIB = gdk_pixbuf-$(GDK_PIXBUF_API_VERSION).lib
+GTK_LIBS = gtk-$(GTK_API_VERSION).0.lib gdk-$(GTK_API_VERSION).0.lib
+PANGO_LIBS = pangocairo-$(PANGO_API_VERSION).lib pango-$(PANGO_API_VERSION).lib
+
+GTKSOURCEVIEW_LIB = gtksourceview-$(GTKSOURCEVIEW_API_VERSION).0.lib
+
+GTKSOURCEVIEWMM_LIBS_C_BASE = \
+ $(GTK_LIBS) \
+ $(GDK_PIXBUF_LIB) \
+ $(GIO_LIBS) \
+ $(CAIRO_LIBS)
+
+GTKSOURCEVIEWMM_LIBS_C = \
+ $(GTK_LIBS) \
+ $(GTKSOURCEVIEWMM_LIBS_C_BASE)
+
+GTKSOURCEVIEWMM_LIBS_CXX = \
+ $(GTKMM_LIB) \
+ $(GDKMM_LIB) \
+ $(PANGOMM_LIB) \
+ $(ATKMM_LIB) \
+ $(GIOMM_LIB) \
+ $(GLIBMM_LIB) \
+ $(CAIROMM_LIB) \
+ $(LIBSIGC_LIB)
+
+GTKSOURCEVIEWMM_LIBS_C = \
+ $(GTKSOURCEVIEW_LIB) \
+ $(GTKSOURCEVIEWMM_LIBS_C_BASE)
+
+GTKSOURCEVIEWMM_DEP_LIBS = \
+ $(GTKSOURCEVIEWMM_LIBS_CXX) \
+ $(GTKSOURCEVIEWMM_LIBS_C)
+
+# CXXFLAGS
+GTKSOURCEVIEWMM_BASE_CXXFLAGS = \
+ /EHsc \
+ /Ivs$(VSVER)\$(CFG)\$(PLAT) \
+ /I..\untracked\gtksourceview \
+ /I..\gtksourceview \
+ /wd4530 /wd4250 \
+ /FImsvc_recommended_pragmas.h
+
+!if $(VSVER) >= 14
+GTKSOURCEVIEWMM_BASE_CXXFLAGS = \
+ $(GTKSOURCEVIEWMM_BASE_CXXFLAGS) \
+ /utf-8 /wd4828 \
+!endif
+
+LIBGTKSOURCEVIEWMM_CFLAGS = \
+ /DGTKSOURCEVIEWMM_BUILD \
+ $(GTKSOURCEVIEWMM_BASE_CXXFLAGS) \
+ $(GTKSOURCEVIEWMM_INCLUDES)
+
+# We build gtksourceviewmm-vc$(VSVER_LIB)-$(GTKMM_MAJOR_VERSION)_$(GTKMM_MINOR_VERSION).dll or
+# gtksourceviewmm-vc$(VSVER_LIB)-d-$(GTKMM_MAJOR_VERSION)_$(GTKMM_MINOR_VERSION).dll at least=
+
+!if "$(USE_COMPAT_LIBS)" != ""
+VSVER_LIB = $(PDBVER)0
+MESON_VERVER_LIB =
+!else
+VSVER_LIB = $(PDBVER)$(VSVER_SUFFIX)
+MESON_VERVER_LIB = -vc$(VSVER_LIB)
+!endif
+
+!ifdef USE_MESON_LIBS
+LIBSIGC_LIBNAME = sigc-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)
+GLIBMM_LIBNAME = glibmm$(MESON_VERVER_LIB)-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)
+GIOMM_LIBNAME = giomm$(MESON_VERVER_LIB)-$(GLIBMM_MAJOR_VERSION).$(GLIBMM_MINOR_VERSION)
+CAIROMM_LIBNAME = cairomm$(MESON_VERVER_LIB)-$(CAIROMM_MAJOR_VERSION).$(CAIROMM_MINOR_VERSION)
+PANGOMM_LIBNAME = pangomm$(MESON_VERVER_LIB)-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)
+ATKMM_LIBNAME = atkmm$(MESON_VERVER_LIB)-$(ATKMM_MAJOR_VERSION).$(ATKMM_MINOR_VERSION)
+GDKMM_LIBNAME = gdkmm$(MESON_VERVER_LIB)-$(GTKMM_MAJOR_VERSION).$(GTKMM_MINOR_VERSION)
+GTKMM_LIBNAME = gtkmm$(MESON_VERVER_LIB)-$(GTKMM_MAJOR_VERSION).$(GTKMM_MINOR_VERSION)
+GTKSOURCEVIEWMM_LIBNAME =
gtksourceviewmm$(MESON_VERVER_LIB)-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)
+
+GTKSOURCEVIEWMM_DLLNAME = $(GTKSOURCEVIEWMM_LIBNAME)-1
+!else
+LIBSIGC_LIBNAME = sigc-vc$(PDBVER)0$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION)
+GLIBMM_LIBNAME = glibmm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION)
+GIOMM_LIBNAME = giomm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION)
+CAIROMM_LIBNAME = cairomm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(CAIROMM_MAJOR_VERSION)_$(CAIROMM_MINOR_VERSION)
+PANGOMM_LIBNAME = pangomm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(PANGOMM_MAJOR_VERSION)_$(PANGOMM_MINOR_VERSION)
+ATKMM_LIBNAME = atkmm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(ATKMM_MAJOR_VERSION)_$(ATKMM_MINOR_VERSION)
+GDKMM_LIBNAME = gdkmm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(GTKMM_MAJOR_VERSION)_$(GTKMM_MINOR_VERSION)
+GTKMM_LIBNAME = gtkmm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(GTKMM_MAJOR_VERSION)_$(GTKMM_MINOR_VERSION)
+GTKSOURCEVIEWMM_LIBNAME =
gtksourceviewmm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(GTKSOURCEVIEWMM_MAJOR_VERSION)_$(GTKSOURCEVIEWMM_MINOR_VERSION)
+
+GTKSOURCEVIEWMM_DLLNAME = $(GTKSOURCEVIEWMM_LIBNAME)
+!endif
+
+LIBSIGC_LIB = $(LIBSIGC_LIBNAME).lib
+GLIBMM_LIB = $(GLIBMM_LIBNAME).lib
+GIOMM_LIB = $(GIOMM_LIBNAME).lib
+CAIROMM_LIB = $(CAIROMM_LIBNAME).lib
+PANGOMM_LIB = $(PANGOMM_LIBNAME).lib
+ATKMM_LIB = $(ATKMM_LIBNAME).lib
+GDKMM_LIB = $(GDKMM_LIBNAME).lib
+GTKMM_LIB = $(GTKMM_LIBNAME).lib
+
+GTKSOURCEVIEWMM_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(GTKSOURCEVIEWMM_DLLNAME).dll
+GTKSOURCEVIEWMM_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(GTKSOURCEVIEWMM_LIBNAME).lib
+
+TARGETS = $(GTKSOURCEVIEWMM_LIB)
+
+GENDEF = vs$(VSVER)\$(CFG)\$(PLAT)\gendef.exe
+
+GTKSOURCEVIEWMM_HG_FILES = $(files_hg)
+GTKSOURCEVIEWMM_INT_EXTRA_SOURCES = $(files_extra_cc)
+GTKSOURCEVIEWMM_INT_EXTRA_HEADERS = $(files_extra_h)
+GTKSOURCEVIEWMM_INT_GENERATED_HEADERS = $(files_built_h)
+GTKSOURCEVIEWMM_INT_GENERATED_SOURCES = $(files_built_cc)
+
+# Path to glib-compile-resources.exe
+!ifndef GLIB_COMPILE_RESOURCES
+GLIB_COMPILE_RESOURCES = $(PREFIX)\bin\glib-compile-resources.exe
+!endif
diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak
new file mode 100644
index 0000000..702d563
--- /dev/null
+++ b/MSVC_NMake/create-lists-msvc.mak
@@ -0,0 +1,102 @@
+# Convert the source listing to object (.obj) listing in
+# another NMake Makefile module, include it, and clean it up.
+# This is a "fact-of-life" regarding NMake Makefiles...
+# This file does not need to be changed unless one is maintaining the NMake Makefiles
+
+# For those wanting to add things here:
+# To add a list, do the following:
+# # $(description_of_list)
+# if [call create-lists.bat header $(makefile_snippet_file) $(variable_name)]
+# endif
+#
+# if [call create-lists.bat file $(makefile_snippet_file) $(file_name)]
+# endif
+#
+# if [call create-lists.bat footer $(makefile_snippet_file)]
+# endif
+# ... (repeat the if [call ...] lines in the above order if needed)
+# !include $(makefile_snippet_file)
+#
+# (add the following after checking the entries in $(makefile_snippet_file) is correct)
+# (the batch script appends to $(makefile_snippet_file), you will need to clear the file unless the
following line is added)
+#!if [del /f /q $(makefile_snippet_file)]
+#!endif
+
+# In order to obtain the .obj filename that is needed for NMake Makefiles to build DLLs/static LIBs or EXEs,
do the following
+# instead when doing 'if [call create-lists.bat file $(makefile_snippet_file) $(file_name)]'
+# (repeat if there are multiple $(srcext)'s in $(source_list), ignore any headers):
+# !if [for %c in ($(source_list)) do @if "%~xc" == ".$(srcext)" @call create-lists.bat file
$(makefile_snippet_file) $(intdir)\%~nc.obj]
+#
+# $(intdir)\%~nc.obj needs to correspond to the rules added in build-rules-msvc.mak
+# %~xc gives the file extension of a given file, %c in this case, so if %c is a.cc, %~xc means .cc
+# %~nc gives the file name of a given file without extension, %c in this case, so if %c is a.cc, %~nc means a
+
+NULL=
+
+gtksourceviewmm_generated_private_headers = $(GTKSOURCEVIEWMM_HG_FILES:.hg=_p.h)
+
+# For gtksourceviewmm
+!if [call create-lists.bat header gtksourceviewmm.mak gtksourceviewmm_OBJS]
+!endif
+
+!if [for %c in ($(GTKSOURCEVIEWMM_INT_GENERATED_SOURCES)) do @if "%~xc" == ".cc" @call create-lists.bat file
gtksourceviewmm.mak ^vs$(VSVER)\^$(CFG)\^$(PLAT)\gtksourceviewmm\%~nc.obj]
+!endif
+
+!if [for %c in ($(GTKSOURCEVIEWMM_INT_EXTRA_SOURCES)) do @if "%~xc" == ".cc" @call create-lists.bat file
gtksourceviewmm.mak ^vs$(VSVER)\^$(CFG)\^$(PLAT)\gtksourceviewmm\%~nc.obj]
+!endif
+
+#!if [@call create-lists.bat file gtksourceviewmm.mak
^vs$(VSVER)\^$(CFG)\^$(PLAT)\gtksourceviewmm\gtksourceviewmm.res]
+#!endif
+
+!if [call create-lists.bat footer gtksourceviewmm.mak]
+!endif
+
+!if [call create-lists.bat header gtksourceviewmm.mak gtksourceviewmm_real_hg]
+!endif
+
+!if [for %h in ($(GTKSOURCEVIEWMM_HG_FILES)) do @call create-lists.bat file gtksourceviewmm.mak
../gtksourceview/src/%h]
+!endif
+
+!if [call create-lists.bat footer gtksourceviewmm.mak]
+!endif
+
+!if [call create-lists.bat header gtksourceviewmm.mak gtksourceviewmm_tests]
+!endif
+
+!if [for /f %d in ('dir /ad /b ..\tests\') do @call create-lists.bat file gtksourceviewmm.mak
^vs$(VSVER)\^$(CFG)\^$(PLAT)\gtksourceviewmm-test-%d.exe]
+!endif
+
+!if [call create-lists.bat footer gtksourceviewmm.mak]
+!endif
+
+!if [call create-lists.bat header gtksourceviewmm.mak gtksourceviewmm_tests & @(for /f %t in ('dir /ad /b
..\tests') do @call create-lists.bat file gtksourceviewmm.mak vs$(VSVER)\$(CFG)\$(PLAT)\%t.exe) & @call
create-lists.bat footer gtksourceviewmm.mak]
+!endif
+
+!if [for /f %t in ('dir /ad /b ..\tests') do @for %s in (..\tests\%t\*.cc) do @echo
vs^$(VSVER)\^$(CFG)\^$(PLAT)\gtkmm-tests\%t-%~ns.obj: %s>>gtksourceviewmm.mak & @echo. if not exist ^$(@D)\
md ^$(@D)>>gtksourceviewmm.mak & @echo. ^$(CXX) ^$(GTKSOURCEVIEWMM_BASE_CXXFLAGS)
^$(GTKSOURCEVIEWMM_INCLUDES) ^$(CFLAGS) /Fo^$(@D)\%t-%~ns.obj /Fd^$(@D)\ ^$** /c>>gtksourceviewmm.mak &
@echo.>>gtksourceviewmm.mak]
+!endif
+
+!if [for /f %t in ('dir /ad /b ..\tests') do @call create-lists.bat header gtksourceviewmm.mak %t_OBJS &
@(for %s in (..\tests\%t\*.cc) do @call create-lists.bat file gtksourceviewmm.mak
vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm-tests\%t-%~ns.obj) & @call create-lists.bat footer gtksourceviewmm.mak]
+!endif
+
+!if [for /f %t in ('dir /ad /b ..\tests') do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%t.exe:
^$(GTKSOURCEVIEWMM_LIB) ^$(%t_OBJS)>>gtksourceviewmm.mak & @echo. link ^$(LDFLAGS) ^$**
^$(GTKSOURCEVIEWMM_DEP_LIBS) /out:^$@>>gtksourceviewmm.mak & @echo.>>gtksourceviewmm.mak]
+!endif
+
+!if [for %f in (gtksourceviewmm\buffer.h) do @if not exist ..\untracked\gtksourceview\%f if not exist
..\gtksourceview\%f if not exist vs$(VSVER)\$(CFG)\$(PLAT)\%f (md
vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\private) & ($(PERL) -- $(GMMPROC_DIR)/gmmproc -I ../codegen/m4 -I
$(GMMPROC_GTK_DIR) -I $(GMMPROC_PANGO_DIR) -I $(GMMPROC_ATK_DIR) --defs ../gtksourceview/src buffer
../gtksourceview/src vs$(VSVER)/$(CFG)/$(PLAT)/gtksourceviewmm)]
+!endif
+
+!if [for %d in (vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm ..\untracked\gtksourceview\gtksourceviewmm
..\gtksourceview\gtksourceviewmm) do @if exist %d\buffer.h call get-gmmproc-ver
%d\buffer.h>>gtksourceviewmm.mak]
+!endif
+
+!include gtksourceviewmm.mak
+
+!if [del /f /q gtksourceviewmm.mak]
+!endif
+
+!if "$(GMMPROC_VER)" >= "2.64.3"
+GTKSOURCEVIEWMM_INT_TARGET = vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm
+GTKSOURCEVIEWMM_DEF_LDFLAG =
+!else
+GTKSOURCEVIEWMM_INT_TARGET = vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\gtksourceviewmm.def
+GTKSOURCEVIEWMM_DEF_LDFLAG = /def:$(GTKSOURCEVIEWMM_INT_TARGET)
+GTKSOURCEVIEWMM_BASE_CXXFLAGS = $(GTKSOURCEVIEWMM_BASE_CXXFLAGS) /DGTKSOURCEVIEWMM_USE_GENDEF
+!endif
diff --git a/MSVC_NMake/create-lists.bat b/MSVC_NMake/create-lists.bat
new file mode 100644
index 0000000..ef60d5c
--- /dev/null
+++ b/MSVC_NMake/create-lists.bat
@@ -0,0 +1,42 @@
+@echo off
+rem Simple .bat script for creating the NMake Makefile snippets.
+
+if not "%1" == "header" if not "%1" == "file" if not "%1" == "footer" goto :error_cmd
+if "%2" == "" goto error_no_destfile
+
+if "%1" == "header" goto :header
+if "%1" == "file" goto :addfile
+if "%1" == "footer" goto :footer
+
+:header
+if "%3" == "" goto error_var
+echo %3 = \>>%2
+goto done
+
+:addfile
+if "%3" == "" goto error_file
+echo. %3 \>>%2
+goto done
+
+:footer
+echo. $(NULL)>>%2
+echo.>>%2
+goto done
+
+:error_cmd
+echo Specified command '%1' was invalid. Valid commands are: header file footer.
+goto done
+
+:error_no_destfile
+echo Destination NMake snippet file must be specified
+goto done
+
+:error_var
+echo A name must be specified for using '%1'.
+goto done
+
+:error_file
+echo A file must be specified for using '%1'.
+goto done
+
+:done
\ No newline at end of file
diff --git a/MSVC_NMake/detectenv-msvc.mak b/MSVC_NMake/detectenv-msvc.mak
new file mode 100644
index 0000000..5d2f78a
--- /dev/null
+++ b/MSVC_NMake/detectenv-msvc.mak
@@ -0,0 +1,163 @@
+# Change this (or specify PREFIX= when invoking this NMake Makefile) if
+# necessary, so that the libs and headers of the dependent third-party
+# libraries can be located. For instance, if building from GLib's
+# included Visual Studio projects, this should be able to locate the GLib
+# build out-of-the-box if they were not moved. GLib's headers will be
+# found in $(GLIB_PREFIX)\include\glib-2.0 and
+# $(GLIB_PREFIX)\lib\glib-2.0\include and its import library will be found
+# in $(GLIB_PREFIX)\lib.
+
+!if "$(PREFIX)" == ""
+PREFIX = ..\..\vs$(VSVER)\$(PLAT)
+!endif
+
+# Location of the PERL interpreter, for running glib-mkenums. glib-mkenums
+# needs to be found in $(PREFIX)\bin. Using either a 32-bit or x64 PERL
+# interpreter are supported for either a 32-bit or x64 build.
+
+!if "$(PERL)" == ""
+PERL = perl
+!endif
+
+# Location of the Python interpreter, for building introspection. The complete set
+# of Python Modules for introspection (the giscanner Python scripts and the _giscanner.pyd
+# compiled module) needs to be found in $(PREFIX)\lib\gobject-introspection\giscanner, and
+# the g-ir-scanner Python script and g-ir-compiler utility program needs to be found
+# in $(PREFIX)\bin, together with any DLLs they will depend on, if those DLLs are not already
+# in your PATH.
+# Note that the Python interpreter and the introspection modules and utility progam must
+# correspond to the build type (i.e. 32-bit Release for 32-bit Release builds, and so on).
+#
+# For introspection, currently only Python 2.7.x is supported. This may change when Python 3.x
+# support is added upstream in gobject-introspection--when this happens, the _giscanner.pyd must
+# be the one that is built against the release series of Python that is used here.
+
+!if "$(PYTHON)" == ""
+PYTHON = python
+!endif
+
+# Location of the pkg-config utility program, for building introspection. It needs to be able
+# to find the pkg-config (.pc) files so that the correct libraries and headers for the needed libraries
+# can be located, using PKG_CONFIG_PATH. Using either a 32-bit or x64 pkg-config are supported for
+# either a 32-bit or x64 build.
+
+!if "$(PKG_CONFIG)" == ""
+PKG_CONFIG = pkg-config
+!endif
+
+# The items below this line should not be changed, unless one is maintaining
+# the NMake Makefiles. The exception is for the CFLAGS_ADD line(s) where one
+# could use his/her desired compiler optimization flags, if he/she knows what is
+# being done.
+
+# 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)
+MSG = ^
+This Makefile is only for Visual Studio 2008 and later.^
+You need to ensure that the Visual Studio Environment is properly set up^
+before running this Makefile.
+!error $(MSG)
+!endif
+
+ERRNUL = 2>NUL
+_HASH=^#
+
+!if ![echo VCVERSION=_MSC_VER > vercl.x] \
+ && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \
+ && ![echo PLAT=Win32 >> vercl.x] \
+ && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
+ && ![echo PLAT=x64 >> vercl.x] \
+ && ![echo $(_HASH)elif defined(_M_ARM64) >> vercl.x] \
+ && ![echo PLAT=arm64 >> vercl.x] \
+ && ![echo $(_HASH)endif >> vercl.x] \
+ && ![cl -nologo -TC -P vercl.x $(ERRNUL)]
+!include vercl.i
+!if ![echo VCVER= ^\> vercl.vc] \
+ && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc]
+!include vercl.vc
+!endif
+!endif
+!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
+!endif
+
+VSVER = 0
+PDBVER = 0
+VSVER_SUFFIX = 0
+
+!if $(VCVERSION) > 1499 && $(VCVERSION) < 1600
+PDBVER = 9
+!elseif $(VCVERSION) > 1599 && $(VCVERSION) < 1700
+PDBVER = 10
+!elseif $(VCVERSION) > 1699 && $(VCVERSION) < 1800
+PDBVER = 11
+!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
+PDBVER = 12
+!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000
+PDBVER = 14
+!if $(VCVERSION) > 1909 && $(VCVERSION) < 1920
+VSVER_SUFFIX = 1
+VSVER = 15
+!elseif $(VCVERSION) > 1919 && $(VCVERSION) < 2000
+VSVER_SUFFIX = 2
+VSVER = 16
+!else
+VSVER = $(PDBVER)
+!endif
+!else
+VSVER = $(PDBVER)
+!endif
+
+!if "$(VSVER)" == "0"
+MSG = ^
+This NMake Makefile set supports Visual Studio^
+9 (2008) through 16 (2019). Your Visual Studio^
+version is not supported.
+!error $(MSG)
+!endif
+
+VALID_CFGSET = FALSE
+!if "$(CFG)" == "release" || "$(CFG)" == "Release" || "$(CFG)" == "debug" || "$(CFG)" == "Debug"
+VALID_CFGSET = TRUE
+!endif
+
+# One may change these items, but be sure to test
+# the resulting binaries
+!if "$(CFG)" == "release" || "$(CFG)" == "Release"
+CFLAGS_ADD_NO_GL = /MD /O2 /MP
+CFLAGS_ADD = $(CFLAGS_ADD_NO_GL) /GL
+!if "$(VSVER)" != "9"
+CFLAGS_ADD = $(CFLAGS_ADD) /d2Zi+
+CFLAGS_ADD_NO_GL = $(CFLAGS_ADD_NO_GL) /d2Zi+
+!endif
+!else
+CFLAGS_ADD = /MDd /Od
+CFLAGS_ADD_NO_GL = $(CFLAGS_ADD)
+!endif
+
+!if "$(PLAT)" == "x64"
+LDFLAGS_ARCH = /machine:x64
+!elseif "$(PLAT)" == "arm64"
+LDFLAGS_ARCH = /machine:arm64
+!else
+LDFLAGS_ARCH = /machine:x86
+!endif
+
+!if "$(VALID_CFGSET)" == "TRUE"
+CFLAGS_NOGL = $(CFLAGS_ADD_NO_GL) /W3 /Zi
+CFLAGS = $(CFLAGS_ADD) /W3 /Zi
+
+LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(PREFIX)\lib /DEBUG
+
+!if "$(CFG)" == "debug" || "$(CFG)" == "Debug"
+ARFLAGS_NOLTCG = $(LDFLAGS_ARCH)
+ARFLAGS = $(LDFLAGS_ARCH)
+LDFLAGS_NOLTCG = $(LDFLAGS_BASE)
+LDFLAGS = $(LDFLAGS_BASE)
+!else
+ARFLAGS_NOLTCG = $(LDFLAGS_ARCH) /LTCG
+ARFLAGS = $(ARFLAGS_NOLTCG) /LTCG
+LDFLAGS_NOLTCG = $(LDFLAGS_BASE) /opt:ref
+LDFLAGS = $(LDFLAGS_NOLTCG) /LTCG
+!endif
+!endif
diff --git a/MSVC_NMake/filelist.am b/MSVC_NMake/filelist.am
new file mode 100644
index 0000000..570816b
--- /dev/null
+++ b/MSVC_NMake/filelist.am
@@ -0,0 +1,16 @@
+## This file is part of gtkmm.
+
+msvc_nmake_data = \
+ README \
+ build-rules-msvc.mak \
+ config-msvc.mak \
+ create-lists-msvc.mak \
+ create-lists.bat \
+ detectenv-msvc.mak \
+ filelist.am \
+ generate-msvc.mak \
+ gendef/gendef.cc \
+ get-gmmproc-ver.bat \
+ info-msvc.mak \
+ install.mak \
+ Makefile.vc
diff --git a/MSVC_NMake/gendef/gendef.cc b/MSVC_NMake/gendef/gendef.cc
new file mode 100644
index 0000000..db2dd09
--- /dev/null
+++ b/MSVC_NMake/gendef/gendef.cc
@@ -0,0 +1,106 @@
+/*
+ * MICO --- an Open Source CORBA implementation
+ * Copyright (c) 2003 Harald B�hme
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * For more information, visit the MICO Home Page at
+ * http://www.mico.org/
+ */
+
+/* Modified by Cedric Gustin <cedric gustin gmail com> on 2006/01/13 :
+ * Redirect the output of dumpbin to dumpbin.out instead of reading the
+ * output stream of popen, as it fails with Visual Studio 2005 in
+ * pre-link build events.
+ */
+
+#include <iostream>
+#include <fstream>
+#include <stdio.h>
+
+using namespace std;
+
+int main(int argc,char** argv)
+{
+ if (argc < 4) {
+ cerr << "Usage: " << argv[0] << " <def-file-name> <dll-base-name> <obj-file> ...." << endl;
+ return 2;
+ }
+
+ // CG : Explicitly redirect stdout to dumpbin.out.
+ string dumpbin = "dumpbin /SYMBOLS /OUT:dumpbin.out";
+ int i = 3;
+
+ for(;i<argc;) {
+ dumpbin += " ";
+ dumpbin += argv[i++];
+ }
+
+ FILE * dump;
+
+ if( (dump = _popen(dumpbin.c_str(),"r")) == NULL ) {
+ cerr << "could not popen dumpbin" << endl;
+ return 3;
+ }
+
+ // CG : Wait for the dumpbin process to finish and open dumpbin.out.
+ _pclose(dump);
+ dump=fopen("dumpbin.out","r");
+
+ ofstream def_file(argv[1]);
+
+ def_file << "LIBRARY " << argv[2] << endl;
+ def_file << "EXPORTS" << endl;
+
+ i=0;
+ while( !feof(dump)) {
+ char buf [65000];
+
+ if( fgets( buf, 64999, dump ) != NULL ) {
+ if(!strstr(buf," UNDEF ") && strstr(buf," External ")) {
+ char *s = strchr(buf,'|') + 1;
+ while(*s == ' ' || *s == '\t') s++;
+ char *e=s;
+ while(*e != ' ' && *e != '\t' && *e != '\0' && *e!= '\n') e++;
+ *e = '\0';
+
+#if (_MSC_VER >= 1900)
+ /* Filter out these symbols as they are done inline in the
+ * compiler-shipped headers, so that things can link properly on
+ * later Visual Studio versions. Unfortunately we can't just
+ * link to legacy_stdio_definitions.lib, so this list below may
+ * continue to grow.
+ */
+ if (_stricmp(s, "__local_stdio_printf_options") != 0 &&
+ _stricmp(s, "_vsnprintf_l") != 0 &&
+ _stricmp(s, "_vsprintf_l") != 0) {
+#endif
+ if(strchr(s,'?')==0 && s[0]=='_' && strchr(s,'@') == 0 )//this is a C export
type: _fct -> fct
+ def_file << " " << (s+1) << endl;
+ else if(strchr(s,'?')!=0 && strncmp(s,"??_G",4)!=0 && strncmp(s,"??_E",4)!=0)
+ def_file << " " << s << endl;
+#if (_MSC_VER >= 1900)
+ }
+#endif
+ }
+ }
+ }
+
+ // CG : Close dumpbin.out and delete it.
+ fclose(dump);
+ remove("dumpbin.out");
+
+ cout << dumpbin.c_str() << endl;
+}
diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak
new file mode 100644
index 0000000..b594d24
--- /dev/null
+++ b/MSVC_NMake/generate-msvc.mak
@@ -0,0 +1,49 @@
+# NMake Makefile portion for code generation and
+# intermediate build directory creation
+# Items in here should not need to be edited unless
+# one is maintaining the NMake build files.
+
+# Create the build directories
+
+vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm:
+ @-md $@
+
+# Generate .def files
+vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\gtksourceviewmm.def: $(GENDEF)
vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm $(gtksourceviewmm_OBJS)
+ vs$(VSVER)\$(CFG)\$(PLAT)\gendef.exe $@ $(GTKSOURCEVIEWMM_DLLNAME).dll
vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\*.obj
+
+# Generate wrap_init.cc files
+vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\wrap_init.cc: $(gtksourceviewmm_real_hg)
+ @if not exist ..\gdk\gtksourceviewmm\wrap_init.cc $(PERL) -- "$(GMMPROC_DIR)/generate_wrap_init.pl"
--namespace=Gsv --parent_dir=gtksourceviewmm $(gtksourceviewmm_real_hg:\=/)>$@
+
+prep-git-build: pkg-ver.mak
+
+#gtksourceviewmm\gtksourceviewmm.rc: ..\configure.ac
+
+# You may change GTKSOURCEVIEWMM_DISABLE_DEPRECATED and GTKSOURCEVIEWMM_STATIC_LIB if you know what you are
doing
+
+..\gtksourceview\gtksourceviewmmconfig.h: ..\configure.ac ..\gtksourceview\gtksourceviewmmconfig.h.in
+ @if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
+ @if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build
+ @if "$(DO_REAL_GEN)" == "1" echo Generating $@...
+ @if "$(DO_REAL_GEN)" == "1" copy ..\gtksourceview\$(@F).in $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GTKSOURCEVIEWMM_DISABLE_DEPRECATED/\/\*
\#undef GTKSOURCEVIEWMM_DISABLE_DEPRECATED \*\//g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GTKSOURCEVIEWMM_STATIC_LIB/\/\* \#undef
GTKSOURCEVIEWMM_STATIC_LIB \*\//g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GTKSOURCEVIEWMM_MAJOR_VERSION/\#define
GTKSOURCEVIEWMM_MAJOR_VERSION $(PKG_MAJOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GTKSOURCEVIEWMM_MINOR_VERSION/\#define
GTKSOURCEVIEWMM_MINOR_VERSION $(PKG_MINOR_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef GTKSOURCEVIEWMM_MICRO_VERSION/\#define
GTKSOURCEVIEWMM_MICRO_VERSION $(PKG_MICRO_VERSION)/g" $@
+ @if "$(DO_REAL_GEN)" == "1" del $@.bak
+
+pkg-ver.mak: ..\configure.ac
+ @echo Generating version info Makefile Snippet...
+ @$(PERL) -00 -ne "print if /AC_INIT\(/" $** | \
+ $(PERL) -pe "tr/, /\n/s" | \
+ $(PERL) -ne "print if 2 .. 2" | \
+ $(PERL) -ne "print /\[(.*)\]/" > ver.txt
+ @echo @echo off>pkg-ver.bat
+ @echo.>>pkg-ver.bat
+ @echo set /p glibmm_ver=^<ver.txt>>pkg-ver.bat
+ @echo for /f "tokens=1,2,3 delims=." %%%%a IN ("%glibmm_ver%") do (echo PKG_MAJOR_VERSION=%%%%a^&
echo PKG_MINOR_VERSION=%%%%b^& echo PKG_MICRO_VERSION=%%%%c)^>$@>>pkg-ver.bat
+ @pkg-ver.bat
+ @del ver.txt pkg-ver.bat
+ $(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 ..\gtksourceview\gtksourceviewmmconfig.h
diff --git a/MSVC_NMake/get-gmmproc-ver.bat b/MSVC_NMake/get-gmmproc-ver.bat
new file mode 100644
index 0000000..f9b340f
--- /dev/null
+++ b/MSVC_NMake/get-gmmproc-ver.bat
@@ -0,0 +1,34 @@
+@echo off
+REM get-gmmproc-ver: Grab first line of a gmmproc-generated
+REM .h file to see which version of gmmproc is used to
+REM generate the header
+
+if "%1" == "" goto :usage
+
+call :print_first_line %1
+goto :eof
+
+:print_first_line
+setlocal EnableDelayedExpansion
+set /a line=0
+
+for /f ^"usebackq^ eol^=^ delims^=^" %%l in (%1) do (
+ if "!line!" == "1" goto :eof
+ echo %%l>tmp.txt
+ for /f "tokens=1-5" %%a in (tmp.txt) do (
+ if not "%%a" == "//" goto :not_gmmproc
+ if not "%%b" == "Generated" goto :not_gmmproc
+ if not "%%c" == "by" goto :not_gmmproc
+ if not "%%d" == "gmmproc" goto :not_gmmproc
+ echo GMMPROC_VER=%%e
+ )
+ del /f tmp.txt
+ set /a line+=1
+)
+
+:not_gmmproc
+echo This is not a gmmproc generated file.
+goto :eof
+
+:usage
+echo Usage: get-gmmproc-ver ^<generated-header^>
\ No newline at end of file
diff --git a/MSVC_NMake/info-msvc.mak b/MSVC_NMake/info-msvc.mak
new file mode 100644
index 0000000..7019f6a
--- /dev/null
+++ b/MSVC_NMake/info-msvc.mak
@@ -0,0 +1,60 @@
+# NMake Makefile portion for displaying config info
+
+all-build-info:
+ @echo.
+ @echo ----------
+ @echo Build info
+ @echo ---------
+ @echo Build Type: $(CFG)
+
+help:
+ @echo.
+ @echo ================================
+ @echo Building gtksourcemm Using NMake
+ @echo ================================
+ @echo nmake /f Makefile.vc CFG=[release^|debug] ^<PREFIX=PATH^> ^<option1=xxx option2=xxx^>
+ @echo.
+ @echo Where:
+ @echo ------
+ @echo CFG: Required, use CFG=release for an optimized build and CFG=debug
+ @echo for a debug build. PDB files are generated for all builds.
+ @echo.
+ @echo PREFIX: Optional, the path where dependent libraries and tools may be
+ @echo found, default is ^$(srcrootdir)\..\vs^$(short_vs_ver)\^$(platform),
+ @echo where ^$(short_vs_ver) is 12 for VS 2013, and 14 for VS 2015~2019
+ @echo and so on; and ^$(platform) is Win32 for 32-bit builds and x64 for
+ @echo x64 builds.
+ @echo.
+ @echo USE_MESON_LIBS: Use this if linking to Meson-built
+ @echo variants of glibmm, pangomm and libsigc++ is desired.
+ @echo By using this option, gtkmm, pangomm, atkmm and cairomm
+ @echo should be linked to the Meson-built variants of
+ @echo glibmm and libsigc++ as well.
+ @echo.
+ @echo GMMPROC_DIR, GMMPROC_PANGO_DIR, GMMPROC_ATK_DIR, GMMPROC_GTK_DIR:
+ @echo Required if building directly from a GIT checkout,
+ @echo or re-generating the source files from the .hg/.ccg
+ @echo files. GMMPROC_GTK_DIR, GMMPROC_PANGO_DIR and GMMPROC_ATK_DIR are by
+ @echo default in , ^$(GMMPROC_DIR)/../../gtkmm-$(GTKMM_MAJOR_VERSION).$(GTKMM_MINOR_VERSION)/proc/m4,
+ @echo ^$(GMMPROC_DIR)/../../pangomm-$(PANGOMM_MAJOR_VERSION).$(PANGOMM_MINOR_VERSION)/proc/m4
+ @echo and ^$(GMMPROC_DIR)/../../atkmm-$(ATKMM_MAJOR_VERSION).$(ATKMM_MINOR_VERSION)/proc/m4
respectively.
+ @echo PERL with XML::Parser and some common *nix commands
+ @echo are required, as well as the .m4 and PERL files from
+ @echo glibmm, atkmm, pangomm and gtkmm, which will be used by
+ @echo gmmproc.
+ @echo.
+ @echo ======
+ @echo A 'clean' target is supported to remove all generated files, intermediate
+ @echo object files and binaries for the specified configuration.
+ @echo.
+ @echo An 'install' target is supported to copy the build (DLLs, utility programs,
+ @echo LIBs, along with the introspection files if applicable) to appropriate
+ @echo locations under ^$(PREFIX).
+ @echo.
+ @echo A 'prep-git-build' target is supported for building from GIT checkouts, which
+ @echo will generate gtksourceviewmmconfig.h. Use this target before building
+ @echo any other targets when building from GIT checkouts.
+ @echo.
+ @echo A 'tests' target is supported to build the gtksourceviewmm's test programs.
+ @echo ======
+ @echo.
diff --git a/MSVC_NMake/install.mak b/MSVC_NMake/install.mak
new file mode 100644
index 0000000..df7b3f2
--- /dev/null
+++ b/MSVC_NMake/install.mak
@@ -0,0 +1,17 @@
+# NMake Makefile snippet for copying the built libraries, utilities and headers to
+# a path under $(PREFIX).
+
+install: all
+ @if not exist $(PREFIX)\bin\ md $(PREFIX)\bin
+ @if not exist
$(PREFIX)\lib\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\include\ md
$(PREFIX)\lib\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\include
+ @if not exist
$(PREFIX)\include\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\gtksourceviewmm\private\
@md
$(PREFIX)\include\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\gtksourceviewmm\private
+ @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(GTKSOURCEVIEWMM_LIBNAME).dll $(PREFIX)\bin
+ @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(GTKSOURCEVIEWMM_LIBNAME).pdb $(PREFIX)\bin
+ @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(GTKSOURCEVIEWMM_LIBNAME).lib $(PREFIX)\lib
+ @copy ..\gtksourceview\gtksourceviewmm.h
"$(PREFIX)\include\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\"
+ @copy "..\gtksourceview\gtksourceviewmmconfig.h"
"$(PREFIX)\lib\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\include\"
+ @for %h in ($(GTKSOURCEVIEWMM_INT_EXTRA_HEADERS)) do @copy ..\gtksourceview\gtksourceviewmm\%h
"$(PREFIX)\include\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\gtksourceviewmm\%h"
+ @for %h in ($(GTKSOURCEVIEWMM_INT_GENERATED_HEADERS)) do @if exist
..\gtksourceview\gtksourceviewmm\%h copy ..\gtksourceview\gtksourceviewmm\%h
"$(PREFIX)\include\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\gtksourceviewmm\%h"
+ @for %h in ($(GTKSOURCEVIEWMM_INT_GENERATED_HEADERS)) do @if exist
vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\%h copy vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\%h
"$(PREFIX)\include\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\gtksourceviewmm\%h"
+ @for %h in ($(GTKSOURCEVIEWMM_HG_FILES)) do @if exist
..\gtksourceview\gtksourceviewmm\private\%~nh_p.h copy ..\gtksourceview\gtksourceviewmm\private\%~nh_p.h
"$(PREFIX)\include\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\gtksourceviewmm\private\%~nh_p.h"
+ @for %h in ($(GTKSOURCEVIEWMM_HG_FILES)) do @if exist
vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\private\%~nh_p.h copy
vs$(VSVER)\$(CFG)\$(PLAT)\gtksourceviewmm\private\%~nh_p.h
"$(PREFIX)\include\gtksourceviewmm-$(GTKSOURCEVIEWMM_MAJOR_VERSION).$(GTKSOURCEVIEWMM_MINOR_VERSION)\gtksourceviewmm\private\%~nh_p.h"
diff --git a/Makefile.am b/Makefile.am
index 92972f4..575b0c2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,4 +28,9 @@ nodist_gtksourceviewmm_libinclude_HEADERS = gtksourceview/gtksourceviewmmconfig.
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = gtksourceview/$(GTKSOURCEVIEWMM_MODULE_NAME).pc
+include $(srcdir)/MSVC_NMake/filelist.am
+
+msvc_files = $(addprefix MSVC_NMake/,$(msvc_nmake_data))
+dist_noinst_DATA = $(msvc_files)
+
include $(top_srcdir)/build/dist-changelog.am
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]