head 1.20; access; symbols OSSP_JS_1_6_20070208:1.20 OSSP_JS_1_6_20060820:1.20 OSSP_JS_1_6_20060803:1.19 OSSP_JS_1_6_20060731:1.17 OSSP_JS_1_6_20060730:1.16 OSSP_JS_1_6_20060729:1.15 OSSP_JS_1_6_20060724:1.14 OSSP_JS_1_6_20060722:1.12; locks; strict; comment @# @; 1.20 date 2006.08.20.15.45.13; author rse; state Exp; branches; next 1.19; commitid WhxywYkCAaud9BJr; 1.19 date 2006.08.03.13.19.20; author rse; state Exp; branches; next 1.18; commitid 9Bvk8Ze7oUq2ToHr; 1.18 date 2006.08.03.12.41.27; author rse; state Exp; branches; next 1.17; commitid kujso7TfogkZFoHr; 1.17 date 2006.07.31.11.37.56; author rse; state Exp; branches; next 1.16; commitid VY4A5BJ3Gm7fq0Hr; 1.16 date 2006.07.30.08.00.44; author rse; state Exp; branches; next 1.15; commitid MYsn6PDUAj5JfRGr; 1.15 date 2006.07.29.09.08.15; author rse; state Exp; branches; next 1.14; commitid eqsSzsDhkYGTEJGr; 1.14 date 2006.07.24.19.21.49; author rse; state Exp; branches; next 1.13; commitid 0UZnJz3dVK7md9Gr; 1.13 date 2006.07.23.18.34.15; author rse; state Exp; branches; next 1.12; commitid gVEVhueKwq30Z0Gr; 1.12 date 2006.07.23.10.52.12; author rse; state Exp; branches; next 1.11; commitid nAaPVoGAf5VxqYFr; 1.11 date 2006.07.23.08.00.43; author rse; state Exp; branches; next 1.10; commitid VL1SmkRG7aHItXFr; 1.10 date 2006.07.22.20.04.20; author rse; state Exp; branches; next 1.9; commitid Aag6T76vqGhXvTFr; 1.9 date 2006.07.22.19.43.48; author rse; state Exp; branches; next 1.8; commitid QqT7sMu2XvzUoTFr; 1.8 date 2006.07.22.17.02.34; author rse; state Exp; branches; next 1.7; commitid f1Zw4Lu12xpBvSFr; 1.7 date 2006.07.22.16.33.39; author rse; state Exp; branches; next 1.6; commitid 72VneHPW6QFFlSFr; 1.6 date 2006.07.22.16.16.23; author rse; state Exp; branches; next 1.5; commitid Q0GNj0b9we0LfSFr; 1.5 date 2006.07.22.15.40.04; author rse; state Exp; branches; next 1.4; commitid ply9UPjF1x8i3SFr; 1.4 date 2006.07.22.15.02.07; author rse; state Exp; branches; next 1.3; commitid GmjUFjJ3yPkhQRFr; 1.3 date 2006.07.22.14.03.51; author rse; state Exp; branches; next 1.2; commitid zacvxOkskU8iwRFr; 1.2 date 2006.07.22.13.48.03; author rse; state Exp; branches; next 1.1; commitid hQS8iSBKnNYRqRFr; 1.1 date 2006.07.22.11.04.43; author rse; state Exp; branches; next ; commitid DeAm5kOtHjOPwQFr; desc @@ 1.20 log @Add support for UTF-8 C strings in the API and internally by adding a --with-utf8 build-time options which builds the code with JS_C_STRINGS_ARE_UTF8. @ text @dnl ## dnl ## OSSP js - JavaScript Engine dnl ## Copyright (c) 1998-2006 Mozilla dnl ## dnl ## This file is part of OSSP js, a distribution of the Mozilla JavaScript dnl ## reference implementation, which can found at http://www.ossp.org/pkg/lib/js/ dnl ## dnl ## Permission to use, copy, modify, and distribute this software for dnl ## any purpose with or without fee is hereby granted, provided that dnl ## the above copyright notice and this permission notice appear in all dnl ## copies. dnl ## dnl ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED dnl ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF dnl ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. dnl ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR dnl ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, dnl ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT dnl ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF dnl ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND dnl ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, dnl ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT dnl ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF dnl ## SUCH DAMAGE. dnl ## dnl ## configure.ac: GNU Autoconf source script dnl ## AC_PREREQ(2.60) AC_INIT JS_VERSION=`./shtool version -l txt -d short VERSION` $ac_confdir/shtool echo -e \ "Configuring %BOSSP js%b (Mozilla JavaScript Engine), version %B${JS_VERSION}%b" AC_SUBST(JS_VERSION) AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_PROG_MAKE_SET AC_PROG_CC AC_CHECK_DEBUGGING AC_CHECK_VA_COPY AC_CHECK_LIB(nsl, gethostname) if test ".`echo $LIBS | grep nsl`" = .; then AC_CHECK_LIB(nsl, gethostbyname) fi AC_CHECK_LIB(socket, accept) AC_CHECK_LIB(m, floor) AC_CHECK_MEMBERS([struct stat.st_birthtime, struct stat.st_birthtimensec],,, [#include ]) CPPFLAGS="$CPPFLAGS -DOSSP" case "${host}" in *mingw* | *windows* | *winnt* ) CPPFLAGS="$CPPFLAGS -DXP_WIN" ;; * ) CPPFLAGS="$CPPFLAGS -DXP_UNIX" ;; esac CPPFLAGS="$CPPFLAGS -DEXPORT_JS_API" dnl # configure option --with-version AC_ARG_WITH([version], AC_HELP_STRING([--with-version], [build the run-time engine with JavaScript features only. Available versions are: ECMA-3, JS-1.5, JS-1.6 (default)]), [ac_cv_with_version=$withval], [ac_cv_with_version=no]) AC_CACHE_CHECK([whether to build the run-time engine with JavaScript features only], [ac_cv_with_version], [ac_cv_with_version=no]) case "$ac_cv_with_version" in dnl JS-1.0 ) CPPFLAGS="$CPPFLAGS -DJS_VERSION=100" ;; dnl JS-1.1 ) CPPFLAGS="$CPPFLAGS -DJS_VERSION=110" ;; dnl JS-1.2 ) CPPFLAGS="$CPPFLAGS -DJS_VERSION=120" ;; dnl JS-1.3 ) CPPFLAGS="$CPPFLAGS -DJS_VERSION=130" ;; dnl JS-1.4 ) CPPFLAGS="$CPPFLAGS -DJS_VERSION=140" ;; ECMA-3 ) CPPFLAGS="$CPPFLAGS -DJS_VERSION=148" ;; JS-1.5 ) CPPFLAGS="$CPPFLAGS -DJS_VERSION=150" ;; JS-1.6 ) CPPFLAGS="$CPPFLAGS -DJS_VERSION=160" ;; esac CLI_CPPFLAGS="" CLI_CFLAGS="" CLI_LDFLAGS="" CLI_LIBS="" CLI_OBJS="" dnl # configure option --with-editline[=path] AC_ARG_WITH([editline], AC_HELP_STRING([--with-editline], [build command line interface with line editing support via editline, libedit or GNU readline]), [ac_cv_with_editline=$withval], [ac_cv_with_editline=no]) AC_CACHE_CHECK([whether to build command line interface with line editing support], [ac_cv_with_editline], [ac_cv_with_editline=no]) if test ".$ac_cv_with_editline" != ".no"; then CLI_CPPFLAGS="$CLI_CPPFLAGS -DEDITLINE" case "$ac_cv_with_editline" in /* ) CLI_LDFLAGS="-L$ac_cv_with_editline" ;; esac OLD_LDFLAGS="$LDFLAGS"; OLD_LIBS="$LIBS"; LDFLAGS="$LDFLAGS $CLI_LDFLAGS" LIBS="" AC_SEARCH_LIBS(tcgetattr, termcap termlib curses ncurses) AC_SEARCH_LIBS(tputs, termcap termlib curses ncurses) TERM_LIBS="$LIBS" AC_SEARCH_LIBS(readline, editline edit readline,,, [$TERM_LIBS]) CLI_LIBS="$LIBS" LDFLAGS="$OLD_LDFLAGS" LIBS="$OLD_LIBS" fi dnl # configure option --with-perl AC_ARG_WITH([perl], AS_HELP_STRING([--with-perl], [build Perl-to-JS and JS-to-Perl bindings]), [ac_cv_with_perl=$withval], [ac_cv_with_perl=no]) AC_CACHE_CHECK([whether to build Perl-to-JS and JS-to-Perl bindings], [ac_cv_with_perl], [ac_cv_with_perl=no]) if test ".$ac_cv_with_perl" != ".no"; then WITH_PERL="yes" CLI_OBJS="$CLI_OBJS src/perlconnect/jsperl.o" CLI_CPPFLAGS="$CLI_CPPFLAGS -DPERLCONNECT" else WITH_PERL="no" fi AC_SUBST(WITH_PERL) case "$ac_cv_with_perl" in /* ) PERL="$ac_cv_with_perl" ;; esac AC_PATH_PROG(PERL, perl, NA) if test ".$ac_cv_with_perl" = ".yes" -a ".$PERL" = ".NA"; then AC_ERROR([required Perl interpreter not found in \$PATH]) fi if test ".$ac_cv_with_perl" != ".no"; then CLI_CFLAGS="$CLI_CFLAGS `$PERL -MExtUtils::Embed -e ccopts`" CLI_LIBS="$CLI_LIBS `$PERL -MExtUtils::Embed -e ldopts`" fi dnl # configure option --without-file AC_ARG_WITH([file], AS_HELP_STRING([--without-file], [build without File object (grants access to the filesystem)]), [ac_cv_with_file=$withval], [ac_cv_with_file=yes]) AC_CACHE_CHECK([whether to build with the File object], [ac_cv_with_file], [ac_cv_with_file=yes]) if test ".$ac_cv_with_file" = ".yes"; then CPPFLAGS="$CPPFLAGS -DJS_HAS_FILE_OBJECT" fi dnl # configure option --with-dso AC_ARG_WITH([dso], AS_HELP_STRING([--with-dso], [build without DSO object (allows run-time process extending)]), [ac_cv_with_dso=$withval], [ac_cv_with_dso=no]) AC_CACHE_CHECK([whether to build with the DSO object], [ac_cv_with_dso], [ac_cv_with_dso=no]) if test ".$ac_cv_with_dso" = ".yes"; then AC_CHECK_LIB(dl, dlopen) AC_CHECK_HEADER(dlfcn.h, , AC_ERROR([dlopen(3) header required])) AC_CHECK_FUNCS(dlopen dlclose dlerror, , AC_ERROR([dlopen(3) API functions dlopen/dlclose/dlerror required])) CPPFLAGS="$CPPFLAGS -DJS_HAS_DSO_OBJECT" CLI_LDFLAGS="$CLI_LDFLAGS -export-dynamic" fi dnl # configure option --with-utf8 AC_ARG_WITH([utf8], AS_HELP_STRING([--with-utf8], [build with exclusive UTF-8 C strings (uses Unicode UTF-8 encoded C strings only)]), [ac_cv_with_utf8=$withval], [ac_cv_with_utf8=no]) AC_CACHE_CHECK([whether to build with exclusive UTF-8 C string], [ac_cv_with_utf8], [ac_cv_with_utf8=no]) if test ".$ac_cv_with_utf8" = ".yes"; then CPPFLAGS="$CPPFLAGS -DJS_C_STRINGS_ARE_UTF8" fi AC_SUBST(CLI_CFLAGS) AC_SUBST(CLI_CPPFLAGS) AC_SUBST(CLI_LDFLAGS) AC_SUBST(CLI_LIBS) AC_SUBST(CLI_OBJS) with_tags="" sinclude(libtool.m4) AC_PROG_LIBTOOL AC_CONFIG_HEADERS(config.h) AC_CONFIG_FILES([Makefile js.pc js-config.sh src/perlconnect/Makefile.PL]) AC_OUTPUT @ 1.19 log @Add optional Dynamic Shared Object (DSO) support (see src/jsdso.[ch]). This comes in two flavors: 1. Provide two public C API functions... JSBool JS_DSOLoad (JSContext *cx, int *id, const char *filename); JSBool JS_DSOUnload (JSContext *cx, int id); ...as an ultra-thin wrapper around the POSIX dlopen(3) API. It especially mimics the BSD RTLD behaviour of calling pre-defined functions (mandatory "js_DSO_load" and optional "js_DSO_unload") inside the DSO after/before the dlopen/dlclose calls. This allows the DSOs to perform their init/shutdown actions. 2. Provide a small JavaScript global object "DSO" which binds the two public DSO C API functions into the JavaScript language as "DSO.load" and "DSO.unload". The "DSO" object can be created by the friend C API function js_InitDSOClass(). This function is used by the command-linne interface "js" by default. As a result the OSSP Mozilla JavaScript engine is now able to dynamically load C extensions similar to what other programming languages provide since a longer time. @ text @d154 9 @ 1.18 log @Be more clean and replace weak "#if JS_HAS_FILE_OBJECT" constructs with the stronger "#if defined(JS_HAS_FILE_OBJECT) && (JS_HAS_FILE_OBJECT - 0)" as the JS_HAS_FILE_OBJECT can be not defined at all (in contrast to other JS_HAS_XXXX defines which are all listed in src/jsconfig.h) @ text @d141 13 @ 1.17 log @Use Autoconf macros AC_CANONICAL_BUILD and AC_CANONICAL_HOST to make sure that the host identification is really available. Submitted by: Alfred Reibenschuh @ text @d138 1 a138 1 CPPFLAGS="$CPPFLAGS -DJS_HAS_FILE_OBJECT" @ 1.16 log @Add support for Windows CygWin and MinGW environments. @ text @d36 3 @ 1.15 log @Increase portability by gracefully downgrading the stat(2) use of st_birthtime to st_birthtimensec or even st_mtime. @ text @d50 6 a55 1 CPPFLAGS="$CPPFLAGS -DOSSP -DXP_UNIX -DEXPORT_JS_API" @ 1.14 log @Move definitions of XP_UNIX and EXPORT_JS_API back from jstypes.h to configure.ac (and this way the command-line) to not break the use of jstypes.h as a regular API header in JS based applications. @ text @d48 2 @ 1.13 log @o Install all src/js*.h headers during "make install" to allow applications to at least optionally poke around in the internals. This also allows an application to call js_InitFileClass() from without us having to really call this function in the standard API function JS_InitStandardClasses(). o Change the default of the --with-file/--without from --without-file to --with-file (enable the File object by default), but activate it only in the CLI (where it doesn't hurt and where it is actually really required to get something useful running there in practice) but explicitly _NOT_ in JS_InitStandardClasses() (as this is what would hurt the security in applications which assume that JS_InitStandardClasses() initialized only really the standard classes). @ text @d48 1 a48 1 CPPFLAGS="$CPPFLAGS -DOSSP" @ 1.12 log @add optional JS_HAS_FILE_OBJECT support without the need for NSPR (stdio is used instead) @ text @d122 1 a122 1 dnl # configure option --with-file d124 4 a127 4 AS_HELP_STRING([--with-file], [build with File object (grants access to the filesystem)]), [ac_cv_with_file=$withval], [ac_cv_with_file=no]) AC_CACHE_CHECK([whether to build with the File object], [ac_cv_with_file], [ac_cv_with_file=no]) if test ".$ac_cv_with_file" != ".no"; then @ 1.11 log @provide js-config script @ text @d122 9 @ 1.10 log @use the word distribution @ text @d31 1 a31 1 V=`./shtool version -l txt -d short VERSION` d33 2 a34 1 "Configuring %BOSSP js%b (Mozilla JavaScript Engine), version %B${V}%b" d133 1 a133 1 AC_CONFIG_FILES([Makefile js.pc src/perlconnect/Makefile.PL]) @ 1.9 log @more files, better versioning @ text @d5 1 a5 1 dnl ## This file is part of OSSP js, a repackaging of the Mozilla JavaScript @ 1.8 log @add va_copy Autoconf support and use this @ text @d31 1 a31 3 . VERSION V=`echo "${VERSION_JAVASCRIPT}:${VERSION_MOZILLA}:${VERSION_OSSP}" |\ sed -e 's;^\([[0-9]]\)\([[0-9]]\)[[^:]]*:FIREFOX_\([[0-9]]\)_\([[0-9]]\)[[^:]]*:\(.*\)$;\1.\2.\3.\4.\5;'` d33 1 a33 1 "Configuring %BOSSP js%b (JavaScript Engine), version %B${V}%b" @ 1.7 log @cleanup texts @ text @d40 2 @ 1.6 log @add support for building with particular feature sets @ text @d3 1 a3 2 dnl ## Copyright (c) 2006 Ralf S. Engelschall dnl ## Copyright (c) 2006 The OSSP Project d5 1 a5 1 dnl ## This file is part of OSSP js, a packaged version of the Mozilla JavaScript @ 1.5 log @improve Perl support @ text @d50 17 @ 1.4 log @add optional EDITLINE support @ text @d51 1 d54 3 d63 1 a63 1 CLI_CPPFLAGS="-DEDITLINE" d79 27 d109 1 d116 1 a116 1 AC_CONFIG_FILES([Makefile js.pc]) @ 1.3 log @improve versioning @ text @d50 29 @ 1.2 log @add more OSSP stuff @ text @d32 3 a34 1 V=`./shtool version -ltxt -dlong VERSION` @ 1.1 log @add our own files @ text @d39 6 d46 1 a46 2 CPPFLAGS="$CPPFLAGS -DXP_UNIX" CPPFLAGS="$CPPFLAGS -DNDEBUG" @