Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2017-12-07 20:24:59 +0000
committerLeo Ufimtsev2017-12-08 17:37:35 +0000
commit0b13ae7a288041245b030d0d11d81e0e61a5745f (patch)
tree60a7db8b71fad99764a35b65f9ab94abffe9d0a1
parent9c54c03117378e5d19d000fb8823a7ac43a79523 (diff)
downloadeclipse.platform.swt-0b13ae7a288041245b030d0d11d81e0e61a5745f.tar.gz
eclipse.platform.swt-0b13ae7a288041245b030d0d11d81e0e61a5745f.tar.xz
eclipse.platform.swt-0b13ae7a288041245b030d0d11d81e0e61a5745f.zip
Bug 510905 [GTK3][Webkit2] Implement webkit2 support for browser
function (Part 2: Java return a value from callback.) Only build webkit extension if the relevant package flags are available. Change-Id: I88d24bea11adb3d202cec3b8a07d9278ab027edf Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak9
2 files changed, 15 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
index a59af9e1f8..6539966345 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
@@ -347,6 +347,15 @@ func_echo_plus "Building SWT/GTK+ for Architectures: $SWT_OS $SWT_ARCH"
func_build_gtk3 () {
export GTK_VERSION=3.0
+
+ # Dictate Webkit2 Extension only if pkg-config flags exist
+ pkg-config --exists webkit2gtk-web-extension-4.0
+ if [ $? == 0 ]; then
+ export BUILD_WEBKIT2EXTENSION="yes";
+ else
+ func_echo_error "Warning: Cannot compile Webkit2 Extension because 'pkg-config --exists webkit2gtk-web-extension-4-0' check failed. Please install webkitgtk4-devel.ARCH on your system."
+ fi
+
func_echo_plus "Building GTK3 bindings:"
${MAKE_TYPE} -f $MAKEFILE all $MAKE_CAIRO $MAKE_AWT "${@}"
RETURN_VALUE=$? #make can return 1 or 2 if it fails. Thus need to cache it in case it's used programmatically somewhere.
@@ -361,6 +370,7 @@ func_build_gtk3 () {
func_build_gtk2 () {
func_echo_plus "Building GTK2 bindings:"
export GTK_VERSION=2.0
+ export BUILD_WEBKIT2EXTENSION="no";
if [ ${MODEL} = 'x86_64' ]; then
# Bug 515155: Avoid memcpy@GLIBC_2.14 (old Linux compatibility)
SWT_PTR_CFLAGS="${SWT_PTR_CFLAGS} -fno-builtin-memmove"
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
index c8a253fac6..00f5f725db 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
@@ -189,7 +189,7 @@ atk_stats.o: atk_stats.c atk_structs.h atk_stats.h atk.h
#
# WebKit lib
#
-ifeq ($(GTK_VERSION), 3.0)
+ifeq ($(BUILD_WEBKIT2EXTENSION),yes)
make_webkit: $(WEBKIT_LIB) make_webkit2extension #Webkit2 only used by gtk3.
else
make_webkit: $(WEBKIT_LIB)
@@ -249,12 +249,13 @@ glx_stats.o: glx_stats.c glx_stats.h
# I hope there are no spaces in the path :-).
install: all
cp $(ALL_SWT_LIBS) $(OUTPUT_DIR)
-ifeq ($(GTK_VERSION), 3.0) # Copy webextension into it's own folder, but create folder first.
+ifeq ($(BUILD_WEBKIT2EXTENSION),yes)
+ @# Copy webextension into it's own folder, but create folder first.
@# CAREFULLY delete '.so' files inside webextension*. Then carefully remove the directories. 'rm -rf' seemed too risky of an approach.
@-[ "$$(ls -d $(OUTPUT_DIR)/$(WEBEXTENSION_BASE_DIR)*/*.so)" ] && rm -v `ls -d $(OUTPUT_DIR)/$(WEBEXTENSION_BASE_DIR)*/*.so`
@-[ "$$(ls -d $(OUTPUT_DIR)/$(WEBEXTENSION_BASE_DIR)*)" ] && rmdir -v `ls -d $(OUTPUT_DIR)/$(WEBEXTENSION_BASE_DIR)*`
-
- # Copying webextension is not critical for build to succeed, thus we use '-'. SWT can still function without a webextension.
+
+ @# Copying webextension is not critical for build to succeed, thus we use '-'. SWT can still function without a webextension.
@-[ -d $(OUTPUT_DIR)/$(WEBEXTENSION_DIR) ] || mkdir -v $(OUTPUT_DIR)/$(WEBEXTENSION_DIR) # If folder does not exist, make it.
-cp $(WEBKIT_EXTENSION_LIB) $(OUTPUT_DIR)/$(WEBEXTENSION_DIR)/
endif

Back to the top