changeset 4973:92d277a8419c

RT-32378: add parfait support to gradle build
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Wed, 04 Sep 2013 14:07:24 -0700
parents c06259a9d8b7
children 1edf46aeb5f7
files build.gradle buildSrc/genVSproperties.bat buildSrc/linux.gradle buildSrc/mac.gradle buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy buildSrc/win.gradle
diffstat 6 files changed, 36 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Wed Sep 04 13:42:23 2013 -0700
+++ b/build.gradle	Wed Sep 04 14:07:24 2013 -0700
@@ -309,6 +309,10 @@
 defineProperty("COMPILE_PANGO", "false")
 if (COMPILE_PANGO instanceof String) ext.COMPILE_PANGO = Boolean.parseBoolean(COMPILE_PANGO)
 
+// COMPILE_PARFAIT specifies whether to build parfait
+defineProperty("COMPILE_PARFAIT", "false")
+if (COMPILE_PARFAIT instanceof String) ext.COMPILE_PARFAIT = Boolean.parseBoolean(COMPILE_PARFAIT)
+
 
 // Define the SWT.jar that we are going to have to download during the build process based
 // on what platform we are compiling from (not based on our target).
@@ -2129,8 +2133,9 @@
                 workingDir("$projectDir/src/main/native")
                 if (t.name == "win") {
                     String qtDir = cygpath(System.getenv().get("QTSDK_DIR"))
+                    String parfaitPath = COMPILE_PARFAIT ? System.getenv().get("PARFAIT_PATH") + ";" : "";
                     Map environmentSettings = new HashMap(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
-                    environmentSettings["PATH"] = "$WINDOWS_VS_PATH;$qtDir/bin;$qtDir/qt/bin"
+                    environmentSettings["PATH"] = parfaitPath + "$WINDOWS_VS_PATH;$qtDir/bin;$qtDir/qt/bin"
                     environmentSettings["QMAKESPEC"] = "win32-msvc2008"
                     environment(environmentSettings)
                     /* To build with ICU:
@@ -2179,6 +2184,19 @@
                     "JAVA_HOME"       : JAVA_HOME,
                     "WEBKITOUTPUTDIR" : webkitOutputDir,
                 ])
+
+                if (COMPILE_PARFAIT) {
+                    environment([
+                        "CC"        : "parfait-gcc",
+                        "QMAKE_CC"  : "parfait-gcc",
+                        "CXX"       : "parfait-g++",
+                        "QMAKE_CXX" : "parfait-g++",
+                        "CPP"       : "parfait-g++",
+                        "cc"        : "parfait-gcc",
+                        "LINK"      : "parfait-g++",
+                        "QMAKE_LINK": "parfait-g++",
+                    ])
+                }
                 commandLine("perl", "Tools/Scripts/build-webkit", "--java", "--imageio")
             }
 
--- a/buildSrc/genVSproperties.bat	Wed Sep 04 13:42:23 2013 -0700
+++ b/buildSrc/genVSproperties.bat	Wed Sep 04 14:07:24 2013 -0700
@@ -80,7 +80,7 @@
 echo windows.vs.INCLUDE=%INCLUDE%@@ENDOFLINE@@
 echo windows.vs.LIB=%LIB%@@ENDOFLINE@@
 echo windows.vs.LIBPATH=%LIBPATH%@@ENDOFLINE@@
-echo windows.vs.PATH=%PATH%@@ENDOFLINE@@
+echo windows.vs.PATH=%PARFAIT_PATH%;%PATH%@@ENDOFLINE@@
 echo windows.vs.VER=%VSVER%@@ENDOFLINE@@
 echo WINDOWS_SDK_DIR=%WindowsSdkDir%@@ENDOFLINE@@
 echo ############################################################
--- a/buildSrc/linux.gradle	Wed Sep 04 13:42:23 2013 -0700
+++ b/buildSrc/linux.gradle	Wed Sep 04 14:07:24 2013 -0700
@@ -128,9 +128,9 @@
     }
 )
 
-
-def compiler = "gcc"
-def linker = "g++"
+def compiler = COMPILE_PARFAIT ? "parfait-gcc" : "gcc";
+def cc_compiler = COMPILE_PARFAIT ? "parfait-cc" : "cc";
+def linker = COMPILE_PARFAIT ? "parfait-g++" : "g++";
 
 LINUX.glass = [:]
 LINUX.glass.javahInclude = [
@@ -155,7 +155,7 @@
 LINUX.prism = [:]
 LINUX.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
 LINUX.prism.nativeSource = file("modules/graphics/src/main/native-prism")
-LINUX.prism.compiler = "cc"
+LINUX.prism.compiler = cc_compiler
 LINUX.prism.ccFlags = [ccFlags, "-DINLINE=inline"].flatten()
 LINUX.prism.linker = linker
 LINUX.prism.linkFlags = [linkFlags].flatten()
@@ -164,7 +164,7 @@
 LINUX.prismSW = [:]
 LINUX.prismSW.javahInclude = ["com/sun/pisces/**/*"]
 LINUX.prismSW.nativeSource = file("modules/graphics/src/main/native-prism-sw")
-LINUX.prismSW.compiler = "cc"
+LINUX.prismSW.compiler = cc_compiler
 LINUX.prismSW.ccFlags = [ccFlags, "-DINLINE=inline"].flatten()
 LINUX.prismSW.linker = linker
 LINUX.prismSW.linkFlags = [linkFlags].flatten()
--- a/buildSrc/mac.gradle	Wed Sep 04 13:42:23 2013 -0700
+++ b/buildSrc/mac.gradle	Wed Sep 04 14:07:24 2013 -0700
@@ -91,8 +91,9 @@
         commonParams,
         IS_DEBUG ? "-DDEBUG" : ["-O3", "-DNDEBUG"]].flatten()
 
-def compiler = "gcc"
-def linker = "g++"
+def compiler = COMPILE_PARFAIT ? "parfait-gcc" : "gcc";
+def cc_compiler = COMPILE_PARFAIT ? "parfait-cc" : "cc";
+def linker = COMPILE_PARFAIT ? "parfait-g++" : "g++";
 
 MAC.glass = [:]
 MAC.glass.javahInclude = [
@@ -123,7 +124,7 @@
 MAC.prism = [:]
 MAC.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
 MAC.prism.nativeSource = file("modules/graphics/src/main/native-prism")
-MAC.prism.compiler = "cc"
+MAC.prism.compiler = cc_compiler
 MAC.prism.ccFlags = ["-O3", "-DINLINE=inline",
         "-I$JDK_HOME/include",
         "-I$JDK_HOME/include/darwin",
@@ -138,7 +139,7 @@
 MAC.prismSW = [:]
 MAC.prismSW.javahInclude = ["com/sun/pisces/**/*"]
 MAC.prismSW.nativeSource = file("modules/graphics/src/main/native-prism-sw")
-MAC.prismSW.compiler = "cc"
+MAC.prismSW.compiler = cc_compiler
 MAC.prismSW.ccFlags = [MAC.prism.ccFlags].flatten()
 MAC.prismSW.linker = linker
 MAC.prismSW.linkFlags = [MAC.prism.linkFlags].flatten()
--- a/buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy	Wed Sep 04 13:42:23 2013 -0700
+++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/LinkTask.groovy	Wed Sep 04 14:07:24 2013 -0700
@@ -39,7 +39,8 @@
         lib.getParentFile().mkdirs();
         project.exec({
             commandLine(linker);
-            args(objectDir.listFiles());
+            // Exclude parfait files (.bc)
+            args(objectDir.listFiles().findAll{ !it.getAbsolutePath().endsWith(".bc") });
             if (project.IS_WINDOWS) {
                 args("/out:$lib");
             } else {
--- a/buildSrc/win.gradle	Wed Sep 04 13:42:23 2013 -0700
+++ b/buildSrc/win.gradle	Wed Sep 04 14:07:24 2013 -0700
@@ -103,7 +103,8 @@
         defineProperty("WINDOWS_VS_VER", properties, "70")
         defineProperty("WINDOWS_VS_LIB", properties, "$WINDOWS_VS_VCINSTALLDIR/LIB;" + "$WINDOWS_SDK_DIR/lib;")
         defineProperty("WINDOWS_VS_LIBPATH", properties, "$WINDOWS_VS_VCINSTALLDIR/LIB;")
-        defineProperty("WINDOWS_VS_PATH", properties, "$WINDOWS_VS_DEVENVDIR;" +
+        def parfaitPath = COMPILE_PARFAIT ? System.getenv().get("PARFAIT_PATH") + ";" : "";
+        defineProperty("WINDOWS_VS_PATH", properties, parfaitPath + "$WINDOWS_VS_DEVENVDIR;" +
                 "$WINDOWS_VS_VSINSTALLDIR/VC/BIN;" +
                 "$WINDOWS_VS_VSINSTALLDIR/Common7/Tools;" +
                 "$WINDOWS_VS_VCINSTALLDIR/VCPackages;" +
@@ -128,8 +129,8 @@
 String msvcBinDir = (IS_64
                   ? "$WINDOWS_VS_VSINSTALLDIR/VC/BIN/amd64"
                   : "$WINDOWS_VS_VSINSTALLDIR/VC/BIN")
-def compiler = cygpath("$msvcBinDir/cl.exe")
-def linker = cygpath("$msvcBinDir/link.exe")
+def compiler = COMPILE_PARFAIT ? "cl.exe" : cygpath("$msvcBinDir/cl.exe")
+def linker = COMPILE_PARFAIT ? "link.exe" : cygpath("$msvcBinDir/link.exe")
 ext.RC = cygpath("$WINDOWS_SDK_DIR/Bin/RC.Exe")
 ext.FXC = cygpath("$WINDOWS_DXSDK_DIR/utilities/bin/x86/fxc.exe")
 ext.MC = cygpath("$WINDOWS_SDK_DIR/Bin/mt.exe")