Skip to content

Commit 40709f4

Browse files
Merge pull request livecode#2472 from livecodefraser/gyp-windows_config_tweaks
Gyp windows config tweaks
2 parents 3973ecd + af9f07e commit 40709f4

4 files changed

Lines changed: 87 additions & 17 deletions

File tree

config.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ if test -z "$TARGET_ARCH"; then
258258
esac
259259
fi
260260

261+
# Location of Perl when running Windows builds
262+
WIN_PERL=${WIN_PERL:-"C:/perl/bin/perl.exe"}
263+
261264
# Android default settings and tools
262265
ANDROID_BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-22.0.1}
263266
ANDROID_JAVA_SDK=${ANDROID_JAVA_SDK:-${JAVA_SDK:-/usr/lib/jvm/java-7-openjdk-amd64}}
@@ -310,7 +313,8 @@ case ${OS} in
310313
"-Gandroid_ndk_version=${ANDROID_NDK_VERSION}" "$@"
311314
;;
312315
win)
313-
invoke_gyp $basic_args "-Gmsvs_version=${WIN_MSVS_VERSION}" "$@"
316+
invoke_gyp $basic_args "-Gmsvs_version=${WIN_MSVS_VERSION}" \
317+
"-Dperl=${WIN_PERL}" "$@"
314318
;;
315319
mac|ios)
316320
invoke_gyp $basic_args "-DOS=${OS}" \

config/perl.gypi

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
{
22
'variables':
33
{
4-
'conditions':
5-
[
6-
[
7-
'host_os == "win"',
8-
{
9-
'perl': [ 'C:/perl/bin/perl.exe' ],
10-
},
11-
{
12-
'perl': [ 'perl' ],
13-
},
14-
],
15-
],
4+
'perl%': [ 'perl' ],
165
},
176
}

config/win32.gypi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
'variables':
33
{
44
# Path to the Windows SDK for Apple QuickTime
5-
'quicktime_sdk': '$(foo)C:/Program Files/QuickTime SDK',
5+
'quicktime_sdk%': '$(foo)C:/Program Files/QuickTime SDK',
66

77
# Path to versions 4 and 5 of the Microsoft Speech SDK
8-
'ms_speech_sdk4': '$(foo)C:/Program Files/Microsoft Speech SDK',
9-
'ms_speech_sdk5': '$(foo)C:/Program Files/Microsoft Speech SDK 5.1',
8+
'ms_speech_sdk4%': '$(foo)C:/Program Files/Microsoft Speech SDK',
9+
'ms_speech_sdk5%': '$(foo)C:/Program Files/Microsoft Speech SDK 5.1',
1010

1111
'output_dir': '../win-<(target_arch)-bin',
1212
},

configure.bat

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
1-
python.exe gyp\gyp_main.py --format msvs --depth . --generator-output build-win-x86/livecode -Gmsvs_version=2010
1+
@echo off
2+
REM Configures the Windows build
3+
4+
SETLOCAL EnableExtensions
5+
6+
REM Set this variable if any warnings have been reported
7+
SET warnings=0
8+
9+
REM Not all versions of windows the the %programfiles(x86)% variable
10+
IF NOT DEFINED programfiles(x86) SET programfiles(x86)=%programfiles%
11+
12+
REM Note: to test whether a directory exists in batch script, you need to check
13+
REM whether a file within that directory exists. Easiest way to do this is to
14+
REM add the "*" wildcard after the directory
15+
16+
REM Attempt to locate a copy of Perl
17+
WHERE /Q perl 1>NUL 2>NUL
18+
IF %ERRORLEVEL% NEQ 0 (
19+
IF EXIST C:\perl64\bin\perl.exe (
20+
SET extra_options=%extra_options% -Dperl="C:/perl64/bin/perl.exe"
21+
) ELSE IF EXIST C:\perl\bin\perl.exe (
22+
SET extra_options=%extra_options% -Dperl="C:/perl/bin/perl.exe"
23+
) ELSE (
24+
ECHO >&2 Error: could not locate a copy of perl
25+
PAUSE
26+
EXIT 1
27+
)
28+
)
29+
30+
REM Attempt to locate a copy of Python
31+
WHERE /Q python 1>NUL 2>NUL
32+
IF %ERRORLEVEL% NEQ 0 (
33+
IF EXIST C:\Python27\python.exe (
34+
SET python=C:\Python27\python.exe
35+
) ELSE IF EXIST C:\Python26\python.exe (
36+
SET python=C:\Python26\python.exe
37+
) ELSE (
38+
ECHO >&2 Error: could not locate a copy of python
39+
PAUSE
40+
EXIT 1
41+
)
42+
) ELSE (
43+
SET python=python
44+
)
45+
46+
REM Attempt to locate the QuickTime SDK
47+
IF EXIST "%programfiles(x86)%\QuickTime SDK\*" (
48+
SET extra_options=%extra_options% -Dquicktime_sdk="%programfiles(x86)%/QuickTime SDK"
49+
) ELSE (
50+
ECHO >&2 Error: could not locate the QuickTime SDK
51+
PAUSE
52+
EXIT 1
53+
)
54+
55+
REM Attempt to locate the Microsoft Speech SDK v5.1
56+
IF EXIST "%programfiles(x86)%\Microsoft Speech SDK 5.1\*" (
57+
SET extra_options=%extra_options% -Dms_speech_sdk5="%programfiles(x86)%/Microsoft Speech SDK 5.1"
58+
) ELSE (
59+
ECHO >&2 Warning: could not locate the Microsoft Speech SDK v5.1; revSpeech will not build
60+
SET warnings=1
61+
)
62+
63+
REM Attempt to locate the Microsoft Speech SDK v4
64+
IF EXIST "%programfiles(x86)%\Microsoft Speech SDK\*" (
65+
SET extra_options=%extra_options% -Dms_speech_sdk4="%programfiles(x86)%/Microsoft Speech SDK"
66+
) ELSE (
67+
ECHO >&2 Warning: could not locate the Microsoft Speech SDK v4; revSpeech will not build
68+
SET warnings=1
69+
)
70+
71+
REM Pause so any warnings can be seen
72+
IF %warnings% NEQ 0 PAUSE
73+
74+
REM Run the configure step
75+
%python% gyp\gyp_main.py --format msvs --depth . --generator-output build-win-x86/livecode -Gmsvs_version=2010 %extra_options%
76+
77+
REM Pause if there was an error so that the user gets a chance to see it
78+
IF %ERRORLEVEL% NEQ 0 PAUSE
279
EXIT %ERRORLEVEL%
380

0 commit comments

Comments
 (0)