---
Ideally we'd make it possible to choose between mozjs and v8 at
configure time (or even run time with plugins). But right now I'll
settle for *only* v8, instead of *only* mozjs.

 Makefile.am  |   11 ++++++-----
 configure.ac |   15 +++++++++++----
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 452cb45..f661b5f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,9 +33,9 @@ src_pacrunner_SOURCES = $(gdbus_sources) $(builtin_sources) \
                        src/log.h src/log.c src/plugin.h src/plugin.c \
                        src/download.h src/download.c \
                        src/client.c src/manager.c src/proxy.c \
-                       src/manual.c src/mozjs.c src/javascript.h
+                       src/manual.c src/v8.cc src/javascript.h
 
-src_pacrunner_LDADD = $(builtin_libadd) @MOZJS_LIBS@ \
+src_pacrunner_LDADD = $(builtin_libadd) @V8_LIBS@ \
                                @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ -ldl
 
 src_pacrunner_LDFLAGS = -Wl,--export-dynamic
@@ -76,14 +76,15 @@ endif
 noinst_PROGRAMS = unit/test-mozjs
 
 unit_test_mozjs_SOURCES = unit/test-mozjs.c src/pacrunner.h \
-                       src/proxy.c src/manual.c src/download.c src/mozjs.c
+                       src/proxy.c src/manual.c src/download.c src/v8.cc
 
-unit_test_mozjs_LDADD = @MOZJS_LIBS@ @GLIB_LIBS@
+unit_test_mozjs_LDADD = @V8_LIBS@ @GLIB_LIBS@
 
-AM_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @CAPNG_CFLAGS@ @MOZJS_CFLAGS@ \
+AM_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @CAPNG_CFLAGS@ \
                                        $(builtin_cflags) \
                                        -DPACRUNNER_PLUGIN_BUILTIN \
                                        -DPLUGINDIR=\""$(plugindir)"\"
+AM_CXXFLAGS = $(AM_CFLAGS)
 
 INCLUDES = -I$(builddir)/src -I$(srcdir)/src -I$(srcdir)/gdbus
 
diff --git a/configure.ac b/configure.ac
index 2624e0d..233b493 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,7 @@ COMPILER_FLAGS
 AC_LANG_C
 
 AC_PROG_CC
+AC_PROG_CXX
 AC_PROG_CC_PIE
 AC_PROG_INSTALL
 
@@ -103,10 +104,16 @@ if (test "${enable_capng}" = "yes"); then
        AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities 
library.])
 fi
 
-PKG_CHECK_MODULES(MOZJS, mozilla-js >= 1.9, enable_threads=yes,
-                       AC_MSG_ERROR(Mozilla Javascript >= 1.9 is required))
-AC_SUBST(MOZJS_CFLAGS)
-AC_SUBST(MOZJS_LIBS)
+dnl PKG_CHECK_MODULES(MOZJS, mozilla-js >= 1.9, enable_threads=yes,
+dnl                    AC_MSG_ERROR(Mozilla Javascript >= 1.9 is required))
+dnl AC_SUBST(MOZJS_CFLAGS)
+dnl AC_SUBST(MOZJS_LIBS)
+
+AC_CHECK_LIB(v8,V8_Fatal,[
+       enable_threads=yes
+       V8_LIBS="-lv8 -lpthread"
+       AC_SUBST(V8_LIBS)],[
+       AC_MSG_ERROR(Chrome v8 is required)], -lpthread)
 
 if (test "${enable_threads}" = "yes"); then
        AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
-- 
1.7.3.2



_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to