From cd55690be5d0e7f62f656494d1c36954ac677ce9 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 12 Jul 2017 12:27:44 +0800 Subject: Visual Studio builds: Adapt to the Python-fied glib-genmarshal glib-genmarshal is used for the Visual Studio builds, and has been recently converted to a Python script instead of a compiled C program. Since Visual Studio calls cmd.exe to run Custom Build steps, we need to call Python explicitly to run glib-genmarshal as shebang lines are not supported in cmd.exe, which means that Python will become a hard build-time requirement instead of being optional. This also means that the atk.pc pkg-config file will always be generated. However, since ATK does not yet require a really recent GLib, maintain compatibility with older GLib by calling glib-genmarshal.exe when the glib-genmarshal Python script is not found. --- win32/vs10/README.txt | 7 +++++++ win32/vs10/atk-gen-src.props | 20 +++++++++++++++----- win32/vs10/atk-install.propsin | 7 ++++--- win32/vs10/atk.vcxprojin | 21 +++++++++------------ win32/vs9/README.txt | 6 ++++++ win32/vs9/atk-gen-src.vsprops | 17 +++++++++++++++-- win32/vs9/atk-install.vspropsin | 7 ++++--- win32/vs9/atk.vcprojin | 4 ++-- 8 files changed, 62 insertions(+), 27 deletions(-) diff --git a/win32/vs10/README.txt b/win32/vs10/README.txt index 1efbcfa..b394757 100644 --- a/win32/vs10/README.txt +++ b/win32/vs10/README.txt @@ -16,6 +16,13 @@ into atk.vcxproj and atk.vcxproj.filters respectively. The dependencies for this package are gettext-runtime (libintl), GLib* and ZLib. +You will also need a Python 2.7.x or 3.x installation, as Python will be +used to run glib-genmarshal, which was converted into a Python script from +a compiled C program, in addition to generating the atk.pc pkg-config +file for the build. See PythonPath (32-bit builds) or PythonPathX64 (x64 +builds) in atk-version-paths.props to see that they point to the correct paths. + + a) look for all of the dependencies (except GLib*) under http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32-bit) -OR- diff --git a/win32/vs10/atk-gen-src.props b/win32/vs10/atk-gen-src.props index 6abbcdc..d699f4f 100644 --- a/win32/vs10/atk-gen-src.props +++ b/win32/vs10/atk-gen-src.props @@ -7,13 +7,20 @@ if not exist ..\..\config.h copy ..\..\config.h.win32 ..\..\config.h cd ..\..\atk - -$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h - -$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c - +if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h +if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h +if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c +if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c cd $(SolutionDir) + +cd ..\..\atk +if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h +if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h +if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c +if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c +cd $(SolutionDir) + <_PropertySheetDisplayName>atkgensrcprops @@ -25,5 +32,8 @@ cd $(SolutionDir) $(GenMarshalSrc) + + $(GenMarshalSrcX64) + diff --git a/win32/vs10/atk-install.propsin b/win32/vs10/atk-install.propsin index b790fa8..81c2dc5 100644 --- a/win32/vs10/atk-install.propsin +++ b/win32/vs10/atk-install.propsin @@ -18,10 +18,11 @@ copy $(BinDir)\atk-$(ApiVersion).lib $(CopyDir)\lib mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk #include "atk.vs10.headers" -if exist ..\atk.pc (mkdir $(CopyDir)\lib\pkgconfig & copy ..\atk.pc $(CopyDir)\lib\pkgconfig) +mkdir $(CopyDir)\lib\pkgconfig +copy ..\atk.pc $(CopyDir)\lib\pkgconfig - if exist $(PythonPath)\python.exe $(PythonPath)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion) - if exist $(PythonPathX64)\python.exe $(PythonPathX64)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion) + $(PythonPath)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion) + $(PythonPathX64)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion) ..\atk.pc diff --git a/win32/vs10/atk.vcxprojin b/win32/vs10/atk.vcxprojin index 4f96b7c..b1c79d2 100644 --- a/win32/vs10/atk.vcxprojin +++ b/win32/vs10/atk.vcxprojin @@ -159,20 +159,17 @@ - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\config.h;%(Outputs) - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\config.h;%(Outputs) + Copying config.h from config.h.win32... + $(GenConfigH) + ..\..\config.h;%(Outputs) - Generating Marshalling Sources... - $(GenMarshalSrc) - ..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c;%(Outputs) - Generating Marshalling Sources... - $(GenMarshalSrc) - ..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c;%(Outputs) + Generating Marshalling Sources... + $(GenMarshalSrc) + ..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c;%(Outputs) + Generating Marshalling Sources... + $(GenMarshalSrcX64) + ..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c;%(Outputs) diff --git a/win32/vs9/README.txt b/win32/vs9/README.txt index ad90fe2..1798877 100644 --- a/win32/vs9/README.txt +++ b/win32/vs9/README.txt @@ -16,6 +16,12 @@ atk.vcproj. The dependencies for this package are gettext-runtime (libintl), GLib* and ZLib. +You will also need a Python 2.7.x or 3.x installation, as Python will be +used to run glib-genmarshal, which was converted into a Python script from +a compiled C program, in addition to generating the atk.pc pkg-config +file for the build. See PythonPath (32-bit builds) or PythonPathX64 (x64 +builds) in atk-version-paths.vsprops to see that they point to the correct paths. + a) look for all of the dependencies (except GLib*) under http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32-bit) -OR- diff --git a/win32/vs9/atk-gen-src.vsprops b/win32/vs9/atk-gen-src.vsprops index 7e39862..ccfcb68 100644 --- a/win32/vs9/atk-gen-src.vsprops +++ b/win32/vs9/atk-gen-src.vsprops @@ -13,9 +13,22 @@ Name="GenMarshalSrc" Value=" cd ..\..\atk -$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h -$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c +if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h +if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h +if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c +if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c cd $(SolutionDir) " /> + diff --git a/win32/vs9/atk-install.vspropsin b/win32/vs9/atk-install.vspropsin index aed8fd5..880dad5 100644 --- a/win32/vs9/atk-install.vspropsin +++ b/win32/vs9/atk-install.vspropsin @@ -19,15 +19,16 @@ copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\atk-$(ApiVersion).li mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk #include "atk.headers" -if exist ..\atk.pc (mkdir $(CopyDir)\lib\pkgconfig & copy ..\atk.pc $(CopyDir)\lib\pkgconfig) +mkdir $(CopyDir)\lib\pkgconfig +copy ..\atk.pc $(CopyDir)\lib\pkgconfig " /> diff --git a/win32/vs9/atk.vcprojin b/win32/vs9/atk.vcprojin index 69c354d..a51a747 100644 --- a/win32/vs9/atk.vcprojin +++ b/win32/vs9/atk.vcprojin @@ -222,7 +222,7 @@ @@ -230,7 +230,7 @@ -- cgit v1.2.1