Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Compile support in linux: see README-linux.txt

  • Loading branch information...
commit 34caf89a7021b8969f945cc4e316ecf02e412d51 1 parent bb58325
@espardino authored
View
13 README-linux.txt
@@ -0,0 +1,13 @@
+sudo apt-get install libpcre3-dev bison flex scons subversion
+
+
+* apply patch to sources
+* run ./configure inside swig sources (or swigconfig.h not found)
+
+v8 will fail:
+
+in third_party/v8/v8 edit SConstruct, change:
+
+ and remove -Werror lines
+
+
View
2  src/Examples/jsv8/class/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/example_wrap.cxx
- COMMAND ${SWIG_JS_EXECUTABLE} -jsv8 -c++ -debug-top 4 -o ${CMAKE_CURRENT_BINARY_DIR}/example_wrap.cxx -outdir ${CMAKE_CURRENT_BINARY_DIR} example.i > ${CMAKE_CURRENT_BINARY_DIR}/output.txt
+ COMMAND ${SWIG_JS_EXECUTABLE} -jsv8 -c++ -debug-top 4 -o ${CMAKE_CURRENT_BINARY_DIR}/example_wrap.cxx -outdir ${CMAKE_CURRENT_BINARY_DIR} -I${PROJECT_BINARY_DIR}/Lib -I${PROJECT_BINARY_DIR}/Lib/js/v8 example.i > ${CMAKE_CURRENT_BINARY_DIR}/output.txt
COMMENT "${SWIG_JS_EXECUTABLE} -jsv8 -c++ -debug-top 4 -o ${CMAKE_CURRENT_BINARY_DIR}/example_wrap.cxx -outdir ${CMAKE_CURRENT_BINARY_DIR} example.i > ${CMAKE_CURRENT_BINARY_DIR}/output.txt"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
View
2  src/Examples/jsv8/class/main.cxx
@@ -17,7 +17,7 @@ void test1() {
// Handle<String> source = String::New("var bla = new Bla(); bla.bla(); bla.blupp(2);");
// Handle<String> source = String::New("var circle = new Circle(2.0); log('Hallo Welt!'); log(circle.area());");
- Handle<String> source = String::New("var circle = new Circle(2.0); circle.x = 1.2;");
+ Handle<String> source = String::New("var circle = new Circle(2.0); circle.x = 1.2; console.log(circle.area());");
// Compile the source code.
Handle<Script> script = Script::Compile(source);
View
10 src/swig/CMakeLists.txt
@@ -9,9 +9,13 @@ include_directories(${SWIG_INCLUDES})
add_executable(swig swigmain.cxx jsv8.cxx)
+if (UNIX)
target_link_libraries(swig
- swig_cparse swig_preprocessor swig_doh swiglib swig_modules)
-
+ swig_cparse swig_preprocessor swig_doh swiglib swig_modules libpcre.so)
+else()
+target_link_libraries(swig
+ swig_cparse swig_preprocessor swig_doh swiglib swig_modules )
+endif()
get_target_property(SWIG_EXE swig LOCATION)
get_filename_component(SWIG_EXE_NAME ${SWIG_EXE} NAME)
@@ -26,4 +30,4 @@ add_custom_command(TARGET swig
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Lib ${PROJECT_BINARY_DIR}/Lib
)
-set(SWIG_JS_EXECUTABLE ${PROJECT_BINARY_DIR}/${SWIG_EXE_NAME} CACHE INTERNAL "" FORCE)
+set(SWIG_JS_EXECUTABLE ${PROJECT_BINARY_DIR}/${SWIG_EXE_NAME} CACHE INTERNAL "" FORCE)
View
9 src/swig/jsv8.cxx
@@ -21,12 +21,13 @@ static int treduce = SWIG_cparse_template_reduce(0);
#include <string.h>
#include <limits.h>
#include <iostream>
-#include <conio.h>
+
+
static const char *usage = "\
JavaScript Options (available with -js)\n\
";
-
+/*
int JSV8_DOH_EndsWith(String* s, String* suffix) {
if (s == 0 || suffix == 0)
return 0;
@@ -44,8 +45,10 @@ int JSV8_DOH_EndsWith(String* s, String* suffix) {
return (strcmp(s_str, s_suffix) == 0);
}
-#define EndsWith JSV8_DOH_EndsWith
+*/
+
+#define EndsWith(name,val) (Strcmp(Char(name) + Len(name) - 4, val)==0)
/**
* Creates a string that is used to define a class template instance.
*/
View
23 third_party/CMakeLists.txt
@@ -3,18 +3,19 @@
# ==========
#
-add_subdirectory(FireBreath)
-
-set_target_properties(NpapiCore PluginCore ScriptingCore ActiveXCore
- PROPERTIES FOLDER third_party/FireBreath
-)
-set_target_properties(UnitTest++ UnitTest_ActiveXCore UnitTest_ScriptingCore NPAPIHost
- PROPERTIES FOLDER third_party/FireBreath/UnitTests
-)
-set_target_properties(boost_thread boost_system
- PROPERTIES FOLDER third_party/boost
-)
+if(WIN32)
+ add_subdirectory(FireBreath)
+ set_target_properties(NpapiCore PluginCore ScriptingCore ActiveXCore
+ PROPERTIES FOLDER third_party/FireBreath
+ )
+ set_target_properties(UnitTest++ UnitTest_ActiveXCore UnitTest_ScriptingCore NPAPIHost
+ PROPERTIES FOLDER third_party/FireBreath/UnitTests
+ )
+ set_target_properties(boost_thread boost_system
+ PROPERTIES FOLDER third_party/boost
+ )
+endif()
#
# Swig
# ==========
View
6 third_party/v8/CMakeLists.txt
@@ -35,6 +35,9 @@ if(${v8mode} STREQUAL "debug")
if(WIN32)
list(APPEND _V8_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/v8/v8.lib)
set(V8_DLL ${CMAKE_CURRENT_SOURCE_DIR}/v8/v8_g.dll)
+ elseif(UNIX)
+ list(APPEND _V8_LIBS -lv8)
+ set(V8_DLL ${CMAKE_CURRENT_SOURCE_DIR}/v8/libv8.so)
else()
message(FATAL_ERROR "Not yet implemented: what is the output of v8 build under posix?")
endif()
@@ -42,6 +45,9 @@ elseif(${v8mode} STREQUAL "release")
if(WIN32)
list(APPEND _V8_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/v8/v8.lib)
set(V8_DLL ${CMAKE_CURRENT_SOURCE_DIR}/v8/v8.dll)
+ elseif(UNIX)
+ list(APPEND _V8_LIBS -lv8)
+ set(V8_DLL ${CMAKE_CURRENT_SOURCE_DIR}/v8/libv8.so)
else()
message(FATAL_ERROR "Not yet implemented: what is the output of v8 build under posix?")
endif()
Please sign in to comment.
Something went wrong with that request. Please try again.