changeset 7030:da8f82520f32

RT-36013 enable building freetype and pango in cross builds Reviewed-by: kcr
author ddhill
date Wed, 14 May 2014 14:57:00 -0400
parents 2396fec9b032
children 673952cc9f16
files build.gradle buildSrc/armv5sf.gradle buildSrc/armv6hf.gradle buildSrc/armv6sf.gradle buildSrc/armv7hf.gradle buildSrc/armv7sf.gradle
diffstat 6 files changed, 31 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Wed May 14 14:56:48 2014 -0400
+++ b/build.gradle	Wed May 14 14:57:00 2014 -0400
@@ -810,21 +810,6 @@
  *        in the name of the final library, such as libprism-common.dylib.
  */
 void addNative(Project project, String name) {
-    addNative(project, name, null)
-}
-
-/**
- * Convenience method for creating javah, cc, link, and "native" tasks in the given project. These
- * tasks are parameterized by name, so that we can produce, for example, javahGlass, ccGlass, etc
- * named tasks.
- * 
- * @param project The project to add tasks to
- * @param name The name of the project, such as "prism-common". This name is used
- *        in the name of the generated task, such as ccPrismCommon, and also
- *        in the name of the final library, such as libprism-common.dylib.
- * @param list of compile targets. Library is applicable only for these targets.
- */
-void addNative(Project project, String name, List<String> includeTargets) {
     // TODO if we want to handle 32/64 bit windows in the same build,
     // Then we will need to modify the win compile target to be win32 or win64
     def capitalName = name.split("-").collect{it.capitalize()}.join()
@@ -845,14 +830,25 @@
     def libRootDir = project.file("$project.buildDir/libs/$name")
     // For each compile target, create a javah / cc / link triplet
     compileTargets { t ->
-        if (includeTargets != null && !includeTargets.contains(t.name)) {
-            return
-        }
         def targetProperties = project.rootProject.ext[t.upper]
         def library = targetProperties.library
         def properties = targetProperties.get(name)
         def nativeDir = file("$nativeRootDir/${t.name}")
         def headerDir = file("$headerRootDir/${t.name}")
+
+        // If there is not a library clause in the properties, assume it is not wanted
+        if (!targetProperties.containsKey(name)) {
+            println("Ignoring native library ${name}. Not defined in ${t.name} project properties");
+            return
+        }
+
+        // check for the property disable${name} = true
+        def String disableKey = "disable${name}"
+        def boolean disabled = targetProperties.containsKey(disableKey) ? targetProperties.get(disableKey) : false
+        if (disabled) {
+            println("Native library ${name} disabled in ${t.name} project properties");
+            return
+        }
         
         def javahTask = project.task("javah${t.capital}${capitalName}", type: JavaHeaderTask, dependsOn: project.classes, group: "Build") {
             description = "Generates JNI Headers for ${name} for ${t.name}"
@@ -1281,9 +1277,8 @@
     addNative(project, "prismES2")
 
     if (IS_COMPILE_PANGO) {
-        // TODO: embedded support
-        addNative(project, "fontFreetype", ["linux"])
-        addNative(project, "fontPango", ["linux"])
+        addNative(project, "fontFreetype")
+        addNative(project, "fontPango")
     }
 
     if (IS_WINDOWS) {
@@ -2087,7 +2082,9 @@
             }
         }        
         
-        if (!t.name.startsWith("arm")) {
+        // check for the property disable${name} = true
+        def boolean disabled = targetProperties.containsKey('disableMedia') ? targetProperties.get('disableMedia') : false
+        if (!disabled) {
             // Building GStreamer
             def buildGStreamer = task("build${t.capital}GStreamer") {
                 enabled = IS_COMPILE_MEDIA
@@ -2785,10 +2782,7 @@
                 from("modules/graphics/build/libs/jsl-decora/${t.name}/${library(targetProperties.decora.lib)}")
                 def libs = ['font', 'prism', 'prismSW', 'prismES2', 'glass', 'iio']
                 if (IS_COMPILE_PANGO) {
-                    // TODO: embedded support
-                    if ("${defaultHostTarget}" == "${t.name}") {
-                        libs += ['fontFreetype', 'fontPango'];
-                    }
+                    libs += ['fontFreetype', 'fontPango'];
                 }
                 libs.each { lib ->
                     def variants = targetProperties[lib].containsKey('variants') && !useLipo ? targetProperties[lib].variants : [null]
--- a/buildSrc/armv5sf.gradle	Wed May 14 14:56:48 2014 -0400
+++ b/buildSrc/armv5sf.gradle	Wed May 14 14:57:00 2014 -0400
@@ -573,6 +573,7 @@
 ARMV5SF.fontT2K.linkFlags = fontLFlags
 ARMV5SF.fontT2K.lib = "javafx_font_t2k"
 
+ARMV5SF.disablefontFreetype = true // Need to fix the imports
 ARMV5SF.fontFreetype = [:]
 ARMV5SF.fontFreetype.javahInclude = ["com/sun/javafx/font/freetype/OSFreetype.class"]
 ARMV5SF.fontFreetype.nativeSource = ["src/main/native-font/freetype.c"]
@@ -582,6 +583,7 @@
 ARMV5SF.fontFreetype.linkFlags = [linkFlags, fontLFlags, freetypeLinkFlags].flatten()
 ARMV5SF.fontFreetype.lib = "javafx_font_freetype"
 
+ARMV5SF.disablefontPango = true
 ARMV5SF.fontPango = [:]
 ARMV5SF.fontPango.javahInclude = ["com/sun/javafx/font/freetype/OSPango.class"]
 ARMV5SF.fontPango.nativeSource = ["src/main/native-font/pango.c"]
@@ -601,6 +603,7 @@
 ARMV5SF.webkit.ccFlags  = extraCFlags.join(' ')
 ARMV5SF.webkit.linkFlags = extraLFlags.join(' ')
 
+ARMV5SF.disableMedia = true
 ARMV5SF.media = [:]
 ARMV5SF.media.compiler = compiler
 ARMV5SF.media.linker = linker
--- a/buildSrc/armv6hf.gradle	Wed May 14 14:56:48 2014 -0400
+++ b/buildSrc/armv6hf.gradle	Wed May 14 14:57:00 2014 -0400
@@ -597,6 +597,7 @@
 ARMV6HF.webkit.ccFlags  = extraCFlags.join(' ')
 ARMV6HF.webkit.linkFlags = extraLFlags.join(' ')
 
+ARMV6HF.disableMedia = true
 ARMV6HF.media = [:]
 ARMV6HF.media.compiler = compiler
 ARMV6HF.media.linker = linker
--- a/buildSrc/armv6sf.gradle	Wed May 14 14:56:48 2014 -0400
+++ b/buildSrc/armv6sf.gradle	Wed May 14 14:57:00 2014 -0400
@@ -571,6 +571,7 @@
 ARMV6SF.fontT2K.linkFlags = fontLFlags
 ARMV6SF.fontT2K.lib = "javafx_font_t2k"
 
+ARMV6SF.disablefontFreetype = true // Need to fix the imports
 ARMV6SF.fontFreetype = [:]
 ARMV6SF.fontFreetype.javahInclude = ["com/sun/javafx/font/freetype/OSFreetype.class"]
 ARMV6SF.fontFreetype.nativeSource = ["src/main/native-font/freetype.c"]
@@ -580,6 +581,7 @@
 ARMV6SF.fontFreetype.linkFlags = [linkFlags, fontLFlags, freetypeLinkFlags].flatten()
 ARMV6SF.fontFreetype.lib = "javafx_font_freetype"
 
+ARMV6SF.disablefontPango = true
 ARMV6SF.fontPango = [:]
 ARMV6SF.fontPango.javahInclude = ["com/sun/javafx/font/freetype/OSPango.class"]
 ARMV6SF.fontPango.nativeSource = ["src/main/native-font/pango.c"]
@@ -599,6 +601,7 @@
 ARMV6SF.webkit.ccFlags  = extraCFlags.join(' ')
 ARMV6SF.webkit.linkFlags = extraLFlags.join(' ')
 
+ARMV6SF.disableMedia = true
 ARMV6SF.media = [:]
 ARMV6SF.media.compiler = compiler
 ARMV6SF.media.linker = linker
--- a/buildSrc/armv7hf.gradle	Wed May 14 14:56:48 2014 -0400
+++ b/buildSrc/armv7hf.gradle	Wed May 14 14:57:00 2014 -0400
@@ -579,6 +579,7 @@
 ARMV7HF.webkit.ccFlags  = extraCFlags.join(' ')
 ARMV7HF.webkit.linkFlags = extraLFlags.join(' ')
 
+ARMV7SF.disableMedia = true
 ARMV7HF.media = [:]
 ARMV7HF.media.compiler = compiler
 ARMV7HF.media.linker = linker
--- a/buildSrc/armv7sf.gradle	Wed May 14 14:56:48 2014 -0400
+++ b/buildSrc/armv7sf.gradle	Wed May 14 14:57:00 2014 -0400
@@ -573,6 +573,7 @@
 ARMV7SF.fontT2K.linkFlags = fontLFlags
 ARMV7SF.fontT2K.lib = "javafx_font_t2k"
 
+ARMV7SF.disablefontFreetype = true // Need to fix the imports
 ARMV7SF.fontFreetype = [:]
 ARMV7SF.fontFreetype.javahInclude = ["com/sun/javafx/font/freetype/OSFreetype.class"]
 ARMV7SF.fontFreetype.nativeSource = ["src/main/native-font/freetype.c"]
@@ -582,6 +583,7 @@
 ARMV7SF.fontFreetype.linkFlags = [linkFlags, fontLFlags, freetypeLinkFlags].flatten()
 ARMV7SF.fontFreetype.lib = "javafx_font_freetype"
 
+ARMV7SF.disablefontPango = true
 ARMV7SF.fontPango = [:]
 ARMV7SF.fontPango.javahInclude = ["com/sun/javafx/font/freetype/OSPango.class"]
 ARMV7SF.fontPango.nativeSource = ["src/main/native-font/pango.c"]
@@ -601,6 +603,7 @@
 ARMV7SF.webkit.ccFlags  = extraCFlags.join(' ')
 ARMV7SF.webkit.linkFlags = extraLFlags.join(' ')
 
+ARMV7SF.disableMedia = true
 ARMV7SF.media = [:]
 ARMV7SF.media.compiler = compiler
 ARMV7SF.media.linker = linker