[amtk/nmake.improvements: 1/2] Visual Studio builds: Fix Python and PERL handling



commit a43e36df70a1db8d55debffeddeb6c9d7912049e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Jul 14 14:46:06 2020 +0800

    Visual Studio builds: Fix Python and PERL handling
    
    We may not be building the introspection files, so the build would likely fail
    if we do not pass in PYTHON=... in the NMake command line, even if a Python
    interpreter is in the PATH, unless introspection files are being built, because
    we are running glib-mkenums, which will make use of Python (or, PERL, for older
    versions).
    
    Fix this by moving where we set up the PYTHON path so that it will be set up
    for all builds.
    
    Likewise, make sure we set up a default value for calling PERL, so that if it
    is to be used, we can opt to pass in the full path of the PERL interpreter, or
    make sure the PERL interpreter is indeed in the PATH.

 win32/config-msvc.mak.in     | 18 ++++++++++++++++++
 win32/introspection-msvc.mak | 11 -----------
 2 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/win32/config-msvc.mak.in b/win32/config-msvc.mak.in
index bc1d5a7..1bf999b 100644
--- a/win32/config-msvc.mak.in
+++ b/win32/config-msvc.mak.in
@@ -30,6 +30,24 @@ LIBINTL_LIB = intl.lib
 GLIB_MKENUMS=$(PREFIX)\bin\glib-mkenums
 !endif
 
+# Note: The PYTHON must be the Python release series that was used to build
+# the GObject-introspection scanner Python module, if building the introspection
+# files are desired!
+# Either having python.exe your PATH will work or passing in
+# PYTHON=<full path to your Python interpretor> will do.  If not building the
+# introspection files, any recent Python 2.7.x/3.x installation should do.
+!if "$(PYTHON)" == ""
+PYTHON=python
+!endif
+
+# PERL interpreter, required for running the legacy versions of glib-mkenum that is
+# written in PERL (i.e. LEGACY_GLIB_MKENUMS is used in the NMake command line).
+# Either having perl.exe in your PATH will work or passing in
+# PERL=<full path to your PERL interpreter> will do.
+!if "$(PERL)" == ""
+PERL=perl
+!endif
+
 LDFLAGS = $(LDFLAGS) /libpath:$(LIBDIR)
 
 # These are the base minimum libraries required for building amtk.
diff --git a/win32/introspection-msvc.mak b/win32/introspection-msvc.mak
index e395a2d..83fc60b 100644
--- a/win32/introspection-msvc.mak
+++ b/win32/introspection-msvc.mak
@@ -22,17 +22,6 @@ PKG_CONFIG_PATH=$(PREFIX_LIB_FULL)\pkgconfig;$(PKG_CONFIG_PATH)
 !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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]