summaryrefslogtreecommitdiff
path: root/libproxy
diff options
context:
space:
mode:
authornpmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56>2010-02-11 04:30:33 +0000
committernpmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56>2010-02-11 04:30:33 +0000
commit71dcfe5744ae358bc67b1a0b5cfe2f8cfd2b0151 (patch)
tree1bcf48e85d1241a4fec484d41b4efee84e81627f /libproxy
parent28fa12244ae076c4d1180c2c34ac2949e2669e3e (diff)
downloadlibproxy-71dcfe5744ae358bc67b1a0b5cfe2f8cfd2b0151.tar.gz
Add support for building against mozjs or webkit on win32 (via manually set cache variables)
git-svn-id: http://libproxy.googlecode.com/svn/trunk@536 c587cffe-e639-0410-9787-d7902ae8ed56
Diffstat (limited to 'libproxy')
-rw-r--r--libproxy/CMakeLists.txt25
-rw-r--r--libproxy/modules/pacrunner_mozjs.cpp9
2 files changed, 29 insertions, 5 deletions
diff --git a/libproxy/CMakeLists.txt b/libproxy/CMakeLists.txt
index f78688f..c00b684 100644
--- a/libproxy/CMakeLists.txt
+++ b/libproxy/CMakeLists.txt
@@ -84,17 +84,36 @@ if(UNIX AND NOT APPLE)
set(ENVVAR_FOUND 1)
endif()
+if(WIN32)
+ # Make the relevant variables show up in the UI
+ set(MOZJS_INCLUDE_DIR "MOZJS_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "Path to the MOZJS include files")
+ set(WEBKIT_INCLUDE_DIR "WEBKIT_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "Path to the WEBKIT include files")
+ set(MOZJS_LIBRARIES "MOZJS_LIBRARIES-NOTFOUND" CACHE FILEPATH "Path to the MOZJS .lib file")
+ set(WEBKIT_LIBRARIES "WEBKIT_LIBRARIES-NOTFOUND" CACHE FILEPATH "Path to the WEBKIT .lib file")
+
+ if(MOZJS_LIBRARIES AND MOZJS_INCLUDE_DIR)
+ set(MOZJS_FOUND 1)
+ link_directories(MOZJS_LIBRARIES)
+ include_directories("${MOZJS_INCLUDE_DIR}")
+ endif()
+ if(WEBKIT_LIBRARIES AND WEBKIT_INCLUDE_DIR)
+ set(WEBKIT_FOUND 1)
+ link_directories(WEBKIT_LIBRARIES)
+ include_directories("${WEBKIT_INCLUDE_DIR}")
+ endif()
+endif()
+
if(APPLE)
find_library(WEBKIT_LIBRARIES JavaScriptCore)
find_library(SC_LIBRARIES SystemConfiguration)
find_library(CF_LIBRARIES CoreFoundation)
- if(NOT "${WEBKIT_LIBRARIES}" STREQUAL "")
+ if(WEBKIT_LIBRARIES)
set(WEBKIT_FOUND 1)
endif()
- if(NOT "${SC_LIBRARIES}" STREQUAL "")
+ if(SC_LIBRARIES)
set(SC_FOUND 1)
endif()
- if(NOT "${CF_LIBRARIES}" STREQUAL "")
+ if(CF_LIBRARIES)
set(CF_FOUND 1)
endif()
endif()
diff --git a/libproxy/modules/pacrunner_mozjs.cpp b/libproxy/modules/pacrunner_mozjs.cpp
index 2945b3c..c611b4b 100644
--- a/libproxy/modules/pacrunner_mozjs.cpp
+++ b/libproxy/modules/pacrunner_mozjs.cpp
@@ -26,6 +26,11 @@ using namespace libproxy;
#ifndef JS_HAS_FILE_OBJECT
#define JS_HAS_FILE_OBJECT 0
#endif
+#ifdef WIN32
+#ifndef XP_WIN
+#define XP_WIN
+#endif
+#endif
#include <jsapi.h>
#include "pacutils.h"
@@ -37,7 +42,7 @@ using namespace libproxy;
#define INET6_ADDRSTRLEN 46
#endif
-static JSBool dnsResolve(JSContext *cx, JSObject */*obj*/, uintN /*argc*/, jsval *argv, jsval *rval) {
+static JSBool dnsResolve(JSContext *cx, JSObject * /*obj*/, uintN /*argc*/, jsval *argv, jsval *rval) {
// Get hostname argument
char *tmp = JS_strdup(cx, JS_GetStringBytes(JS_ValueToString(cx, argv[0])));
@@ -70,7 +75,7 @@ static JSBool dnsResolve(JSContext *cx, JSObject */*obj*/, uintN /*argc*/, jsval
return true;
}
-static JSBool myIpAddress(JSContext *cx, JSObject *obj, uintN /*argc*/, jsval */*argv*/, jsval *rval) {
+static JSBool myIpAddress(JSContext *cx, JSObject *obj, uintN /*argc*/, jsval * /*argv*/, jsval *rval) {
char *hostname = (char *) JS_malloc(cx, 1024);
if (!gethostname(hostname, 1023)) {
JSString *myhost = JS_NewString(cx, hostname, strlen(hostname));