aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2011-12-21 09:46:46 +0100
committerJiri Vanek <[email protected]>2011-12-21 09:46:46 +0100
commit684e9d8dc2e335ef808c2ed7df22d8ee3b801ea1 (patch)
tree8dcd9864ed77ffd09d297a29e127e59d7efd7eb2
parentd6072b8d9141bdcc3e4be09671780054bad89432 (diff)
Made compatible with both versions of xulrunner
-rw-r--r--ChangeLog10
-rw-r--r--acinclude.m420
-rw-r--r--configure.ac1
-rw-r--r--plugin/icedteanp/IcedTeaNPPlugin.cc6
4 files changed, 36 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index af6c79f..b34d7b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-12-21 Jiri Vanek <[email protected]>
+
+ * acinclude.m4: added definition of IT_CHECK_XULRUNNER_API_VERSION,
+ which tries to compile small program against new xulrunner api
+ * configure.ac: added call of IT_CHECK_XULRUNNER_API_VERSION
+ * 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.
+
2011-12-19 Danesh Dadachanji <[email protected]>
Fix for BasicService being used in applet constructors but not
diff --git a/acinclude.m4 b/acinclude.m4
index afbff9f..c819d0f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -495,6 +495,26 @@ AC_DEFUN_ONCE([IT_CHECK_GLIB_VERSION],[
PKG_CHECK_MODULES([GLIB2_V_216],[glib-2.0 >= 2.16],[],[AC_DEFINE([LEGACY_GLIB])])
])
+AC_DEFUN_ONCE([IT_CHECK_XULRUNNER_API_VERSION],
+[
+ AC_MSG_CHECKING([for legacy xulrunner api])
+ AC_LANG_PUSH(C++)
+ CXXFLAGS_BACKUP=$CXXFLAGS
+ CXXFLAGS=$CXXFLAGS" "$MOZILLA_CFLAGS
+ AC_TRY_COMPILE([
+ #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([IT_CHECK_WITH_GCJ],
[
AC_MSG_CHECKING([whether to compile ecj natively])
diff --git a/configure.ac b/configure.ac
index 2eef44e..ba61917 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,6 +81,7 @@ IT_CHECK_FOR_CLASS(COM_SUN_JNDI_TOOLKIT_URL_URLUTIL, [com.sun.jndi.toolkit.url.U
IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef])
IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE
IT_CHECK_GLIB_VERSION
+IT_CHECK_XULRUNNER_API_VERSION
#
# Find optional depedencies
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc
index 2192793..48a4378 100644
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc
@@ -2291,7 +2291,11 @@ NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable)
// Returns a string describing the MIME type that this plugin
// handles.
-char*
+#ifdef LEGACY_XULRUNNERAPI
+ char*
+#else
+ const char*
+#endif
NP_GetMIMEDescription ()
{
PLUGIN_DEBUG ("NP_GetMIMEDescription\n");