Skip to content
Permalink
Browse files
8257895: Allow building of JavaFX media libs for Apple Silicon
Backport-of: 8adbc67
  • Loading branch information
Johan Vos committed May 18, 2021
1 parent b2d930e commit 7e16449b2bdeb093b14c1433459bfeb0e49a9f91
Showing with 3,572 additions and 24 deletions.
  1. +5 −2 build.gradle
  2. +1 −1 buildSrc/mac.gradle
  3. +515 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/mac/aarch64/ffi.h
  4. +215 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/mac/aarch64/fficonfig.h
  5. +1,009 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/aarch64/ffi.c
  6. +104 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/aarch64/ffitarget.h
  7. +67 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/aarch64/internal.h
  8. +440 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/aarch64/sysv.S
  9. 0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/{include → src/x86}/ffitarget.h
  10. +1,138 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/sysv.S
  11. +5 −2 modules/javafx.media/src/main/native/gstreamer/projects/mac/fxplugins/Makefile
  12. +10 −2 modules/javafx.media/src/main/native/gstreamer/projects/mac/glib-lite/Makefile
  13. +5 −2 modules/javafx.media/src/main/native/gstreamer/projects/mac/gstreamer-lite/Makefile
  14. +39 −10 modules/javafx.media/src/main/native/gstreamer/projects/mac/libffi/Makefile
  15. +2 −1 modules/javafx.media/src/main/native/gstreamer/projects/win/glib-lite/Makefile.ffi
  16. +2 −1 modules/javafx.media/src/main/native/gstreamer/projects/win/glib-lite/Makefile.gobject
  17. +5 −0 modules/javafx.media/src/main/native/jfxmedia/Common/ProductFlags.h
  18. +6 −1 modules/javafx.media/src/main/native/jfxmedia/Utils/ColorConverter.c
  19. +4 −2 modules/javafx.media/src/main/native/jfxmedia/projects/mac/Makefile
@@ -420,6 +420,9 @@ if (IS_STATIC_BUILD && IS_COMPILE_MEDIA) {
throw new GradleException("Can not have COMPILE_MEDIA when STATIC_BUILD is enabled");
}

// By default, target architecture = host architecture, but we allow different ones.
defineProperty("TARGET_ARCH", OS_ARCH)

// BUILD_TOOLS_DOWNLOAD_SCRIPT specifies a path of a gradle script which downloads
// required build tools.
defineProperty("BUILD_TOOLS_DOWNLOAD_SCRIPT", "")
@@ -3809,13 +3812,13 @@ project(":media") {
doLast {
exec {
commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/libffi")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=ffi")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=ffi", "ARCH=$TARGET_ARCH")
args ("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}", "AR=${mediaProperties.ar}")
}

exec {
commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite", "ARCH=$TARGET_ARCH")
args ("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}")
}
}
@@ -114,7 +114,7 @@ def commonParams = [
"-arch", "$TARGET_ARCH"]

if (hasProperty('TARGET_ARCH')) {
commonParams = ["-target", "${TARGET_ARCH}-apple-macos-11", commonParams]
commonParams = ["-target", "${TARGET_ARCH}-apple-macos-11", commonParams].flatten()
}

def ccBaseFlags = [

1 comment on commit 7e16449

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 7e16449 May 18, 2021

Please sign in to comment.