From: Darren S. <li...@yo...> - 2012-02-20 18:46:03
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1329763537 0 # Node ID 2013d1cd46594e19c2710247052068286a0ad90b # Branch default # Parent 05a8a46e1bd02be6d608d7f60c7911450437aae6 Fix up build for Firefox 10's libmozjs. A STABLE libmozjs ABI, or at least a backward-compatible API, would be good... diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 0.5.907: 2012-??-?? - * Fix compilation with that nice stable API in libmozjs. This time - it's a jsval change in Firefox 9 which is to blame. + * Fix compilation with that nice stable API in libmozjs. + - There's a jsval change in Firefox 9. + - Firefox 10 drops JSFloat64 (looks like cleanup). * Fix a build failure which occurs when how to retrieve certain HAL properties isn't known. (Observed on Debian hurd-i386.) * Quiet build (with automake 1.11 or later). --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -453,6 +453,11 @@ AM_CONDITIONAL(HAVE_GETOPT_LONG, test x"$ac_getopt_long" = "xyes") dnl --------------------------------------------- +dnl That nice stable libmozjs API... :-( +dnl --------------------------------------------- +GXINE_JS_CHECK_TYPES + +dnl --------------------------------------------- dnl Miscellaneous build flags dnl --------------------------------------------- --git a/m4/_js.m4 b/m4/_js.m4 --- a/m4/_js.m4 +++ b/m4/_js.m4 @@ -214,3 +214,20 @@ fi AC_SUBST(NSPR_CFLAGS) ]) + +AC_DEFUN([GXINE_JS_CHECK_TYPES], + [JSFLOAT64=n + AC_MSG_CHECKING([for JSFloat64]) + SAVED_CFLAGS="$CFLAGS" + CFLAGS="$JS_CFLAGS $CFLAGS" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <jsapi.h>]], + [[JSFloat64 test = 0.0;]] + )], + [AC_DEFINE([HAVE_JSFLOAT64], [1], [Define if JSFloat64 is declared]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])], + ) + CFLAGS="$SAVED_CFLAGS" + ]) --git a/src/script_engine.h b/src/script_engine.h --- a/src/script_engine.h +++ b/src/script_engine.h @@ -34,6 +34,11 @@ #include <jsapi.h> #include <pthread.h> +// nice stable mozjs API +#ifndef HAVE_JSFLOAT64 +typedef jsdouble JSFloat64; +#endif + #ifndef JSFUN_FAST_NATIVE // All natives are JSFastNative #define JSFUN_FAST_NATIVE 0 |