summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-05-12 21:03:54 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-05-12 21:03:54 (GMT)
commit11e7301fb1f86a35e35072c8e4753095d28dc43c (patch)
treebf05b7622966265a26cc5f5f3d7a8a7d05fe4aed
parent3cfb5df8f3b0571a529d05e51218eb9f4fdc1930 (diff)
downloaduscxml-11e7301fb1f86a35e35072c8e4753095d28dc43c.zip
uscxml-11e7301fb1f86a35e35072c8e4753095d28dc43c.tar.gz
uscxml-11e7301fb1f86a35e35072c8e4753095d28dc43c.tar.bz2
Builds and links and tests ok on linux now
-rw-r--r--.travis.yml2
-rw-r--r--config.h.in2
-rw-r--r--contrib/cmake/FindJSC.cmake9
-rw-r--r--contrib/cmake/FindV8.cmake15
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h12
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp4
-rw-r--r--src/uscxml/util/URL.cpp6
7 files changed, 41 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml
index 0bc2cd2..f9e0e72 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-sudo: false
+sudo: required
language: cpp
compiler:
- gcc
diff --git a/config.h.in b/config.h.in
index bae7de8..a9f29a2 100644
--- a/config.h.in
+++ b/config.h.in
@@ -72,6 +72,8 @@
#cmakedefine MILES_FOUND
#cmakedefine V8_FOUND
#cmakedefine JSC_FOUND
+#cmakedefine HAS_JSC_JAVASCRIPTCORE_H
+#cmakedefine HAS_JSC_JAVASCRIPT_H
#cmakedefine LIBICAL_FOUND
#cmakedefine SWI_FOUND
#cmakedefine FFMPEG_FOUND
diff --git a/contrib/cmake/FindJSC.cmake b/contrib/cmake/FindJSC.cmake
index 2040ccf..456cc68 100644
--- a/contrib/cmake/FindJSC.cmake
+++ b/contrib/cmake/FindJSC.cmake
@@ -1,6 +1,6 @@
if (NOT APPLE)
- FIND_PATH(JSC_INCLUDE_DIR JavaScriptCore/JavaScriptCore.h
- PATH_SUFFIXES webkitgtk-1.0 webkitgtk-3.0
+ FIND_PATH(JSC_INCLUDE_DIR JavaScriptCore/JSBase.h
+ PATH_SUFFIXES webkitgtk-4.0 webkitgtk-3.0 webkitgtk-1.0
PATHS
/usr/local
/usr
@@ -11,8 +11,11 @@ if (NOT APPLE)
)
endif()
+FIND_PATH(HAS_JSC_JAVASCRIPTCORE_H JavaScriptCore/JavaScriptCore.h PATHS ${JSC_INCLUDE_DIR})
+FIND_PATH(HAS_JSC_JAVASCRIPT_H JavaScriptCore/JavaScript.h PATHS ${JSC_INCLUDE_DIR})
+
FIND_LIBRARY(JSC_LIBRARY
- NAMES JavaScriptCore javascriptcoregtk-1.0 javascriptcoregtk-3.0
+ NAMES JavaScriptCore javascriptcoregtk-4.0 javascriptcoregtk-3.0 javascriptcoregtk-1.0
)
INCLUDE(FindPackageHandleStandardArgs)
diff --git a/contrib/cmake/FindV8.cmake b/contrib/cmake/FindV8.cmake
index 819bedd..e3ec38c 100644
--- a/contrib/cmake/FindV8.cmake
+++ b/contrib/cmake/FindV8.cmake
@@ -50,6 +50,21 @@ else()
endif()
endif()
+# I have no idea how we would find the version otherwise :(
+include(CheckCXXSourceCompiles)
+set(CMAKE_REQUIRED_INCLUDES ${V8_INCLUDE_DIR})
+set(CMAKE_REQUIRED_LIBRARIES ${V8_LIBRARY})
+check_cxx_source_compiles("
+ #include <v8>
+ int main(){ v8::Array::New(v8::Isolate::GetCurrent()); }
+" V8_VER_AFTER_032318)
+
+if (NOT V8_VER_AFTER_032318)
+ message(STATUS "Your V8 installation is too old - we need >= 3.23.17")
+ unset(V8_LIBRARY)
+ unset(V8_INCLUDE_DIR)
+endif()
+
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(V8 DEFAULT_MSG V8_LIBRARY V8_INCLUDE_DIR)
MARK_AS_ADVANCED(V8_LIBRARY V8_INCLUDE_DIR)
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h
index 55e5c1f..b65dc37 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h
@@ -20,10 +20,22 @@
#ifndef JSCDATAMODEL_H_KN8TWG0V
#define JSCDATAMODEL_H_KN8TWG0V
+#include "uscxml/config.h"
#include "uscxml/plugins/DataModel.h"
#include <list>
#include <set>
+
+/**
+ * There are two variants with JavaScriptCore headers
+ * Still beats the >20 V8 variants =D
+ */
+#if defined(HAS_JSC_JAVASCRIPTCORE_H)
#include <JavaScriptCore/JavaScriptCore.h>
+#elif defined(HAS_JSC_JAVASCRIPT_H)
+#include <JavaScriptCore/JavaScript.h>
+#else
+#error "Did not find header for JSC?"
+#endif
#ifdef BUILD_AS_PLUGINS
#include "uscxml/plugins/Plugins.h"
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
index 8b2bb04..bfa29d8 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
@@ -47,9 +47,9 @@ static XMLCh* JS2XMLString(const v8::Local<v8::Value>& value) {
return(ret);
}
-// javascript magic here
+// this is the version we support here
+#define SWIG_V8_VERSION 0x032317
-#define SWIG_V8_VERSION 0x034000
#include "V8DOM.cpp.inc"
namespace uscxml {
diff --git a/src/uscxml/util/URL.cpp b/src/uscxml/util/URL.cpp
index ad271d5..a576f8b 100644
--- a/src/uscxml/util/URL.cpp
+++ b/src/uscxml/util/URL.cpp
@@ -138,10 +138,10 @@ URL URLImpl::resolveWithCWD(URLImpl* relative) {
if (!getcwd(currPath, sizeof(currPath))) {
ERROR_PLATFORM_THROW("Cannot get current working directory");
}
- currPath[sizeof(currPath) - 1] = '\0'; /* not really required */
+ currPath[sizeof(currPath) - 1] = '\0'; /* not really required? */
-
- std::shared_ptr<URLImpl> cwdURL(new URLImpl(std::string("file://") + currPath));
+ // without the trailing slash, last component is assumed a file
+ std::shared_ptr<URLImpl> cwdURL(new URLImpl(std::string("file://") + currPath + PATH_SEPERATOR));
return resolve(relative, cwdURL.get());
}