Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'features/org.eclipse.equinox.executable.feature/library/gtk')
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/.gitignore3
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/build.sh238
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/build.xml28
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c347
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h77
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c134
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c126
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/make_aix.mak116
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/make_hpux.mak102
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/make_linux.mak112
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/gtk/make_solaris.mak111
11 files changed, 1394 insertions, 0 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/.gitignore b/features/org.eclipse.equinox.executable.feature/library/gtk/.gitignore
new file mode 100644
index 000000000..8d396827f
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/.gitignore
@@ -0,0 +1,3 @@
+/*.o
+/eclipse
+/eclipse_*.so \ No newline at end of file
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/build.sh b/features/org.eclipse.equinox.executable.feature/library/gtk/build.sh
new file mode 100644
index 000000000..29d3871cb
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/build.sh
@@ -0,0 +1,238 @@
+#!/bin/sh
+#*******************************************************************************
+# Copyright (c) 2000, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Kevin Cornell (Rational Software Corporation)
+# Martin Oberhuber (Wind River) - [176805] Support building with gcc and debug
+#*******************************************************************************
+#
+# Usage: sh build.sh [<optional switches>] [clean]
+#
+# where the optional switches are:
+# -output <PROGRAM_OUTPUT> - executable filename ("eclipse")
+# -os <DEFAULT_OS> - default Eclipse "-os" value
+# -arch <DEFAULT_OS_ARCH> - default Eclipse "-arch" value
+# -ws <DEFAULT_WS> - default Eclipse "-ws" value
+# -java <JAVA_HOME> - java install for jni headers
+#
+# All other arguments are directly passed to the "make" program.
+# This script can also be invoked with the "clean" argument.
+#
+# Examples:
+# sh build.sh clean
+# sh build.sh -java /usr/j2se OPTFLAG=-g PICFLAG=-fpic
+
+cd `dirname $0`
+
+# Define default values for environment variables used in the makefiles.
+programOutput="eclipse"
+defaultOS=""
+defaultOSArch=""
+defaultWS="gtk"
+EXEC_DIR=../../../../../rt.equinox.binaries/org.eclipse.equinox.executable
+defaultJava=DEFAULT_JAVA_JNI
+defaultJavaHome=""
+javaHome=""
+makefile=""
+if [ "${CC}" = "" ]; then
+ CC=cc
+ export CC
+fi
+
+# Parse the command line arguments and override the default values.
+extraArgs=""
+while [ "$1" != "" ]; do
+ if [ "$1" = "-os" ] && [ "$2" != "" ]; then
+ defaultOS="$2"
+ shift
+ elif [ "$1" = "-arch" ] && [ "$2" != "" ]; then
+ defaultOSArch="$2"
+ shift
+ elif [ "$1" = "-ws" ] && [ "$2" != "" ]; then
+ defaultWS="$2"
+ shift
+ elif [ "$1" = "-output" ] && [ "$2" != "" ]; then
+ programOutput="$2"
+ shift
+ elif [ "$1" = "-java" ] && [ "$2" != "" ]; then
+ javaHome="$2"
+ shift
+ else
+ extraArgs="$extraArgs $1"
+ fi
+ shift
+done
+if [ "$defaultOS" = "" ]; then
+ defaultOS=`uname -s`
+fi
+if [ "$defaultOSArch" = "" ]; then
+ defaultOSArch=`uname -m`
+fi
+
+
+case $defaultOS in
+ "Linux" | "linux")
+ makefile="make_linux.mak"
+ defaultOS="linux"
+ case $defaultOSArch in
+ "x86_64")
+ defaultOSArch="x86_64"
+ defaultJava=DEFAULT_JAVA_EXEC
+ [ -d /bluebird/teamswt/swt-builddir/build/JRE/x64/jdk1.6.0_14 ] && defaultJavaHome="/bluebird/teamswt/swt-builddir/build/JRE/x64/jdk1.6.0_14"
+ OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
+ ;;
+ i?86 | "x86")
+ defaultOSArch="x86"
+ [ -d /bluebird/teamswt/swt-builddir/build/JRE/x32/jdk1.6.0_14 ] && defaultJavaHome="/bluebird/teamswt/swt-builddir/build/JRE/x32/jdk1.6.0_14"
+ OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
+ ;;
+ "ppc")
+ defaultOSArch="ppc"
+ defaultJava=DEFAULT_JAVA_EXEC
+ [ -d /bluebird/teamswt/swt-builddir/JDKs/PPC/ibm-java2-ppc-50 ] && defaultJavaHome="/bluebird/teamswt/swt-builddir/JDKs/PPC/ibm-java2-ppc-50"
+ OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
+ ;;
+ "ppc64")
+ defaultOSArch="ppc64"
+ defaultJava=DEFAULT_JAVA_EXEC
+ [ -d /bluebird/teamswt/swt-builddir/JDKs/PPC64/ibm-java2-ppc64-50 ] && defaultJavaHome="/bluebird/teamswt/swt-builddir/JDKs/PPC64/ibm-java2-ppc64-50"
+ OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
+ ;;
+ "s390")
+ defaultOSArch="s390"
+ defaultJava=DEFAULT_JAVA_EXEC
+ OUTPUT_DIR="$EXEC_DIR/contributed/$defaultWS/$defaultOS/$defaultOSArch"
+ ;;
+ "s390x")
+ defaultOSArch="s390x"
+ defaultJava=DEFAULT_JAVA_EXEC
+ OUTPUT_DIR="$EXEC_DIR/contributed/$defaultWS/$defaultOS/$defaultOSArch"
+ ;;
+ "ia64")
+ defaultOSArch="ia64"
+ defaultJava=DEFAULT_JAVA_EXEC
+ OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
+ ;;
+ *)
+ echo "*** Unknown MODEL <${MODEL}>"
+ ;;
+ esac
+ ;;
+ "AIX" | "aix")
+ makefile="make_aix.mak"
+ defaultOS="aix"
+ if [ -z "$defaultOSArch" ]; then
+ defaultOSArch="ppc64"
+ fi
+ [ -d /bluebird/teamswt/swt-builddir/JDKs/AIX/PPC64/j564/sdk ] && defaultJavaHome="/bluebird/teamswt/swt-builddir/JDKs/AIX/PPC64/j564/sdk"
+ ;;
+ "HP-UX" | "hpux")
+ makefile="make_hpux.mak"
+ defaultOS="hpux"
+ case $defaultOSArch in
+ "ia64_32")
+ PATH=$PATH:/opt/hp-gcc/bin:/opt/gtk2.6/bin
+ PKG_CONFIG_PATH="/opt/gtk2.6/lib/pkgconfig"
+ ;;
+ "ia64")
+ PATH=$PATH:/opt/hp-gcc/bin:/opt/gtk_64bit/bin
+ PKG_CONFIG_PATH="/opt/gtk_64bit/lib/hpux64/pkgconfig"
+ ;;
+ esac
+ export PATH PKG_CONFIG_PATH
+ [ -d /opt/java1.5 ] && defaultJavaHome="/opt/java1.5"
+ ;;
+ "SunOS" | "solaris")
+ makefile="make_solaris.mak"
+ defaultOS="solaris"
+ OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
+ #PATH=/usr/ccs/bin:/opt/SUNWspro/bin:$PATH
+ PATH=/usr/ccs/bin:/export/home/SUNWspro/bin:$PATH
+ export PATH
+ if [ "$PROC" = "" ]; then
+ PROC=`uname -p`
+ fi
+ case ${PROC} in
+ "i386" | "x86")
+ defaultOSArch="x86"
+ [ -d /bluebird/teamswt/swt-builddir/build/JRE/Solaris_x86/jdk1.6.0_14 ] && defaultJavaHome="/bluebird/teamswt/swt-builddir/build/JRE/Solaris_x86/jdk1.6.0_14"
+ CC=cc
+ ;;
+ "sparc")
+ defaultOSArch="sparc"
+ [ -d /bluebird/teamswt/swt-builddir/build/JRE/SPARC/jdk1.6.0_14 ] && defaultJavaHome="/bluebird/teamswt/swt-builddir/build/JRE/SPARC/jdk1.6.0_14"
+ CC=cc
+ ;;
+ *)
+ echo "*** Unknown processor type <${PROC}>"
+ ;;
+ esac
+ ;;
+ *)
+ echo "Unknown OS -- build aborted"
+ ;;
+esac
+export CC
+
+
+# Set up environment variables needed by the makefiles.
+PROGRAM_OUTPUT="$programOutput"
+DEFAULT_OS="$defaultOS"
+DEFAULT_OS_ARCH="$defaultOSArch"
+DEFAULT_WS="$defaultWS"
+DEFAULT_JAVA=$defaultJava
+
+origJavaHome=$JAVA_HOME
+if [ -n "$javaHome" ]; then
+ JAVA_HOME=$javaHome
+ export JAVA_HOME
+elif [ -z "$JAVA_HOME" -a -n "$defaultJavaHome" ]; then
+ JAVA_HOME="$defaultJavaHome"
+ export JAVA_HOME
+fi
+
+if [ "$defaultOSArch" = "ppc64" ]; then
+ if [ "$defaultOS" = "aix" ]; then
+ M_ARCH=-maix64
+ else
+ M_ARCH=-m64
+ fi
+ export M_ARCH
+elif [ "$defaultOSArch" = "s390" ]; then
+ M_ARCH=-m31
+ export M_ARCH
+elif [ "$defaultOSArch" = "ia64" ]; then
+ M_ARCH=-mlp64
+ export M_ARCH
+fi
+
+LIBRARY_DIR="$EXEC_DIR/../org.eclipse.equinox.launcher.$defaultWS.$defaultOS.$defaultOSArch"
+OUTPUT_DIR="$EXEC_DIR/bin/$defaultWS/$defaultOS/$defaultOSArch"
+
+export OUTPUT_DIR PROGRAM_OUTPUT DEFAULT_OS DEFAULT_OS_ARCH DEFAULT_WS DEFAULT_JAVA LIBRARY_DIR
+
+# If the OS is supported (a makefile exists)
+if [ "$makefile" != "" ]; then
+ if [ "$extraArgs" != "" ]; then
+ make -f $makefile $extraArgs
+ else
+ echo "Building $OS launcher. Defaults: -os $DEFAULT_OS -arch $DEFAULT_OS_ARCH -ws $DEFAULT_WS"
+ make -f $makefile clean
+ case x$CC in
+ x*gcc*) make -f $makefile all PICFLAG=-fpic ;;
+ *) make -f $makefile all ;;
+ esac
+ fi
+else
+ echo "Unknown OS $OS -- build aborted"
+fi
+
+#restore original JAVA_HOME
+JAVA_HOME="$origJavaHome"
+export JAVA_HOME
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/build.xml b/features/org.eclipse.equinox.executable.feature/library/gtk/build.xml
new file mode 100644
index 000000000..f485479d3
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/build.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project default="build_eclipse" basedir=".">
+
+<target name="build_eclipse">
+ <exec dir="." executable="sh">
+ <arg line="${basedir}/build.sh"/>
+ <arg line="install"/>
+ </exec>
+</target>
+
+<target name="build_eclipse_ppc">
+ <exec dir="." executable="sh">
+ <env key="MODEL" value="ppc"/>
+ <arg line="${basedir}/build.sh"/>
+ <arg line="install"/>
+ </exec>
+</target>
+
+<target name="clean">
+ <tstamp/>
+ <exec dir="." executable="sh">
+ <arg line="${basedir}/build.sh"/>
+ <arg line="clean"/>
+ </exec>
+</target>
+
+</project> \ No newline at end of file
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c
new file mode 100644
index 000000000..6ec48e79f
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c
@@ -0,0 +1,347 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Kevin Cornell (Rational Software Corporation)
+ * Tom Tromey (Red Hat, Inc.)
+ *******************************************************************************/
+
+#include "eclipseMozilla.h"
+#include "eclipseCommon.h"
+#include "eclipseOS.h"
+#include "eclipseUtil.h"
+#include "eclipseGtk.h"
+
+#include <signal.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/ioctl.h>
+#include <dlfcn.h>
+#ifdef SOLARIS
+#include <sys/filio.h>
+#endif
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <locale.h>
+#include <semaphore.h>
+#include <fcntl.h>
+
+#ifdef HPUX
+#define SEM_FAILED (void *)-1
+#endif
+
+/* Global Variables */
+char* defaultVM = "java";
+char* vmLibrary = "libjvm.so";
+char* shippedVMDir = "jre/bin/";
+
+/* Define the special arguments for the various Java VMs. */
+static char* argVM_JAVA[] = { NULL };
+
+/* Define local variables . */
+static long splashHandle = 0;
+static GtkWidget* shellHandle = 0;
+
+static sem_t* mutex;
+static Atom appWindowAtom, launcherWindowAtom;
+static _TCHAR** openFilePath = NULL; /* the files we want to open */
+static int openFileTimeout = 60; /* number of seconds to wait before timeout */
+static int windowPropertySet = 0; /* set to 1 on success */
+
+static struct sigaction quitAction;
+static struct sigaction intAction;
+
+/* Local functions */
+static void catch_signal(int sig) {
+ //catch signals, free the lock, reinstall the original
+ //signal handlers and reraise the signal.
+ sem_post(mutex);
+ sem_close(mutex);
+ sigaction(SIGINT, &intAction, NULL);
+ sigaction(SIGQUIT, &intAction, NULL);
+ raise(sig);
+}
+
+typedef int (*LockFunc)();
+int executeWithLock(char *name, LockFunc func) {
+ int result = -1;
+ int lock = -1;
+ struct sigaction action;
+
+ mutex = sem_open(name, O_CREAT | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO, 1);
+ if (mutex == SEM_FAILED) {
+ //create failed. Probably lock is already created so try opening the existing lock.
+ mutex = sem_open(name, 0);
+ }
+ if (mutex == SEM_FAILED)
+ return -1; //this is an error.
+
+ // install signal handler to free the lock if something bad happens.
+ // sem_t is not freed automatically when a process ends.
+ action.sa_handler = catch_signal;
+ sigaction(SIGINT, &action, &intAction);
+ sigaction(SIGQUIT, &action, &quitAction);
+
+ while ((lock = sem_trywait(mutex)) != 0) {
+ if (errno == EAGAIN) {
+ //couldn't acquire lock, sleep a bit and try again
+ sleep(1);
+ if (--openFileTimeout > 0)
+ continue;
+ }
+ break;
+ }
+
+ if (lock == 0)
+ result = func();
+
+ sem_post(mutex);
+ sem_close(mutex);
+
+ //reinstall the original signal handlers
+ sigaction(SIGINT, &intAction, NULL);
+ sigaction(SIGQUIT, &quitAction, NULL);
+ return result;
+}
+
+/* Create a "SWT_Window_" + APP_NAME string with optional suffix.
+ * Caller should free the memory when finished */
+static char * createSWTWindowString(char * suffix, int semaphore) {
+#ifdef SOLARIS
+ /* solaris requires semaphore names to start with '/' */
+ char * prefix = semaphore != 0 ? _T_ECLIPSE("/SWT_Window_") : _T_ECLIPSE("SWT_Window_");
+#else
+ char * prefix = _T_ECLIPSE("SWT_Window_");
+#endif
+
+ char * result = malloc((_tcslen(prefix) + _tcslen(getOfficialName()) + (suffix != NULL ? _tcslen(suffix) : 0) + 1) * sizeof(char));
+ if (suffix != NULL)
+ _stprintf(result, _T_ECLIPSE("%s%s%s"), prefix, getOfficialName(), suffix);
+ else
+ _stprintf(result, _T_ECLIPSE("%s%s"), prefix, getOfficialName());
+ return result;
+}
+
+static int setAppWindowPropertyFn() {
+ Window appWindow;
+ Atom propAtom;
+ _TCHAR *propVal;
+
+ //Look for the SWT window. If it's there, set a property on it.
+ appWindow = gtk.XGetSelectionOwner(gtk_GDK_DISPLAY, appWindowAtom);
+ if (appWindow) {
+ propAtom = gtk.XInternAtom(gtk_GDK_DISPLAY, "org.eclipse.swt.filePath.message", FALSE);
+ //append a colon delimiter in case more than one file gets appended to the app windows property.
+ propVal = concatPaths(openFilePath, _T_ECLIPSE(':'));
+ gtk.XChangeProperty(gtk_GDK_DISPLAY, appWindow, propAtom, propAtom, 8, PropModeAppend, (unsigned char *)propVal, _tcslen(propVal));
+ free(propVal);
+ windowPropertySet = 1;
+ return 1;
+ }
+ return 0;
+}
+
+/* set the Application window property by executing _setWindowPropertyFn within a semaphore */
+int setAppWindowProperty() {
+ int result;
+ char * mutexName = createSWTWindowString(NULL, 1);
+ result = executeWithLock(mutexName, setAppWindowPropertyFn);
+ gtk.XSync(gtk_GDK_DISPLAY, False);
+ free(mutexName);
+ return result;
+}
+
+/* timer callback function to call setAppWindowProperty */
+static gboolean setAppWindowTimerProc(gpointer data) {
+ //try to set the app window property. If unsuccessful return true to reschedule the timer.
+ openFileTimeout--;
+ return !setAppWindowProperty() && openFileTimeout > 0;
+}
+
+int createLauncherWindow() {
+ Window window, launcherWindow;
+ //check if a launcher window exists. If none exists, we know we are the first and we should be launching the app.
+ window = gtk.XGetSelectionOwner(gtk_GDK_DISPLAY, launcherWindowAtom);
+ if (window == 0) {
+ //create a launcher window that other processes can find.
+ launcherWindow = gtk.XCreateWindow(gtk_GDK_DISPLAY, gtk.XRootWindow(gtk_GDK_DISPLAY, gtk.XDefaultScreen(gtk_GDK_DISPLAY)), -10, -10, 1,
+ 1, 0, 0, InputOnly, CopyFromParent, (unsigned long) 0, (XSetWindowAttributes *) NULL);
+ //for some reason Set and Get are both necessary. Set alone does nothing.
+ gtk.XSetSelectionOwner(gtk_GDK_DISPLAY, launcherWindowAtom, launcherWindow, CurrentTime);
+ gtk.XGetSelectionOwner(gtk_GDK_DISPLAY, launcherWindowAtom);
+ //add a timeout to set the property on the apps window once the app is launched.
+ gtk.g_timeout_add(1000, setAppWindowTimerProc, 0);
+ return 0;
+ }
+ return 1;
+}
+
+int reuseWorkbench(_TCHAR** filePath, int timeout) {
+ char *appName, *launcherName;
+ int result = 0;
+
+ if (initWindowSystem(&initialArgc, initialArgv, 1) != 0)
+ return -1;
+
+ openFileTimeout = timeout;
+ openFilePath = filePath;
+
+ //App name is defined in SWT as well. Values must be consistent.
+ appName = createSWTWindowString(NULL, 0);
+ appWindowAtom = gtk.XInternAtom(gtk_GDK_DISPLAY, appName, FALSE);
+ free(appName);
+
+ //check if app is already running. Just set property if it is.
+ if (setAppWindowProperty() > 0)
+ return 1;
+
+ /* app is not running, create a launcher window to act as a mutex so we don't need to keep the semaphore locked */
+ launcherName = createSWTWindowString(_T_ECLIPSE("_Launcher"), 1);
+ launcherWindowAtom = gtk.XInternAtom(gtk_GDK_DISPLAY, launcherName, FALSE);
+ result = executeWithLock(launcherName, createLauncherWindow);
+ free(launcherName);
+
+ if (result == 1) {
+ //The app is already being launched in another process. Set the property on that app window and exit
+ while (openFileTimeout > 0) {
+ if (setAppWindowProperty() > 0)
+ return 1; //success
+ else {
+ openFileTimeout--;
+ sleep(1);
+ }
+ }
+ //timed out trying to set the app property
+ result = 0;
+ }
+ return result;
+}
+
+/* Create and Display the Splash Window */
+int showSplash( const char* featureImage )
+{
+ GtkWidget *image;
+ GdkPixbuf *pixbuf;
+
+ if (splashHandle != 0)
+ return 0; /* already showing splash */
+ if (featureImage == NULL)
+ return -1;
+
+ if (initialArgv == NULL)
+ initialArgc = 0;
+
+ if( initWindowSystem(&initialArgc, initialArgv, 1) != 0)
+ return -1;
+
+ shellHandle = gtk.gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk.gtk_window_set_decorated((GtkWindow*)(shellHandle), FALSE);
+ gtk.g_signal_connect_data((gpointer)shellHandle, "destroy", (GtkSignalFunc)(gtk.gtk_widget_destroyed), &shellHandle, NULL, 0);
+
+ pixbuf = gtk.gdk_pixbuf_new_from_file(featureImage, NULL);
+ image = gtk.gtk_image_new_from_pixbuf(pixbuf);
+ if (pixbuf) {
+ gtk.g_object_unref(pixbuf);
+ }
+ gtk.gtk_container_add((GtkContainer*)(shellHandle), image);
+
+ if (getOfficialName() != NULL)
+ gtk.gtk_window_set_title((GtkWindow*)(shellHandle), getOfficialName());
+ gtk.gtk_window_set_position((GtkWindow*)(shellHandle), GTK_WIN_POS_CENTER);
+ gtk.gtk_window_resize((GtkWindow*)(shellHandle), gtk.gdk_pixbuf_get_width(pixbuf), gtk.gdk_pixbuf_get_height(pixbuf));
+ gtk.gtk_widget_show_all((GtkWidget*)(shellHandle));
+ splashHandle = (long)shellHandle;
+ dispatchMessages();
+ return 0;
+}
+
+void dispatchMessages() {
+ if (gtk.g_main_context_iteration != 0)
+ while(gtk.g_main_context_iteration(0,0) != 0) {}
+}
+
+jlong getSplashHandle() {
+ return splashHandle;
+}
+
+void takeDownSplash() {
+ if(shellHandle != 0) {
+ gtk.gtk_widget_destroy(shellHandle);
+ dispatchMessages();
+ splashHandle = 0;
+ shellHandle = NULL;
+ }
+}
+
+/* Get the window system specific VM arguments */
+char** getArgVM( char* vm )
+{
+ char** result;
+
+/* if (isJ9VM( vm ))
+ return argVM_J9;*/
+
+ /* Use the default arguments for a standard Java VM */
+ result = argVM_JAVA;
+ return result;
+}
+
+JavaResults* launchJavaVM( char* args[] )
+{
+ JavaResults* jvmResults = NULL;
+ pid_t jvmProcess, finishedProcess = 0;
+ int exitCode;
+
+#ifdef MOZILLA_FIX
+ fixEnvForMozilla();
+#endif /* MOZILLA_FIX */
+
+ jvmProcess = fork();
+ if (jvmProcess == 0)
+ {
+ /* Child process ... start the JVM */
+ execv(args[0], args);
+
+ /* The JVM would not start ... return error code to parent process. */
+ /* TODO, how to distinguish this as a launch problem to the other process? */
+ _exit(errno);
+ }
+
+ jvmResults = malloc(sizeof(JavaResults));
+ memset(jvmResults, 0, sizeof(JavaResults));
+
+ /* If the JVM is still running, wait for it to terminate. */
+ if (jvmProcess != 0)
+ {
+ /* When attempting a file open, we need to spin the event loop
+ * for setAppWindowTimerProc to run. When that succeeds or times out,
+ * we can stop the event loop and just wait on the child process.
+ */
+ if (openFilePath != NULL) {
+ struct timespec sleepTime;
+ sleepTime.tv_sec = 0;
+ sleepTime.tv_nsec = 5e+8; // 500 milliseconds
+
+ while(openFileTimeout > 0 && !windowPropertySet && (finishedProcess = waitpid(jvmProcess, &exitCode, WNOHANG)) == 0) {
+ dispatchMessages();
+ nanosleep(&sleepTime, NULL);
+ }
+ }
+ if (finishedProcess == 0)
+ waitpid(jvmProcess, &exitCode, 0);
+ if (WIFEXITED(exitCode))
+ /* TODO, this should really be a runResult if we could distinguish the launch problem above */
+ jvmResults->launchResult = WEXITSTATUS(exitCode);
+ }
+
+ return jvmResults;
+}
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h
new file mode 100644
index 000000000..503c9a5f9
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.h
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+#ifndef ECLIPSE_GTK_H
+#define ECLIPSE_GTK_H
+
+#include <gtk/gtk.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdkx.h>
+
+struct GTK_PTRS {
+ short not_initialized;
+ void (*gtk_container_add) (GtkContainer*, GtkWidget*);
+ gint (*gtk_dialog_run) (GtkDialog *);
+ GtkWidget* (*gtk_image_new_from_pixbuf)(GdkPixbuf*);
+ gboolean (*gtk_init_check) (int*, char***);
+ gboolean (*gtk_init_with_args) (int*, char***, const char *, void *, const char *, GError **);
+ GtkWidget* (*gtk_message_dialog_new) (GtkWindow*, GtkDialogFlags, GtkMessageType, GtkButtonsType, const gchar*, ...);
+ gchar* (*gtk_set_locale) ();
+ void (*gtk_widget_destroy) (GtkWidget*);
+ void (*gtk_widget_destroyed) (GtkWidget*, GtkWidget**);
+ void (*gtk_widget_show_all) (GtkWidget*);
+ GtkWidget* (*gtk_window_new) (GtkWindowType);
+ void (*gtk_window_resize) (GtkWindow*, gint, gint);
+ void (*gtk_window_set_title) (GtkWindow*, const gchar*);
+ void (*gtk_window_set_decorated) (GtkWindow*, gboolean);
+ void (*gtk_window_set_position) (GtkWindow*, GtkWindowPosition);
+
+ gulong (*g_signal_connect_data) (gpointer, const gchar*, GCallback, gpointer, GClosureNotify, GConnectFlags);
+ gboolean (*g_main_context_iteration) (GMainContext*, gboolean);
+ void (*g_object_unref) (gpointer);
+ GObject* (*g_object_new) (GType, const gchar*, ...);
+ guint (*g_timeout_add) (guint, GSourceFunc, gpointer);
+ void (*g_error_free) (GError *);
+
+#ifdef SOLARIS
+ GString* (*g_string_insert_c) (GString *, gssize, gchar);
+#endif
+
+ GdkDisplay* (*gdk_display_get_default) ();
+ Display* (*gdk_x11_display_get_xdisplay) (GdkDisplay*);
+ GdkPixbuf* (*gdk_pixbuf_new_from_file) (const char*, GError **);
+ int (*gdk_pixbuf_get_width) (const GdkPixbuf*);
+ int (*gdk_pixbuf_get_height) (const GdkPixbuf*);
+ void (*gdk_set_program_class) (const char*);
+
+ Window (*XGetSelectionOwner) (Display*, Atom);
+ void (*XSetSelectionOwner) (Display*, Atom, Window, Time);
+ void (*XChangeProperty) (Display*, Window, Atom, Atom, int, int, unsigned char *, int);
+ Window (*XCreateWindow) (Display*, Window, int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, Visual*, unsigned long, XSetWindowAttributes*);
+ void (*XSync) (Display*, Bool);
+ int (*XDefaultScreen) (Display*);
+ Window (*XRootWindow) (Display*, int);
+ Atom (*XInternAtom) (Display*, _Xconst char*, Bool );
+};
+
+#define gtk_GDK_DISPLAY gtk.gdk_x11_display_get_xdisplay(gtk.gdk_display_get_default())
+extern struct GTK_PTRS gtk;
+
+#define FN_TABLE_ENTRY(fn, required) { (void**)& gtk.fn, #fn, required }
+typedef struct {
+ void ** fnPtr;
+ char * fnName;
+ int required;
+} FN_TABLE;
+
+/* load the gtk libraries and initialize the function pointers */
+extern int loadGtk();
+
+#endif
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c
new file mode 100644
index 000000000..b30327ec5
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Andrew Niefer
+ *******************************************************************************/
+
+#include "eclipseCommon.h"
+#include "eclipseOS.h"
+#include "eclipseGtk.h"
+
+#include <locale.h>
+#include <dlfcn.h>
+#include <stdio.h>
+
+#define ECLIPSE_ICON 401
+
+char dirSeparator = '/';
+char pathSeparator = ':';
+
+/* Define local variables for the main window. */
+static int saveArgc = 0; /* arguments after they were parsed, for window system */
+static char** saveArgv = 0;
+
+gboolean gtkInitialized = FALSE;
+
+#ifdef SOLARIS
+/* a call to this function appears inline in glib/gstring.h on Solaris,
+ so provide a definition here and hook it up
+ */
+GString* g_string_insert_c (GString *string, gssize pos, gchar c) {
+ /* see bug 264615, we can get here without having initialized the gtk pointers */
+ if (gtk.not_initialized)
+ loadGtk();
+ return gtk.g_string_insert_c(string, pos, c);
+}
+#endif
+
+/* Display a Message */
+void displayMessage(char* title, char* message)
+{
+ GtkWidget* dialog;
+
+ /* If GTK has not been initialized yet, do it now. */
+ if (initWindowSystem( &saveArgc, saveArgv, 1 ) != 0) {
+ printf("%s:\n%s\n", title, message);
+ return;
+ }
+
+ dialog = gtk.gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ "%s", message);
+ gtk.gtk_window_set_title((GtkWindow*)dialog, title);
+ gtk.gtk_dialog_run((GtkDialog*)dialog);
+ gtk.gtk_widget_destroy(dialog);
+}
+
+/* Initialize the Window System */
+int initWindowSystem(int* pArgc, char* argv[], int showSplash)
+{
+ int defaultArgc = 1;
+ char * defaultArgv [] = { "", 0 };
+
+ if(gtkInitialized)
+ return 0;
+
+ /* load the GTK libraries and initialize function pointers */
+ if (loadGtk() != 0)
+ return -1;
+
+ if (getOfficialName() != NULL)
+ defaultArgv[0] = getOfficialName();
+
+ if (argv == NULL) {
+ /* gtk_init_check on Solaris 9 doesn't like NULL or empty argv */
+ pArgc = &defaultArgc;
+ argv = defaultArgv;
+ }
+
+ /* Save the arguments in case displayMessage() is called in the main launcher. */
+ if (saveArgv == 0)
+ {
+ saveArgc = *pArgc;
+ saveArgv = argv;
+ }
+
+ /* Initialize GTK. */
+ if (gtk.gtk_set_locale) gtk.gtk_set_locale();
+ if (gtk.gtk_init_with_args) {
+ GError *error = NULL;
+ if (!gtk.gtk_init_with_args(pArgc, &argv, NULL, NULL, NULL, &error)) {
+ if (error) {
+ fprintf(stderr, "%s: %s\n", getOfficialName(), error->message);
+ if (gtk.g_error_free) gtk.g_error_free(error);
+ }
+ return -1;
+ }
+ } else {
+ if (!gtk.gtk_init_check(pArgc, &argv)) {
+ return -1;
+ }
+ }
+
+ /*_gdk_set_program_class(getOfficialName());*/
+ gtkInitialized = TRUE;
+ return 0;
+}
+
+/* Load the specified shared library
+ */
+void * loadLibrary( char * library ){
+ void * result= dlopen(library, RTLD_LAZY);
+ if(result == 0)
+ printf("%s\n",dlerror());
+ return result;
+}
+
+/* Unload the shared library
+ */
+void unloadLibrary( void * handle ){
+ dlclose(handle);
+}
+
+/* Find the given symbol in the shared library
+ */
+void * findSymbol( void * handle, char * symbol ){
+ return dlsym(handle, symbol);
+}
+
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c
new file mode 100644
index 000000000..51ed70a9f
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkInit.c
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "eclipseGtk.h"
+#include "eclipseCommon.h"
+#include <dlfcn.h>
+#include <string.h>
+#include <stdlib.h>
+
+struct GTK_PTRS gtk = { 1 }; /* initialize the first field "not_initialized" so we can tell when we've loaded the pointers */
+
+/* tables to help initialize the function pointers */
+/* functions from libgtk-x11-2.0 or libgtk-3.so.0*/
+static FN_TABLE gtkFunctions[] = {
+ FN_TABLE_ENTRY(gtk_container_add, 1),
+ FN_TABLE_ENTRY(gtk_dialog_run, 1),
+ FN_TABLE_ENTRY(gtk_image_new_from_pixbuf, 1),
+ FN_TABLE_ENTRY(gtk_init_check, 1),
+ FN_TABLE_ENTRY(gtk_init_with_args, 0),
+ FN_TABLE_ENTRY(gtk_message_dialog_new, 1),
+ FN_TABLE_ENTRY(gtk_set_locale, 0),
+ FN_TABLE_ENTRY(gtk_widget_destroy, 1),
+ FN_TABLE_ENTRY(gtk_widget_destroyed, 1),
+ FN_TABLE_ENTRY(gtk_widget_show_all, 1),
+ FN_TABLE_ENTRY(gtk_window_new, 1),
+ FN_TABLE_ENTRY(gtk_window_resize, 1),
+ FN_TABLE_ENTRY(gtk_window_set_title, 1),
+ FN_TABLE_ENTRY(gtk_window_set_decorated, 1),
+ FN_TABLE_ENTRY(gtk_window_set_position, 1),
+ { NULL, NULL }
+};
+/* functions from libgdk-x11-2.0 or libgdk-3.so.0*/
+static FN_TABLE gdkFunctions[] = {
+ FN_TABLE_ENTRY(gdk_set_program_class, 1),
+ FN_TABLE_ENTRY(gdk_display_get_default, 1),
+ FN_TABLE_ENTRY(gdk_x11_display_get_xdisplay, 1),
+ { NULL, NULL }
+};
+/* functions from libgdk_pixbuf-2.0 */
+static FN_TABLE pixFunctions[] = {
+ FN_TABLE_ENTRY(gdk_pixbuf_new_from_file, 1),
+ FN_TABLE_ENTRY(gdk_pixbuf_get_width, 1),
+ FN_TABLE_ENTRY(gdk_pixbuf_get_height, 1),
+ { NULL, NULL }
+};
+/* functions from libgobject-2.0 */
+static FN_TABLE gobjFunctions[] = {
+ FN_TABLE_ENTRY(g_signal_connect_data, 1),
+ FN_TABLE_ENTRY(g_main_context_iteration, 1),
+ FN_TABLE_ENTRY(g_object_unref, 1),
+ FN_TABLE_ENTRY(g_timeout_add, 1),
+ FN_TABLE_ENTRY(g_error_free, 1),
+#ifdef SOLARIS
+ FN_TABLE_ENTRY(g_string_insert_c, 1),
+#endif
+ { NULL, NULL }
+};
+
+/* functions from libX11 */
+static FN_TABLE x11Functions[] = {
+ FN_TABLE_ENTRY(XGetSelectionOwner, 1),
+ FN_TABLE_ENTRY(XSetSelectionOwner, 1),
+ FN_TABLE_ENTRY(XCreateWindow, 1),
+ FN_TABLE_ENTRY(XChangeProperty, 1),
+ FN_TABLE_ENTRY(XSync, 1),
+ FN_TABLE_ENTRY(XRootWindow, 1),
+ FN_TABLE_ENTRY(XDefaultScreen, 1),
+ FN_TABLE_ENTRY(XInternAtom, 1),
+ { NULL, NULL }
+};
+
+
+static int loadGtkSymbols( void * library, FN_TABLE * table) {
+ int i = 0;
+ void * fn;
+ for (i = 0; table[i].fnName != NULL; i++) {
+ fn = findSymbol(library, table[i].fnName);
+ if (fn != 0) {
+ *(table[i].fnPtr) = fn;
+ } else {
+ if (table[i].required) return -1;
+ }
+ }
+ return 0;
+}
+
+int loadGtk() {
+#ifdef AIX
+#define DLFLAGS RTLD_LAZY | RTLD_MEMBER
+#else
+#define DLFLAGS RTLD_LAZY
+#endif
+
+ void *gdkLib = NULL, *gtkLib = NULL, *objLib = NULL, *pixLib = NULL, *x11Lib = NULL;
+
+ if (getenv("SWT_GTK3")) {
+ gdkLib = dlopen(GDK3_LIB, DLFLAGS);
+ gtkLib = dlopen(GTK3_LIB, DLFLAGS);
+ }
+ if (!gtkLib || !gdkLib) {
+ gdkLib = dlopen(GDK_LIB, DLFLAGS);
+ gtkLib = dlopen(GTK_LIB, DLFLAGS);
+ }
+ objLib = dlopen(GOBJ_LIB, DLFLAGS);
+ pixLib = dlopen(PIXBUF_LIB, DLFLAGS);
+ x11Lib = dlopen(X11_LIB, DLFLAGS);
+
+ /* initialize ptr struct to 0's */
+ memset(&gtk, 0, sizeof(struct GTK_PTRS));
+
+ if ( gtkLib == NULL || loadGtkSymbols(gtkLib, gtkFunctions) != 0) return -1;
+ if ( gdkLib == NULL || loadGtkSymbols(gdkLib, gdkFunctions) != 0) return -1;
+ if ( pixLib == NULL || loadGtkSymbols(pixLib, pixFunctions) != 0) return -1;
+ if ( objLib == NULL || loadGtkSymbols(objLib, gobjFunctions) != 0) return -1;
+ if ( x11Lib == NULL || loadGtkSymbols(x11Lib, x11Functions) != 0) return -1;
+
+ return 0;
+}
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/make_aix.mak b/features/org.eclipse.equinox.executable.feature/library/gtk/make_aix.mak
new file mode 100644
index 000000000..2d3a71d9b
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/make_aix.mak
@@ -0,0 +1,116 @@
+#*******************************************************************************
+# Copyright (c) 2010, 2011 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Kevin Cornell (Rational Software Corporation)
+# Tom Tromey (Red Hat, Inc.)
+#*******************************************************************************
+include ../make_version.mak
+# Makefile for creating the GTK eclipse launcher program.
+#
+# This makefile expects the utility "pkg-config" to be in the PATH.
+
+# This makefile expects the following environment variables set:
+#
+# PROGRAM_OUTPUT - the filename of the output executable
+# DEFAULT_OS - the default value of the "-os" switch
+# DEFAULT_OS_ARCH - the default value of the "-arch" switch
+# DEFAULT_WS - the default value of the "-ws" switch
+# JAVA_HOME - JAVA_HOME for jni headers
+#default value for PROGRAM_OUTPUT
+
+PROGRAM_OUTPUT=eclipse
+PROGRAM_LIBRARY=$(PROGRAM_OUTPUT)_$(LIB_VERSION).so
+
+
+# Define the object modules to be compiled and flags.
+CC=gcc
+MAIN_OBJS = eclipseMain.o
+COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseGtkCommon.o eclipseGtkInit.o
+DLL_OBJS = eclipse.o eclipseGtk.o eclipseUtil.o eclipseJNI.o eclipseMozilla.o eclipseShm.o eclipseNix.o
+
+EXEC = $(PROGRAM_OUTPUT)
+DLL = $(PROGRAM_LIBRARY)
+#LIBS = `pkg-config --libs-only-L gtk+-2.0` -lgtk-x11-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lgdk-x11-2.0 -lpthread -ldl -lX11
+LIBS = -lpthread -ldl
+
+X11_LIB_ppc = shr4.o
+X11_LIB_ppc64 = shr_64.o
+X11_LIB = -DX11_LIB="\"libX11.a($(X11_LIB_$(DEFAULT_OS_ARCH)))\""
+GTK_LIBS = -DGTK_LIB="\"libgtk-x11-2.0.a(libgtk-x11-2.0.so.0)\"" \
+ -DGDK_LIB="\"libgdk-x11-2.0.a(libgdk-x11-2.0.so.0)\"" \
+ -DGTK3_LIB="\"libgtk-3.a(libgtk-3.so.0)\"" \
+ -DGDK3_LIB="\"libgdk-3.a(libgdk-3.so.0)\"" \
+ -DPIXBUF_LIB="\"libgdk_pixbuf-2.0.a(libgdk_pixbuf-2.0.so.0)\"" \
+ -DGOBJ_LIB="\"libgobject-2.0.a(libgobject-2.0.so.0)\"" \
+ $(X11_LIB)
+
+LFLAGS = ${M_ARCH} -shared
+CFLAGS = ${M_ARCH} -g -s -Wall\
+ -fpic \
+ -DAIX \
+ -DMOZILLA_FIX \
+ -DDEFAULT_OS="\"$(DEFAULT_OS)\"" \
+ -DDEFAULT_OS_ARCH="\"$(DEFAULT_OS_ARCH)\"" \
+ -DDEFAULT_WS="\"$(DEFAULT_WS)\"" \
+ -D$(DEFAULT_JAVA) \
+ $(GTK_LIBS) \
+ -I. \
+ -I.. \
+ -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux \
+ `pkg-config --cflags gtk+-2.0`
+
+all: $(EXEC) $(DLL)
+
+eclipse.o: ../eclipse.c ../eclipseOS.h ../eclipseCommon.h ../eclipseJNI.h
+ $(CC) $(CFLAGS) -c ../eclipse.c -o eclipse.o
+
+eclipseMain.o: ../eclipseUnicode.h ../eclipseCommon.h ../eclipseMain.c
+ $(CC) $(CFLAGS) -c ../eclipseMain.c -o eclipseMain.o
+
+eclipseCommon.o: ../eclipseCommon.h ../eclipseUnicode.h ../eclipseCommon.c
+ $(CC) $(CFLAGS) -c ../eclipseCommon.c
+
+eclipseGtkCommon.o: ../eclipseCommon.h ../eclipseOS.h eclipseGtk.h eclipseGtkCommon.c
+ $(CC) $(CFLAGS) -c eclipseGtkCommon.c -o eclipseGtkCommon.o
+
+eclipseGtkInit.o: ../eclipseCommon.h eclipseGtk.h eclipseGtkInit.c
+ $(CC) $(CFLAGS) -c eclipseGtkInit.c -o eclipseGtkInit.o
+
+eclipseUtil.o: ../eclipseUtil.c ../eclipseUtil.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseUtil.c -o eclipseUtil.o
+
+eclipseJNI.o: ../eclipseJNI.c ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.h
+ $(CC) $(CFLAGS) -c ../eclipseJNI.c -o eclipseJNI.o
+
+eclipseConfig.o: ../eclipseConfig.c ../eclipseConfig.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseConfig.c -o eclipseConfig.o
+
+eclipseMozilla.o: ../eclipseMozilla.c ../eclipseMozilla.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseMozilla.c -o eclipseMozilla.o
+
+eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
+ $(CC) $(CFLAGS) -c ../eclipseShm.c -o eclipseShm.o
+
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c ../eclipseNix.c -o eclipseNix.o
+
+$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
+ $(CC) ${M_ARCH} -Wl,-bM:UR -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
+ sedmgr -c exempt $(EXEC)
+
+$(DLL): $(DLL_OBJS) $(COMMON_OBJS)
+ $(CC) $(LFLAGS) -o $(DLL) $(DLL_OBJS) $(COMMON_OBJS) $(LIBS)
+
+install: all
+ cp $(EXEC) $(OUTPUT_DIR)
+ cp $(DLL) $(LIBRARY_DIR)
+ rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)
+
+clean:
+ rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/make_hpux.mak b/features/org.eclipse.equinox.executable.feature/library/gtk/make_hpux.mak
new file mode 100644
index 000000000..d0227efc2
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/make_hpux.mak
@@ -0,0 +1,102 @@
+#*******************************************************************************
+# Copyright (c) 2000, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Kevin Cornell (Rational Software Corporation)
+# Sumit Sarkar (Hewlett-Packard)
+#*******************************************************************************
+include ../make_version.mak
+# Makefile for creating the HPUX/Motif eclipse launcher program.
+
+# This makefile expects the following environment variables set:
+#
+# PROGRAM_OUTPUT - the filename of the output executable
+# DEFAULT_OS - the default value of the "-os" switch
+# DEFAULT_OS_ARCH - the default value of the "-arch" switch
+# DEFAULT_WS - the default value of the "-ws" switch
+# X11_HOME - the full path to X11 header files
+# MOTIF_HOME - the full path to Motif header files
+
+#ifeq ($(PROGRAM_OUTPUT),)
+# PROGRAM_OUTPUT=eclipse
+#endif
+
+DEFAULT_JAVA=DEFAULT_JAVA_EXEC
+PROGRAM_LIBRARY=eclipse_$(LIB_VERSION).so
+
+# Define the object modules to be compiled and flags.
+CC=gcc
+MAIN_OBJS = eclipseMain.o
+COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseGtkCommon.o eclipseGtkInit.o
+DLL_OBJS = eclipse.o eclipseGtk.o eclipseUtil.o eclipseJNI.o eclipseShm.o eclipseNix.o
+
+EXEC = $(PROGRAM_OUTPUT)
+DLL = $(PROGRAM_LIBRARY)
+LIBS = -L$(MOTIF_HOME)/lib -L$(X11_HOME)/lib -lpthread -lrt
+GTK_LIBS = \
+ -DGTK_LIB="\"libgtk-x11-2.0.so\"" -DGDK_LIB="\"libgdk-x11-2.0.so\"" \
+ -DGTK3_LIB="\"libgtk-3.so\"" -DGDK3_LIB="\"libgdk-3.so\"" \
+ -DPIXBUF_LIB="\"libgdk_pixbuf-2.0.so\"" \
+ -DGOBJ_LIB="\"libgobject-2.0.so\"" -DX11_LIB="\"libX11.so\""
+LFLAGS = ${M_ARCH} -shared -static-libgcc
+# -Wl,--export-dynamic
+CFLAGS = ${M_ARCH} -O -s \
+ -DNETSCAPE_FIX \
+ -DDEFAULT_OS="\"$(DEFAULT_OS)\"" \
+ -DDEFAULT_OS_ARCH="\"$(DEFAULT_OS_ARCH)\"" \
+ -DDEFAULT_WS="\"$(DEFAULT_WS)\"" \
+ -D$(DEFAULT_JAVA) \
+ -DHPUX \
+ $(GTK_LIBS) \
+ -I./ \
+ -I../ \
+ -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/hp-ux \
+ `pkg-config --cflags gtk+-2.0`
+
+all: $(EXEC) $(DLL)
+
+.c.o:
+ $(CC) $(CFLAGS) -c $< -o $@
+
+eclipse.o: ../eclipse.c ../eclipseOS.h ../eclipseCommon.h ../eclipseJNI.h
+ $(CC) $(CFLAGS) -c ../eclipse.c -o $@
+
+eclipseMain.o: ../eclipseMain.c ../eclipseUnicode.h ../eclipseCommon.h
+ $(CC) $(CFLAGS) -c ../eclipseMain.c -o $@
+
+eclipseCommon.o: ../eclipseCommon.c ../eclipseCommon.h ../eclipseUnicode.h
+ $(CC) $(CFLAGS) -c ../eclipseCommon.c -o $@
+
+eclipseUtil.o: ../eclipseUtil.c ../eclipseUtil.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseUtil.c -o $@
+
+eclipseJNI.o: ../eclipseJNI.c ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.h
+ $(CC) $(CFLAGS) -c ../eclipseJNI.c -o $@
+
+eclipseConfig.o: ../eclipseConfig.c ../eclipseConfig.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseConfig.c -o $@
+
+eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
+ $(CC) $(CFLAGS) -c ../eclipseShm.c -o $@
+
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c ../eclipseNix.c -o $@
+
+$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
+ $(CC) ${M_ARCH} -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
+
+$(DLL): $(DLL_OBJS) $(COMMON_OBJS)
+ $(CC) $(LFLAGS) -o $(DLL) $(DLL_OBJS) $(COMMON_OBJS) $(LIBS)
+
+install: all
+ cp $(EXEC) $(OUTPUT_DIR)
+ cp $(DLL) $(LIBRARY_DIR)
+ rm -f $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)
+
+clean:
+ rm -f $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/make_linux.mak b/features/org.eclipse.equinox.executable.feature/library/gtk/make_linux.mak
new file mode 100644
index 000000000..6abe01702
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/make_linux.mak
@@ -0,0 +1,112 @@
+#*******************************************************************************
+# Copyright (c) 2000, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Kevin Cornell (Rational Software Corporation)
+# Tom Tromey (Red Hat, Inc.)
+#*******************************************************************************
+include ../make_version.mak
+# Makefile for creating the GTK eclipse launcher program.
+#
+# This makefile expects the utility "pkg-config" to be in the PATH.
+
+# This makefile expects the following environment variables set:
+#
+# PROGRAM_OUTPUT - the filename of the output executable
+# DEFAULT_OS - the default value of the "-os" switch
+# DEFAULT_OS_ARCH - the default value of the "-arch" switch
+# DEFAULT_WS - the default value of the "-ws" switch
+# JAVA_HOME - JAVA_HOME for jni headers
+#default value for PROGRAM_OUTPUT
+ifeq ($(PROGRAM_OUTPUT),)
+ PROGRAM_OUTPUT=eclipse
+endif
+
+PROGRAM_LIBRARY=$(PROGRAM_OUTPUT)_$(LIB_VERSION).so
+
+ifeq ($(DEFAULT_JAVA),)
+ DEFAULT_JAVA=DEFAULT_JAVA_JNI
+endif
+
+# Define the object modules to be compiled and flags.
+CC?=gcc
+MAIN_OBJS = eclipseMain.o
+COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseGtkCommon.o eclipseGtkInit.o
+DLL_OBJS = eclipse.o eclipseGtk.o eclipseUtil.o eclipseJNI.o eclipseMozilla.o eclipseShm.o eclipseNix.o
+
+EXEC = $(PROGRAM_OUTPUT)
+DLL = $(PROGRAM_LIBRARY)
+#LIBS = `pkg-config --libs-only-L gtk+-2.0` -lgtk-x11-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lgdk-x11-2.0 -lpthread -ldl -lX11
+LIBS = -lpthread -ldl
+GTK_LIBS = \
+ -DGTK_LIB="\"libgtk-x11-2.0.so.0\"" -DGDK_LIB="\"libgdk-x11-2.0.so.0\"" \
+ -DGTK3_LIB="\"libgtk-3.so.0\"" -DGDK3_LIB="\"libgdk-3.so.0\"" \
+ -DPIXBUF_LIB="\"libgdk_pixbuf-2.0.so.0\"" -DGOBJ_LIB="\"libgobject-2.0.so.0\"" -DX11_LIB="\"libX11.so.6\""
+LFLAGS = ${M_ARCH} -shared -fpic -Wl,--export-dynamic
+CFLAGS = ${M_ARCH} -g -s -Wall\
+ -fpic \
+ -DLINUX \
+ -DMOZILLA_FIX \
+ -DDEFAULT_OS="\"$(DEFAULT_OS)\"" \
+ -DDEFAULT_OS_ARCH="\"$(DEFAULT_OS_ARCH)\"" \
+ -DDEFAULT_WS="\"$(DEFAULT_WS)\"" \
+ -D$(DEFAULT_JAVA) \
+ $(GTK_LIBS) \
+ -I. \
+ -I.. \
+ -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux \
+ `pkg-config --cflags gtk+-2.0`
+
+all: $(EXEC) $(DLL)
+
+eclipse.o: ../eclipse.c ../eclipseOS.h ../eclipseCommon.h ../eclipseJNI.h
+ $(CC) $(CFLAGS) -c ../eclipse.c -o eclipse.o
+
+eclipseMain.o: ../eclipseUnicode.h ../eclipseCommon.h ../eclipseMain.c
+ $(CC) $(CFLAGS) -c ../eclipseMain.c -o eclipseMain.o
+
+eclipseCommon.o: ../eclipseCommon.h ../eclipseUnicode.h ../eclipseCommon.c
+ $(CC) $(CFLAGS) -c ../eclipseCommon.c
+
+eclipseGtkCommon.o: ../eclipseCommon.h ../eclipseOS.h eclipseGtk.h eclipseGtkCommon.c
+ $(CC) $(CFLAGS) -c eclipseGtkCommon.c -o eclipseGtkCommon.o
+
+eclipseGtkInit.o: ../eclipseCommon.h eclipseGtk.h eclipseGtkInit.c
+ $(CC) $(CFLAGS) -c eclipseGtkInit.c -o eclipseGtkInit.o
+
+eclipseUtil.o: ../eclipseUtil.c ../eclipseUtil.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseUtil.c -o eclipseUtil.o
+
+eclipseJNI.o: ../eclipseJNI.c ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.h
+ $(CC) $(CFLAGS) -c ../eclipseJNI.c -o eclipseJNI.o
+
+eclipseConfig.o: ../eclipseConfig.c ../eclipseConfig.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseConfig.c -o eclipseConfig.o
+
+eclipseMozilla.o: ../eclipseMozilla.c ../eclipseMozilla.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseMozilla.c -o eclipseMozilla.o
+
+eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
+ $(CC) $(CFLAGS) -c ../eclipseShm.c -o eclipseShm.o
+
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c ../eclipseNix.c -o eclipseNix.o
+
+$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
+ $(CC) ${M_ARCH} -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
+
+$(DLL): $(DLL_OBJS) $(COMMON_OBJS)
+ $(CC) $(LFLAGS) -o $(DLL) $(DLL_OBJS) $(COMMON_OBJS) $(LIBS)
+
+install: all
+ cp $(EXEC) $(OUTPUT_DIR)
+ cp $(DLL) $(LIBRARY_DIR)
+ rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)
+
+clean:
+ rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/make_solaris.mak b/features/org.eclipse.equinox.executable.feature/library/gtk/make_solaris.mak
new file mode 100644
index 000000000..945becf9e
--- /dev/null
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/make_solaris.mak
@@ -0,0 +1,111 @@
+#*******************************************************************************
+# Copyright (c) 2000, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Kevin Cornell (Rational Software Corporation)
+# Tom Tromey (Red Hat, Inc.)
+# Martin Oberhuber (Wind River) - [176805] Support building with gcc and debug
+#*******************************************************************************
+include ../make_version.mak
+# Makefile for creating the GTK eclipse launcher program.
+#
+# This makefile expects the utility "pkg-config" to be in the PATH.
+
+# This makefile expects the following environment variables set:
+#
+# PROGRAM_OUTPUT - the filename of the output executable
+# DEFAULT_OS - the default value of the "-os" switch
+# DEFAULT_OS_ARCH - the default value of the "-arch" switch
+# DEFAULT_WS - the default value of the "-ws" switch
+# JAVA_HOME - JAVA_HOME for JNI headers
+
+#ifeq ($(PROGRAM_OUTPUT),)
+ PROGRAM_OUTPUT=eclipse
+#endif
+
+PROGRAM_LIBRARY=$(PROGRAM_OUTPUT)_$(LIB_VERSION).so
+
+# Define the object modules to be compiled and flags.
+MAIN_OBJS = eclipseMain.o
+COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseGtkCommon.o eclipseGtkInit.o
+DLL_OBJS = eclipse.o eclipseGtk.o eclipseUtil.o eclipseJNI.o eclipseMozilla.o eclipseShm.o eclipseNix.o
+PICFLAG = -K PIC
+# Optimize and remove all debugging information by default
+OPTFLAG = -O -s
+# OPTFLAG = -g
+
+EXEC = $(PROGRAM_OUTPUT)
+DLL = $(PROGRAM_LIBRARY)
+#LIBS = `pkg-config --libs-only-L gtk+-2.0` -lgtk-x11-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lgdk-x11-2.0 -lglib-2.0 -lthread -ldl -lc
+LIBS = -lthread -ldl -lc -lrt
+GTK_LIBS = \
+ -DGTK_LIB="\"libgtk-x11-2.0.so.0\"" -DGDK_LIB="\"libgdk-x11-2.0.so.0\"" \
+ -DGTK3_LIB="\"libgtk-3.so.0\"" -DGDK3_LIB="\"libgdk-3.so.0\"" \
+ -DPIXBUF_LIB="\"libgdk_pixbuf-2.0.so.0\"" -DGOBJ_LIB="\"libgobject-2.0.so.0\"" -DX11_LIB="\"libX11.so.4\""
+LFLAGS = -G
+CFLAGS = $(OPTFLAG) \
+ -DSOLARIS \
+ $(PICFLAG) \
+ -DMOZILLA_FIX \
+ -DDEFAULT_OS="\"$(DEFAULT_OS)\"" \
+ -DDEFAULT_OS_ARCH="\"$(DEFAULT_OS_ARCH)\"" \
+ -DDEFAULT_WS="\"$(DEFAULT_WS)\"" \
+ $(GTK_LIBS) \
+ -I. \
+ -I.. \
+ -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/solaris \
+ `pkg-config --cflags gtk+-2.0`
+
+all: $(EXEC) $(DLL)
+
+eclipse.o: ../eclipse.c ../eclipseOS.h ../eclipseCommon.h ../eclipseJNI.h
+ $(CC) $(CFLAGS) -c ../eclipse.c -o eclipse.o
+
+eclipseMain.o: ../eclipseUnicode.h ../eclipseCommon.h ../eclipseMain.c
+ $(CC) $(CFLAGS) -c ../eclipseMain.c -o eclipseMain.o
+
+eclipseCommon.o: ../eclipseCommon.h ../eclipseUnicode.h ../eclipseCommon.c
+ $(CC) $(CFLAGS) -c ../eclipseCommon.c
+
+eclipseGtkCommon.o: ../eclipseCommon.h ../eclipseOS.h eclipseGtk.h eclipseGtkCommon.c
+ $(CC) $(CFLAGS) -c eclipseGtkCommon.c -o eclipseGtkCommon.o
+
+eclipseGtkInit.o: ../eclipseCommon.h eclipseGtk.h eclipseGtkInit.c
+ $(CC) $(CFLAGS) -c eclipseGtkInit.c -o eclipseGtkInit.o
+
+eclipseUtil.o: ../eclipseUtil.c ../eclipseUtil.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseUtil.c -o eclipseUtil.o
+
+eclipseJNI.o: ../eclipseJNI.c ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.h
+ $(CC) $(CFLAGS) -c ../eclipseJNI.c -o eclipseJNI.o
+
+eclipseConfig.o: ../eclipseConfig.c ../eclipseConfig.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseConfig.c -o eclipseConfig.o
+
+eclipseMozilla.o: ../eclipseMozilla.c ../eclipseMozilla.h ../eclipseOS.h
+ $(CC) $(CFLAGS) -c ../eclipseMozilla.c -o eclipseMozilla.o
+
+eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
+ $(CC) $(CFLAGS) -c ../eclipseShm.c -o eclipseShm.o
+
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c ../eclipseNix.c -o eclipseNix.o
+
+$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
+ $(CC) -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
+
+$(DLL): $(DLL_OBJS) $(COMMON_OBJS)
+ $(CC) $(LFLAGS) -o $(DLL) $(DLL_OBJS) $(COMMON_OBJS) $(LIBS)
+
+install: all
+ cp $(EXEC) $(OUTPUT_DIR)
+ cp $(DLL) $(LIBRARY_DIR)
+ rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)
+
+clean:
+ rm -f $(EXEC) $(DLL) $(MAIN_OBJS) $(COMMON_OBJS) $(DLL_OBJS)

Back to the top