Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRolf Theunissen2018-03-10 19:57:01 +0000
committerAlexander Kurtakov2018-03-23 08:53:50 +0000
commite061a646a35408e4c4cbd20733baa1f7e304be3e (patch)
tree851c1a96843eed70ef6cd914011ea20410052ec8 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk
parent7ff1827cdc8b28d83309c71b9acc5929c7997319 (diff)
downloadeclipse.platform.swt-e061a646a35408e4c4cbd20733baa1f7e304be3e.tar.gz
eclipse.platform.swt-e061a646a35408e4c4cbd20733baa1f7e304be3e.tar.xz
eclipse.platform.swt-e061a646a35408e4c4cbd20733baa1f7e304be3e.zip
Bug 488431 - Provide SWT/GTK3 port on Windows
Make GTK build on win32 again Change-Id: Iea9e8fbd53af430b998597449a1445ffd716c5ef Signed-off-by: Rolf Theunissen <rolf.theunissen@altran.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_win32.mak9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
3 files changed, 23 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_win32.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_win32.mak
index ae25262d36..ee087017c5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_win32.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_win32.mak
@@ -11,8 +11,12 @@
# Makefile for creating SWT libraries for Linux GTK
-# Uncomment to debug parts of SWT natives
-# SWT_WEBKIT_DEBUG = -DWEBKIT_DEBUG
+#SWT_LIB_DEBUG=1 # to debug glue code in /bundles/org.eclipse.swt/bin/library. E.g os_custom.c:swt_fixed_forall(..)
+# Can be set via environment like: export SWT_LIB_DEBUG=1
+ifdef SWT_LIB_DEBUG
+SWT_DEBUG = -O0 -g3 -ggdb3
+NO_STRIP=1
+endif
include make_common.mak
@@ -77,6 +81,7 @@ ATK_OBJECTS = swt.o atk.o atk_structs.o atk_custom.o atk_stats.o
CFLAGS = -O -Wall \
-DSWT_VERSION=$(SWT_VERSION) \
$(NATIVE_STATS) \
+ $(SWT_DEBUG) \
-DWIN32 -DGTK \
-I$(JAVA_HOME)/include \
-I$(JAVA_HOME)/include/win32 \
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
index a779a44076..c7e19a99c6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
@@ -70,29 +70,35 @@
#define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
#endif
+
#define OS_LOAD_FUNCTION LOAD_FUNCTION
// Hard-link code generated from GTK.java to LIB_GTK
-#define GTK_LOAD_FUNCTION(var, name) \
+#define GTK_LOAD_FUNCTION(var, name) LOAD_FUNCTION_LIB(var, LIB_GTK, name)
+// Hard-link code generated from GTK.java to LIB_GDK
+#define GDK_LOAD_FUNCTION(var, name) LOAD_FUNCTION_LIB(var, LIB_GDK, name)
+
+#ifdef _WIN32
+#define LOAD_FUNCTION_LIB(var, libname, name) \
static int initialized = 0; \
- static void *var = NULL; \
+ static FARPROC var = NULL; \
if (!initialized) { \
- void* handle = dlopen(LIB_GTK, LOAD_FLAGS); \
- if (handle) var = dlsym(handle, #name); \
+ HMODULE hm = LoadLibrary(libname); \
+ if (hm) var = GetProcAddress(hm, #name); \
initialized = 1; \
- CHECK_DLERROR \
}
-
-// Hard-link code generated from GTK.java to LIB_GTK
-#define GDK_LOAD_FUNCTION(var, name) \
+#else
+#define LOAD_FUNCTION_LIB(var, libname, name) \
static int initialized = 0; \
static void *var = NULL; \
if (!initialized) { \
- void* handle = dlopen(LIB_GDK, LOAD_FLAGS); \
+ void* handle = dlopen(libname, LOAD_FLAGS); \
if (handle) var = dlsym(handle, #name); \
initialized = 1; \
CHECK_DLERROR \
}
+#endif
+
#ifdef GDK_WINDOWING_X11
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 675a6751c8..bcce6b32a0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -45,6 +45,7 @@
#define LIB_GDK "libgdk-win32-2.0-0.dll"
#endif
#define LIB_GTHREAD "libgthread-2.0-0.dll"
+#define LIB_GLIB "libglib-2.0-0.dll"
#define LIB_ATK "libatk-1.0-0.dll"
#define LIB_FONTCONFIG "libfontconfig-1.dll"
#else

Back to the top