-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcompile
executable file
·19 lines (16 loc) · 1.27 KB
/
compile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# In order to include JavaNativeFoundation headers this is based on
# https://macosx-port-dev.openjdk.java.narkive.com/QZT8BXTT/is-javanativefoundation-still-supported-on-os-x-10-10
# see also
# https://github.com/apple/openjdk/
SDK_HDRS="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/"
SDK_ROOT="$(xcrun --show-sdk-path)"
JDK="$(/usr/libexec/java_home)"
SDK_HDRS="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/"
SDK_FRAMEWORKS=$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
gcc -Inative -arch arm64 -o libAppleScriptEngine.dylib -dynamiclib \
-I/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/JavaNativeFoundation.framework/Versions/A/Headers \
-I${SDK_HDRS} -I${JDK}/include -I${JDK}/include/darwin \
-L/Users/mjh/Documents/JavaNativeFoundation/ -lJavaNativeFoundation \
-F${SDK_FRAMEWORKS} -framework Foundation -framework Carbon -framework Cocoa native/*.m
install_name_tool -change "libJavaNativeFoundation.dylib" "@loader_path/libJavaNativeFoundation.dylib" "libAppleScriptEngine.dylib"