Title: [112203] trunk/Source/WebCore
Revision
112203
Author
[email protected]
Date
2012-03-26 20:58:35 -0700 (Mon, 26 Mar 2012)

Log Message

Build system prep work for upstreaming iOS changes
<http://webkit.org/b/82267>

Reviewed by Mark Rowe.

* DerivedSources.make: Move 'bison' into a variable and use
xcrun to find it on Mac OS X.
* bindings/scripts/preprocessor.pm:
(applyPreprocessor): Add local @args variable.  On iOS, the
compiler needs additional "-isysroot $(SDKROOT)" arguments when
invoked, so it's easier to add them to an array, especially if
$SDKROOT contains a space in the path.  Remove now-redundant
$gccLocation variable.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112202 => 112203)


--- trunk/Source/WebCore/ChangeLog	2012-03-27 03:50:43 UTC (rev 112202)
+++ trunk/Source/WebCore/ChangeLog	2012-03-27 03:58:35 UTC (rev 112203)
@@ -1,3 +1,19 @@
+2012-03-26  David Kilzer  <[email protected]>
+
+        Build system prep work for upstreaming iOS changes
+        <http://webkit.org/b/82267>
+
+        Reviewed by Mark Rowe.
+
+        * DerivedSources.make: Move 'bison' into a variable and use
+        xcrun to find it on Mac OS X.
+        * bindings/scripts/preprocessor.pm:
+        (applyPreprocessor): Add local @args variable.  On iOS, the
+        compiler needs additional "-isysroot $(SDKROOT)" arguments when
+        invoked, so it's easier to add them to an array, especially if
+        $SDKROOT contains a space in the path.  Remove now-redundant
+        $gccLocation variable.
+
 2012-03-26  Nate Chapin  <[email protected]>
 
         Remove duplicate error() impls in CachedResource subclasses

Modified: trunk/Source/WebCore/DerivedSources.make (112202 => 112203)


--- trunk/Source/WebCore/DerivedSources.make	2012-03-27 03:50:43 UTC (rev 112202)
+++ trunk/Source/WebCore/DerivedSources.make	2012-03-27 03:58:35 UTC (rev 112203)
@@ -728,11 +728,21 @@
 
 # --------
 
+# Path to bison
+
+ifeq ($(OS),MACOS)
+BISON=$(shell xcrun -find bison)
+else
+BISON=bison
+endif
+
+# --------
+
 # CSS grammar
 # NOTE: Older versions of bison do not inject an inclusion guard, so we add one.
 
 CSSGrammar.cpp : css/CSSGrammar.y
-	bison -d -p cssyy $< -o $@
+	$(BISON) -d -p cssyy $< -o $@
 	touch CSSGrammar.cpp.h
 	touch CSSGrammar.hpp
 	echo '#ifndef CSSGrammar_h' > CSSGrammar.h
@@ -747,7 +757,7 @@
 # NOTE: Older versions of bison do not inject an inclusion guard, so we add one.
 
 XPathGrammar.cpp : xml/XPathGrammar.y $(PROJECT_FILE)
-	bison -d -p xpathyy $< -o $@
+	$(BISON) -d -p xpathyy $< -o $@
 	touch XPathGrammar.cpp.h
 	touch XPathGrammar.hpp
 	echo '#ifndef XPathGrammar_h' > XPathGrammar.h

Modified: trunk/Source/WebCore/bindings/scripts/preprocessor.pm (112202 => 112203)


--- trunk/Source/WebCore/bindings/scripts/preprocessor.pm	2012-03-27 03:50:43 UTC (rev 112202)
+++ trunk/Source/WebCore/bindings/scripts/preprocessor.pm	2012-03-27 03:58:35 UTC (rev 112203)
@@ -40,17 +40,17 @@
     my $defines = shift;
     my $preprocessor = shift;
 
+    my @args = ();
     if (!$preprocessor) {
         require Config;
-        my $gccLocation = "";
         if ($ENV{CC}) {
-            $gccLocation = $ENV{CC};
+            $preprocessor = $ENV{CC};
         } elsif (($Config::Config{'osname'}) =~ /solaris/i) {
-            $gccLocation = "/usr/sfw/bin/gcc";
+            $preprocessor = "/usr/sfw/bin/gcc";
         } else {
-            $gccLocation = "/usr/bin/gcc";
+            $preprocessor = "/usr/bin/gcc";
         }
-        $preprocessor = $gccLocation . " -E -P -x c++";
+        push(@args, qw(-E -P -x c++));
     }
 
     # Remove double quotations from $defines and extract macros.
@@ -60,7 +60,7 @@
     my @macros = grep { $_ } split(/\s+/, $defines); # grep skips empty macros.
     @macros = map { "-D$_" } @macros;
 
-    my $pid = open2(\*PP_OUT, \*PP_IN, split(' ', $preprocessor), @macros, $fileName);
+    my $pid = open2(\*PP_OUT, \*PP_IN, split(' ', $preprocessor), @args, @macros, $fileName);
     close PP_IN;
     my @documentContent = <PP_OUT>;
     close PP_OUT;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to