Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.executable/library/win32')
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/.cvsignore3
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/build.bat130
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/build.sh76
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/build.xml19
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipse.exe.manifest11
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipse.icobin0 -> 24238 bytes
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipse.rc21
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c259
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c122
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak139
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak112
11 files changed, 892 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/.cvsignore b/bundles/org.eclipse.equinox.executable/library/win32/.cvsignore
new file mode 100644
index 000000000..ef22704b6
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/.cvsignore
@@ -0,0 +1,3 @@
+*.obj
+eclipse.exe
+eclipse.res
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/build.bat b/bundles/org.eclipse.equinox.executable/library/win32/build.bat
new file mode 100644
index 000000000..ea748c0c5
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/build.bat
@@ -0,0 +1,130 @@
+@rem *******************************************************************************
+@rem Copyright (c) 2000, 2005 IBM Corporation and others.
+@rem All rights reserved. This program and the accompanying materials
+@rem are made available under the terms of the Eclipse Public License v1.0
+@rem which accompanies this distribution, and is available at
+@rem http://www.eclipse.org/legal/epl-v10.html
+@rem
+@rem Contributors:
+@rem IBM Corporation - initial API and implementation
+@rem Kevin Cornell (Rational Software Corporation)
+@rem **********************************************************************
+@rem
+@rem Usage: sh build.sh [<optional switches>] [clean]
+@rem
+@rem where the optional switches are:
+@rem -output <PROGRAM_OUTPUT> - executable filename ("eclipse")
+@rem -library <PROGRAM_LIBRARY>- dll filename (eclipse.dll)
+@rem -os <DEFAULT_OS> - default Eclipse "-os" value (qnx)
+@rem -arch <DEFAULT_OS_ARCH> - default Eclipse "-arch" value (x86)
+@rem -ws <DEFAULT_WS> - default Eclipse "-ws" value (photon)
+@rem -java <JAVA_HOME> - location of a Java SDK for JNI headers
+@rem
+@rem
+@rem This script can also be invoked with the "clean" argument.
+@rem
+@rem NOTE: The C compiler needs to be setup. This script has been
+@rem tested against Microsoft Visual C and C++ Compiler 6.0.
+@rem
+@rem Uncomment the lines below and edit MSVC_HOME to point to the
+@rem correct root directory of the compiler installation, if you
+@rem want this to be done by this script.
+@rem
+@rem ******
+@echo off
+
+IF NOT "%JAVA_HOME%"=="" GOTO MSVC
+rem *****
+rem Javah
+rem *****
+set JAVA_HOME=j:\teamswt\swt-builddir\ibm-jdk1.4.1
+set path=%JAVA_HOME%;%path%
+
+:MSVC
+if not "%MSVC_HOME%" == "" goto MAKE
+set MSVC_HOME=k:\dev\products\msvc60\vc98
+call %MSVC_HOME%\bin\vcvars32.bat
+if not "%mssdk%" == "" goto MAKE
+set mssdk=K:\dev\PRODUCTS\PLATSDK\feb2003
+call %mssdk%\setenv.bat
+
+:MAKE
+
+rem --------------------------
+rem Define default values for environment variables used in the makefiles.
+rem --------------------------
+set programOutput=eclipse.exe
+set programLibrary=eclipse.dll
+set defaultOS=win32
+set defaultOSArch=x86
+set defaultWS=win32
+set makefile=make_win32.mak
+set OS=Windows
+
+rem --------------------------
+rem Parse the command line arguments and override the default values.
+rem --------------------------
+set extraArgs=
+:WHILE
+if "%1" == "" goto WHILE_END
+ if "%2" == "" goto LAST_ARG
+
+ if "%1" == "-os" (
+ set defaultOS=%2
+ shift
+ goto NEXT )
+ if "%1" == "-arch" (
+ set defaultOSArch=%2
+ shift
+ goto NEXT )
+ if "%1" == "-ws" (
+ set defaultWS=%2
+ shift
+ goto NEXT )
+ if "%1" == "-output" (
+ set programOutput=%2
+ shift
+ goto NEXT )
+ if "%1" == "-library" (
+ set programLibrary=%2
+ shift
+ goto NEXT )
+ if "%1" == "-java" (
+ set javaHome=%2
+ shift
+ goto NEXT )
+:LAST_ARG
+ set extraArgs=%extraArgs% %1
+
+:NEXT
+ shift
+ goto WHILE
+:WHILE_END
+
+rem --------------------------
+rem Set up environment variables needed by the makefile.
+rem --------------------------
+set PROGRAM_OUTPUT=%programOutput%
+set PROGRAM_LIBRARY=%programLibrary%
+set DEFAULT_OS=%defaultOS%
+set DEFAULT_OS_ARCH=%defaultOSArch%
+set DEFAULT_WS=%defaultWS%
+set OUTPUT_DIR=..\..\bin\%defaultWS%\%defaultOS%\%defaultOSArch%
+set JAVA_HOME=%javaHome%
+
+rem --------------------------
+rem Run nmake to build the executable.
+rem --------------------------
+if "%extraArgs%" == "" goto MAKE_ALL
+
+nmake -f %makefile% %extraArgs%
+goto DONE
+
+:MAKE_ALL
+echo Building %OS% launcher. Defaults: -os %DEFAULT_OS% -arch %DEFAULT_OS_ARCH% -ws %DEFAULT_WS%
+nmake -f %makefile% clean
+nmake -f %makefile% %1 %2 %3 %4
+goto DONE
+
+
+:DONE
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/build.sh b/bundles/org.eclipse.equinox.executable/library/win32/build.sh
new file mode 100644
index 000000000..386f81d59
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/build.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+#*******************************************************************************
+# Copyright (c) 2000, 2005 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)
+#*******************************************************************************
+#
+# 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
+#
+#
+# This script can also be invoked with the "clean" argument.
+
+cd `dirname $0`
+
+# Define default values for environment variables used in the makefiles.
+programOutput="eclipse.exe"
+defaultOS="win32"
+defaultOSArch="x86"
+defaultWS="win32"
+makefile="make_mingw.mak"
+OS="Windows"
+
+# 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
+ else
+ extraArgs="$extraArgs $1"
+ fi
+ shift
+done
+
+# Set up environment variables needed by the makefiles.
+PROGRAM_OUTPUT="$programOutput"
+DEFAULT_OS="$defaultOS"
+DEFAULT_OS_ARCH="$defaultOSArch"
+DEFAULT_WS="$defaultWS"
+OUTPUT_DIR=../../bin/$defaultWS/$defaultOS/$defaultOSArch
+
+export OUTPUT_DIR PROGRAM_OUTPUT DEFAULT_OS DEFAULT_OS_ARCH DEFAULT_WS
+
+# 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
+ make -f $makefile all
+ fi
+else
+ echo "Unknown OS ($OS) -- build aborted"
+fi
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/build.xml b/bundles/org.eclipse.equinox.executable/library/win32/build.xml
new file mode 100644
index 000000000..a5a99abbd
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/build.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project default="build_eclipse" basedir=".">
+
+<target name="build_eclipse">
+ <exec dir="." executable="${basedir}\build.bat">
+ <arg line="install"/>
+ </exec>
+ <eclipse.refreshLocal resource="platform-launcher" depth="infinite" />
+</target>
+
+<target name="clean">
+ <tstamp/>
+ <exec dir="." executable="${basedir}\build.bat">
+ <arg line="clean"/>
+ </exec>
+</target>
+
+</project> \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipse.exe.manifest b/bundles/org.eclipse.equinox.executable/library/win32/eclipse.exe.manifest
new file mode 100644
index 000000000..51cdc24f6
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipse.exe.manifest
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="3.1.0.0" processorArchitecture="X86" name="Eclipse Launcher" type="win32"/>
+ <description>Standard Widget Toolkit</description>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"/>
+ </dependentAssembly>
+ </dependency>
+</assembly>
+ \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipse.ico b/bundles/org.eclipse.equinox.executable/library/win32/eclipse.ico
new file mode 100644
index 000000000..5b2f132dd
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipse.ico
Binary files differ
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipse.rc b/bundles/org.eclipse.equinox.executable/library/win32/eclipse.rc
new file mode 100644
index 000000000..723baa714
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipse.rc
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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
+ *******************************************************************************/
+
+#define ECLIPSE_ICON 401
+
+#include "windows.h"
+#include "winver.h"
+
+
+ECLIPSE_ICON ICON DISCARDABLE "eclipse.ico"
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "eclipse.exe.manifest"
+
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
new file mode 100644
index 000000000..a1a5fa2b4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
@@ -0,0 +1,259 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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)
+ *******************************************************************************/
+
+#include "eclipseOS.h"
+#include "eclipseCommon.h"
+
+#include <windows.h>
+#include <commctrl.h>
+#include <process.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+#ifdef __MINGW32__
+#include <stdlib.h>
+#endif
+
+extern HWND topWindow;
+
+/* Global Variables */
+_TCHAR* consoleVM = _T("java.exe");
+_TCHAR* defaultVM = _T("javaw.exe");
+_TCHAR* vmLibrary = _T("jvm.dll");
+_TCHAR* shippedVMDir = _T("jre\\bin\\");
+
+/* Define the window system arguments for the Java VM. */
+static _TCHAR* argVM[] = { NULL };
+
+/* define default locations in which to find the jvm shared library
+ * these are paths relative to the java exe, the shared library is
+ * for example jvmLocations[0] + dirSeparator + vmLibrary */
+#define MAX_LOCATION_LENGTH 10 /* none of the jvmLocations strings should be longer than this */
+static const _TCHAR* jvmLocations [] = { _T("j9vm"),
+ _T("client"),
+ _T("server"),
+ _T("classic"),
+ NULL };
+/* Show the Splash Window
+ *
+ * Open the bitmap, insert into the splash window and display it.
+ *
+ */
+int showSplash( const _TCHAR* featureImage )
+{
+ static int splashing = 0;
+ HBITMAP hBitmap = 0;
+ BITMAP bmp;
+ HDC hDC;
+ int depth;
+ int x, y;
+ int width, height;
+
+ if(splashing) {
+ /*splash screen is already showing, do nothing */
+ return 0;
+ }
+
+ /* if Java was started first and is calling back to show the splash, we might not
+ * have initialized the window system yet
+ */
+ initWindowSystem(0, NULL, 1);
+
+ /* Load the bitmap for the feature. */
+ hDC = GetDC( NULL);
+ depth = GetDeviceCaps( hDC, BITSPIXEL ) * GetDeviceCaps( hDC, PLANES);
+ ReleaseDC(NULL, hDC);
+ if (featureImage != NULL)
+ hBitmap = LoadImage(NULL, featureImage, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+
+ /* If the bitmap could not be found, return an error. */
+ if (hBitmap == 0)
+ return ERROR_FILE_NOT_FOUND;
+
+ GetObject(hBitmap, sizeof(BITMAP), &bmp);
+
+ /* figure out position */
+ width = GetSystemMetrics (SM_CXSCREEN);
+ height = GetSystemMetrics (SM_CYSCREEN);
+ x = (width - bmp.bmWidth) / 2;
+ y = (height - bmp.bmHeight) / 2;
+
+ /* Centre the splash window and display it. */
+ SetWindowPos (topWindow, 0, x, y, bmp.bmWidth, bmp.bmHeight, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
+ SendMessage( topWindow, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hBitmap );
+ ShowWindow( topWindow, SW_SHOW );
+ BringWindowToTop( topWindow );
+ splashing = 1;
+
+ /* Process messages */
+ dispatchMessages();
+ return 0;
+}
+
+void dispatchMessages() {
+ MSG msg;
+
+ if(topWindow == 0)
+ return;
+ while (PeekMessage( &msg, NULL, 0, 0, PM_REMOVE))
+ {
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ }
+}
+
+long getSplashHandle() {
+ return (long)topWindow;
+}
+
+void takeDownSplash() {
+ if(topWindow != NULL) {
+ DestroyWindow(topWindow);
+ dispatchMessages();
+ }
+}
+
+/* Get the window system specific VM args */
+_TCHAR** getArgVM( _TCHAR *vm )
+{
+ return argVM;
+}
+
+/* Local functions */
+
+/*
+ * Find the VM shared library starting from the java executable
+ */
+_TCHAR* findVMLibrary( _TCHAR* command ) {
+ int i, j;
+ int pathLength;
+ struct _stat stats;
+ _TCHAR * path; /* path to resulting jvm shared library */
+ _TCHAR * location; /* points to begining of jvmLocations section of path */
+
+ /* for looking in the registry */
+ HKEY keys[2] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE };
+ HKEY jreKey = NULL, subKey = NULL;
+ DWORD length = MAX_PATH;
+ _TCHAR keyName[MAX_PATH], lib[MAX_PATH];
+ _TCHAR * jreKeyName;
+
+ if (command != NULL) {
+ location = _tcsrchr( command, dirSeparator ) + 1;
+
+ /*check first to see if command already points to the library */
+ if (_tcscmp(location, vmLibrary) == 0) {
+ return command;
+ }
+
+ pathLength = location - command;
+ path = malloc((pathLength + MAX_LOCATION_LENGTH + 1 + _tcslen(vmLibrary)) * sizeof(_TCHAR *));
+ _tcsncpy(path, command, pathLength);
+ location = &path[pathLength];
+
+ /*
+ * We are trying base/jvmLocations[*]/vmLibrary
+ * where base is the directory containing the given java command, normally jre/bin
+ */
+ i = -1;
+ while(jvmLocations[++i] != NULL) {
+ int length = _tcslen(jvmLocations[i]);
+ _tcscpy(location, jvmLocations[i]);
+ location[length] = dirSeparator;
+ location[length + 1] = _T('\0');
+ _tcscat(location, vmLibrary);
+ if (_tstat( path, &stats ) == 0 && (stats.st_mode & S_IFREG) != 0)
+ { /* found it */
+ return path;
+ }
+ }
+ }
+
+ /* Not found yet, try the registry, we will use the first 1.4 or 1.5 vm we can find*/
+ jreKeyName = _T("Software\\JavaSoft\\Java Runtime Environment");
+ for (i = 0; i < 2; i++) {
+ jreKey = NULL;
+ if (RegOpenKeyEx(keys[i], jreKeyName, 0, KEY_READ, &jreKey) == ERROR_SUCCESS) {
+ j = 0;
+ while (RegEnumKeyEx(jreKey, j++, keyName, &length, 0, 0, 0, 0) == ERROR_SUCCESS) {
+ /*look for a 1.4 or 1.5 vm*/
+ if( _tcsncmp(_T("1.4"), keyName, 3) == 0 || _tcsncmp(_T("1.5"), keyName, 3) == 0) {
+ subKey = NULL;
+ if(RegOpenKeyEx(jreKey, keyName, 0, KEY_READ, &subKey) == ERROR_SUCCESS) {
+ length = MAX_PATH;
+ /*The RuntimeLib value should point to the library we want*/
+ if(RegQueryValueEx(subKey, _T("RuntimeLib"), NULL, NULL, (void*)&lib, &length) == ERROR_SUCCESS) {
+ if (_tstat( lib, &stats ) == 0 && (stats.st_mode & S_IFREG) != 0)
+ { /*library exists*/
+ path = malloc( length * sizeof(TCHAR*));
+ path[0] = _T('\0');
+ _tcscat(path, lib);
+
+ RegCloseKey(subKey);
+ RegCloseKey(jreKey);
+ return path;
+ }
+ }
+ RegCloseKey(subKey);
+ }
+ }
+ }
+ RegCloseKey(jreKey);
+ }
+ }
+ return NULL;
+}
+
+void restartLauncher( _TCHAR* program, _TCHAR* args[] )
+{
+ int index, length;
+ _TCHAR *commandLine, *ch, *space;
+
+ /*
+ * Build the command line. Any argument with spaces must be in
+ * double quotes in the command line.
+ */
+ length = _tcslen(program) + 1;
+ for (index = 0; args[index] != NULL; index++)
+ {
+ /* String length plus space character */
+ length += _tcslen( args[ index ] ) + 1;
+ /* Quotes */
+ if (_tcschr( args[ index ], _T(' ') ) != NULL) length += 2;
+ }
+ commandLine = ch = malloc ( (length + 1) * sizeof(_TCHAR) );
+ _tcscpy(ch, program);
+ ch += _tcslen(program);
+ *ch++ = _T(' ');
+ for (index = 0; args[index] != NULL; index++)
+ {
+ space = _tcschr( args[ index ], _T(' '));
+ if (space != NULL) *ch++ = _T('\"');
+ _tcscpy( ch, args[index] );
+ ch += _tcslen( args[index] );
+ if (space != NULL) *ch++ = _T('\"');
+ *ch++ = _T(' ');
+ }
+ *ch = _T('\0');
+
+ {
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ GetStartupInfo(&si);
+ if (CreateProcess(NULL, commandLine, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
+ CloseHandle( pi.hThread );
+ }
+ }
+ free(commandLine);
+}
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c
new file mode 100644
index 000000000..bbc4ae5f9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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 <windows.h>
+#include <stdlib.h>
+#include <commctrl.h>
+
+#define ECLIPSE_ICON 401
+
+_TCHAR dirSeparator = _T('\\');
+_TCHAR pathSeparator = _T(';');
+
+void initWindowSystem( int* pArgc, _TCHAR* argv[], int showSplash );
+/*static LRESULT WINAPI WndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);*/
+
+/* Global Main Window*/
+#ifdef UNICODE
+extern HWND topWindow;
+#else
+HWND topWindow = 0;
+#endif
+
+/* Define local variables for the main window. */
+/*static WNDPROC oldProc;*/
+
+static int initialized = 0;
+
+/* Display a Message */
+void displayMessage( _TCHAR* title, _TCHAR* message )
+{
+ if(!initialized)
+ initWindowSystem(0, NULL, 0);
+ MessageBox( topWindow, message, title, MB_OK );
+}
+
+/* Initialize Window System
+ *
+ * Create a pop window to display the bitmap image.
+ *
+ * Return the window handle as the data for the splash command.
+ *
+ */
+void initWindowSystem( int* pArgc, _TCHAR* argv[], int showSplash )
+{
+ if(initialized)
+ return;
+ /* Create a window that has no decorations. */
+
+ InitCommonControls();
+ topWindow = CreateWindowEx (0,
+ _T("STATIC"),
+ officialName,
+ SS_BITMAP | WS_POPUP,
+ CW_USEDEFAULT,
+ 0,
+ CW_USEDEFAULT,
+ 0,
+ NULL,
+ NULL,
+ GetModuleHandle (NULL),
+ NULL);
+ SetClassLong(topWindow, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(ECLIPSE_ICON)));
+/*
+ oldProc = (WNDPROC) GetWindowLong (topWindow, GWL_WNDPROC);
+ SetWindowLong (topWindow, GWL_WNDPROC, (LONG) WndProc);
+*/
+ initialized = 1;
+}
+
+/* Window Procedure for the Spash window.
+ *
+ * A special WndProc is needed to return the proper vlaue for WM_NCHITTEST.
+ * It must also detect the message from the splash window process.
+ */
+/*static LRESULT WINAPI WndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ switch (uMsg)
+ {
+ case WM_NCHITTEST: return HTCLIENT;
+ case WM_CLOSE:
+ PostQuitMessage( 0 );
+ break;
+ }
+ return CallWindowProc (oldProc, hwnd, uMsg, wParam, lParam);
+}*/
+
+/* Load the specified shared library
+ */
+void * loadLibrary( _TCHAR * library ){
+ return LoadLibrary(library);
+}
+
+/* Unload the shared library
+ */
+void unloadLibrary( void * handle ){
+ FreeLibrary(handle);
+}
+
+/* Find the given symbol in the shared library
+ */
+void * findSymbol( void * handle, _TCHAR * symbol ){
+ char * str = NULL;
+ void * result;
+
+ str = toNarrow(symbol);
+ result = GetProcAddress(handle, str);
+ free(str);
+ return result;
+}
+
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak b/bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak
new file mode 100644
index 000000000..9f5d0542f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak
@@ -0,0 +1,139 @@
+#*******************************************************************************
+# Copyright (c) 2000, 2005 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)
+# Silenio Quarti (IBM)
+# Sam Robb (TimeSys Corporation)
+#*******************************************************************************
+
+# Makefile for creating the eclipse launcher program.
+
+# This makefile expects the following environment variables set:
+#
+# PROGRAM_OUTPUT - the filename of the output executable
+# PROGRAM_LIBRARY - the file of the output shared library
+# 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
+
+#if PROGRAM_OUTPUT is not set, assume eclipse.exe
+ifeq ($(PROGRAM_OUTPUT),)
+ PROGRAM_OUTPUT=eclipse.exe
+ PROGRAM_LIBRARY=eclipse_1.dll
+endif
+
+# Allow for cross-compiling under linux
+OSTYPE ?= $(shell if uname -s | grep -iq cygwin ; then echo cygwin; else echo linux; fi)
+
+ifeq ($(OSTYPE),cygwin)
+CCVER = i686
+CC = i686-pc-cygwin-gcc
+RC = windres
+else
+CCVER = i586
+CC = $(shell which i586-pc-cygwin-gcc)
+TDIR = $(dir $(shell test -L $(CC) && readlink $(CC) || echo $(CC)))
+RC = $(TDIR)/i586-pc-cygwin-windres
+SYSINC = -isystem $(TDIR)/../include/mingw
+endif
+
+ifeq ($(CC),)
+$(error Unable to find $(CCVER)-pc-cygwin-gcc)
+endif
+
+# Define the object modules to be compiled and flags.
+MAIN_OBJS = eclipseMain.o aeclipseMain.o
+COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseWinCommon.o\
+ aeclipseConfig.o aeclipseCommon.o aeclipseWinCommon.o
+DLL_OBJS = eclipse.o eclipseWin.o eclipseUtil.o eclipseJNI.o\
+ aeclipse.o aeclipseWin.o aeclipseUtil.o aeclipseJNI.o
+
+LIBS = -lkernel32 -luser32 -lgdi32 -lcomctl32 -lmsvcrt
+LDFLAGS = -mwindows -mno-cygwin
+DLL_LDFLAGS = -mno-cygwin -shared -Wl,--export-all-symbols -Wl,--kill-at
+RES = eclipse.res
+EXEC = $(PROGRAM_OUTPUT)
+DLL = $(PROGRAM_LIBRARY)
+DEBUG = $(CDEBUG)
+CFLAGS = -g -s -Wall \
+ -I. -I$(JAVA_JNI) $(SYSINC) \
+ -D_WIN32 \
+ -DWIN32_LEAN_AND_MEAN \
+ -mno-cygwin
+ACFLAGS = -I.. -DDEFAULT_OS="\"$(DEFAULT_OS)\"" \
+ -DDEFAULT_OS_ARCH="\"$(DEFAULT_OS_ARCH)\"" \
+ -DDEFAULT_WS="\"$(DEFAULT_WS)\"" \
+ $(DEBUG) $(CFLAGS)
+WCFLAGS = -DUNICODE $(ACFLAGS)
+
+all: $(EXEC) $(DLL)
+
+eclipseMain.o: ../eclipseUnicode.h ../eclipseCommon.h ../eclipseMain.c
+ $(CC) $(DEBUG) $(WCFLAGS) -c -o $@ ../eclipseMain.c
+
+aeclipseMain.o: ../eclipseUnicode.h ../eclipseCommon.h ../eclipseMain.c
+ $(CC) $(DEBUG) $(ACFLAGS) -c -o $@ ../eclipseMain.c
+
+eclipseCommon.o: ../eclipseCommon.h ../eclipseUnicode.h ../eclipseCommon.c
+ $(CC) $(DEBUG) $(WCFLAGS) -c -o $@ ../eclipseCommon.c
+
+aeclipseCommon.o: ../eclipseCommon.h ../eclipseUnicode.h ../eclipseCommon.c
+ $(CC) $(DEBUG) $(ACFLAGS) -c -o $@ ../eclipseCommon.c
+
+eclipseWinCommon.o: ../eclipseCommon.h eclipseWinCommon.c
+ $(CC) $(DEBUG) $(WCFLAGS) -c -o $@ eclipseWinCommon.c
+
+aeclipseWinCommon.o: ../eclipseCommon.h eclipseWinCommon.c
+ $(CC) $(DEBUG) $(ACFLAGS) -c -o $@ eclipseWinCommon.c
+
+eclipse.o: ../eclipseOS.h ../eclipseUnicode.h ../eclipseJNI.h ../eclipseCommon.h ../eclipse.c
+ $(CC) $(DEBUG) $(WCFLAGS) -c -o $@ ../eclipse.c
+
+eclipseUtil.o: ../eclipseUtil.h ../eclipseUnicode.h ../eclipseUtil.c
+ $(CC) $(DEBUG) $(WCFLAGS) -c -o $@ ../eclipseUtil.c
+
+eclipseConfig.o: ../eclipseConfig.h ../eclipseUnicode.h ../eclipseConfig.c
+ $(CC) $(DEBUG) $(WCFLAGS) -c -o $@ ../eclipseConfig.c
+
+eclipseWin.o: ../eclipseOS.h ../eclipseUnicode.h eclipseWin.c
+ $(CC) $(DEBUG) $(WCFLAGS) -c -o $@ eclipseWin.c
+
+eclipseJNI.o: ../eclipseUnicode.h ../eclipseJNI.c
+ $(CC) $(DEBUG) $(WCFLAGS) -c -o $@ ../eclipseJNI.c
+
+aeclipse.o: ../eclipseOS.h ../eclipseUnicode.h ../eclipseCommon.h ../eclipse.c
+ $(CC) $(DEBUG) $(ACFLAGS) -c -o $@ ../eclipse.c
+
+aeclipseUtil.o: ../eclipseUtil.h ../eclipseUnicode.h ../eclipseUtil.c
+ $(CC) $(DEBUG) $(ACFLAGS) -c -o $@ ../eclipseUtil.c
+
+aeclipseConfig.o: ../eclipseConfig.h ../eclipseUnicode.h ../eclipseConfig.c
+ $(CC) $(DEBUG) $(ACFLAGS) -c -o $@ ../eclipseConfig.c
+
+aeclipseWin.o: ../eclipseOS.h ../eclipseUnicode.h eclipseWin.c
+ $(CC) $(DEBUG) $(ACFLAGS) -c -o $@ eclipseWin.c
+
+aeclipseJNI.o: ../eclipseUnicode.h ../eclipseJNI.c
+ $(CC) $(DEBUG) $(ACFLAGS) -c -o $@ ../eclipseJNI.c
+
+$(RES): eclipse.rc
+ $(RC) --output-format=coff --include-dir=.. -o $@ $<
+
+$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS) $(RES)
+ $(CC) $(LDFLAGS) -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(RES) $(LIBS)
+
+$(DLL): $(DLL_OBJS) $(COMMON_OBJS)
+ $(CC) $(DLL_LDFLAGS) -o $(DLL) $(DLL_OBJS) $(COMMON_OBJS) $(LIBS)
+
+install: all
+ cp $(EXEC) $(DLL) $(OUTPUT_DIR)
+ rm -f $(EXEC) $(DLL_OBJS) $(COMMON_OBJS) $(MAIN_OBJS) $(RES)
+
+clean:
+ $(RM) $(EXEC) $(DLL) $(DLL_OBJS) $(COMMON_OBJS) $(MAIN_OBJS) $(RES)
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak b/bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak
new file mode 100644
index 000000000..8e0c284ed
--- /dev/null
+++ b/bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak
@@ -0,0 +1,112 @@
+#******************************************************************************
+# Copyright (c) 2000, 2006 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)
+#*******************************************************************************
+
+# Makefile for creating the eclipse launcher program.
+
+# This makefile expects the following environment variables set:
+#
+# PROGRAM_OUTPUT - the filename of the output executable
+# PROGRAM_LIBRARY - the filename of the output dll library
+# 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 - the location of the Java for JNI includes
+
+!include <ntwin32.mak>
+
+# Define the object modules to be compiled and flags.
+MAIN_OBJS = eclipseMain.obj aeclipseMain.obj
+COMMON_OBJS = eclipseConfig.obj eclipseCommon.obj eclipseWinCommon.obj\
+ aeclipseConfig.obj aeclipseCommon.obj aeclipseWinCommon.obj
+DLL_OBJS = eclipse.obj eclipseWin.obj eclipseUtil.obj eclipseJNI.obj\
+ aeclipse.obj aeclipseWin.obj aeclipseUtil.obj aeclipseJNI.obj
+
+LIBS = kernel32.lib user32.lib comctl32.lib
+DLL_LIBS = kernel32.lib user32.lib comctl32.lib gdi32.lib Advapi32.lib
+LFLAGS = /INCREMENTAL:NO /DEBUG /NOLOGO -subsystem:windows,4.0 -entry:wmainCRTStartup
+DLL_LFLAGS = /INCREMENTAL:NO /PDB:NONE /DEBUG /NOLOGO -entry:_DllMainCRTStartup@12 -dll /BASE:0x10000000 /DLL
+RES = eclipse.res
+EXEC = eclipse.exe
+DLL = eclipse_1.exe
+DEBUG = #$(cdebug)
+acflags = -I.. -DDEFAULT_OS="\"$(DEFAULT_OS)\"" \
+ -DDEFAULT_OS_ARCH="\"$(DEFAULT_OS_ARCH)\"" \
+ -DDEFAULT_WS="\"$(DEFAULT_WS)\"" \
+ /I$(JAVA_HOME)\include /I$(JAVA_HOME)\include\win32 \
+ $(cflags)
+wcflags = -DUNICODE $(acflags)
+cvars = /Zi #/O1
+all: $(EXEC) $(DLL)
+
+eclipseMain.obj: ../eclipseUnicode.h ../eclipseCommon.h ../eclipseMain.c
+ $(cc) $(DEBUG) $(wcflags) $(cvars) /Fo$*.obj ../eclipseMain.c
+
+eclipseCommon.obj: ../eclipseCommon.h ../eclipseUnicode.h ../eclipseCommon.c
+ $(cc) $(DEBUG) $(wcflags) $(cvars) /Fo$*.obj ../eclipseCommon.c
+
+eclipse.obj: ../eclipseOS.h ../eclipseUnicode.h ../eclipse.c
+ $(cc) $(DEBUG) $(wcflags) $(cvars) /Fo$*.obj ../eclipse.c
+
+eclipseUtil.obj: ../eclipseUtil.h ../eclipseUnicode.h ../eclipseUtil.c
+ $(cc) $(DEBUG) $(wcflags) $(cvars) /Fo$*.obj ../eclipseUtil.c
+
+eclipseConfig.obj: ../eclipseConfig.h ../eclipseUnicode.h ../eclipseConfig.c
+ $(cc) $(DEBUG) $(wcflags) $(cvars) /Fo$*.obj ../eclipseConfig.c
+
+eclipseWin.obj: ../eclipseOS.h ../eclipseUnicode.h eclipseWin.c
+ $(cc) $(DEBUG) $(wcflags) $(cvars) /Fo$*.obj eclipseWin.c
+
+eclipseWinCommon.obj: ../eclipseCommon.h eclipseWinCommon.c
+ $(cc) $(DEBUG) $(wcflags) $(cvars) /Fo$*.obj eclipseWinCommon.c
+
+eclipseJNI.obj: ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.c
+ $(CC) $(DEBUG) $(wcflags) $(cvars) /Fo$*.obj ../eclipseJNI.c
+
+aeclipseJNI.obj: ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.c
+ $(cc) $(DEBUG) $(acflags) $(cvars) /FoaeclipseJNI.obj ../eclipseJNI.c
+
+aeclipseMain.obj: ../eclipseUnicode.h ../eclipseCommon.h ../eclipseMain.c
+ $(cc) $(DEBUG) $(acflags) $(cvars) /FoaeclipseMain.obj ../eclipseMain.c
+
+aeclipseCommon.obj: ../eclipseCommon.h ../eclipseUnicode.h ../eclipseCommon.c
+ $(cc) $(DEBUG) $(acflags) $(cvars) /FoaeclipseCommon.obj ../eclipseCommon.c
+
+aeclipse.obj: ../eclipseOS.h ../eclipseUnicode.h ../eclipse.c
+ $(cc) $(DEBUG) $(acflags) $(cvars) /Foaeclipse.obj ../eclipse.c
+
+aeclipseUtil.obj: ../eclipseUtil.h ../eclipseUnicode.h ../eclipseUtil.c
+ $(cc) $(DEBUG) $(acflags) $(cvars) /FoaeclipseUtil.obj ../eclipseUtil.c
+
+aeclipseConfig.obj: ../eclipseConfig.h ../eclipseConfig.h ../eclipseConfig.c
+ $(cc) $(DEBUG) $(acflags) $(cvars) /FoaeclipseConfig.obj ../eclipseConfig.c
+
+aeclipseWin.obj: ../eclipseOS.h ../eclipseUnicode.h eclipseWin.c
+ $(cc) $(DEBUG) $(acflags) $(cvars) /FoaeclipseWin.obj eclipseWin.c
+
+aeclipseWinCommon.obj: ../eclipseCommon.h eclipseWinCommon.c
+ $(cc) $(DEBUG) $(acflags) $(cvars) /FoaeclipseWinCommon.obj eclipseWinCommon.c
+
+$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS) $(RES)
+ $(link) $(LFLAGS) -out:$(PROGRAM_OUTPUT) $(MAIN_OBJS) $(COMMON_OBJS) $(RES) $(LIBS)
+
+$(DLL): $(DLL_OBJS) $(COMMON_OBJS)
+ $(link) $(DLL_LFLAGS) -out:$(PROGRAM_LIBRARY) $(DLL_OBJS) $(COMMON_OBJS) $(RES) $(DLL_LIBS)
+
+$(RES): eclipse.rc
+ $(rc) -r -fo $(RES) eclipse.rc
+
+install: all
+ copy $(EXEC) $(OUTPUT_DIR)
+ del -f $(EXEC) $(MAIN_OBJS) $(DLL_OBJS) $(COMMON_OBJS) $(RES)
+
+clean:
+ del $(EXEC) $(MAIN_OBJS) $(DLL_OBJS) $(COMMON_OBJS) $(RES)

Back to the top