[GTK] Install web and plugin processes in libexecdir instead of bindir
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Aug 2011 12:20:12 +0000 (12:20 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Aug 2011 12:20:12 +0000 (12:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=65600

Reviewed by Martin Robinson.

.:

* GNUmakefile.am: Initialize libexec_PROGRAMS, only used by
WebKit2 in this moment.

Source/WebKit2:

Launch processes from libexecdir or WEBKIT_EXEC_PATH
environment variable when it's set. This variable will be used by
MiniBrowser and unit tests to find processes without having to
install them.

* GNUmakefile.am:
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):

Tools:

Set WEBKIT_EXEC_PATH environment variable to use web and plugin
process from current directory instead of the intalled ones.

* MiniBrowser/gtk/GNUmakefile.am:
* MiniBrowser/gtk/main.c:
(main):
* WebKitTestRunner/GNUmakefile.am:
* WebKitTestRunner/gtk/main.cpp:
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92273 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
GNUmakefile.am
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Tools/ChangeLog
Tools/MiniBrowser/gtk/GNUmakefile.am
Tools/MiniBrowser/gtk/main.c
Tools/WebKitTestRunner/GNUmakefile.am
Tools/WebKitTestRunner/gtk/main.cpp

index cf3d940628d3fbcddac9f66b4cfd826e850ad7e3..6cd8f6044b0695136c10b69088901b4e7266a8cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Install web and plugin processes in libexecdir instead of bindir
+        https://bugs.webkit.org/show_bug.cgi?id=65600
+
+        Reviewed by Martin Robinson.
+
+        * GNUmakefile.am: Initialize libexec_PROGRAMS, only used by
+        WebKit2 in this moment.
+
 2011-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Reorganize pkg-config files
index 695cd4cf4a0a1ad12bb1fbb76d467f53b3cf35b3..d21f7eebb9cb03e5a77057d3e851dc04f9fd6370 100644 (file)
@@ -45,6 +45,7 @@ pkgconfigdir := $(libdir)/pkgconfig
 # Libraries and support components
 bin_PROGRAMS :=
 noinst_PROGRAMS :=
+libexec_PROGRAMS :=
 noinst_HEADERS :=
 noinst_LTLIBRARIES :=
 lib_LTLIBRARIES :=
index ed73b677b33e9488a8562e9c28a4a50b4538c7e4..066dfb83d8aaf9bc8299eeec51dad271cd9fada8 100644 (file)
@@ -1,3 +1,19 @@
+2011-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Install web and plugin processes in libexecdir instead of bindir
+        https://bugs.webkit.org/show_bug.cgi?id=65600
+
+        Reviewed by Martin Robinson.
+
+        Launch processes from libexecdir or WEBKIT_EXEC_PATH
+        environment variable when it's set. This variable will be used by
+        MiniBrowser and unit tests to find processes without having to
+        install them.
+
+        * GNUmakefile.am:
+        * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
+        (WebKit::ProcessLauncher::launchProcess):
+
 2011-08-03  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: remove Node parameter from the InspectorClient::highlight
index f25123c4b22cc7d8de088685cc1cba0d7905e469..3383198a7e1475594243a333ce6b7ae7a70adadd 100644 (file)
@@ -844,6 +844,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPP
        -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
        -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
        -I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
+       -DLIBEXECDIR=\""$(libexecdir)"\" \
        $(webcore_cppflags) \
        $(webcoregtk_cppflags) \
        $(javascriptcore_cppflags) \
@@ -960,7 +961,7 @@ DISTCLEANFILES += \
        $(top_builddir)/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
 
 # WebKitWebProcess
-bin_PROGRAMS += \
+libexec_PROGRAMS += \
        Programs/WebKitWebProcess
 
 Programs_WebKitWebProcess_CPPFLAGS = \
@@ -1037,7 +1038,7 @@ libWebCoreGtk2_la_CPPFLAGS = \
        $(XT_CFLAGS) \
        $(ZLIB_LIBS)
 
-bin_PROGRAMS += \
+libexec_PROGRAMS += \
        Programs/WebKitPluginProcess
 
 Programs_WebKitPluginProcess_CPPFLAGS = \
index 2a398c36365c2f3947f4e2fdf58f43ea14e0c2c0..f2d32624c66b1f8df10b8671acdd7ce0f5129684 100644 (file)
@@ -76,7 +76,8 @@ void ProcessLauncher::launchProcess()
         return;
     }
 
-    GOwnPtr<gchar> binaryPath(g_build_filename(applicationDirectoryPath().data(),
+    const gchar* execDirectory = g_getenv("WEBKIT_EXEC_PATH");
+    GOwnPtr<gchar> binaryPath(g_build_filename(execDirectory ? execDirectory : LIBEXECDIR,
                                                m_launchOptions.processType == ProcessLauncher::WebProcess ? gWebKitWebProcessName : gWebKitPluginProcessName, NULL));
     GOwnPtr<gchar> socket(g_strdup_printf("%d", sockets[0]));
     char* argv[3];
index 34d7e22b337785a5087b7a6d7740ff4b73a201b4..a2a36e6aef30f5f2cbd94f186dd5ac0a2b742bec 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Install web and plugin processes in libexecdir instead of bindir
+        https://bugs.webkit.org/show_bug.cgi?id=65600
+
+        Reviewed by Martin Robinson.
+
+        Set WEBKIT_EXEC_PATH environment variable to use web and plugin
+        process from current directory instead of the intalled ones.
+
+        * MiniBrowser/gtk/GNUmakefile.am:
+        * MiniBrowser/gtk/main.c:
+        (main):
+        * WebKitTestRunner/GNUmakefile.am:
+        * WebKitTestRunner/gtk/main.cpp:
+        (main):
+
 2011-08-02  Anders Carlsson  <andersca@apple.com>
 
         Add mac-lion platform to old-run-webkit-tests
index 60ee0dcc356d7f7dcf53db9365d31dd6f7dadf2d..e3785760dfdc2c383e5dd8ae4e674030511a6361 100644 (file)
@@ -4,6 +4,7 @@ bin_PROGRAMS += \
 Programs_MiniBrowser_CPPFLAGS = \
        -I$(srcdir)/Source \
        -I$(top_builddir)/DerivedSources/WebKit2/include \
+       -DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs/\" \
        $(global_cppflags) \
        $(GLIB_CFLAGS) \
        $(GTK_CFLAGS)
index a0c514f05507e49032c64a79aac0e5b0b27ac11e..3cbf2bca445fcbab5d34c2dab5c55dadf6ab7d6f 100644 (file)
@@ -93,6 +93,9 @@ int main(int argc, char *argv[])
     }
     g_option_context_free (context);
 
+    // Prefer the not installed web and plugin processes.
+    g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE);
+
     WKContextRef processContext = createWKContextWithInjectedBundle();
 
     if (uriArguments) {
index d95734099d583e769f5fa8aba5ac4f1698dd4a4f..d2feca59b1e8e26e2328a09ec1c33fbc7582a210 100644 (file)
@@ -24,6 +24,7 @@ Programs_WebKitTestRunner_CPPFLAGS = \
        -include Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h \
        -I$(srcdir)/Tools/WebKitTestRunner \
        -I$(top_builddir)/DerivedSources/WebKit2/include \
+       -DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs/\" \
        $(global_cppflags) \
        $(javascriptcore_cppflags) \
        $(GLOBALDEPS_CFLAGS) \
index 7405197c6c27c3f8f863ef7c2856e7014a546d7a..4ed8ffbd341b7c09e7eda53775ab0cc15e1d16c6 100644 (file)
@@ -31,6 +31,8 @@
 int main(int argc, char** argv)
 {
     gtk_init(&argc, &argv);
+    // Prefer the not installed web and plugin processes.
+    g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE);
     WTR::TestController controller(argc, const_cast<const char**>(argv));
     return 0;
 }