From 7f9b0b8a52965e633703d9c2f118572a3de12bb6 Mon Sep 17 00:00:00 2001 From: "Fraser J. Gordon" Date: Tue, 23 Jun 2015 14:38:25 +0100 Subject: [PATCH 1/6] Don't attempt to locate Perl from within Gyp --- config/perl.gypi | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/config/perl.gypi b/config/perl.gypi index 234360b4448..c0a923dc3e6 100644 --- a/config/perl.gypi +++ b/config/perl.gypi @@ -1,17 +1,6 @@ { 'variables': { - 'conditions': - [ - [ - 'host_os == "win"', - { - 'perl': [ 'C:/perl/bin/perl.exe' ], - }, - { - 'perl': [ 'perl' ], - }, - ], - ], + 'perl%': [ 'perl' ], }, } From 47ffb186750d7c02bc7745efd05d20d73a48e124 Mon Sep 17 00:00:00 2001 From: "Fraser J. Gordon" Date: Tue, 23 Jun 2015 14:38:57 +0100 Subject: [PATCH 2/6] Improve the Windows configure script to detect Python and Perl itself --- configure.bat | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/configure.bat b/configure.bat index 9eed4dfecd3..2d2fc87b25a 100644 --- a/configure.bat +++ b/configure.bat @@ -1,3 +1,40 @@ -python.exe gyp\gyp_main.py --format msvs --depth . --generator-output build-win-x86/livecode -Gmsvs_version=2010 +@echo off +REM Configures the Windows build + +SETLOCAL EnableExtensions + +REM Attempt to locate a copy of Perl +WHERE /Q perl 1>NUL 2>NUL +IF %ERRORLEVEL% NEQ 0 ( + IF EXIST C:\perl64\bin\perl.exe ( + SET extra_options=%extra_options% -Dperl="C:/perl64/bin/perl.exe" + ) ELSE IF EXIST C:\perl\bin\perl.exe ( + SET extra_options=%extra_options% -Dperl="C:/perl/bin/perl.exe" + ) ELSE ( + ECHO >&2 Error: could not locate a copy of perl + PAUSE + EXIT 1 + ) +) + +REM Attempt to locate a copy of Python +WHERE /Q python 1>NUL 2>NUL +IF %ERRORLEVEL% NEQ 0 ( + IF EXIST C:\Python27\python.exe ( + SET python=C:\Python27\python.exe + ) ELSE ( + ECHO >&2 Error: could not locate a copy of python + PAUSE + EXIT 1 + ) +) ELSE ( + SET python=python +) + +REM Run the configure step +%python% gyp\gyp_main.py --format msvs --depth . --generator-output build-win-x86/livecode -Gmsvs_version=2010 %extra_options% + +REM Pause if there was an error so that the user gets a chance to see it +IF %ERRORLEVEL% NEQ 0 PAUSE EXIT %ERRORLEVEL% From 886a64a91b972ed97c122bb01d450892fa399c85 Mon Sep 17 00:00:00 2001 From: "Fraser J. Gordon" Date: Tue, 23 Jun 2015 14:46:23 +0100 Subject: [PATCH 3/6] Add a default Perl location when configuring for Win32 through config.sh --- config.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.sh b/config.sh index ecbc22b6144..184bde104f3 100755 --- a/config.sh +++ b/config.sh @@ -258,6 +258,9 @@ if test -z "$TARGET_ARCH"; then esac fi +# Location of Perl when running Windows builds +WIN32_PERL=${WIN32_PERL:-"C:/perl/bin/perl.exe"} + # Android default settings and tools ANDROID_BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-22.0.1} ANDROID_JAVA_SDK=${ANDROID_JAVA_SDK:-${JAVA_SDK:-/usr/lib/jvm/java-7-openjdk-amd64}} @@ -310,7 +313,8 @@ case ${OS} in "-Gandroid_ndk_version=${ANDROID_NDK_VERSION}" "$@" ;; win) - invoke_gyp $basic_args "-Gmsvs_version=${WIN_MSVS_VERSION}" "$@" + invoke_gyp $basic_args "-Gmsvs_version=${WIN_MSVS_VERSION}" \ + "-Dperl=${WIN32_PERL}" "$@" ;; mac|ios) invoke_gyp $basic_args "-DOS=${OS}" \ From 6170378e1cccda2cb5cc02fb50c7b7a8c8c334dd Mon Sep 17 00:00:00 2001 From: "Fraser J. Gordon" Date: Tue, 23 Jun 2015 15:17:51 +0100 Subject: [PATCH 4/6] Win32 configure.bat gives errors/warnings for missing SDKs A mising QuickTime SDK will result in an error while missing speech SDKs will warn that revSpeech will not build. --- config/win32.gypi | 6 +++--- configure.bat | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/config/win32.gypi b/config/win32.gypi index c8dac4c50e3..dc7852f6e90 100644 --- a/config/win32.gypi +++ b/config/win32.gypi @@ -2,11 +2,11 @@ 'variables': { # Path to the Windows SDK for Apple QuickTime - 'quicktime_sdk': '$(foo)C:/Program Files/QuickTime SDK', + 'quicktime_sdk%': '$(foo)C:/Program Files/QuickTime SDK', # Path to versions 4 and 5 of the Microsoft Speech SDK - 'ms_speech_sdk4': '$(foo)C:/Program Files/Microsoft Speech SDK', - 'ms_speech_sdk5': '$(foo)C:/Program Files/Microsoft Speech SDK 5.1', + 'ms_speech_sdk4%': '$(foo)C:/Program Files/Microsoft Speech SDK', + 'ms_speech_sdk5%': '$(foo)C:/Program Files/Microsoft Speech SDK 5.1', 'output_dir': '../win-<(target_arch)-bin', }, diff --git a/configure.bat b/configure.bat index 2d2fc87b25a..b0fe39bc843 100644 --- a/configure.bat +++ b/configure.bat @@ -3,6 +3,16 @@ REM Configures the Windows build SETLOCAL EnableExtensions +REM Set this variable if any warnings have been reported +SET warnings=0 + +REM Not all versions of windows the the %programfiles(x86)% variable +IF NOT DEFINED programfiles(x86) SET programfiles(x86)=%programfiles% + +REM Note: to test whether a directory exists in batch script, you need to check +REM whether a file within that directory exists. Easiest way to do this is to +REM add the "*" wildcard after the directory + REM Attempt to locate a copy of Perl WHERE /Q perl 1>NUL 2>NUL IF %ERRORLEVEL% NEQ 0 ( @@ -31,6 +41,34 @@ IF %ERRORLEVEL% NEQ 0 ( SET python=python ) +REM Attempt to locate the QuickTime SDK +IF EXIST "%programfiles(x86)%\QuickTime SDK\*" ( + SET extra_options=%extra_options% -Dquicktime_sdk="%programfiles(x86)%/QuickTime SDK" +) ELSE ( + ECHO >&2 Error: could not locate the QuickTime SDK + PAUSE + EXIT 1 +) + +REM Attempt to locate the Microsoft Speech SDK v5.1 +IF EXIST "%programfiles(x86)%\Microsoft Speech SDK 5.1\*" ( + SET extra_options=%extra_options% -Dms_speech_sdk5="%programfiles(x86)%/Microsoft Speech SDK 5.1" +) ELSE ( + ECHO >&2 Warning: could not locate the Microsoft Speech SDK v5.1; revSpeech will not build + SET warnings=1 +) + +REM Attempt to locate the Microsoft Speech SDK v4 +IF EXIST "%programfiles(x86)%\Microsoft Speech SDK\*" ( + SET extra_options=%extra_options% -Dms_speech_sdk4="%programfiles(x86)%/Microsoft Speech SDK" +) ELSE ( + ECHO >&2 Warning: could not locate the Microsoft Speech SDK v4; revSpeech will not build + SET warnings=1 +) + +REM Pause so any warnings can be seen +IF %warnings% NEQ 0 PAUSE + REM Run the configure step %python% gyp\gyp_main.py --format msvs --depth . --generator-output build-win-x86/livecode -Gmsvs_version=2010 %extra_options% From 4939ff054ed5a6936aac4150a6a53bdc3699b2cc Mon Sep 17 00:00:00 2001 From: "Fraser J. Gordon" Date: Tue, 23 Jun 2015 15:36:12 +0100 Subject: [PATCH 5/6] Add support for Python2.6 to configure.bat --- configure.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.bat b/configure.bat index b0fe39bc843..3a5bc774838 100644 --- a/configure.bat +++ b/configure.bat @@ -32,6 +32,8 @@ WHERE /Q python 1>NUL 2>NUL IF %ERRORLEVEL% NEQ 0 ( IF EXIST C:\Python27\python.exe ( SET python=C:\Python27\python.exe + ) ELSE IF EXIST C:\Python26\python.exe ( + SET python=C:\Python26\python.exe ) ELSE ( ECHO >&2 Error: could not locate a copy of python PAUSE From af9f07ea6599d781b884bf05e42bcf9f818f80b0 Mon Sep 17 00:00:00 2001 From: Fraser Gordon Date: Tue, 23 Jun 2015 16:16:45 +0100 Subject: [PATCH 6/6] Rename WIN32_PERL -> WIN_PERL --- config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.sh b/config.sh index 184bde104f3..fde36f22291 100755 --- a/config.sh +++ b/config.sh @@ -259,7 +259,7 @@ if test -z "$TARGET_ARCH"; then fi # Location of Perl when running Windows builds -WIN32_PERL=${WIN32_PERL:-"C:/perl/bin/perl.exe"} +WIN_PERL=${WIN_PERL:-"C:/perl/bin/perl.exe"} # Android default settings and tools ANDROID_BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-22.0.1} @@ -314,7 +314,7 @@ case ${OS} in ;; win) invoke_gyp $basic_args "-Gmsvs_version=${WIN_MSVS_VERSION}" \ - "-Dperl=${WIN32_PERL}" "$@" + "-Dperl=${WIN_PERL}" "$@" ;; mac|ios) invoke_gyp $basic_args "-DOS=${OS}" \