Bug 761516 - Build linux webapprt on all gtk2 platforms, not only linux. r=jst
authorLandry Breuil <landry@openbsd.org>
Mon, 11 Jun 2012 20:50:18 +0200
changeset 96423 5c5336ccf186d4778073678502ac7dcea87eea8e
parent 96422 ce4fcd70f3c90a1ed3b188fcab2fdc46d5bc145d
child 96424 52887e7b07cdcb30ec972d103d4b43db7905aca1
push id845
push usertim.taubert@gmx.de
push dateWed, 13 Jun 2012 13:35:17 +0000
treeherderfx-team@bdbed29aaaa6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs761516
milestone16.0a1
Bug 761516 - Build linux webapprt on all gtk2 platforms, not only linux. r=jst
webapprt/Makefile.in
webapprt/linux/webapprt.cpp
--- a/webapprt/Makefile.in
+++ b/webapprt/Makefile.in
@@ -19,17 +19,17 @@ include $(topsrcdir)/config/config.mk
 FINAL_TARGET = $(DIST)/bin/webapprt
 
 ifneq (,$(filter WINNT,$(OS_ARCH)))
 DIRS += win
 else
 ifeq ($(OS_ARCH),Darwin)
 DIRS += mac
 else
-ifeq ($(OS_ARCH),Linux)
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 DIRS += linux
 endif # linux
 endif # mac
 endif # windows
 
 EXTRA_PP_COMPONENTS = \
   components.manifest \
   CommandLineHandler.js \
--- a/webapprt/linux/webapprt.cpp
+++ b/webapprt/linux/webapprt.cpp
@@ -12,16 +12,17 @@
 #include <unistd.h>
 
 // Mozilla headers
 #include "nsIFile.h"
 #include "nsINIParser.h"
 #include "nsXPCOMGlue.h"
 #include "nsXPCOMPrivate.h"              // for MAXPATHLEN and XPCOM_DLL
 #include "nsXULAppAPI.h"
+#include "BinaryPath.h"
 
 const char kAPP_INI[] = "application.ini";
 const char kWEBAPP_INI[] = "webapp.ini";
 const char kWEBAPPRT_INI[] = "webapprt.ini";
 const char kWEBAPPRT_PATH[] = "webapprt";
 const char kAPP_ENV_VAR[] = "XUL_APP_FILE";
 const char kAPP_RT[] = "webapprt-stub";
 
@@ -223,17 +224,17 @@ int main(int argc, char *argv[])
 {
   gtk_init(&argc, &argv);
 
   pargc = &argc;
   pargv = &argv;
 
   // Get current executable path
   char curExePath[MAXPATHLEN];
-  if (readlink("/proc/self/exe", curExePath, MAXPATHLEN) == -1) {
+  if (NS_FAILED(mozilla::BinaryPath::Get(argv[0], curExePath))) {
     ErrorDialog("Couldn't read current executable path");
     return 255;
   }
 
   // Set up webAppIniPath with path to webapp.ini
   char curExeDir[MAXPATHLEN];
   GetDirFromPath(curExeDir, curExePath);
   char webAppIniPath[MAXPATHLEN];