changeset 4301:66df77e2c6b2

RT-31639 Re-enable x86 development builds with EGL
author Daniel Blaukopf <daniel.blaukopf@oracle.com>
date Tue, 16 Jul 2013 14:26:23 +0300
parents 71b246b6efa0
children 74ac20176fc5
files buildSrc/x86egl.gradle
diffstat 1 files changed, 389 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/buildSrc/x86egl.gradle	Tue Jul 16 14:26:23 2013 +0300
@@ -0,0 +1,389 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ext.X86EGL = [:]
+
+// Declare whether this particular target file applies to the current system
+X86EGL.canBuild = IS_LINUX
+if (!X86EGL.canBuild) {
+    return;
+}
+
+// Lambda for naming the generated libs
+X86EGL.library = { name -> return "lib${name}.so" as String }
+
+// alias for this platform in legacy artifacts
+X86EGL.artifactsName = "x86egl"
+
+X86EGL.compileSwing = false;
+X86EGL.compileSWT = false;
+X86EGL.compileFXPackager = false;
+X86EGL.compileDesignTime = false;
+
+// Libraries end up in the sdk/rt/lib/arm directory for arm builds
+X86EGL.libDest = "lib/$OS_ARCH"
+
+// TODO this is garbage. Each target file should define what it includes,
+// not what it excludes.
+X86EGL.jfxrtJarExcludes = [
+    "**/*.hlsl",
+    "com/sun/glass/ui/win",
+    "com/sun/glass/ui/accessible/win",
+    "com/sun/prism/d3d",
+    "com/sun/prism/es2/gl/win",
+    //"com/sun/prism/null3d",
+    "com/sun/scenario/effect/impl/hw/d3d",
+    
+    "com/sun/glass/events/mac",
+    "com/sun/glass/ui/mac",
+    "com/sun/glass/ui/accessible/mac",
+    "com/sun/prism/es2/gl/mac",
+    
+    "com/sun/glass/ui/android",
+    
+    "com/sun/glass/ui/ios",
+    
+    "com/sun/glass/ui/swt", // SWT glass
+    
+    "javafx/embed/swing", // Swing Interop
+    
+    "javafx/embed/swt", // SWT Interop
+
+    "com/sun/prism/es2/MacGL*",
+    "com/sun/prism/es2/IOSGL*",
+    "com/sun/prism/es2/WinGL*",
+]
+
+def commonFlags = [
+        "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags
+        "-W", "-Wall", "-Wno-unused", "-Wno-parentheses", "-Werror=implicit-function-declaration"] // warning flags
+// Specify the compilation parameters and link parameters
+def ccFlags = [
+        commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c",
+        IS_DEBUG ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten()
+//ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
+def linkFlags = ["-shared", commonFlags].flatten()
+
+// Specify the compilation parameters and link parameters
+def extraCFlags = [
+        "-I", "-L",
+        ccFlags,
+        "-DEGL_X11_FB_CONTAINER"].flatten();
+def extraLFlags = [
+        "-I", "-L",
+        linkFlags].flatten()
+
+def lensLFlags = [extraLFlags, "-lpthread", "-ludev", "-ldl", "-lm"].flatten()
+
+def fontCFlags = [extraCFlags].flatten()
+def fontLFlags = [extraLFlags].flatten()
+
+def iioCFlags = [extraCFlags].flatten()
+def iioLFlags = [extraLFlags].flatten()
+
+def es2EglfbCFlags = [extraCFlags, "-DIS_EGLFB", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+def es2EglfbLFlags = [extraLFlags].flatten()
+
+def es2X11CFlags = [extraCFlags, "-DUSE_XSHM", "-DDEBUG", "-DIS_EGLX11", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+def es2X11LFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten()
+
+def mediaCFlags = [extraCFlags,
+    "-I/usr/include/gstreamer-0.10",
+    "-I/usr/include/glib-2.0",
+    "-DENABLE.nativeSource=1", "-DENABLE_GST_FFMPEG=1"].flatten()
+def mediaLFlags = [extraLFlags, "-lgstreamer-0.10", "-lgstapp-0.10",
+    "-lgstbase-0.10", "-lglib-2.0", "-lgobject-2.0", "-lgmodule-2.0", "-lgthread-2.0"].flatten()
+
+def webCFlags = [extraCFlags].flatten()
+def webLFlags = [extraLFlags].flatten()
+
+// Create $buildDir/linux_tools.properties file and load props from it
+setupTools("linux_tools",
+        { propFile ->
+            ByteArrayOutputStream results = new ByteArrayOutputStream();
+            exec {
+                commandLine("pkg-config", "--cflags", "gtk+-2.0", "gthread-2.0", "xtst");
+                setStandardOutput(results);
+            }
+            propFile << "cflags=" << results.toString().trim() << "\n";
+
+            results = new ByteArrayOutputStream();
+            exec {
+                commandLine "pkg-config", "--libs", "gtk+-2.0", "gthread-2.0", "xtst"
+                standardOutput = results
+            }
+            propFile << "libs=" << results.toString().trim();
+        },
+        { properties ->
+            ccFlags.addAll(properties.getProperty("cflags").split(" "))
+            linkFlags.addAll(properties.getProperty("libs").split(" "))
+        }
+)
+
+X86EGL.javafxPlatformProperties ="""javafx.platform=eglfb
+directfb.glass.platform=Lens
+directfb.glass.lens=dfb
+directfb.prism.order=sw
+directfb.com.sun.javafx.isEmbedded=true
+directfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglfb.glass.platform=Lens
+eglfb.glass.lens=eglfb
+eglfb.prism.order=es2
+eglfb.prism.eglfb=true
+eglfb.prism.device=true
+eglfb.prism.lcdtext=false
+eglfb.use.egl=true
+eglfb.use.gles2=true
+eglfb.embedded=eglfb
+eglfb.com.sun.javafx.isEmbedded=true
+eglfb.doNativeComposite=true
+eglfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+fb.glass.platform=Lens
+fb.glass.lens=fb
+fb.prism.order=sw
+fb.com.sun.javafx.isEmbedded=true
+fb.glass.restrictWindowToScreen=true
+fb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglx11.glass.platform=Lens
+eglx11.glass.lens=eglx11
+eglx11.prism.order=es2
+eglx11.prism.eglx11=true
+eglx11.prism.device=true
+eglx11.prism.lcdtext=false
+eglx11.use.egl=true
+eglx11.use.gles2=true
+eglx11.embedded=eglx11
+eglx11.com.sun.javafx.isEmbedded=true
+eglx11.com.sun.javafx.scene.control.skin.FXVK.cache=true
+gtk.glass.platform=gtk
+gtk.prism.order=sw
+gtk.com.sun.javafx.isEmbedded=true
+gtk.com.sun.javafx.scene.control.skin.FXVK.cache=true"""
+
+def pangoCCFlags = ["-D_ENABLE_PANGO"];
+def pangoLinkFlags = [];
+setupTools("linux_pango_tools",
+        { propFile ->
+            ByteArrayOutputStream results = new ByteArrayOutputStream();
+            exec {
+                commandLine "pkg-config", "--cflags", "pangoft2"
+                standardOutput = results
+            }
+            propFile << "cflags=" << results.toString().trim() << "\n";
+
+            results = new ByteArrayOutputStream();
+            exec {
+                commandLine "pkg-config", "--libs", "pangoft2"
+                standardOutput = results
+            }
+            propFile << "libs=" << results.toString().trim();
+        },
+        { properties ->
+            pangoCCFlags.addAll(properties.getProperty("cflags").split(" "))
+            pangoLinkFlags.addAll(properties.getProperty("libs").split(" "))
+        }
+)
+
+def compiler = "gcc"
+def linker = "g++"
+
+X86EGL.glass = [:]
+X86EGL.glass.variants = ["eglfb", "directfb", "fb", "eglx11", "gtk"]
+X86EGL.glass.javahInclude = [
+    "com/sun/glass/events/**",
+    "com/sun/glass/ui/*",
+    "com/sun/glass/ui/lens/*"]
+X86EGL.glass.lib = "glass"
+
+X86EGL.glass.eglfb = [:]
+// TODO when building headless, use lens/cursor/nullcursor/
+// otherwise we use lens/cursor/fbCursor/ and lens/input/udev
+
+// TODO when USE_RFB is specified use lens/rfb
+
+// TODO use /headless/headlessScreen when using headless
+X86EGL.glass.eglfb.nativeSource = [
+    file("modules/graphics/src/main/native-glass/lens"),
+    file("modules/graphics/src/main/native-glass/lens/wm"),
+    file("modules/graphics/src/main/native-glass/lens/cursor/fbCursor"),
+    file("modules/graphics/src/main/native-glass/lens/input/udev"),
+    file("modules/graphics/src/main/native-glass/lens/wm/screen/x11ContainerScreen.c")]
+    //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
+X86EGL.glass.eglfb.compiler = compiler
+X86EGL.glass.eglfb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.eglfb.linker = linker
+X86EGL.glass.eglfb.linkFlags = [lensLFlags].flatten()
+X86EGL.glass.eglfb.lib = "glass-lens-eglfb"
+
+X86EGL.glass.directfb = [:]
+X86EGL.glass.directfb.nativeSource = [
+    file("modules/graphics/src/main/native-glass/lens"),
+    file("modules/graphics/src/main/native-glass/lens/wm"),
+    file("modules/graphics/src/main/native-glass/lens/cursor/fbCursor"),
+    file("modules/graphics/src/main/native-glass/lens/input/udev"),
+    file("modules/graphics/src/main/native-glass/lens/wm/screen/dfbScreen.c")]
+    //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
+X86EGL.glass.directfb.compiler = compiler
+X86EGL.glass.directfb.ccFlags = ["-ffast-math", extraCFlags, "-I/usr/include/directfb", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.directfb.linker = linker
+X86EGL.glass.directfb.linkFlags = [lensLFlags].flatten()
+X86EGL.glass.directfb.lib = "glass-lens-dfb"
+
+X86EGL.glass.fb = [:]
+X86EGL.glass.fb.nativeSource = [
+    file("modules/graphics/src/main/native-glass/lens"),
+    file("modules/graphics/src/main/native-glass/lens/wm"),
+    file("modules/graphics/src/main/native-glass/lens/cursor/fbCursor"),
+    file("modules/graphics/src/main/native-glass/lens/input/udev"),
+    file("modules/graphics/src/main/native-glass/lens/wm/screen/fbdevScreen.c")]
+    //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
+X86EGL.glass.fb.compiler = compiler
+X86EGL.glass.fb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.fb.linker = linker
+X86EGL.glass.fb.linkFlags = [lensLFlags].flatten()
+X86EGL.glass.fb.lib = "glass-lens-fb"
+
+X86EGL.glass.eglx11 = [:]
+X86EGL.glass.eglx11.nativeSource = [
+    file("modules/graphics/src/main/native-glass/lens"),
+    file("modules/graphics/src/main/native-glass/lens/wm"),
+    file("modules/graphics/src/main/native-glass/lens/cursor/fbCursor"),
+    file("modules/graphics/src/main/native-glass/lens/input/udev"),
+    file("modules/graphics/src/main/native-glass/lens/wm/screen/x11ContainerScreen.c")]
+    //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
+X86EGL.glass.eglx11.compiler = compiler
+X86EGL.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.eglx11.linker = linker
+X86EGL.glass.eglx11.linkFlags = [lensLFlags].flatten()
+X86EGL.glass.eglx11.lib = "glass-lens-eglx11"
+
+X86EGL.glass.gtk = [:]
+X86EGL.glass.gtk.nativeSource = [
+    file("modules/graphics/src/main/native-glass/lens"),
+    file("modules/graphics/src/main/native-glass/lens/wm")]
+X86EGL.glass.gtk.compiler = compiler
+X86EGL.glass.gtk.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.gtk.linker = linker
+X86EGL.glass.gtk.linkFlags = [lensLFlags, "-lstdc++"].flatten()
+X86EGL.glass.gtk.lib = "glass"
+
+X86EGL.decora = [:]
+X86EGL.decora.compiler = compiler
+X86EGL.decora.ccFlags = extraCFlags
+X86EGL.decora.linker = linker
+X86EGL.decora.linkFlags = extraLFlags
+X86EGL.decora.lib = "decora-sse"
+
+X86EGL.prism = [:]
+X86EGL.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
+X86EGL.prism.nativeSource = file("modules/graphics/src/main/native-prism")
+X86EGL.prism.compiler = compiler
+X86EGL.prism.ccFlags = [extraCFlags].flatten()
+X86EGL.prism.linker = linker
+X86EGL.prism.linkFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten()
+X86EGL.prism.lib = "prism-common"
+
+X86EGL.prismSW = [:]
+X86EGL.prismSW.javahInclude = ["com/sun/pisces/**/*"]
+X86EGL.prismSW.nativeSource = file("modules/graphics/src/main/native-prism-sw")
+X86EGL.prismSW.compiler = compiler
+X86EGL.prismSW.ccFlags = [extraCFlags].flatten()
+X86EGL.prismSW.linker = linker
+X86EGL.prismSW.linkFlags = [extraLFlags].flatten()
+X86EGL.prismSW.lib = "prism-sw"
+
+X86EGL.iio = [:]
+X86EGL.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
+X86EGL.iio.nativeSource = [
+    file("modules/graphics/src/main/native-iio"),
+    file("modules/graphics/src/main/native-iio/libjpeg7")]
+X86EGL.iio.compiler = compiler
+X86EGL.iio.ccFlags = iioCFlags
+X86EGL.iio.linker = linker
+X86EGL.iio.linkFlags = iioLFlags
+X86EGL.iio.lib = "javafx-iio"
+
+X86EGL.prismES2 = [:]
+X86EGL.prismES2.variants = ["eglfb", "eglx11"]
+X86EGL.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
+
+X86EGL.prismES2.eglfb = [:]
+X86EGL.prismES2.eglfb.nativeSource = [
+    file("modules/graphics/src/main/native-prism-es2"),
+    file("modules/graphics/src/main/native-prism-es2/GL"),
+    file("modules/graphics/src/main/native-prism-es2/eglfb")
+]
+X86EGL.prismES2.eglfb.compiler = compiler
+X86EGL.prismES2.eglfb.ccFlags = es2EglfbCFlags
+X86EGL.prismES2.eglfb.linker = linker
+X86EGL.prismES2.eglfb.linkFlags = es2EglfbLFlags
+X86EGL.prismES2.eglfb.lib = "prism-es2-eglfb"
+
+X86EGL.prismES2.eglx11 = [:]
+X86EGL.prismES2.eglx11.nativeSource = [
+    file("modules/graphics/src/main/native-prism-es2"),
+    file("modules/graphics/src/main/native-prism-es2/GL"),
+    file("modules/graphics/src/main/native-prism-es2/eglx11")
+]
+X86EGL.prismES2.eglx11.compiler = compiler
+X86EGL.prismES2.eglx11.ccFlags = es2X11CFlags
+X86EGL.prismES2.eglx11.linker = linker
+X86EGL.prismES2.eglx11.linkFlags = es2X11LFlags
+X86EGL.prismES2.eglx11.lib = "prism-es2-eglx11"
+
+def closedDir = file("$projectDir/../rt-closed")
+X86EGL.font = [:]
+X86EGL.font.javahInclude = [
+    "com/sun/javafx/font/**/*",
+    "com/sun/javafx/text/**/*"]
+X86EGL.font.nativeSource = [file("modules/graphics/src/main/native-font")]
+X86EGL.font.compiler = compiler
+X86EGL.font.ccFlags = fontCFlags
+X86EGL.font.linker = linker
+X86EGL.font.linkFlags = fontLFlags
+X86EGL.font.lib = "javafx-font"
+
+X86EGL.fontT2K = [:]
+X86EGL.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
+X86EGL.fontT2K.nativeSource = [
+        file("$closedDir/javafx-font-t2k-native/src"),
+        file("$closedDir/javafx-font-t2k-native/src/layout"),
+        file("$closedDir/javafx-font-t2k-native/src/layoutfx")]
+X86EGL.fontT2K.compiler = compiler
+X86EGL.fontT2K.ccFlags = fontCFlags
+X86EGL.fontT2K.linker = linker
+X86EGL.fontT2K.linkFlags = fontLFlags
+X86EGL.fontT2K.lib = "javafx-font-t2k"
+
+X86EGL.fontPango = [:]
+X86EGL.fontPango.javahInclude = ["com/sun/javafx/font/pango/*"]
+X86EGL.fontPango.nativeSource = [
+    "src/main/native-font/pango.c",
+    "src/main/native-font/freetype.c"]
+X86EGL.fontPango.compiler = compiler
+X86EGL.fontPango.ccFlags = ["-DJFXFONT_PLUS", ccFlags, pangoCCFlags].flatten()
+X86EGL.fontPango.linker = linker
+X86EGL.fontPango.linkFlags = [linkFlags, pangoLinkFlags].flatten()
+X86EGL.fontPango.lib = "javafx-font-pango"