1 /*
   2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 ext.X86EGL = [:]
  27 
  28 def sdk
  29 def compilerHome
  30 def compilerPrefix
  31 def pkgconfig
  32 def jniPlatform
  33 if (IS_MAC) {
  34     jniPlatform="darwin"
  35     fetchExternalTools('X86EGL', [ "x86egl-01.tgz" ], 
  36         rootProject.CROSS_TOOLS_DIR, rootProject.IS_IMPORT_CROSS_TOOLS)
  37     sdk=file("${rootProject.CROSS_TOOLS_DIR}/x86egl-01")
  38     pkgconfig="${sdk}/bin/pkg-config"
  39 } else {
  40     jniPlatform="linux"
  41     sdk=""
  42     pkgconfig="pkg-config"
  43 }
  44 
  45 if (rootProject.hasProperty("X86EGL_COMPILER")) {
  46     logger.quiet "Using alternate X86EGL_COMPILER $rootProject.X86EGL_COMPILER"
  47     compilerHome=file(rootProject.X86EGL_COMPILER);
  48 } else {
  49     compilerHome=file("/usr");
  50 }
  51 if (rootProject.hasProperty("X86EGL_COMPILER_PREFIX")) {
  52     logger.quiet "Using alternate X86EGL_COMPILER_PREFIX $rootProject.X86EGL_COMPILER_PREFIX"
  53     compilerPrefix="${rootProject.X86EGL_COMPILER_PREFIX}"
  54 } else {
  55     compilerPrefix=""
  56 }
  57 
  58 def compiler = file("$compilerHome/bin/${compilerPrefix}gcc").getAbsolutePath()
  59 def linker = file("$compilerHome/bin/${compilerPrefix}g++").getAbsolutePath()
  60 
  61 // Declare whether this particular target file applies to the current system
  62 X86EGL.canBuild = (IS_LINUX || IS_MAC) && compilerHome.exists()
  63 if (!X86EGL.canBuild) {
  64     return;
  65 }
  66 
  67 // Lambda for naming the generated libs
  68 X86EGL.library = { name -> return "lib${name}.so" as String }
  69 
  70 X86EGL.compileSwing = false;
  71 X86EGL.compileSWT = false;
  72 X86EGL.compileFXPackager = false;
  73 X86EGL.compileDesignTime = false;
  74 X86EGL.compileWebnodeNative = false;
  75 X86EGL.compileMediaNative = false;
  76 
  77 X86EGL.includeLens = true
  78 X86EGL.includeMonocle = true
  79 X86EGL.includeNull3d = true
  80 X86EGL.includeEGL = true
  81 X86EGL.includeSwing = false
  82 X86EGL.includeSWT = false
  83 X86EGL.includeGTK = true
  84 
  85 X86EGL.javafxPlatformDefault="monocle"
  86 
  87 // Libraries end up in the sdk/rt/lib/[i386|amd46] directory depending on machine arch
  88 if (rootProject.hasProperty("X86EGL_ARCH")) {
  89     X86EGL.arch = X86EGL_ARCH
  90     X86EGL.libDest = "lib/${X86EGL_ARCH}"
  91 } else {
  92     X86EGL.arch = OS_ARCH
  93     X86EGL.libDest = "lib/${OS_ARCH}"
  94 }
  95 
  96 def commonFlags = [
  97         "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags
  98         "-W", "-Wall", "-Wno-unused", "-Wno-parentheses", "-Werror=implicit-function-declaration"] // warning flags
  99 // Specify the compilation parameters and link parameters
 100 def ccFlags = [
 101         commonFlags,
 102         "-I$JDK_HOME/include", "-I$JDK_HOME/include/${jniPlatform}", "-c",
 103         IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].flatten()
 104 //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
 105 def linkFlags = ["-shared", commonFlags].flatten()
 106 
 107 // Specify the compilation parameters and link parameters
 108 def extraCFlags = [
 109         "-I", "-L",
 110         ccFlags,
 111         "-I$sdk/usr/include",
 112         "-DEGL_X11_FB_CONTAINER"].flatten();
 113 def extraLFlags = [
 114         "-I", "-L",
 115         "-L$sdk/usr/lib",
 116         "-L$sdk/usr/lib/i386-linux-gnu",
 117         linkFlags].flatten()
 118 
 119 def lensLFlags = [extraLFlags, "-lpthread", "-ludev", "-ldl", "-lm"].flatten()
 120 def monocleCFlags = [
 121         extraCFlags,
 122         "-Werror",
 123         "-I", file("modules/graphics/src/main/native-glass/monocle/")].flatten();
 124 def monocleLFlags = [extraLFlags, "-ldl", "-lm"].flatten()
 125 
 126 def fontCFlags = [extraCFlags].flatten()
 127 def fontLFlags = [extraLFlags].flatten()
 128 
 129 def iioCFlags = [extraCFlags].flatten()
 130 def iioLFlags = [extraLFlags].flatten()
 131 
 132 def es2EglfbCFlags = [extraCFlags, "-DIS_EGLFB", "-DLINUX", "-ffast-math" ].flatten()
 133 def es2EglfbLFlags = [extraLFlags].flatten()
 134 
 135 def es2X11CFlags = [extraCFlags, "-DUSE_XSHM", "-DDEBUG", "-DIS_EGLX11", "-DLINUX"].flatten()
 136 def es2X11LFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten()
 137 
 138 def mediaCFlags = [extraCFlags,
 139     "-I${sdk}/usr/include/gstreamer-0.10",
 140     "-I${sdk}/usr/include/glib-2.0",
 141     "-DENABLE.nativeSource=1", "-DENABLE_GST_FFMPEG=1"].flatten()
 142 def mediaLFlags = [extraLFlags, "-lgstreamer-0.10", "-lgstapp-0.10",
 143     "-lgstbase-0.10", "-lglib-2.0", "-lgobject-2.0", "-lgmodule-2.0", "-lgthread-2.0"].flatten()
 144 
 145 def webCFlags = [extraCFlags].flatten()
 146 def webLFlags = [extraLFlags].flatten()
 147 
 148 def gtkCFlags = [extraCFlags].flatten()
 149 def gtkLFlags = [extraLFlags].flatten()
 150 // Create $buildDir/x86egl_tools.properties file and load props from it
 151 setupTools("x86egl_tools",
 152         { propFile ->
 153             ByteArrayOutputStream results = new ByteArrayOutputStream();
 154 
 155             exec {
 156                 commandLine("$pkgconfig", "--cflags", "gtk+-2.0",
 157                         "gthread-2.0", "xtst");
 158                 setStandardOutput(results);
 159             }
 160             propFile << "cflags=" << results.toString().trim() << "\n";
 161 
 162             results = new ByteArrayOutputStream();
 163             exec {
 164                 commandLine "$pkgconfig", "--libs", "gtk+-2.0",
 165                         "gthread-2.0", "xtst"
 166                 standardOutput = results
 167             }
 168             propFile << "libs=" << results.toString().trim();
 169         },
 170         { properties ->
 171             gtkCFlags.addAll(properties.getProperty("cflags").split(" "))
 172             gtkLFlags.addAll(properties.getProperty("libs").split(" "))
 173         }
 174 )
 175 
 176 def monoclePlatformAdditions = """
 177 monocle.glass.platform=Monocle
 178 monocle.prism.order=es2,sw
 179 monocle.prism.eglfb=true
 180 monocle.prism.lcdtext=false
 181 monocle.prism.maxvram=128m
 182 monocle.prism.targetvram=112m
 183 monocle.use.egl=true
 184 monocle.use.gles2=true
 185 monocle.embedded=monocle
 186 monocle.com.sun.javafx.isEmbedded=true
 187 monocle.doNativeComposite=true
 188 monocle.com.sun.javafx.scene.control.skin.FXVK.cache=true
 189 monocle.prism.glDepthSize=0
 190 monocle.com.sun.javafx.gestures.zoom=true
 191 monocle.com.sun.javafx.gestures.rotate=true
 192 monocle.com.sun.javafx.gestures.scroll=true"""
 193 
 194 def lensPlatformAdditions = """
 195 directfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 196 directfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 197 directfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 198 directfb.glass.platform=Lens
 199 directfb.glass.lens=dfb
 200 directfb.prism.order=sw
 201 directfb.com.sun.javafx.isEmbedded=true
 202 directfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
 203 directfb.com.sun.javafx.gestures.zoom=true
 204 directfb.com.sun.javafx.gestures.rotate=true
 205 directfb.com.sun.javafx.gestures.scroll=true
 206 eglfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 207 eglfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 208 eglfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 209 eglfb.glass.platform=Lens
 210 eglfb.glass.lens=eglfb
 211 eglfb.prism.order=es2
 212 eglfb.prism.eglfb=true
 213 eglfb.prism.lcdtext=false
 214 eglfb.prism.maxvram=128m
 215 eglfb.prism.targetvram=112m
 216 eglfb.use.egl=true
 217 eglfb.use.gles2=true
 218 eglfb.embedded=eglfb
 219 eglfb.com.sun.javafx.isEmbedded=true
 220 eglfb.doNativeComposite=true
 221 eglfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
 222 eglfb.prism.glDepthSize=0
 223 eglfb.com.sun.javafx.gestures.zoom=true
 224 eglfb.com.sun.javafx.gestures.rotate=true
 225 eglfb.com.sun.javafx.gestures.scroll=true
 226 fb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 227 fb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 228 fb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 229 fb.glass.platform=Lens
 230 fb.glass.lens=fb
 231 fb.prism.order=sw
 232 fb.com.sun.javafx.isEmbedded=true
 233 fb.glass.restrictWindowToScreen=true
 234 fb.com.sun.javafx.scene.control.skin.FXVK.cache=true
 235 fb.com.sun.javafx.gestures.zoom=true
 236 fb.com.sun.javafx.gestures.rotate=true
 237 fb.com.sun.javafx.gestures.scroll=true
 238 eglx11.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 239 eglx11.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 240 eglx11.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 241 eglx11.glass.platform=Lens
 242 eglx11.glass.lens=eglx11
 243 eglx11.prism.order=es2
 244 eglx11.prism.eglx11=true
 245 eglx11.prism.lcdtext=false
 246 eglx11.prism.maxvram=128m
 247 eglx11.prism.targetvram=112m
 248 eglx11.use.egl=true
 249 eglx11.use.gles2=true
 250 eglx11.embedded=eglx11
 251 eglx11.com.sun.javafx.isEmbedded=true
 252 eglx11.com.sun.javafx.scene.control.skin.FXVK.cache=true
 253 eglx11.prism.glDepthSize=0
 254 eglx11.com.sun.javafx.gestures.zoom=true
 255 eglx11.com.sun.javafx.gestures.rotate=true
 256 eglx11.com.sun.javafx.gestures.scroll=true"""
 257 
 258 def gtkPlatformAdditions = """
 259 gtk.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
 260 gtk.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
 261 gtk.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 262 gtk.glass.platform=gtk
 263 gtk.prism.order=sw
 264 gtk.com.sun.javafx.isEmbedded=true
 265 gtk.com.sun.javafx.scene.control.skin.FXVK.cache=true
 266 gtk.com.sun.javafx.gestures.zoom=true
 267 gtk.com.sun.javafx.gestures.rotate=true
 268 gtk.com.sun.javafx.gestures.scroll=true"""
 269 
 270 def pangoCCFlags = ["-D_ENABLE_PANGO"];
 271 def pangoLinkFlags = [];
 272 setupTools("x86egl_pango_tools",
 273         { propFile ->
 274             ByteArrayOutputStream results = new ByteArrayOutputStream();
 275             exec {
 276                 commandLine "$pkgconfig", "--cflags", "pangoft2"
 277                 standardOutput = results
 278             }
 279             propFile << "cflags=" << results.toString().trim() << "\n";
 280 
 281             results = new ByteArrayOutputStream();
 282             exec {
 283                 commandLine "$pkgconfig", "--libs", "pangoft2"
 284                 standardOutput = results
 285             }
 286             propFile << "libs=" << results.toString().trim();
 287         },
 288         { properties ->
 289             pangoCCFlags.addAll(properties.getProperty("cflags").split(" "))
 290             pangoLinkFlags.addAll(properties.getProperty("libs").split(" "))
 291         }
 292 )
 293 
 294 def freetypeCCFlags = [ext.IS_COMPILE_PANGO ? "-D_ENABLE_PANGO" :
 295                        ext.IS_COMPILE_HARFBUZZ ? "-D_ENABLE_HARFBUZZ" : ""]
 296 def freetypeLinkFlags = []
 297 setupTools("x86egl_freetype_tools",
 298     { propFile ->
 299         ByteArrayOutputStream results = new ByteArrayOutputStream();
 300         exec {
 301             commandLine "pkg-config", "--cflags", "freetype2"
 302             standardOutput = results
 303         }
 304         propFile << "cflags=" << results.toString().trim() << "\n";
 305 
 306         results = new ByteArrayOutputStream();
 307         exec {
 308             commandLine "pkg-config", "--libs", "freetype2"
 309             standardOutput = results
 310         }
 311         propFile << "libs=" << results.toString().trim();
 312     },
 313     { properties ->
 314         freetypeCCFlags.addAll(properties.getProperty("cflags").split(" "))
 315         freetypeLinkFlags.addAll(properties.getProperty("libs").split(" "))
 316     }
 317 )
 318 
 319 X86EGL.javafxPlatformProperties = "javafx.platform=${X86EGL.javafxPlatformDefault}"
 320 
 321 X86EGL.glass = [:]
 322 X86EGL.glass.javahInclude = [
 323     "com/sun/glass/events/**",
 324     "com/sun/glass/ui/*"]
 325 X86EGL.glass.variants = [ ]
 326 if (X86EGL.includeLens) { 
 327     X86EGL.glass.variants.addAll("eglfb", "directfb", "fb", "lensport" );
 328     X86EGL.glass.javahInclude.addAll("com/sun/glass/ui/lens/*");
 329     X86EGL.javafxPlatformProperties = X86EGL.javafxPlatformProperties + lensPlatformAdditions
 330 }
 331 if (X86EGL.includeMonocle) { 
 332     X86EGL.glass.variants.addAll("monocle", "monocle_x11");
 333     X86EGL.glass.javahInclude.addAll(
 334         "com/sun/glass/ui/monocle/*",
 335         "com/sun/glass/ui/monocle/dispman/*",
 336         "com/sun/glass/ui/monocle/mx6/*",
 337         "com/sun/glass/ui/monocle/linux/*",
 338         "com/sun/glass/ui/monocle/util/*",
 339         "com/sun/glass/ui/monocle/x11/*");
 340     X86EGL.javafxPlatformProperties = X86EGL.javafxPlatformProperties + monoclePlatformAdditions
 341 }
 342 if (X86EGL.includeGTK) {
 343     X86EGL.glass.variants.addAll("gtk");
 344     X86EGL.glass.javahInclude.addAll("com/sun/glass/ui/gtk/*");
 345     X86EGL.javafxPlatformProperties = X86EGL.javafxPlatformProperties + gtkPlatformAdditions
 346 }
 347 
 348 X86EGL.glass.lib = "glass"
 349 
 350 X86EGL.glass.monocle = [:]
 351 X86EGL.glass.monocle.nativeSource = [
 352         file("modules/graphics/src/main/native-glass/monocle"),
 353         file("modules/graphics/src/main/native-glass/monocle/linux"),
 354         file("modules/graphics/src/main/native-glass/monocle/util") ]
 355 X86EGL.glass.monocle.compiler = compiler
 356 X86EGL.glass.monocle.ccFlags = monocleCFlags
 357 X86EGL.glass.monocle.linker = linker
 358 X86EGL.glass.monocle.linkFlags = monocleLFlags
 359 X86EGL.glass.monocle.lib = "glass_monocle"
 360 
 361 X86EGL.glass.monocle_x11 = [:]
 362 X86EGL.glass.monocle_x11.nativeSource = [
 363         file("modules/graphics/src/main/native-glass/monocle/util"),
 364         file("modules/graphics/src/main/native-glass/monocle/x11") ]
 365 X86EGL.glass.monocle_x11.compiler = compiler
 366 X86EGL.glass.monocle_x11.ccFlags = monocleCFlags
 367 X86EGL.glass.monocle_x11.linker = linker
 368 X86EGL.glass.monocle_x11.linkFlags = [ monocleLFlags, "-lX11" ].flatten()
 369 X86EGL.glass.monocle_x11.lib = "glass_monocle_x11"
 370 
 371 X86EGL.glass.lensport = [:]
 372 X86EGL.glass.lensport.nativeSource = [
 373     file("modules/graphics/src/main/native-glass/lens/lensport") ]
 374 X86EGL.glass.lensport.compiler = compiler
 375 X86EGL.glass.lensport.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DISEGLFB",
 376     "-DLENSPORT", "-I", file("modules/graphics/src/main/native-glass/lens/") ].flatten()
 377 X86EGL.glass.lensport.linker = linker
 378 X86EGL.glass.lensport.linkFlags = [lensLFlags].flatten()
 379 X86EGL.glass.lensport.lib = "lens_porting"
 380 
 381 X86EGL.glass.eglfb = [:]
 382 // TODO when building headless, use lens/cursor/nullcursor/
 383 // otherwise we use lens/cursor/fbCursor/ and lens/input/udev
 384 
 385 // TODO when USE_RFB is specified use lens/rfb
 386 
 387 // TODO use /headless/headlessScreen when using headless
 388 X86EGL.glass.eglfb.nativeSource = [
 389     file("modules/graphics/src/main/native-glass/lens"),
 390     file("modules/graphics/src/main/native-glass/lens/wm"),
 391     file("modules/graphics/src/main/native-glass/lens/cursor/fbCursor"),
 392     file("modules/graphics/src/main/native-glass/lens/input/udev"),
 393     file("modules/graphics/src/main/native-glass/lens/wm/screen/x11ContainerScreen.c") ]
 394     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 395 X86EGL.glass.eglfb.compiler = compiler
 396 X86EGL.glass.eglfb.ccFlags = [ es2EglfbCFlags, "-I", X86EGL.glass.lensport.nativeSource ].flatten()
 397 X86EGL.glass.eglfb.linker = linker
 398 X86EGL.glass.eglfb.linkFlags = [lensLFlags].flatten()
 399 X86EGL.glass.eglfb.lib = "glass_lens_eglfb"
 400 
 401 X86EGL.glass.directfb = [:]
 402 X86EGL.glass.directfb.nativeSource = [
 403     file("modules/graphics/src/main/native-glass/lens"),
 404     file("modules/graphics/src/main/native-glass/lens/wm"),
 405     file("modules/graphics/src/main/native-glass/lens/cursor/fbCursor"),
 406     file("modules/graphics/src/main/native-glass/lens/input/udev"),
 407     file("modules/graphics/src/main/native-glass/lens/wm/screen/dfbScreen.c"),
 408     file("modules/graphics/src/main/native-glass/lens/lensport") ]
 409     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 410 X86EGL.glass.directfb.compiler = compiler
 411 X86EGL.glass.directfb.ccFlags = ["-ffast-math", extraCFlags,
 412         "-I${sdk}/usr/include/directfb", "-DLINUX"].flatten()
 413 X86EGL.glass.directfb.linker = linker
 414 X86EGL.glass.directfb.linkFlags = [lensLFlags].flatten()
 415 X86EGL.glass.directfb.lib = "glass_lens_dfb"
 416 
 417 X86EGL.glass.fb = [:]
 418 X86EGL.glass.fb.nativeSource = [
 419     file("modules/graphics/src/main/native-glass/lens"),
 420     file("modules/graphics/src/main/native-glass/lens/wm"),
 421     file("modules/graphics/src/main/native-glass/lens/cursor/fbCursor"),
 422     file("modules/graphics/src/main/native-glass/lens/input/udev"),
 423     file("modules/graphics/src/main/native-glass/lens/wm/screen/fbdevScreen.c"),
 424     file("modules/graphics/src/main/native-glass/lens/lensport") ]
 425     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 426 X86EGL.glass.fb.compiler = compiler
 427 X86EGL.glass.fb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 428 X86EGL.glass.fb.linker = linker
 429 X86EGL.glass.fb.linkFlags = [lensLFlags].flatten()
 430 X86EGL.glass.fb.lib = "glass_lens_fb"
 431 
 432 X86EGL.glass.eglx11 = [:]
 433 X86EGL.glass.eglx11.nativeSource = [
 434     file("modules/graphics/src/main/native-glass/lens"),
 435     file("modules/graphics/src/main/native-glass/lens/wm"),
 436     file("modules/graphics/src/main/native-glass/lens/cursor/fbCursor"),
 437     file("modules/graphics/src/main/native-glass/lens/input/udev"),
 438     file("modules/graphics/src/main/native-glass/lens/wm/screen/x11ContainerScreen.c")]
 439     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 440 X86EGL.glass.eglx11.compiler = compiler
 441 X86EGL.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 442 X86EGL.glass.eglx11.linker = linker
 443 X86EGL.glass.eglx11.linkFlags = [lensLFlags].flatten()
 444 X86EGL.glass.eglx11.lib = "glass_lens_eglx11"
 445 
 446 X86EGL.glass.gtk = [:]
 447 X86EGL.glass.gtk.nativeSource = file("modules/graphics/src/main/native-glass/gtk")
 448 X86EGL.glass.gtk.compiler = compiler
 449 X86EGL.glass.gtk.ccFlags = ["-ffast-math", gtkCFlags, "-DLINUX"].flatten()
 450 X86EGL.glass.gtk.linker = linker
 451 X86EGL.glass.gtk.linkFlags = [gtkLFlags, "-lstdc++"].flatten()
 452 X86EGL.glass.gtk.lib = "glass"
 453 
 454 X86EGL.decora = [:]
 455 X86EGL.decora.compiler = compiler
 456 X86EGL.decora.ccFlags = extraCFlags
 457 X86EGL.decora.linker = linker
 458 X86EGL.decora.linkFlags = extraLFlags
 459 X86EGL.decora.lib = "decora_sse"
 460 
 461 X86EGL.prism = [:]
 462 X86EGL.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
 463 X86EGL.prism.nativeSource = file("modules/graphics/src/main/native-prism")
 464 X86EGL.prism.compiler = compiler
 465 X86EGL.prism.ccFlags = [extraCFlags].flatten()
 466 X86EGL.prism.linker = linker
 467 X86EGL.prism.linkFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten()
 468 X86EGL.prism.lib = "prism_common"
 469 
 470 X86EGL.prismSW = [:]
 471 X86EGL.prismSW.javahInclude = ["com/sun/pisces/**/*"]
 472 X86EGL.prismSW.nativeSource = file("modules/graphics/src/main/native-prism-sw")
 473 X86EGL.prismSW.compiler = compiler
 474 X86EGL.prismSW.ccFlags = [extraCFlags].flatten()
 475 X86EGL.prismSW.linker = linker
 476 X86EGL.prismSW.linkFlags = [extraLFlags].flatten()
 477 X86EGL.prismSW.lib = "prism_sw"
 478 
 479 X86EGL.iio = [:]
 480 X86EGL.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
 481 X86EGL.iio.nativeSource = [
 482     file("modules/graphics/src/main/native-iio"),
 483     file("modules/graphics/src/main/native-iio/libjpeg7")]
 484 X86EGL.iio.compiler = compiler
 485 X86EGL.iio.ccFlags = iioCFlags
 486 X86EGL.iio.linker = linker
 487 X86EGL.iio.linkFlags = iioLFlags
 488 X86EGL.iio.lib = "javafx_iio"
 489 
 490 X86EGL.prismES2 = [:]
 491 X86EGL.prismES2.variants = ["eglfb", "monocle"]
 492 X86EGL.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
 493 
 494 X86EGL.prismES2.eglfb = [:]
 495 X86EGL.prismES2.eglfb.nativeSource = [
 496     file("modules/graphics/src/main/native-prism-es2"),
 497     file("modules/graphics/src/main/native-prism-es2/GL"),
 498     file("modules/graphics/src/main/native-prism-es2/eglfb")
 499 ]
 500 X86EGL.prismES2.eglfb.compiler = compiler
 501 X86EGL.prismES2.eglfb.ccFlags = [ es2EglfbCFlags, "-I", X86EGL.glass.lensport.nativeSource ].flatten()
 502 X86EGL.prismES2.eglfb.linker = linker
 503 X86EGL.prismES2.eglfb.linkFlags = es2EglfbLFlags
 504 X86EGL.prismES2.eglfb.lib = "prism_es2_eglfb"
 505 
 506 X86EGL.prismES2.eglx11 = [:]
 507 X86EGL.prismES2.eglx11.nativeSource = [
 508     file("modules/graphics/src/main/native-prism-es2"),
 509     file("modules/graphics/src/main/native-prism-es2/GL"),
 510     file("modules/graphics/src/main/native-prism-es2/eglx11")
 511 ]
 512 X86EGL.prismES2.eglx11.compiler = compiler
 513 X86EGL.prismES2.eglx11.ccFlags = es2X11CFlags
 514 X86EGL.prismES2.eglx11.linker = linker
 515 X86EGL.prismES2.eglx11.linkFlags = es2X11LFlags
 516 X86EGL.prismES2.eglx11.lib = "prism_es2_eglx11"
 517 
 518 X86EGL.prismES2.monocle= [:]
 519 X86EGL.prismES2.monocle.nativeSource = [
 520         file("modules/graphics/src/main/native-prism-es2"),
 521         file("modules/graphics/src/main/native-prism-es2/GL"),
 522         file("modules/graphics/src/main/native-prism-es2/monocle")
 523 ]
 524 X86EGL.prismES2.monocle.compiler = compiler
 525 X86EGL.prismES2.monocle.ccFlags = [ es2EglfbCFlags, "-I", X86EGL.glass.lensport.nativeSource ].flatten()
 526 X86EGL.prismES2.monocle.linker = linker
 527 X86EGL.prismES2.monocle.linkFlags = es2EglfbLFlags
 528 X86EGL.prismES2.monocle.lib = "prism_es2_monocle"
 529 
 530 def closedDir = file("$projectDir/../rt-closed")
 531 X86EGL.font = [:]
 532 X86EGL.font.javahInclude = [
 533     "com/sun/javafx/font/**/*",
 534     "com/sun/javafx/text/**/*"]
 535 X86EGL.font.nativeSource = [file("modules/graphics/src/main/native-font")]
 536 X86EGL.font.compiler = compiler
 537 X86EGL.font.ccFlags = fontCFlags
 538 X86EGL.font.linker = linker
 539 X86EGL.font.linkFlags = fontLFlags
 540 X86EGL.font.lib = "javafx_font"
 541 
 542 X86EGL.fontT2K = [:]
 543 X86EGL.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
 544 X86EGL.fontT2K.nativeSource = [
 545         file("$closedDir/javafx-font-t2k-native/src"),
 546         file("$closedDir/javafx-font-t2k-native/src/layout")]
 547 X86EGL.fontT2K.compiler = compiler
 548 X86EGL.fontT2K.ccFlags = [fontCFlags, "-DLE_STANDALONE"].flatten()
 549 X86EGL.fontT2K.linker = linker
 550 X86EGL.fontT2K.linkFlags = fontLFlags
 551 X86EGL.fontT2K.lib = "javafx_font_t2k"
 552 
 553 X86EGL.fontFreetype = [:]
 554 X86EGL.fontFreetype.javahInclude = ["com/sun/javafx/font/freetype/OSFreetype.class"]
 555 X86EGL.fontFreetype.nativeSource = ["src/main/native-font/freetype.c"]
 556 X86EGL.fontFreetype.compiler = compiler
 557 X86EGL.fontFreetype.ccFlags = ["-DJFXFONT_PLUS", ccFlags, freetypeCCFlags].flatten()
 558 X86EGL.fontFreetype.linker = linker
 559 X86EGL.fontFreetype.linkFlags = [linkFlags, freetypeLinkFlags].flatten()
 560 X86EGL.fontFreetype.lib = "javafx_font_freetype"
 561 
 562 X86EGL.fontPango = [:]
 563 X86EGL.fontPango.javahInclude = ["com/sun/javafx/font/freetype/OSPango.class"]
 564 X86EGL.fontPango.nativeSource = ["src/main/native-font/pango.c"]
 565 X86EGL.fontPango.compiler = compiler
 566 X86EGL.fontPango.ccFlags = ["-DJFXFONT_PLUS", ccFlags, pangoCCFlags].flatten()
 567 X86EGL.fontPango.linker = linker
 568 X86EGL.fontPango.linkFlags = [linkFlags, pangoLinkFlags].flatten()
 569 X86EGL.fontPango.lib = "javafx_font_pango"
 570 
 571 X86EGL.disableMedia = true
 572 X86EGL.media =[:]
 573 X86EGL.media.compiler = compiler
 574 X86EGL.media.linker = linker
 575 X86EGL.media.lib = "ar"
 576 
 577 X86EGL.deploy = [:]
 578 X86EGL.deploy.publicLibraryFilter = [
 579   "fxavcodecplugin-52.so",
 580   "fxavcodecplugin-53.so",
 581   "fxplugins.so",
 582   "libjfxwebkit.so",
 583   "libgstplugins-lite.so",
 584   "libgstreamer-lite.so",
 585   "libprism_es2_eglx11.so",
 586   "libglass_lens_fb.so"
 587 ]
 588 X86EGL.deploy.compressBigJar=true