/hg/icedtea-web: Make it run with legacy and 27.0 xullrunner

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Fri Feb 21 06:41:47 PST 2014


changeset 8fda69bc5375 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=8fda69bc5375
author: Jiri Vanek <jvanek at redhat.com>
date: Fri Feb 21 15:41:34 2014 +0100

	Make it run with legacy and 27.0 xullrunner


diffstat:

 ChangeLog                           |  11 +++++++++
 acinclude.m4                        |  41 +++++++++++++++++++++++++++++++++++++
 configure.ac                        |   2 +
 plugin/icedteanp/IcedTeaNPPlugin.cc |   6 ++++-
 4 files changed, 59 insertions(+), 1 deletions(-)

diffs (97 lines):

diff -r 877209479c2f -r 8fda69bc5375 ChangeLog
--- a/ChangeLog	Thu Feb 20 11:25:01 2014 -0500
+++ b/ChangeLog	Fri Feb 21 15:41:34 2014 +0100
@@ -1,3 +1,14 @@
+2014-02-21  Jiri Vanek  <jvanek at redhat.com>
+
+	* acinclude.m4: added (IT_CHECK_XULRUNNER_API_VERSION_CONSTCHAR) macro,
+	Added (IT_CHECK_XULRUNNER_API_VERSION_C11) 
+	* configure.ac: added call of IT_CHECK_XULRUNNER_API_CONSTCHAR and
+	IT_CHECK_XULRUNNER_API_VERSION_C11
+	* plugin/icedteanp/IcedTeaNPPlugin.cc: (NP_GetMIMEDescription) 
+	return type set-up by dependency on defined LEGACY_XULRUNNERAPI.
+	 This one is set by IT_CHECK_XULRUNNER_API_VERSION during configure.
+	if defined, then old char* is used. New const char* is used otherwise.
+
 2014-02-20  Andrew Azores  <aazores at redhat.com>
 
 	New simplified PolicyEditor for editing Java policy files, particularly
diff -r 877209479c2f -r 8fda69bc5375 acinclude.m4
--- a/acinclude.m4	Thu Feb 20 11:25:01 2014 -0500
+++ b/acinclude.m4	Fri Feb 21 15:41:34 2014 +0100
@@ -520,6 +520,47 @@
    PKG_CHECK_MODULES([GLIB2_V_216],[glib-2.0 >= 2.16],[],[AC_DEFINE([LEGACY_GLIB])])
  ])
 
+AC_DEFUN_ONCE([IT_CHECK_XULRUNNER_MIMEDESCRIPTION_CONSTCHAR],
+[
+  AC_MSG_CHECKING([for legacy xulrunner api])
+  AC_LANG_PUSH(C++)
+  CXXFLAGS_BACKUP="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS"" ""$MOZILLA_CFLAGS"
+  AC_COMPILE_IFELSE([
+    #include <npfunctions.h>]
+    [const  char* NP_GetMIMEDescription ()
+    {return (char*) "yap!";}
+    ],[
+    AC_MSG_RESULT(no)
+    ],[
+    AC_MSG_RESULT(yes)
+    AC_DEFINE([LEGACY_XULRUNNERAPI])
+  ])
+  CXXFLAGS="$CXXFLAGS_BACKUP"
+  AC_LANG_POP(C++)
+])
+
+AC_DEFUN_ONCE([IT_CHECK_XULRUNNER_REQUIRES_C11],
+[
+  AC_MSG_CHECKING([for xulrunner enforcing C++11 standard])
+  AC_LANG_PUSH(C++)
+  CXXFLAGS_BACKUP="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS"" ""$MOZILLA_CFLAGS"
+  AC_COMPILE_IFELSE([
+    #include <npapi.h>
+    #include <npruntime.h>]
+    [void setnpptr (NPVariant *result)
+    {VOID_TO_NPVARIANT(*result);}
+    ],[
+    AC_MSG_RESULT(no)
+    CXXFLAGS="$CXXFLAGS_BACKUP"
+    ],[
+    AC_MSG_RESULT(yes)
+    CXXFLAGS="$CXXFLAGS_BACKUP -std=c++11"
+  ])
+  AC_LANG_POP(C++)
+])
+
 AC_DEFUN([IT_CHECK_WITH_GCJ],
 [
   AC_MSG_CHECKING([whether to compile ecj natively])
diff -r 877209479c2f -r 8fda69bc5375 configure.ac
--- a/configure.ac	Thu Feb 20 11:25:01 2014 -0500
+++ b/configure.ac	Fri Feb 21 15:41:34 2014 +0100
@@ -81,6 +81,8 @@
 IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef])
 IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE
 IT_CHECK_GLIB_VERSION
+IT_CHECK_XULRUNNER_MIMEDESCRIPTION_CONSTCHAR
+IT_CHECK_XULRUNNER_REQUIRES_C11
 
 #
 # Find optional depedencies
diff -r 877209479c2f -r 8fda69bc5375 plugin/icedteanp/IcedTeaNPPlugin.cc
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc	Thu Feb 20 11:25:01 2014 -0500
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc	Fri Feb 21 15:41:34 2014 +0100
@@ -2079,7 +2079,11 @@
 // Returns a string describing the MIME type that this plugin
 // handles.
 __attribute__ ((visibility ("default")))
-const char*
+#ifdef LEGACY_XULRUNNERAPI
+  char* 
+#else
+  const char* 
+#endif
 NP_GetMIMEDescription ()
 {
   //this function is called severaltimes between lunches


More information about the distro-pkg-dev mailing list