Title: [182122] trunk/Source/_javascript_Core
Revision
182122
Author
mmaxfi...@apple.com
Date
2015-03-29 13:56:20 -0700 (Sun, 29 Mar 2015)

Log Message

[Win] Allow building _javascript_Core without Cygwin
https://bugs.webkit.org/show_bug.cgi?id=143189

Reviewed by Brent Fulgham.

Paths like /usr/bin/ don't exist on Windows.
Hashbangs don't work on Windows. Instead we must explicitly call the executable.
Prefixing commands with environment variables doesn't work on Windows.
Windows doesn't have 'cmp'
Windows uses 'del' instead of 'rm'
Windows uses 'type NUL' intead of 'touch'

* DerivedSources.make:
* _javascript_Core.vcxproj/_javascript_CoreGenerated.make:
* _javascript_Core.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.make:
* _javascript_Core.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.pl:
* _javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.make:
* _javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl:
* _javascript_Core.vcxproj/build-generated-files.pl:
* UpdateContents.py: Copied from Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (182121 => 182122)


--- trunk/Source/_javascript_Core/ChangeLog	2015-03-29 20:40:15 UTC (rev 182121)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-03-29 20:56:20 UTC (rev 182122)
@@ -1,3 +1,26 @@
+2015-03-29  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [Win] Allow building _javascript_Core without Cygwin
+        https://bugs.webkit.org/show_bug.cgi?id=143189
+
+        Reviewed by Brent Fulgham.
+
+        Paths like /usr/bin/ don't exist on Windows.
+        Hashbangs don't work on Windows. Instead we must explicitly call the executable.
+        Prefixing commands with environment variables doesn't work on Windows.
+        Windows doesn't have 'cmp'
+        Windows uses 'del' instead of 'rm'
+        Windows uses 'type NUL' intead of 'touch'
+
+        * DerivedSources.make:
+        * _javascript_Core.vcxproj/_javascript_CoreGenerated.make:
+        * _javascript_Core.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.make:
+        * _javascript_Core.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.pl:
+        * _javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.make:
+        * _javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl:
+        * _javascript_Core.vcxproj/build-generated-files.pl:
+        * UpdateContents.py: Copied from Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl.
+
 2015-03-28  Joseph Pecoraro  <pecor...@apple.com>
 
         Clean up _javascript_Core/builtins

Modified: trunk/Source/_javascript_Core/DerivedSources.make (182121 => 182122)


--- trunk/Source/_javascript_Core/DerivedSources.make	2015-03-29 20:40:15 UTC (rev 182121)
+++ trunk/Source/_javascript_Core/DerivedSources.make	2015-03-29 20:56:20 UTC (rev 182122)
@@ -68,13 +68,13 @@
 # builtin functions
 .PHONY: JSCBuiltins
 
-# Windows has specific needs for specifying the path to its interpreters
+PYTHON = python
+PERL = perl
+
 ifeq ($(OS),Windows_NT)
-    PYTHON = /usr/bin/python
-    PERL = /usr/bin/perl
+    DELETE = cmd //C del
 else
-    PYTHON = python
-    PERL = perl
+    DELETE = rm -f
 endif
 # --------
 
@@ -87,9 +87,9 @@
 # lookup tables for classes
 
 %.lut.h: create_hash_table %.cpp
-	$^ -i > $@
+	$(PERL) $^ -i > $@
 Lexer.lut.h: create_hash_table Keywords.table
-	$^ > $@
+	$(PERL) $^ > $@
 
 # character tables for Yarr
 
@@ -102,7 +102,7 @@
 # udis86 instruction tables
 
 udis86_itab.h: $(_javascript_Core)/disassembler/udis86/itab.py $(_javascript_Core)/disassembler/udis86/optable.xml
-	(PYTHONPATH=$(_javascript_Core)/disassembler/udis86 $(PYTHON) $(_javascript_Core)/disassembler/udis86/itab.py $(_javascript_Core)/disassembler/udis86/optable.xml || exit 1)
+	$(PYTHON) $(_javascript_Core)/disassembler/udis86/itab.py $(_javascript_Core)/disassembler/udis86/optable.xml
 
 # Bytecode files
 
@@ -170,8 +170,8 @@
 # adding, modifying, or removing domains will trigger regeneration of inspector files.
 
 .PHONY: force
-EnabledInspectorDomains : force
-	echo '$(INSPECTOR_DOMAINS)' | cmp -s - $@ || echo '$(INSPECTOR_DOMAINS)' > $@
+EnabledInspectorDomains : $(_javascript_Core)/UpdateContents.py force
+	$(PYTHON) $(_javascript_Core)/UpdateContents.py '$(INSPECTOR_DOMAINS)' $@
 
 CombinedDomains.json : inspector/scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) EnabledInspectorDomains
 	$(PYTHON) $(_javascript_Core)/inspector/scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) > ./CombinedDomains.json
@@ -184,7 +184,7 @@
 	echo "//# sourceURL=__WebInspectorInjectedScript__" > ./InjectedScriptSource.min.js
 	$(PYTHON) $(_javascript_Core)/inspector/scripts/jsmin.py < $(_javascript_Core)/inspector/InjectedScriptSource.js >> ./InjectedScriptSource.min.js
 	$(PERL) $(_javascript_Core)/inspector/scripts/xxd.pl InjectedScriptSource_js ./InjectedScriptSource.min.js InjectedScriptSource.h
-	rm -f ./InjectedScriptSource.min.js
+	$(DELETE) InjectedScriptSource.min.js
 
 # Web Replay inputs generator
 

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_CoreGenerated.make (182121 => 182122)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_CoreGenerated.make	2015-03-29 20:40:15 UTC (rev 182121)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_CoreGenerated.make	2015-03-29 20:56:20 UTC (rev 182122)
@@ -1,5 +1,5 @@
 all:
-    @touch "%ConfigurationBuildDir%\buildfailed"
+    @type NUL > "%ConfigurationBuildDir%\buildfailed"
     @perl build-generated-files.pl "%ConfigurationBuildDir%" "$(WEBKIT_LIBRARIES)" "%PlatformArchitecture%"
     @copy-files.cmd
 

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.make (182121 => 182122)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.make	2015-03-29 20:40:15 UTC (rev 182121)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.make	2015-03-29 20:56:20 UTC (rev 182122)
@@ -1,5 +1,5 @@
 all:
-    touch "%ConfigurationBuildDir%\buildfailed"
+    @type NUL > "%ConfigurationBuildDir%\buildfailed"
     perl build-LLIntAssembly.pl "%ConfigurationBuildDir%" "$(WEBKIT_LIBRARIES)" "$(DEBUGSUFFIX)" "%PlatformArchitecture%"
     -del "%ConfigurationBuildDir%\buildfailed"
 

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.pl (182121 => 182122)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.pl	2015-03-29 20:40:15 UTC (rev 182121)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.pl	2015-03-29 20:56:20 UTC (rev 182122)
@@ -67,4 +67,4 @@
 my $offlineAsm = File::Spec->catfile($XSRCROOT, 'offlineasm', 'asm.rb');
 my $lowLevelInterpreter = File::Spec->catfile($XSRCROOT, 'llint', 'LowLevelInterpreter.asm');
 my $offsetsExtractor = File::Spec->catfile($BUILD_PRODUCTS_DIR, 'LLIntOffsetsExtractor', "LLIntOffsetsExtractor$ARGV[2].exe");
-system('/usr/bin/env', 'ruby', $offlineAsm, '-I.', $lowLevelInterpreter, $offsetsExtractor, $OUTPUTFILENAME) and die "Failed to generate $OUTPUTFILENAME: $!";
+system('ruby', $offlineAsm, '-I.', $lowLevelInterpreter, $offsetsExtractor, $OUTPUTFILENAME) and die "Failed to generate $OUTPUTFILENAME: $!";

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.make (182121 => 182122)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.make	2015-03-29 20:40:15 UTC (rev 182121)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.make	2015-03-29 20:56:20 UTC (rev 182122)
@@ -1,5 +1,5 @@
 all:
-    touch "%ConfigurationBuildDir%\buildfailed"
+    @type NUL > "%ConfigurationBuildDir%\buildfailed"
     perl build-LLIntDesiredOffsets.pl "%ConfigurationBuildDir%" "$(WEBKIT_LIBRARIES)" "%PlatformArchitecture%"
 
     -del "%ConfigurationBuildDir%\buildfailed"

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl (182121 => 182122)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl	2015-03-29 20:40:15 UTC (rev 182121)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl	2015-03-29 20:56:20 UTC (rev 182122)
@@ -55,4 +55,4 @@
 my $generateOffsetExtractor = File::Spec->catfile($XSRCROOT, 'offlineasm', 'generate_offset_extractor.rb');
 my $lowLevelInterpreter = File::Spec->catfile($XSRCROOT, 'llint', 'LowLevelInterpreter.asm');
 my $OUTPUTFILENAME = File::Spec->catfile($BUILD_PRODUCTS_DIR, 'LLIntDesiredOffsets.h');
-system('/usr/bin/env', 'ruby', $generateOffsetExtractor, "-I$BUILD_PRODUCTS_DIR", $lowLevelInterpreter, $OUTPUTFILENAME) and die "Failed to generate $OUTPUTFILENAME: $!";
+system('ruby', $generateOffsetExtractor, "-I$BUILD_PRODUCTS_DIR", $lowLevelInterpreter, $OUTPUTFILENAME) and die "Failed to generate $OUTPUTFILENAME: $!";

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/build-generated-files.pl (182121 => 182122)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/build-generated-files.pl	2015-03-29 20:40:15 UTC (rev 182121)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/build-generated-files.pl	2015-03-29 20:56:20 UTC (rev 182122)
@@ -74,5 +74,4 @@
 $ENV{'DFTABLES_EXTENSION'} = '.exe';
 
 my $DERIVED_SOURCES_MAKEFILE = File::Spec->catfile($XSRCROOT, 'DerivedSources.make');
-
-system('/usr/bin/make', '-f', $DERIVED_SOURCES_MAKEFILE, '-j', $NUMCPUS) and die "Failed to build $DERIVED_SOURCES_MAKEFILE: $!";
+system('make', '-f', $DERIVED_SOURCES_MAKEFILE, '-j', $NUMCPUS) and die "Failed to build $DERIVED_SOURCES_MAKEFILE: $!";

Copied: trunk/Source/_javascript_Core/UpdateContents.py (from rev 182121, trunk/Source/_javascript_Core/_javascript_Core.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl) (0 => 182122)


--- trunk/Source/_javascript_Core/UpdateContents.py	                        (rev 0)
+++ trunk/Source/_javascript_Core/UpdateContents.py	2015-03-29 20:56:20 UTC (rev 182122)
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+
+# Copyright (C) 2015 Apple Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+# 3.  Neither the name of Apple puter, Inc. ("Apple") nor the names of
+#     its contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import sys
+import os
+
+assert(len(sys.argv) == 3)
+
+comp = sys.argv[1]
+filename = sys.argv[2]
+
+t = False
+
+if os.path.isfile(filename):
+    f = open(filename, 'r')
+    comparator = f.read()
+    f.close()
+    t = True
+
+if (not t or comp == comparator):
+    f = open(filename, 'w')
+    f.write(comp)
+    f.close()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to