From cfdf422b667f68935722797393cbc5028602b928 Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Wed, 7 Oct 2015 18:39:27 +1100 Subject: [PATCH 1/8] [[ Gypify ]] Gypify missing lcidlc project file The lcidlc project files had been removed from the repo but not replaced with gyp files. --- lcidlc/lcidlc.gyp | 115 ++++++++++++++++++++++++++++++++++++++++++++++ livecode.gyp | 3 ++ 2 files changed, 118 insertions(+) create mode 100644 lcidlc/lcidlc.gyp diff --git a/lcidlc/lcidlc.gyp b/lcidlc/lcidlc.gyp new file mode 100644 index 00000000000..a49b87ab473 --- /dev/null +++ b/lcidlc/lcidlc.gyp @@ -0,0 +1,115 @@ +{ + # ----- lcidlc ----- + 'includes': + [ + '../common.gypi', + ], + + 'targets': + [ + { + 'target_name': 'lcidlc', + 'type': 'executable', + + 'dependencies': + [ + '../libfoundation/libfoundation.gyp:libFoundation', + 'encode_support', + ], + + 'include_dirs': + [ + 'include', + 'src', + ], + + 'sources': + [ + 'include/LiveCode.h', + + 'src/Coder.h', + 'src/Coder.cpp', + 'src/CString.h', + 'src/CString.cpp', + 'src/EncodedSupportJava.c', + 'src/EncodedSupport.c', + 'src/Error.h', + 'src/Error.cpp', + 'src/Interface.h', + 'src/Interface.cpp', + 'src/InterfaceGenerate.cpp', + 'src/InterfacePrivate.h', + 'src/Main.cpp', + 'src/NativeType.h', + 'src/NativeType.cpp', + 'src/Parser.h', + 'src/Parser.cpp', + 'src/Position.h', + 'src/Position.cpp', + 'src/Scanner.h', + 'src/Scanner.cpp', + 'src/Value.h', + 'src/Value.cpp', + + ], + }, + { + 'target_name': 'encode_support', + 'type': 'none', + + 'sources': + [ + 'src/Support.java', + 'src/Support.mm', + ], + + 'actions': + [ + { + 'action_name': 'Encode Support.mm', + + 'inputs': + [ + '../util/encode_source.pl', + 'src/Support.mm', + ], + 'outputs': + [ + 'src/EncodedSupport.c', + ], + + 'action': + [ + '<@(perl)', + '../util/encode_source.pl', + 'src/Support.mm', + 'src/EncodedSupport.c', + 'g_support_template', + ], + }, + { + 'action_name': 'Encode Support.java', + + 'inputs': + [ + '../util/encode_source.pl', + 'src/Support.java', + ], + 'outputs': + [ + 'src/EncodedJavaSupport.c', + ], + + 'action': + [ + '<@(perl)', + '../util/encode_source.pl', + 'src/Support.java', + 'src/EncodedJavaSupport.c', + 'g_java_support_template', + ], + }, + ], + }, + ], +} diff --git a/livecode.gyp b/livecode.gyp index df875a48a8f..ce49e92a97e 100644 --- a/livecode.gyp +++ b/livecode.gyp @@ -20,6 +20,9 @@ # Widgets and libraries 'extensions/extensions.gyp:extensions', + + # lcidlc + 'lcidlc/lcidlc.gyp:lcidlc', ], 'conditions': From 7d19b9602eabc070d518ca4fbacf2e604a7331cc Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Wed, 7 Oct 2015 21:54:15 +1100 Subject: [PATCH 2/8] [[ Gypify ]] Generate files into intermediate directory --- lcidlc/lcidlc.gyp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lcidlc/lcidlc.gyp b/lcidlc/lcidlc.gyp index a49b87ab473..7dfaac7c69c 100644 --- a/lcidlc/lcidlc.gyp +++ b/lcidlc/lcidlc.gyp @@ -31,8 +31,6 @@ 'src/Coder.cpp', 'src/CString.h', 'src/CString.cpp', - 'src/EncodedSupportJava.c', - 'src/EncodedSupport.c', 'src/Error.h', 'src/Error.cpp', 'src/Interface.h', @@ -51,6 +49,8 @@ 'src/Value.h', 'src/Value.cpp', + '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedJavaSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedSupport.c', ], }, { @@ -75,7 +75,7 @@ ], 'outputs': [ - 'src/EncodedSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedSupport.c', ], 'action': @@ -83,7 +83,7 @@ '<@(perl)', '../util/encode_source.pl', 'src/Support.mm', - 'src/EncodedSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedSupport.c', 'g_support_template', ], }, @@ -97,7 +97,7 @@ ], 'outputs': [ - 'src/EncodedJavaSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedJavaSupport.c', ], 'action': @@ -105,7 +105,7 @@ '<@(perl)', '../util/encode_source.pl', 'src/Support.java', - 'src/EncodedJavaSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedJavaSupport.c', 'g_java_support_template', ], }, From 4beb768e2af9899d75b3597b7ba1d18e1d3096c1 Mon Sep 17 00:00:00 2001 From: Peter TB Brett Date: Wed, 7 Oct 2015 21:10:07 +0100 Subject: [PATCH 3/8] Don't build lcidlc on emscripten or iOS platforms `lcidlc` isn't needed for either of these operating systems. --- lcidlc/lcidlc.gyp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lcidlc/lcidlc.gyp b/lcidlc/lcidlc.gyp index 7dfaac7c69c..822ed8bb6dd 100644 --- a/lcidlc/lcidlc.gyp +++ b/lcidlc/lcidlc.gyp @@ -52,6 +52,16 @@ '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedJavaSupport.c', '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedSupport.c', ], + + 'conditions': + [ + [ + # Don't compile on iOS or emscripten + 'OS == "ios" or OS == "emscripten"', + { + 'type': 'none', + }, + ], }, { 'target_name': 'encode_support', From d41b07175ed8c30bb78fffc4eb87681b9f307998 Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Thu, 8 Oct 2015 08:02:01 +1100 Subject: [PATCH 4/8] Don't compile lcidlc for android --- lcidlc/lcidlc.gyp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lcidlc/lcidlc.gyp b/lcidlc/lcidlc.gyp index 822ed8bb6dd..baf1567a20d 100644 --- a/lcidlc/lcidlc.gyp +++ b/lcidlc/lcidlc.gyp @@ -56,8 +56,8 @@ 'conditions': [ [ - # Don't compile on iOS or emscripten - 'OS == "ios" or OS == "emscripten"', + # Don't compile on android, iOS or emscripten + 'OS == "android" or OS == "ios" or OS == "emscripten"', { 'type': 'none', }, From 2f64e97359588150d24e3a0ba0d1cd80142257ec Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Thu, 8 Oct 2015 19:08:39 +1100 Subject: [PATCH 5/8] Fix formatting issues and lowercase intermediate dir --- lcidlc/lcidlc.gyp | 68 ++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/lcidlc/lcidlc.gyp b/lcidlc/lcidlc.gyp index baf1567a20d..1072c163526 100644 --- a/lcidlc/lcidlc.gyp +++ b/lcidlc/lcidlc.gyp @@ -7,11 +7,11 @@ 'targets': [ - { + { 'target_name': 'lcidlc', 'type': 'executable', - 'dependencies': + 'dependencies': [ '../libfoundation/libfoundation.gyp:libFoundation', 'encode_support', @@ -27,7 +27,7 @@ [ 'include/LiveCode.h', - 'src/Coder.h', + 'src/Coder.h', 'src/Coder.cpp', 'src/CString.h', 'src/CString.cpp', @@ -49,10 +49,10 @@ 'src/Value.h', 'src/Value.cpp', - '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedJavaSupport.c', - '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedJavaSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedSupport.c', ], - + 'conditions': [ [ @@ -61,65 +61,67 @@ { 'type': 'none', }, + ], ], }, - { - 'target_name': 'encode_support', - 'type': 'none', + { + 'target_name': 'encode_support', + 'type': 'none', - 'sources': + 'sources': [ 'src/Support.java', 'src/Support.mm', ], - 'actions': + 'actions': [ { 'action_name': 'Encode Support.mm', 'inputs': - [ - '../util/encode_source.pl', - 'src/Support.mm', - ], - 'outputs': - [ - '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedSupport.c', - ], + [ + '../util/encode_source.pl', + 'src/Support.mm', + ], + 'outputs': + [ + '<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedSupport.c', + ], - 'action': + 'action': [ '<@(perl)', '../util/encode_source.pl', 'src/Support.mm', - '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedSupport.c', 'g_support_template', ], }, - { + { 'action_name': 'Encode Support.java', 'inputs': - [ - '../util/encode_source.pl', - 'src/Support.java', - ], - 'outputs': - [ - '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedJavaSupport.c', - ], + [ + '../util/encode_source.pl', + 'src/Support.java', + ], + + 'outputs': + [ + '<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedJavaSupport.c', + ], - 'action': + 'action': [ '<@(perl)', '../util/encode_source.pl', 'src/Support.java', - '<(SHARED_INTERMEDIATE_DIR)/LCIDLC/EncodedJavaSupport.c', + '<(SHARED_INTERMEDIATE_DIR)/lcidlc/EncodedJavaSupport.c', 'g_java_support_template', ], }, ], - }, + }, ], } From 821bb64c535c19bf37b117a35a56cc1152e89c0d Mon Sep 17 00:00:00 2001 From: "Fraser J. Gordon" Date: Thu, 8 Oct 2015 10:15:11 +0100 Subject: [PATCH 6/8] [[ Gyp-LCIDLC ]] Work around a Gyp bug in passing command arguments On Windows, Gyp is sometimes too eager in interpreting arguments to scripts as paths rather than literals. As I've not been able to track down the source of this issue, a work-around in the affected script is required. --- util/encode_source.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/encode_source.pl b/util/encode_source.pl index 145a5f19be9..cd58a2a265c 100755 --- a/util/encode_source.pl +++ b/util/encode_source.pl @@ -1,11 +1,12 @@ #!/usr/bin/env perl use warnings; +use File::Basename; # Incoming arguments my $sourceFile = $ARGV[0]; my $destFile = $ARGV[1]; -my $varName = $ARGV[2]; +my $varName = basename($ARGV[2]); #! /usr/bin/revolution -ui From 64f7a2cd9d489bf139ced4fa2206bd578374fe76 Mon Sep 17 00:00:00 2001 From: "Fraser J. Gordon" Date: Thu, 8 Oct 2015 10:16:51 +0100 Subject: [PATCH 7/8] [[ Gyp-LCIDLC ]] Windows: ensure LCIDLC is build as a console application --- lcidlc/lcidlc.gyp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lcidlc/lcidlc.gyp b/lcidlc/lcidlc.gyp index 1072c163526..986e45e3268 100644 --- a/lcidlc/lcidlc.gyp +++ b/lcidlc/lcidlc.gyp @@ -63,6 +63,14 @@ }, ], ], + + 'msvs_settings': + { + 'VCLinkerTool': + { + 'SubSystem': 1, # /SUBSYSTEM:CONSOLE + }, + }, }, { 'target_name': 'encode_support', From 64ff6209ed0746b39546cd0ceaaa1c933bc4c510 Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Thu, 8 Oct 2015 20:38:03 +1100 Subject: [PATCH 8/8] Add comment about workaround --- util/encode_source.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/encode_source.pl b/util/encode_source.pl index cd58a2a265c..d3de3a5ae45 100755 --- a/util/encode_source.pl +++ b/util/encode_source.pl @@ -6,6 +6,9 @@ # Incoming arguments my $sourceFile = $ARGV[0]; my $destFile = $ARGV[1]; + +# Work around gyp issue on windows where it is +# sometimes too eager in relativising paths my $varName = basename($ARGV[2]); #! /usr/bin/revolution -ui