javascript: add option "--disable-javascript" and V8 detection in autotools
This commit is contained in:
parent
2120405a16
commit
148a571dce
63
configure.ac
63
configure.ac
@ -119,6 +119,7 @@ AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
|
||||
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
|
||||
AH_VERBATIM([PLUGIN_TCL], [#undef PLUGIN_TCL])
|
||||
AH_VERBATIM([PLUGIN_GUILE], [#undef PLUGIN_GUILE])
|
||||
AH_VERBATIM([PLUGIN_JAVASCRIPT], [#undef PLUGIN_JAVASCRIPT])
|
||||
AH_VERBATIM([PLUGIN_TRIGGER], [#undef PLUGIN_TRIGGER])
|
||||
AH_VERBATIM([PLUGIN_XFER], [#undef PLUGIN_XFER])
|
||||
AH_VERBATIM([TESTS], [#undef TESTS])
|
||||
@ -150,6 +151,7 @@ AC_ARG_ENABLE(ruby, [ --disable-ruby turn off Ruby script plug
|
||||
AC_ARG_ENABLE(lua, [ --disable-lua turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes)
|
||||
AC_ARG_ENABLE(tcl, [ --disable-tcl turn off Tcl script plugin (default=compiled if found)],enable_tcl=$enableval,enable_tcl=yes)
|
||||
AC_ARG_ENABLE(guile, [ --disable-guile turn off Guile (scheme) script plugin (default=compiled if found)],enable_guile=$enableval,enable_guile=yes)
|
||||
AC_ARG_ENABLE(javascript, [ --disable-javascript turn off Javascript script plugin (default=compiled if found)],enable_javascript=$enableval,enable_javascript=yes)
|
||||
AC_ARG_ENABLE(trigger, [ --disable-trigger turn off Trigger plugin (default=compiled)],enable_trigger=$enableval,enable_trigger=yes)
|
||||
AC_ARG_ENABLE(xfer, [ --disable-xfer turn off Xfer (file transfer) plugin (default=compiled if found)],enable_xfer=$enableval,enable_xfer=yes)
|
||||
AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR directory containing tcl configuration (tclConfig.sh)],tclconfig=$withval,tclconfig='')
|
||||
@ -282,6 +284,7 @@ if test "x$enable_scripts" = "xno" ; then
|
||||
enable_lua="no"
|
||||
enable_tcl="no"
|
||||
enable_guile="no"
|
||||
enable_javascript="no"
|
||||
fi
|
||||
|
||||
# ---------------------------------- alias -------------------------------------
|
||||
@ -848,6 +851,60 @@ if test "x$enable_guile" = "xyes" ; then
|
||||
AC_DEFINE(PLUGIN_GUILE)
|
||||
fi
|
||||
|
||||
# ------------------------------ javascript -----------------------------------
|
||||
|
||||
AC_LANG_PUSH([C++])
|
||||
|
||||
if test "x$enable_javascript" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
v8_found="no"
|
||||
AC_CHECK_HEADER(v8.h,ac_found_v8_header="yes",ac_found_v8_header="no")
|
||||
if test "x$ac_found_v8_header" = "xyes" ; then
|
||||
#AC_CHECK_LIB(v8,v8,ac_found_v8_lib="yes",ac_found_v8_lib="no")
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -lv8"
|
||||
AC_MSG_CHECKING(for v8 usability in programs)
|
||||
AC_TRY_RUN([
|
||||
#include <v8.h>
|
||||
using namespace v8;
|
||||
int main(int argc, char **argv) {
|
||||
const char *version = V8::GetVersion();
|
||||
return 0;
|
||||
}],ac_found_v8_lib="yes", ac_found_v8_lib="no", ac_found_v8_lib="assume-yes")
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
if test "x$ac_found_v8_lib" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
v8_found="yes"
|
||||
V8_CFLAGS=""
|
||||
V8_LFLAGS="-lv8"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN([
|
||||
*** V8 library couldn't be found on your system.
|
||||
*** WeeChat will be built without Javascript support.])
|
||||
enable_javascript="no"
|
||||
not_found="$not_found javascript/v8"
|
||||
fi
|
||||
else
|
||||
AC_MSG_WARN([
|
||||
*** V8 header files couldn't be found on your system.
|
||||
*** WeeChat will be built without Javascript support.])
|
||||
enable_javascript="no"
|
||||
not_found="$not_found javascript/v8"
|
||||
fi
|
||||
else
|
||||
not_asked="$not_asked javascript"
|
||||
fi
|
||||
|
||||
if test "x$enable_javascript" = "xyes" ; then
|
||||
AC_SUBST(V8_CFLAGS)
|
||||
AC_SUBST(V8_LFLAGS)
|
||||
AC_DEFINE(PLUGIN_JAVASCRIPT)
|
||||
fi
|
||||
|
||||
AC_LANG_POP
|
||||
|
||||
# --------------------------------- trigger ------------------------------------
|
||||
|
||||
if test "x$enable_trigger" = "xyes" ; then
|
||||
@ -1192,6 +1249,7 @@ gnu*)
|
||||
esac
|
||||
|
||||
CFLAGS="$CFLAGS -DWEECHAT_VERSION=\\\"$VERSION\\\" -DWEECHAT_LICENSE=\\\"$LICENSE\\\""
|
||||
CPPFLAGS="$CPPFLAGS -DWEECHAT_VERSION=\\\"$VERSION\\\" -DWEECHAT_LICENSE=\\\"$LICENSE\\\""
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# output Makefiles
|
||||
@ -1216,6 +1274,7 @@ AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_TCL, test "$enable_tcl" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_GUILE, test "$enable_guile" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_JAVASCRIPT, test "$enable_javascript" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_TRIGGER, test "$enable_trigger" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_XFER, test "$enable_xfer" = "yes")
|
||||
AM_CONDITIONAL(TESTS, test "$enable_tests" = "yes")
|
||||
@ -1250,6 +1309,7 @@ AC_OUTPUT([Makefile
|
||||
src/plugins/lua/Makefile
|
||||
src/plugins/tcl/Makefile
|
||||
src/plugins/guile/Makefile
|
||||
src/plugins/javascript/Makefile
|
||||
src/plugins/trigger/Makefile
|
||||
src/plugins/xfer/Makefile
|
||||
src/gui/Makefile
|
||||
@ -1319,6 +1379,9 @@ fi
|
||||
if test "x$enable_guile" = "xyes"; then
|
||||
listplugins="$listplugins guile($GUILE_VERSION)"
|
||||
fi
|
||||
if test "x$enable_javascript" = "xyes"; then
|
||||
listplugins="$listplugins javascript/v8"
|
||||
fi
|
||||
if test "x$enable_trigger" = "xyes"; then
|
||||
listplugins="$listplugins trigger"
|
||||
fi
|
||||
|
@ -99,6 +99,10 @@ if PLUGIN_GUILE
|
||||
guile_dir = guile
|
||||
endif
|
||||
|
||||
if PLUGIN_JAVASCRIPT
|
||||
javascript_dir = javascript
|
||||
endif
|
||||
|
||||
if PLUGIN_TRIGGER
|
||||
trigger_dir = trigger
|
||||
endif
|
||||
@ -110,7 +114,7 @@ endif
|
||||
SUBDIRS = . $(alias_dir) $(aspell_dir) $(charset_dir) $(exec_dir) $(fifo_dir) \
|
||||
$(irc_dir) $(logger_dir) $(relay_dir) $(script_dir) $(perl_dir) \
|
||||
$(python_dir) $(ruby_dir) $(lua_dir) $(tcl_dir) $(guile_dir) \
|
||||
$(trigger_dir) $(xfer_dir)
|
||||
$(javascript_dir) $(trigger_dir) $(xfer_dir)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
|
||||
|
@ -17,19 +17,19 @@
|
||||
# along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(JAVASCRIPT_CFLAGS)
|
||||
AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(V8_CFLAGS)
|
||||
|
||||
libdir = ${weechat_libdir}/plugins
|
||||
|
||||
lib_LTLIBRARIES = javascript.la
|
||||
|
||||
javascript_la_SOURCES = weechat-js.c \
|
||||
javascript_la_SOURCES = weechat-js.cpp \
|
||||
weechat-js.h \
|
||||
weechat-js-v8.c \
|
||||
weechat-js-v8.cpp \
|
||||
weechat-js-v8.h \
|
||||
weechat-js-api.c \
|
||||
weechat-js-api.cpp \
|
||||
weechat-js-api.h
|
||||
javascript_la_LDFLAGS = -module -no-undefined
|
||||
javascript_la_LIBADD = ../lib_weechat_plugins_scripts.la $(JAVASCRIPT_LFLAGS)
|
||||
javascript_la_LIBADD = ../lib_weechat_plugins_scripts.la $(V8_LFLAGS)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
|
Loading…
x
Reference in New Issue
Block a user