-# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+#!/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.
+# 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 Inc. ("Apple") nor the names of
+# 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.
+# 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
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.PHONY : all
-all : \
- $(WEBKIT_OUTPUT)/CodeGenerator.pm \
- $(WEBKIT_OUTPUT)/IDLParser.pm \
- $(WEBKIT_OUTPUT)/generate-bindings.pl \
- $(WEBKIT_OUTPUT)/preprocessor.pm \
- $(WEBKIT_OUTPUT)/preprocess-idls.pl \
-#
+import sys
+import os
+
-MIGRATE_CMD = cp $< $@
+def lookFor(relativePath):
+ return os.path.isfile(os.environ['WEBKIT_LIBRARIES'] + relativePath) or os.path.isfile(os.environ['WEBKITLIBRARIESDIR'] + relativePath)
-# Migrate generation scripts
-$(WEBKIT_OUTPUT)/% : $(WEBCORE)/bindings/scripts/%
- $(MIGRATE_CMD)
+print "/* Identifying AVFoundation Support */"
+if lookFor("/include/AVFoundationCF/AVCFBase.h"):
+ print "#define HAVE_AVCF 1"
+if lookFor("/include/AVFoundationCF/AVCFPlayerItemLegibleOutput.h"):
+ print "#define HAVE_AVCF_LEGIBLE_OUTPUT 1"
+if lookFor("/include/AVFoundationCF/AVCFAssetResourceLoader.h"):
+ print "#define HAVE_AVFOUNDATION_LOADER_DELEGATE 1"
+2015-03-30 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Allow building on Windows without Cygwin
+ https://bugs.webkit.org/show_bug.cgi?id=143219
+
+ Reviewed by Brent Fulgham.
+
+ * AVFoundationSupport.py: Renamed from Source/WebCore/WebCore.vcxproj/MigrateScripts.
+ Move logic from DerivedSources.make to its own script
+ (lookFor):
+ * DerivedSources.make: Paths like /usr/bin don't exist on Windows.
+ Windows uses del instead of rm -f
+ Windows doesn't have printf
+ * WebCore.vcxproj/WebCoreGenerated.make: Pass the CC executable to
+ build-generated-files.pl
+ * WebCore.vcxproj/build-generated-files.pl: Export the CC executable as an environment
+ variable. Don't use /usr/bin.
+ * WebCore.vcxproj/migrate-scripts.pl: Deleted the MigrateScripts makefile. We don't
+ need a whole Makefile just to copy 5 files. Moved this logic into migrate-scripts.pl.
+ (copyFile):
+ * bindings/scripts/preprocessor.pm:
+ (applyPreprocessor): Support passing preprocessing flags to the Visual Studio
+ compiler.
+ * dom/make_names.pl: Ditto.
+
2015-03-30 Alexey Proskuryakov <ap@apple.com>
Build fix.
$(WebCore)/svg/SVGZoomEvent.idl
#
-# 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
# --------
XMLViewerCSS.h : xml/XMLViewer.css
$(PYTHON) $(InspectorScripts)/cssmin.py <"$(WebCore)/xml/XMLViewer.css" > ./XMLViewer.min.css
$(PERL) $(InspectorScripts)/xxd.pl XMLViewer_css ./XMLViewer.min.css XMLViewerCSS.h
- rm -f ./XMLViewer.min.css
+ $(DELETE) XMLViewer.min.css
# --------
XMLViewerJS.h : xml/XMLViewer.js
$(PYTHON) $(InspectorScripts)/jsmin.py <"$(WebCore)/xml/XMLViewer.js" > ./XMLViewer.min.js
$(PERL) $(InspectorScripts)/xxd.pl XMLViewer_js ./XMLViewer.min.js XMLViewerJS.h
- rm -f ./XMLViewer.min.js
+ $(DELETE) XMLViewer.min.js
# --------
IDL_FILES_TMP = ./idl_files.tmp
IDL_ATTRIBUTES_FILE = $(WebCore)/bindings/scripts/IDLAttributes.txt
-# The following two lines get a space character stored in a variable.
-# See <http://blog.jgc.org/2007/06/escaping-comma-and-space-in-gnu-make.html>.
-space :=
-space +=
+# The following lines get a newline character stored in a variable.
+# See <http://stackoverflow.com/questions/7039811/how-do-i-process-extremely-long-lists-of-files-in-a-make-recipe>.
+define NL
+
+
+endef
$(SUPPLEMENTAL_MAKEFILE_DEPS) : $(PREPROCESS_IDLS_SCRIPTS) $(BINDING_IDLS) $(PLATFORM_FEATURE_DEFINES) DerivedSources.make
- printf "$(subst $(space),,$(patsubst %,%\n,$(BINDING_IDLS)))" > $(IDL_FILES_TMP)
+ $(foreach f,$(BINDING_IDLS),echo $(f)>>$(IDL_FILES_TMP)$(NL))
$(call preprocess_idls_script, $(PREPROCESS_IDLS_SCRIPTS)) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_JAVASCRIPT" --idlFilesList $(IDL_FILES_TMP) --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) --windowConstructorsFile $(WINDOW_CONSTRUCTORS_FILE) --workerGlobalScopeConstructorsFile $(WORKERGLOBALSCOPE_CONSTRUCTORS_FILE) --dedicatedWorkerGlobalScopeConstructorsFile $(DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE) --supplementalMakefileDeps $@
- rm -f $(IDL_FILES_TMP)
+ $(DELETE) $(IDL_FILES_TMP)
JS%.h : %.idl $(JS_BINDINGS_SCRIPTS) $(IDL_ATTRIBUTES_FILE) $(WINDOW_CONSTRUCTORS_FILE) $(WORKERGLOBALSCOPE_CONSTRUCTORS_FILE) $(PLATFORM_FEATURE_DEFINES)
$(call generator_script, $(JS_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_JAVASCRIPT" --generator JS --idlAttributesFile $(IDL_ATTRIBUTES_FILE) --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) $<
InspectorOverlayPage.h : InspectorOverlayPage.html InspectorOverlayPage.css InspectorOverlayPage.js
$(PYTHON) $(InspectorScripts)/inline-and-minify-stylesheets-and-scripts.py $(WebCore)/inspector/InspectorOverlayPage.html ./InspectorOverlayPage.combined.html
$(PERL) $(InspectorScripts)/xxd.pl InspectorOverlayPage_html ./InspectorOverlayPage.combined.html InspectorOverlayPage.h
- rm -f ./InspectorOverlayPage.combined.html
+ $(DELETE) InspectorOverlayPage.combined.html
all : CommandLineAPIModuleSource.h
echo "//# sourceURL=__WebInspectorCommandLineAPIModuleSource__" > ./CommandLineAPIModuleSource.min.js
$(PYTHON) $(InspectorScripts)/jsmin.py <$(WebCore)/inspector/CommandLineAPIModuleSource.js >> ./CommandLineAPIModuleSource.min.js
$(PERL) $(InspectorScripts)/xxd.pl CommandLineAPIModuleSource_js ./CommandLineAPIModuleSource.min.js CommandLineAPIModuleSource.h
- rm -f ./CommandLineAPIModuleSource.min.js
+ $(DELETE) CommandLineAPIModuleSource.min.js
# Web Replay inputs generator
all : WebCoreHeaderDetection.h
-WebCoreHeaderDetection.h : DerivedSources.make
- echo "/* Identifying AVFoundation Support */" > $@
- if [ -f "$(WEBKIT_LIBRARIES)/include/AVFoundationCF/AVCFBase.h" ]||[ -f "$(WEBKITLIBRARIESDIR)/include/AVFoundationCF/AVCFBase.h" ]; then echo "#define HAVE_AVCF 1" >> $@; else echo >> $@; fi
- if [ -f "$(WEBKIT_LIBRARIES)/include/AVFoundationCF/AVCFPlayerItemLegibleOutput.h" ]||[ -f "$(WEBKITLIBRARIESDIR)/include/AVFoundationCF/AVCFPlayerItemLegibleOutput.h" ]; then echo "#define HAVE_AVCF_LEGIBLE_OUTPUT 1" >> $@; else echo >> $@; fi
- if [ -f "$(WEBKIT_LIBRARIES)/include/AVFoundationCF/AVCFAssetResourceLoader.h" ]||[ -f "$(WEBKITLIBRARIESDIR)/include/AVFoundationCF/AVCFAssetResourceLoader.h" ]; then echo "#define HAVE_AVFOUNDATION_LOADER_DELEGATE 1" >> $@; else echo >> $@; fi
+WebCoreHeaderDetection.h : $(WebCore)/AVFoundationSupport.py DerivedSources.make
+ $(PYTHON) $(WebCore)/AVFoundationSupport.py > $@
endif # Windows_NT
@if errorlevel 1 exit 1\r
@echo XXWebCoreGeneratedXX > "%ConfigurationBuildDir%\buildfailed"\r
\r
- perl build-generated-files.pl "%ConfigurationBuildDir%" "%WebKit_Libraries%" windows "%PlatformArchitecture%"\r
+ perl build-generated-files.pl "%ConfigurationBuildDir%" "%WebKit_Libraries%" windows "%PlatformArchitecture%" "$(CC)"\r
perl migrate-scripts.pl "%ConfigurationBuildDir%\obj%PlatformArchitecture%\WebCore\scripts"\r
@cmd /C copyForwardingHeaders.cmd cg cf\r
@cmd /C copyWebCoreResourceFiles.cmd\r
use strict;
use Cwd;
+use Config;
use File::Path qw(make_path);
use File::Spec;
$ENV{'PLATFORM_FEATURE_DEFINES'} = File::Spec->catfile($SDKROOT, 'tools', 'vsprops', 'FeatureDefines.props');
}
+if ($Config{osname} eq 'MSWin32') {
+ my $ccPath = `where $ARGV[4]`;
+ chomp($ccPath);
+ $ENV{CC} = $ccPath;
+}
+
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: $!";
use strict;
use Cwd;
+use File::Copy;
use File::Path qw(make_path);
use File::Spec;
$ENV{'WebCore'} = $XSRCROOT;
$ENV{'WEBKIT_OUTPUT'} = $XDSTROOT;
-my $MIGRATE_SCRIPTS_MAKEFILE = File::Spec->catfile($XSRCROOT, 'WebCore.vcxproj', 'MigrateScripts');
-system('/usr/bin/make', '-f', $MIGRATE_SCRIPTS_MAKEFILE, '-j', $NUMCPUS) and die "Failed to build $MIGRATE_SCRIPTS_MAKEFILE: $!";
+sub copyFile {
+ my $filename = shift;
+ my $source = File::Spec->catfile($XSRCROOT, "bindings", "scripts", $filename);
+ my $destination = File::Spec->catfile($XDSTROOT, $filename);
+ if (! -e $destination || (stat($source))[9] > (stat($destination))[9]) { # 9th element is file modification time
+ copy($source, $destination);
+ }
+}
+
+copyFile("CodeGenerator.pm");
+copyFile("IDLParser.pm");
+copyFile("generate-bindings.pl");
+copyFile("preprocessor.pm");
+copyFile("preprocess-idls.pl");
} else {
$preprocessor = "/usr/bin/gcc";
}
- push(@args, qw(-E -P -x c++));
+ if ($Config::Config{"osname"} eq "MSWin32") {
+ push(@args, qw(/EP));
+ } else {
+ push(@args, qw(-E -P -x c++));
+ }
}
if ($Config::Config{"osname"} eq "darwin") {
@macros = map { "-D$_" } @macros;
my $pid = 0;
- if ($Config{osname} eq "cygwin" || $Config{osname} eq 'MSWin32') {
+ if ($Config{osname} eq "cygwin") {
# This call can fail if Windows rebases cygwin, so retry a few times until it succeeds.
for (my $tries = 0; !$pid && ($tries < 20); $tries++) {
eval {
sleep 1;
}
};
+ } elsif ($Config::Config{"osname"} eq "MSWin32") {
+ $pid = open2(\*PP_OUT, \*PP_IN, $preprocessor, @args, @macros, $fileName);
} else {
$pid = open2(\*PP_OUT, \*PP_IN, split(' ', $preprocessor), @args, @macros, $fileName);
}
require Config;
-my $gccLocation = "";
+my $ccLocation = "";
if ($ENV{CC}) {
- $gccLocation = $ENV{CC};
+ $ccLocation = $ENV{CC};
} elsif (($Config::Config{"osname"}) =~ /solaris/i) {
- $gccLocation = "/usr/sfw/bin/gcc";
+ $ccLocation = "/usr/sfw/bin/gcc";
} elsif ($Config::Config{"osname"} eq "darwin" && $ENV{SDKROOT}) {
- chomp($gccLocation = `xcrun -find cc -sdk '$ENV{SDKROOT}'`);
+ chomp($ccLocation = `xcrun -find cc -sdk '$ENV{SDKROOT}'`);
} else {
- $gccLocation = "/usr/bin/cc";
+ $ccLocation = "/usr/bin/cc";
+}
+
+my $preprocessor = "";
+if ($Config::Config{"osname"} eq "MSWin32") {
+ $preprocessor = "\"$ccLocation\" /EP";
+} else {
+ $preprocessor = $ccLocation . " -E -x c++";
}
-my $preprocessor = $gccLocation . " -E -x c++";
GetOptions(
'tags=s' => \$tagsFile,