Permalink
Cannot retrieve contributors at this time
/* | |
* Copyright (c) 2013, 2019, 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.ARMV6HF = [:] | |
// Define the location of the sdk and toolchain | |
def crossLibsPackage="armv6hf-02" | |
def sdk=file("${rootProject.CROSS_TOOLS_DIR}/$crossLibsPackage") | |
def compilerHome=file("${rootProject.CROSS_TOOLS_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux") | |
def compilerPrefix | |
def jniPlatform | |
if (IS_LINUX) { | |
fetchExternalTools('ARMV6HF', | |
["${crossLibsPackage}.tgz", | |
"gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux.tgz" ], | |
rootProject.CROSS_TOOLS_DIR, rootProject.IS_IMPORT_CROSS_TOOLS) | |
compilerHome=file("${rootProject.CROSS_TOOLS_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux") | |
compilerPrefix="arm-linux-gnueabihf-" | |
jniPlatform="linux" | |
} else if (IS_MAC) { | |
fetchExternalTools('ARMV6HF', | |
["${crossLibsPackage}.tgz"], | |
rootProject.CROSS_TOOLS_DIR, rootProject.IS_IMPORT_CROSS_TOOLS) | |
compilerHome=file("/usr/local/arm-linux") | |
compilerPrefix="arm-linux-" | |
jniPlatform="darwin" | |
} else { | |
fail("armv6hf Cannot build on this platform") | |
} | |
if (rootProject.hasProperty("ARMV6HF_COMPILER")) { | |
logger.quiet "Using alternate ARMV6HF_COMPILER $rootProject.ARMV6HF_COMPILER" | |
compilerHome=file(rootProject.ARMV6HF_COMPILER); | |
} | |
if (rootProject.hasProperty("ARMV6HF_COMPILER_PREFIX")) { | |
logger.quiet "Using alternate ARMV6HF_COMPILER_PREFIX $rootProject.ARMV6HF_COMPILER_PREFIX" | |
compilerPrefix="${rootProject.ARMV6HF_COMPILER_PREFIX}" | |
} | |
def compiler = file("$compilerHome/bin/${compilerPrefix}gcc").getAbsolutePath() | |
def linker = file("$compilerHome/bin/${compilerPrefix}g++").getAbsolutePath() | |
// Declare whether this particular target file applies to the current system | |
ARMV6HF.canBuild = (IS_LINUX || IS_MAC) && compilerHome.exists() && sdk.exists() | |
if (!ARMV6HF.canBuild) { | |
if (!compilerHome.exists()) println "ERROR: Missing compiler $compilerHome" | |
if (!sdk.exists()) println "ERROR: Missing sdk $sdk" | |
fail("armv6hf missing required tools") | |
} | |
// Lambda for naming the generated libs | |
ARMV6HF.library = { name -> return "lib${name}.so" as String } | |
ARMV6HF.compileSwing = false; | |
ARMV6HF.compileSWT = false; | |
ARMV6HF.compileWebnodeNative = false; | |
ARMV6HF.compileMediaNative = false; | |
ARMV6HF.includeMonocle = true | |
ARMV6HF.includeNull3d = true | |
ARMV6HF.includeEGL = true | |
ARMV6HF.includeSwing = false | |
ARMV6HF.includeSWT = false | |
ARMV6HF.includeGTK = true | |
ARMV6HF.javafxPlatformDefault="monocle" | |
// Libraries end up in the sdk/lib/arm directory for arm builds | |
ARMV6HF.arch = "arm" | |
ARMV6HF.libDest = "lib" | |
def commonFlags = [ | |
"-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags | |
"-Wextra", "-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/$jniPlatform", "-c", | |
IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].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 = [ | |
ccFlags, | |
"-marm", "-mfloat-abi=hard", "-mfpu=vfp", | |
"-I$sdk/usr/include", | |
"-I$sdk/opt/vc/include", | |
"-I$sdk/opt/vc/include/interface/vcos/pthreads", | |
"-I$sdk/opt/vc/include/interface/vmcs_host/linux", | |
"-DOMAP3", "-DUSE_DISPMAN"].flatten(); | |
//See if we should build for imx6 | |
def imxHeader=file("$sdk/usr/include/linux/mxcfb.h") | |
if (imxHeader.exists()) { | |
extraCFlags = [extraCFlags,"-DIMX6_PLATFORM"].flatten(); | |
} | |
def extraLFlags = [ | |
linkFlags, | |
"-L$sdk/lib/arm-linux-gnueabihf", | |
"-L$sdk/usr/lib", | |
"-L$sdk/usr/lib/arm-linux-gnueabihf", | |
"-L$sdk/opt/vc/lib"].flatten() | |
def monocleCFlags = [ | |
extraCFlags, | |
"-Werror", | |
"-I", file("${project("graphics").projectDir}/src/main/native-glass/monocle/")].flatten(); | |
def monocleLFlags = [extraLFlags, "-ldl", "-lm"].flatten() | |
def fontCFlags = [extraCFlags].flatten() | |
def fontLFlags = [extraLFlags, "-ldl"].flatten() | |
def iioCFlags = [extraCFlags, | |
"-Wno-main" // suppress warnings about using main as a variable, 3rd party code | |
].flatten() | |
def iioLFlags = [extraLFlags].flatten() | |
def es2EglfbCFlags = [extraCFlags, "-DIS_EGLFB", "-DLINUX"].flatten() | |
def es2EglfbLFlags = [extraLFlags].flatten() | |
def es2MonocleCFlags = [extraCFlags, "-DIS_EGLFB", "-DLINUX"].flatten() | |
def es2MonocleLFlags = [extraLFlags].flatten() | |
def es2X11CFlags = [extraCFlags, "-DUSE_XSHM", "-DDEBUG", "-DIS_EGLX11", "-DLINUX"].flatten() | |
def es2X11LFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten() | |
def mediaCFlags = [extraCFlags, | |
"-I$sdk/usr/include/gstreamer-0.10", | |
"-I$sdk/usr/include/glib-2.0", | |
"-I$sdk/usr/lib/arm-linux-gnueabihf/glib-2.0/include", | |
"-DENABLE_NATIVE_SOURCE=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() | |
def gtkCFlags = [extraCFlags].flatten() | |
def gtkLFlags = [extraLFlags].flatten() | |
def gtkCFlags_pkgconfig = "-pthread -I${sdk}/usr/include/gtk-2.0 -I${sdk}/usr/lib/arm-linux-gnueabihf/gtk-2.0/include -I${sdk}/usr/include/atk-1.0 -I${sdk}/usr/include/cairo -I${sdk}/usr/include/gdk-pixbuf-2.0 -I${sdk}/usr/include/pango-1.0 -I${sdk}/usr/include/gio-unix-2.0/ -I${sdk}/usr/include -I${sdk}/usr/include/glib-2.0 -I${sdk}/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I${sdk}/usr/include/pixman-1 -I${sdk}/usr/include/freetype2 -I${sdk}/usr/include/libpng12" | |
def gtkLFlags_pkgconfig = "-pthread -L${sdk}/usr/lib/arm-linux-gnueabihf -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lXtst" | |
gtkCFlags.addAll(gtkCFlags_pkgconfig.split(" ")) | |
gtkLFlags.addAll(gtkLFlags_pkgconfig.split(" ")) | |
def monoclePlatformAdditions = """ | |
monocle.glass.platform=Monocle | |
monocle.prism.order=es2,sw | |
monocle.prism.eglfb=true | |
monocle.prism.lcdtext=false | |
monocle.prism.maxvram=128m | |
monocle.prism.targetvram=112m | |
monocle.use.egl=true | |
monocle.use.gles2=true | |
monocle.embedded=monocle | |
monocle.com.sun.javafx.isEmbedded=true | |
monocle.doNativeComposite=true | |
monocle.com.sun.javafx.scene.control.skin.FXVK.cache=true | |
monocle.prism.glDepthSize=0 | |
monocle.com.sun.javafx.gestures.zoom=true | |
monocle.com.sun.javafx.gestures.rotate=true | |
monocle.com.sun.javafx.gestures.scroll=true""" | |
def gtkPlatformAdditions = """ | |
gtk.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true | |
gtk.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true | |
gtk.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=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 | |
gtk.com.sun.javafx.gestures.zoom=true | |
gtk.com.sun.javafx.gestures.rotate=true | |
gtk.com.sun.javafx.gestures.scroll=true""" | |
def pangoCCFlags = [extraCFlags, "-D_ENABLE_PANGO"]; | |
def pangoLinkFlags = [extraLFlags]; | |
def pangoCFlags_pkgconfig = "-pthread -I${sdk}/usr/include/pango-1.0 -I${sdk}/usr/include/freetype2 -I${sdk}/usr/include -I${sdk}/usr/include/glib-2.0 -I${sdk}/usr/lib/arm-linux-gnueabihf/glib-2.0/include" | |
def pangoLFlags_pkgconfig = "-L${sdk}/usr/lib/arm-linux-gnueabihf -lpangoft2-1.0 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0" | |
pangoCCFlags.addAll(pangoCFlags_pkgconfig.split(" ")) | |
pangoLinkFlags.addAll(pangoLFlags_pkgconfig.split(" ")) | |
def freetypeCCFlags = [ext.IS_COMPILE_PANGO ? "-D_ENABLE_PANGO" : | |
ext.IS_COMPILE_HARFBUZZ ? "-D_ENABLE_HARFBUZZ" : ""] | |
def freetypeLinkFlags = [] | |
def freetypeCFlags_pkgconfig = "-I${sdk}/usr/include/freetype2 -I${sdk}/usr/include" | |
def freetypeLFlags_pkgconfig = "-L${sdk}/usr/lib/arm-linux-gnueabihf -lfreetype" | |
freetypeCCFlags.addAll(freetypeCFlags_pkgconfig.split(" ")) | |
freetypeLinkFlags.addAll(freetypeLFlags_pkgconfig.split(" ")) | |
ARMV6HF.javafxPlatformProperties = "javafx.platform=${ARMV6HF.javafxPlatformDefault}" | |
ARMV6HF.glass = [:] | |
ARMV6HF.glass.javahInclude = [ | |
"com/sun/glass/events/**", | |
"com/sun/glass/ui/*"] | |
ARMV6HF.glass.variants = [ ] | |
if (ARMV6HF.includeMonocle) { | |
ARMV6HF.glass.variants.addAll("monocle", "monocle_x11", "monocle_epd"); | |
ARMV6HF.glass.javahInclude.addAll( | |
"com/sun/glass/ui/monocle/*", | |
"com/sun/glass/ui/monocle/dispman/*", | |
"com/sun/glass/ui/monocle/mx6/*", | |
"com/sun/glass/ui/monocle/linux/*", | |
"com/sun/glass/ui/monocle/util/*", | |
"com/sun/glass/ui/monocle/x11/*", | |
"com/sun/glass/ui/monocle/epd/*"); | |
ARMV6HF.javafxPlatformProperties = ARMV6HF.javafxPlatformProperties + monoclePlatformAdditions | |
} | |
if (ARMV6HF.includeGTK) { | |
ARMV6HF.glass.variants.addAll("gtk"); | |
ARMV6HF.glass.javahInclude.addAll("com/sun/glass/ui/gtk/*"); | |
ARMV6HF.javafxPlatformProperties = ARMV6HF.javafxPlatformProperties + gtkPlatformAdditions | |
} | |
ARMV6HF.glass.lib = "glass" | |
ARMV6HF.glass.monocle = [:] | |
ARMV6HF.glass.monocle.nativeSource = [ | |
file("${project("graphics").projectDir}/src/main/native-glass/monocle"), | |
file("${project("graphics").projectDir}/src/main/native-glass/monocle/dispman"), | |
file("${project("graphics").projectDir}/src/main/native-glass/monocle/mx6"), | |
file("${project("graphics").projectDir}/src/main/native-glass/monocle/linux"), | |
file("${project("graphics").projectDir}/src/main/native-glass/monocle/util") ] | |
ARMV6HF.glass.monocle.compiler = compiler | |
ARMV6HF.glass.monocle.ccFlags = monocleCFlags | |
ARMV6HF.glass.monocle.linker = linker | |
ARMV6HF.glass.monocle.linkFlags = monocleLFlags | |
ARMV6HF.glass.monocle.lib = "glass_monocle" | |
ARMV6HF.glass.monocle_x11 = [:] | |
ARMV6HF.glass.monocle_x11.nativeSource = [ | |
file("${project("graphics").projectDir}/src/main/native-glass/monocle/util"), | |
file("${project("graphics").projectDir}/src/main/native-glass/monocle/x11") ] | |
ARMV6HF.glass.monocle_x11.compiler = compiler | |
ARMV6HF.glass.monocle_x11.ccFlags = monocleCFlags | |
ARMV6HF.glass.monocle_x11.linker = linker | |
ARMV6HF.glass.monocle_x11.linkFlags = [ monocleLFlags, "-lX11" ].flatten() | |
ARMV6HF.glass.monocle_x11.lib = "glass_monocle_x11" | |
ARMV6HF.glass.monocle_epd = [:] | |
ARMV6HF.glass.monocle_epd.nativeSource = [ | |
file("${project("graphics").projectDir}/src/main/native-glass/monocle/epd") ] | |
ARMV6HF.glass.monocle_epd.compiler = compiler | |
ARMV6HF.glass.monocle_epd.ccFlags = monocleCFlags | |
ARMV6HF.glass.monocle_epd.linker = linker | |
ARMV6HF.glass.monocle_epd.linkFlags = monocleLFlags | |
ARMV6HF.glass.monocle_epd.lib = "glass_monocle_epd" | |
FileTree ft_gtk = fileTree("${project(":graphics").projectDir}/src/main/native-glass/gtk/") { | |
exclude("**/launcher.c") | |
} | |
File gen_headers = new File("${project(":graphics").buildDir}/gensrc/headers/javafx.graphics") | |
ARMV6HF.glass.gtk = [:] | |
ARMV6HF.glass.gtk.nativeSource = ft_gtk.getFiles() | |
ARMV6HF.glass.gtk.compiler = compiler | |
ARMV6HF.glass.gtk.ccFlags = ["-ffast-math", gtkCFlags, "-DLINUX", "-I${gen_headers}"].flatten() | |
ARMV6HF.glass.gtk.linker = linker | |
ARMV6HF.glass.gtk.linkFlags = [gtkLFlags, "-lstdc++"].flatten() | |
ARMV6HF.glass.gtk.lib = "glass" | |
ARMV6HF.decora = [:] | |
ARMV6HF.decora.compiler = compiler | |
ARMV6HF.decora.ccFlags = extraCFlags | |
ARMV6HF.decora.linker = linker | |
ARMV6HF.decora.linkFlags = extraLFlags | |
ARMV6HF.decora.lib = "decora_sse" | |
ARMV6HF.prism = [:] | |
ARMV6HF.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"] | |
ARMV6HF.prism.nativeSource = file("${project("graphics").projectDir}/src/main/native-prism") | |
ARMV6HF.prism.compiler = compiler | |
ARMV6HF.prism.ccFlags = [extraCFlags].flatten() | |
ARMV6HF.prism.linker = linker | |
ARMV6HF.prism.linkFlags = [extraLFlags].flatten() | |
ARMV6HF.prism.lib = "prism_common" | |
ARMV6HF.prismSW = [:] | |
ARMV6HF.prismSW.javahInclude = ["com/sun/pisces/**/*"] | |
ARMV6HF.prismSW.nativeSource = file("${project("graphics").projectDir}/src/main/native-prism-sw") | |
ARMV6HF.prismSW.compiler = compiler | |
ARMV6HF.prismSW.ccFlags = [extraCFlags].flatten() | |
ARMV6HF.prismSW.linker = linker | |
ARMV6HF.prismSW.linkFlags = [extraLFlags].flatten() | |
ARMV6HF.prismSW.lib = "prism_sw" | |
ARMV6HF.iio = [:] | |
ARMV6HF.iio.javahInclude = ["com/sun/javafx/iio/**/*"] | |
ARMV6HF.iio.nativeSource = [ | |
file("${project("graphics").projectDir}/src/main/native-iio"), | |
file("${project("graphics").projectDir}/src/main/native-iio/libjpeg")] | |
ARMV6HF.iio.compiler = compiler | |
ARMV6HF.iio.ccFlags = iioCFlags | |
ARMV6HF.iio.linker = linker | |
ARMV6HF.iio.linkFlags = iioLFlags | |
ARMV6HF.iio.lib = "javafx_iio" | |
ARMV6HF.prismES2 = [:] | |
ARMV6HF.prismES2.variants = ["monocle"] | |
ARMV6HF.prismES2.javahInclude = ["com/sun/prism/es2/**/*"] | |
ARMV6HF.prismES2.monocle= [:] | |
ARMV6HF.prismES2.monocle.nativeSource = [ | |
file("${project("graphics").projectDir}/src/main/native-prism-es2"), | |
file("${project("graphics").projectDir}/src/main/native-prism-es2/GL"), | |
file("${project("graphics").projectDir}/src/main/native-prism-es2/monocle") | |
] | |
ARMV6HF.prismES2.monocle.compiler = compiler | |
ARMV6HF.prismES2.monocle.ccFlags = [ es2EglfbCFlags, "-I", "-I${gen_headers}" ].flatten() | |
ARMV6HF.prismES2.monocle.linker = linker | |
ARMV6HF.prismES2.monocle.linkFlags =[ es2EglfbLFlags, "-ldl" ].flatten() | |
ARMV6HF.prismES2.monocle.lib = "prism_es2_monocle" | |
def closedDir = file("$projectDir/../rt-closed") | |
ARMV6HF.font = [:] | |
ARMV6HF.font.javahInclude = [ | |
"com/sun/javafx/font/**/*", | |
"com/sun/javafx/text/**/*"] | |
ARMV6HF.font.nativeSource = [file("${project("graphics").projectDir}/src/main/native-font")] | |
ARMV6HF.font.compiler = compiler | |
ARMV6HF.font.ccFlags = fontCFlags | |
ARMV6HF.font.linker = linker | |
ARMV6HF.font.linkFlags = fontLFlags | |
ARMV6HF.font.lib = "javafx_font" | |
ARMV6HF.fontFreetype = [:] | |
ARMV6HF.fontFreetype.javahInclude = ["com/sun/javafx/font/freetype/OSFreetype.class*"] | |
ARMV6HF.fontFreetype.nativeSource = ["src/main/native-font/freetype.c"] | |
ARMV6HF.fontFreetype.compiler = compiler | |
ARMV6HF.fontFreetype.ccFlags = ["-DJFXFONT_PLUS", ccFlags, fontCFlags, freetypeCCFlags].flatten() | |
ARMV6HF.fontFreetype.linker = linker | |
ARMV6HF.fontFreetype.linkFlags = [linkFlags, fontLFlags, freetypeLinkFlags, "-ldl"].flatten() | |
ARMV6HF.fontFreetype.lib = "javafx_font_freetype" | |
ARMV6HF.fontPango = [:] | |
ARMV6HF.fontPango.javahInclude = ["com/sun/javafx/font/freetype/OSPango.class"] | |
ARMV6HF.fontPango.nativeSource = ["src/main/native-font/pango.c"] | |
ARMV6HF.fontPango.compiler = compiler | |
ARMV6HF.fontPango.ccFlags = ["-DJFXFONT_PLUS", ccFlags, pangoCCFlags].flatten() | |
ARMV6HF.fontPango.linker = linker | |
ARMV6HF.fontPango.linkFlags = [linkFlags, pangoLinkFlags].flatten() | |
ARMV6HF.fontPango.lib = "javafx_font_pango" | |
ARMV6HF.webkit = [:] | |
ARMV6HF.webkit.binDir = "$compilerHome/bin" | |
ARMV6HF.webkit.compiler = compiler | |
ARMV6HF.webkit.linker = linker | |
ARMV6HF.webkit.ar = file("$compilerHome/bin/${compilerPrefix}ar").getAbsolutePath() | |
ARMV6HF.webkit.objcopy = file("$compilerHome/bin/${compilerPrefix}objcopy").getAbsolutePath() | |
ARMV6HF.webkit.strip = file("$compilerHome/bin/${compilerPrefix}strip").getAbsolutePath() | |
ARMV6HF.webkit.ccFlags = extraCFlags.join(' ') | |
ARMV6HF.webkit.linkFlags = extraLFlags.join(' ') | |
ARMV6HF.disableMedia = true | |
ARMV6HF.media = [:] | |
ARMV6HF.media.compiler = compiler | |
ARMV6HF.media.linker = linker | |
ARMV6HF.media.extra_cflags = mediaCFlags.join(' ') | |
ARMV6HF.media.extra_ldflags = mediaLFlags.join(' ') | |
ARMV6HF.deploy = [:] | |
ARMV6HF.deploy.publicLibraryFilter = [ | |
"fxavcodecplugin-52.so", | |
"fxavcodecplugin-53.so", | |
"fxplugins.so", | |
"libjfxwebkit.so", | |
"libgstplugins-lite.so", | |
"libgstreamer-lite.so", | |
"libprism_es2_eglx11.so", | |
] | |
ARMV6HF.deploy.compressBigJar=true |