summaryrefslogtreecommitdiff
path: root/Source/WebCore/bindings/scripts/preprocessor.pm
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/bindings/scripts/preprocessor.pm
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/bindings/scripts/preprocessor.pm')
-rw-r--r--Source/WebCore/bindings/scripts/preprocessor.pm29
1 files changed, 23 insertions, 6 deletions
diff --git a/Source/WebCore/bindings/scripts/preprocessor.pm b/Source/WebCore/bindings/scripts/preprocessor.pm
index d92590d77..2321d5191 100644
--- a/Source/WebCore/bindings/scripts/preprocessor.pm
+++ b/Source/WebCore/bindings/scripts/preprocessor.pm
@@ -51,18 +51,20 @@ sub applyPreprocessor
$preprocessor = "/usr/sfw/bin/gcc";
} elsif (-x "/usr/bin/clang") {
$preprocessor = "/usr/bin/clang";
- } elsif ($Config{osname} eq 'msys') {
- $preprocessor = "gcc";
} 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") {
push(@args, "-I" . $ENV{BUILT_PRODUCTS_DIR} . "/usr/local/include") if $ENV{BUILT_PRODUCTS_DIR};
push(@args, "-isysroot", $ENV{SDKROOT}) if $ENV{SDKROOT};
- $defines .= " WTF_PLATFORM_IOS" if defined $ENV{PLATFORM_NAME} && $ENV{PLATFORM_NAME} =~ /iphone(os|simulator)/;
+ $defines .= " WTF_PLATFORM_IOS" if defined $ENV{PLATFORM_NAME} && $ENV{PLATFORM_NAME} !~ /macosx/;
}
# Remove double quotations from $defines and extract macros.
@@ -73,19 +75,34 @@ sub applyPreprocessor
@macros = map { "-D$_" } @macros;
my $pid = 0;
- if ($Config{osname} eq "cygwin" || $Config{osname} eq 'MSWin32' || $Config{osname} eq 'msys') {
+ if ($Config{osname} eq "cygwin") {
+ $ENV{PATH} = "$ENV{PATH}:/cygdrive/c/cygwin/bin";
+ my @preprocessorAndFlags;
+ if ($preprocessor eq "/usr/bin/gcc") {
+ @preprocessorAndFlags = split(' ', $preprocessor);
+ } else {
+ $preprocessor =~ /"(.*)"/;
+ chomp(my $preprocessor = `cygpath -u '$1'`) if (defined $1);
+ chomp($fileName = `cygpath -w '$fileName'`);
+ @preprocessorAndFlags = ($preprocessor, "/nologo", "/EP");
+ }
# 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 {
# Suppress STDERR so that if we're using cl.exe, the output
# name isn't needlessly echoed.
use Symbol 'gensym'; my $err = gensym;
- $pid = open3(\*PP_IN, \*PP_OUT, $err, split(' ', $preprocessor), @args, @macros, $fileName);
+ $pid = open3(\*PP_IN, \*PP_OUT, $err, @preprocessorAndFlags, @args, @macros, $fileName);
1;
} or do {
sleep 1;
}
};
+ } elsif ($Config::Config{"osname"} eq "MSWin32") {
+ # Suppress STDERR so that if we're using cl.exe, the output
+ # name isn't needlessly echoed.
+ use Symbol 'gensym'; my $err = gensym;
+ $pid = open3(\*PP_IN, \*PP_OUT, $err, $preprocessor, @args, @macros, $fileName);
} else {
$pid = open2(\*PP_OUT, \*PP_IN, split(' ', $preprocessor), @args, @macros, $fileName);
}