1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[mujs] Added mujs to configure.ac and Makefiles

This commit is contained in:
Witold Filipczyk 2022-08-21 21:33:13 +02:00
parent 7f44731365
commit 46860128db
6 changed files with 76 additions and 3 deletions

View File

@ -77,6 +77,8 @@ LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
MKINSTALLDIRS = $(PATHPREFIX)@MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MUJS_CFLAGS = @MUJS_CFLAGS@
MUJS_LIBS = @MUJS_LIBS@
OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
PACKAGE = @PACKAGE@
PERL_CFLAGS = @PERL_CFLAGS@
@ -148,6 +150,7 @@ CONFIG_MANUAL = @CONFIG_MANUAL@
CONFIG_MARKS = @CONFIG_MARKS@
CONFIG_MIMETYPES = @CONFIG_MIMETYPES@
CONFIG_MOUSE = @CONFIG_MOUSE@
CONFIG_MUJS = @CONFIG_MUJS@
CONFIG_NNTP = @CONFIG_NNTP@
CONFIG_NO_ROOT_EXEC = @CONFIG_NO_ROOT_EXEC@
CONFIG_OPENSSL = @CONFIG_OPENSSL@

View File

@ -637,6 +637,50 @@ if test "$CONFIG_OS_WIN32" = yes; then
EL_CONFIG_OS_WIN32
fi
# ===================================================================
# Check for MuJS
# ===================================================================
AC_ARG_WITH([mujs],
[AS_HELP_STRING([--with-mujs],
[enable MuJS engine])])
CONFIG_MUJS=
case "$with_mujs" in
"" | no)
# The user specified --without-mujs.
AC_MSG_CHECKING([for MuJS])
AC_MSG_RESULT([disabled])
CONFIG_MUJS="no"
;;
yes)
;;
*)
;;
esac
if test "x$CONFIG_MUJS" = x; then
AC_MSG_CHECKING([for MuJS in pkg-config])
if $PKG_CONFIG $pkg_config_static --cflags --libs mujs > /dev/null 2>&AS_MESSAGE_LOG_FD; then
DB_LOCALSTORAGE_LIBS="$($PKG_CONFIG $pkg_config_static --libs sqlite3)"
XMLPLUSPLUS_LIBS="$($PKG_CONFIG $pkg_config_static --libs libxml++-5.0)"
MUJS_LIBS="$($PKG_CONFIG $pkg_config_static --libs mujs) $DB_LOCALSTORAGE_LIBS $XMLPLUSPLUS_LIBS"
DB_LOCALSTORAGE_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags sqlite3)"
XMLPLUSPLUS_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags libxml++-5.0)"
MUJS_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags mujs) $DB_LOCALSTORAGE_CFLAGS $XMLPLUSPLUS_CFLAGS"
LIBS="$LIBS $MUJS_LIBS $LIBS_X"
CPPFLAGS="$CPPFLAGS_X $MUJS_CFLAGS"
CFLAGS="$CFLAGS $MUJS_CFLAGS"
CONFIG_MUJS=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
# ===================================================================
# Check for QuickJS
# ===================================================================
@ -777,7 +821,7 @@ else
CONFIG_ECMASCRIPT_SMJS=no
fi
EL_CONFIG_DEPENDS(CONFIG_ECMASCRIPT, [CONFIG_ECMASCRIPT_SMJS CONFIG_QUICKJS CONFIG_SCRIPTING_SPIDERMONKEY], [ECMAScript (JavaScript)])
EL_CONFIG_DEPENDS(CONFIG_ECMASCRIPT, [CONFIG_ECMASCRIPT_SMJS CONFIG_MUJS CONFIG_QUICKJS CONFIG_SCRIPTING_SPIDERMONKEY], [ECMAScript (JavaScript)])
AC_SUBST(CONFIG_ECMASCRIPT_SMJS)
if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes &&
@ -807,6 +851,15 @@ if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes ||
CXXFLAGS="$CXXFLAGS $SPIDERMONKEY_CFLAGS"
fi
if test "x$CONFIG_MUJS" = xyes; then
EL_CONFIG(CONFIG_XML, [libxml++5.0])
EL_CONFIG(CONFIG_MUJS, [mujs])
AC_SUBST(MUJS_LIBS)
AC_SUBST(MUJS_CFLAGS)
AC_SUBST(CONFIG_MUJS)
AC_SUBST(CONFIG_XML)
fi
if test "x$CONFIG_QUICKJS" = xyes; then
EL_CONFIG(CONFIG_XML, [libxml++5.0])
EL_CONFIG(CONFIG_QUICKJS, [quickjs])

View File

@ -1,13 +1,17 @@
top_builddir=../..
include $(top_builddir)/Makefile.config
INCLUDES += $(SPIDERMONKEY_CFLAGS)
INCLUDES += $(SPIDERMONKEY_CFLAGS) $(MUJS_CFLAGS)
SUBDIRS-$(CONFIG_ECMASCRIPT_SMJS) += spidermonkey
SUBDIRS-$(CONFIG_MUJS) += mujs
SUBDIRS-$(CONFIG_QUICKJS) += quickjs
OBJS-$(CONFIG_ECMASCRIPT_SMJS) += css2xpath.obj ecmascript.obj localstorage-db.obj spidermonkey.obj
OBJS-$(CONFIG_MUJS) += css2xpath.obj ecmascript.obj localstorage-db.obj mujs.obj
OBJS-$(CONFIG_QUICKJS) += css2xpath.obj ecmascript.obj localstorage-db.obj quickjs.obj
ifeq ($(CONFIG_ECMASCRIPT_SMJS), yes)

View File

@ -17,6 +17,10 @@
#include <quickjs/quickjs.h>
#endif
#ifdef CONFIG_MUJS
#include <mujs.h>
#endif
#ifdef CONFIG_ECMASCRIPT
#include "main/module.h"

View File

@ -0,0 +1,9 @@
top_builddir=../../..
include $(top_builddir)/Makefile.config
INCLUDES += $(MUJS_CFLAGS)
OBJS = attr.obj attributes.obj collection.obj console.obj document.obj element.obj form.obj \
forms.obj history.obj implementation.obj input.obj location.obj \
localstorage.obj navigator.obj nodelist.obj screen.obj unibar.obj window.obj
include $(top_srcdir)/Makefile.lib

View File

@ -672,7 +672,7 @@ do_action(struct session *ses, main_action_T action_id, int verbose)
break;
case ACT_MAIN_TOGGLE_ECMASCRIPT:
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) || defined(CONFIG_QUICKJS)
#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) || defined(CONFIG_MUJS)
toggle_ecmascript(ses);
#endif
break;