Bug 761516 - Build linux runtime on all gtk2 platforms, fixes packaging on OpenBSD. r=glandium a=gavin
--- 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];