Bug 761516 - Build linux runtime on all gtk2 platforms, fixes packaging on OpenBSD. r=glandium a=gavin
authorLandry Breuil <landry@openbsd.org>
Fri, 15 Jun 2012 10:11:56 +0200
changeset 99916 0287e34ea0f8c93e514539bd704954c0140a5243
parent 99915 65a31ad3238590178c18ef6fd739c8dcb0922352
child 99917 621324aea1931c103f34bef2537c64e0829317b4
push idunknown
push userunknown
push dateunknown
reviewersglandium, gavin
bugs761516
milestone15.0a2
Bug 761516 - Build linux runtime on all gtk2 platforms, fixes packaging on OpenBSD. r=glandium a=gavin
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 "nsILocalFile.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";
 
@@ -216,17 +217,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];