Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2021-02-23 13:21:45 +0000
committerSravan Kumar Lakkimsetti2021-03-22 12:52:51 +0000
commit714513390feb75b940cadb58ff9bb1a2f6246be5 (patch)
treef6b5a0c85bcf6082cd9784230365f474d67c5c47
parent480fff1c579af9243d7a24d02ff111596ea027bc (diff)
downloadrt.equinox.framework-714513390feb75b940cadb58ff9bb1a2f6246be5.tar.gz
rt.equinox.framework-714513390feb75b940cadb58ff9bb1a2f6246be5.tar.xz
rt.equinox.framework-714513390feb75b940cadb58ff9bb1a2f6246be5.zip
Bug 572187 - Move Eclipse launcher executable to latest macOS SDK with
deployment target at 10.10 Change-Id: I533bcfee6a6bf5113a8acb888b8e55e0ecc527cc Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-rwxr-xr-xfeatures/org.eclipse.equinox.executable.feature/library/cocoa/build.sh2
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c15
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c54
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c15
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak2
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/eclipse.c2
6 files changed, 48 insertions, 42 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/build.sh b/features/org.eclipse.equinox.executable.feature/library/cocoa/build.sh
index c457ba75a..49558bbf3 100755
--- a/features/org.eclipse.equinox.executable.feature/library/cocoa/build.sh
+++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/build.sh
@@ -65,7 +65,7 @@ DEFAULT_WS="$defaultWS"
DEPLOYMENT_TARGET=10.10
EXEC_DIR=../../../../../rt.equinox.binaries/org.eclipse.equinox.executable
PROGRAM_OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch/Eclipse.app/Contents/MacOS"
-SDKROOT_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk"
+SDKROOT_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
# /System/Library/Frameworks/JavaVM.framework/Headers does not exist anymore on Yosemite
if [ -e /System/Library/Frameworks/JavaVM.framework/Headers ]; then
diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c
index e93adb197..a38047f4e 100644
--- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c
+++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c
@@ -111,11 +111,10 @@ static NSWindow* window = nil;
NSImage* image = [[NSImage alloc] initByReferencingFile: featureImage];
[featureImage release];
if (image != NULL) {
- NSImageRep* imageRep = [image bestRepresentationForDevice: [[NSScreen mainScreen] deviceDescription]];
- NSRect rect = {{0, 0}, {[imageRep pixelsWide], [imageRep pixelsHigh]}};
- [image setSize: NSMakeSize([imageRep pixelsWide], [imageRep pixelsHigh])];
+ NSSize size = [image size];
+ NSRect rect = {{0, 0}, {size.width, size.height}};
[image autorelease];
- window = [[KeyWindow alloc] initWithContentRect: rect styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: 0];
+ window = [[KeyWindow alloc] initWithContentRect: rect styleMask: NSWindowStyleMaskBorderless backing: NSBackingStoreBuffered defer: 0];
if (window != nil) {
[window center];
[window setBackgroundColor: [NSColor colorWithPatternImage: image]];
@@ -141,7 +140,7 @@ static NSWindow* window = nil;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSEvent* event;
NSApplication* application = [NSApplication sharedApplication];
- while ((event = [application nextEventMatchingMask: NSAnyEventMask untilDate: nil inMode: NSDefaultRunLoopMode dequeue: TRUE]) != nil) {
+ while ((event = [application nextEventMatchingMask: NSEventMaskAny untilDate: nil inMode: NSDefaultRunLoopMode dequeue: TRUE]) != nil) {
[application sendEvent: event];
}
[pool release];
@@ -173,9 +172,7 @@ static NSWindow* window = nil;
CFURLRef url = NULL;
NSAppleEventDescriptor *desc = [event descriptorAtIndex:index], *coerceDesc;
if (!desc) continue;
- if ((coerceDesc = [desc coerceToDescriptorType: typeFSRef]) != NULL) {
- url = CFURLCreateFromFSRef(kCFAllocatorDefault, [[coerceDesc data] bytes]);
- } else if ((coerceDesc = [desc coerceToDescriptorType: typeFileURL]) != NULL) {
+ if ((coerceDesc = [desc coerceToDescriptorType: typeFileURL]) != NULL) {
NSData *data = [coerceDesc data];
url = CFURLCreateWithBytes(kCFAllocatorDefault, [data bytes], [data length], kCFStringEncodingUTF8, NULL);
}
@@ -670,5 +667,5 @@ const char* getUUID() {
_TCHAR* getFolderForApplicationData() {
NSString* bundleId = getCFBundleIdentifier();
NSString* appSupport = getApplicationSupport();
- return [[NSString stringWithFormat:@"%@/%@_%s", appSupport, bundleId, getUUID()] UTF8String];
+ return (_TCHAR*)[[NSString stringWithFormat:@"%@/%@_%s", appSupport, bundleId, getUUID()] UTF8String];
}
diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c
index 34aadbaf2..ff7944f3e 100644
--- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c
+++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c
@@ -66,9 +66,12 @@ void displayMessage(char *title, char *message)
}
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- NSAlert* alert = [NSAlert alertWithMessageText: (NSString*)(inDescription != nil ? inError : nil) defaultButton: nil alternateButton: nil otherButton: nil informativeTextWithFormat: (NSString*)(inDescription != nil ? inDescription : inError)];
+ NSAlert *alert = [[NSAlert alloc] init];
+ [alert setMessageText:(NSString*)(inDescription != nil ? inError : nil)];
+ [alert setInformativeText:(NSString*)(inDescription != nil ? inDescription : inError)];
+ [alert addButtonWithTitle:@"Ok"];
[[alert window] setTitle: [NSString stringWithUTF8String: title]];
- [alert setAlertStyle: NSCriticalAlertStyle];
+ [alert setAlertStyle: NSAlertStyleCritical];
[alert runModal];
[pool release];
CFRelease(inError);
@@ -103,7 +106,7 @@ void * loadLibrary( char * library ){
// check if it's a JVM bundle
if (strstr(bundle, "libjvm") && (start = strstr(bundle, "/Contents/Home/")) != NULL) {
- start[0] = NULL;
+ start[0] = 0;
loadVMBundle(bundle);
free(bundle);
if (javaVMBundle) {
@@ -143,8 +146,11 @@ char * resolveSymlinks( char * path ) {
char * result = 0;
CFURLRef url, resolved;
CFStringRef string;
- FSRef fsRef;
- Boolean isFolder, wasAliased;
+ Boolean isStale;
+ CFDataRef data;
+ CFErrorRef errorRef;
+
+
if(path == NULL)
return path;
@@ -154,24 +160,26 @@ char * resolveSymlinks( char * path ) {
CFRelease(string);
if(url == NULL)
return path;
-
- if(CFURLGetFSRef(url, &fsRef)) {
- if( FSResolveAliasFile(&fsRef, true, &isFolder, &wasAliased) == noErr) {
- resolved = CFURLCreateFromFSRef(kCFAllocatorDefault, &fsRef);
- if(resolved != NULL) {
- string = CFURLCopyFileSystemPath(resolved, kCFURLPOSIXPathStyle);
- CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8);
- char *s = malloc(length);
- if (CFStringGetCString(string, s, length, kCFStringEncodingUTF8)) {
- result = s;
- } else {
- free(s);
- }
- CFRelease(string);
- CFRelease(resolved);
- }
- }
- }
+
+ data = CFURLCreateBookmarkDataFromFile(kCFAllocatorDefault, url, &errorRef);
+ if (data == NULL) {
+ CFRelease(url);
+ return path;
+ }
+
+ resolved = CFURLCreateByResolvingBookmarkData(kCFAllocatorDefault, data, kCFURLBookmarkResolutionWithoutMountingMask|kCFURLBookmarkResolutionWithoutUIMask, NULL, NULL, &isStale, &errorRef);
+ if(resolved != NULL) {
+ string = CFURLCopyFileSystemPath(resolved, kCFURLPOSIXPathStyle);
+ CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8);
+ char *s = malloc(length);
+ if (CFStringGetCString(string, s, length, kCFStringEncodingUTF8)) {
+ result = s;
+ } else {
+ free(s);
+ }
+ CFRelease(string);
+ CFRelease(resolved);
+ }
CFRelease(url);
return result;
}
diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c
index c7973f1f6..052ce7edd 100644
--- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c
+++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaMain.c
@@ -26,6 +26,7 @@
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <unistd.h>
+#include <Cocoa/Cocoa.h>
#include <CoreServices/CoreServices.h>
#include <mach-o/dyld.h>
@@ -49,14 +50,12 @@ static int fgPid;
extern int original_main(int argc, char* argv[]);
int main( int argc, char* argv[] ) {
- SInt32 systemVersion= 0;
- if (Gestalt(gestaltSystemVersion, &systemVersion) == noErr) {
- systemVersion &= 0xffff;
- if (systemVersion < 0x1050) {
- displayMessage("Error", "This application requires Mac OS X 10.5 (Leopard) or greater.");
- return 0;
- }
- }
+
+ NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
+ if ((version.majorVersion < 10) || ((version.majorVersion == 10) && (version.minorVersion < 14))) {
+ displayMessage("Error", "This application requires Mac OS 10.14 or greater.");
+ return 0;
+ }
fgConsoleLog= fopen("/dev/console", "w");
fgPid= getpid();
diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak b/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak
index fe34bee2f..185b68df9 100644
--- a/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak
+++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/make_cocoa.mak
@@ -37,7 +37,7 @@ EXEC = $(PROGRAM_OUTPUT)
DLL = $(PROGRAM_LIBRARY)
LIBS = -framework Cocoa
-CFLAGS = -O -s \
+CFLAGS = -O \
-Wall \
-DCOCOA -xobjective-c \
$(ARCHS) \
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
index d6767b25e..f3ab12442 100644
--- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c
+++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
@@ -216,8 +216,10 @@ static _TCHAR* startupMsg =
_T_ECLIPSE("The %s executable launcher was unable to locate its \n\
companion launcher jar.");
+#ifdef LINUX
static _TCHAR* gtk2Msg =
_T_ECLIPSE("The %s executable launcher no longer supports running with GTK + 2.x. Continuing using GTK+ 3.x.");
+#endif
static _TCHAR* homeMsg =
_T_ECLIPSE("The %s executable launcher was unable to locate its \n\

Back to the top