diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | acinclude.m4 | 4 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | plugin/icedteanp/IcedTeaNPPlugin.cc | 53 |
5 files changed, 60 insertions, 12 deletions
@@ -1,3 +1,16 @@ +2011-09-01 Jiri Vanek<[email protected]> + Added functionality to allow icedtea web to be buildable with + rhel5 libraries. + *configure.ac: added IT_CHECK_GLIB_VERSION check. + *acinclude.m4: added IT_CHECK_GLIB_VERSION definition block to test. + version of glib installed and add LEGACY_GLIB define macro into + variable DEFS if version is <2.16. + *plugin/icedteanp/IcedTeaNPPlugin.cc: added replacements for incompatible + functions (g_strcmp0 and find_first_item_in_hash_table)if LEGACY_GLIB + is defined. Added define sections for use this function instead of glib ones. + Duplicated code moved into function getFirstInTableInstance(GHashTble* table). + *Makefile.am: ($(PLUGIN_DIR)/%.o): using DEFS setted by configure for compilation + 2011-08-29 Deepak Bhole <[email protected]> RH734081: Javaws cannot use proxy settings from Firefox diff --git a/Makefile.am b/Makefile.am index 9b8b1d9..69cbfc7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -210,6 +210,7 @@ $(PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc mkdir -p $(PLUGIN_DIR) && \ cd $(PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ + $(DEFS) \ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ diff --git a/acinclude.m4 b/acinclude.m4 index c5b9f4c..4d84244 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -484,6 +484,10 @@ AM_CONDITIONAL(HAS_PKGVERSION, test "x${PKGVERSION}" != "xnone") AC_SUBST(PKGVERSION) ]) +AC_DEFUN_ONCE([IT_CHECK_GLIB_VERSION],[ + PKG_CHECK_MODULES([GLIB2_V_216],[glib-2.0 >= 2.16],[],[AC_DEFINE([LEGACY_GLIB])]) + ]) + AC_DEFUN([IT_CHECK_WITH_GCJ], [ AC_MSG_CHECKING([whether to compile ecj natively]) diff --git a/configure.ac b/configure.ac index 077df01..7bcb100 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,7 @@ IT_CHECK_FOR_CLASS(SUN_MISC_REF, [sun.misc.Ref]) IT_CHECK_FOR_CLASS(COM_SUN_JNDI_TOOLKIT_URL_URLUTIL, [com.sun.jndi.toolkit.url.UrlUtil]) IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef]) IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE +IT_CHECK_GLIB_VERSION # # Find optional depedencies diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc index 77a297e..2192793 100644 --- a/plugin/icedteanp/IcedTeaNPPlugin.cc +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc @@ -249,6 +249,45 @@ int plugin_debug_suspend = (getenv("ICEDTEAPLUGIN_DEBUG") != NULL) && pthread_cond_t cond_message_available = PTHREAD_COND_INITIALIZER; + +#ifdef LEGACY_GLIB +// Returns key from first item stored in hashtable +gboolean +find_first_item_in_hash_table(gpointer key, gpointer value, gpointer user_data) +{ + user_data = key; + return (gboolean)TRUE; +} + +int +g_strcmp0(char *str1, char *str2) +{ + if (str1 != NULL) + return str2 != NULL ? strcmp(str1, str2) : 1; + else // str1 == NULL + return str2 != NULL ? 1 : 0; +} + + +#endif + + +/* + * Find first member in GHashTable* depending on version of glib + */ +gpointer getFirstInTableInstance(GHashTable* table) +{ + gpointer id, instance; + #ifndef LEGACY_GLIB + GHashTableIter iter; + g_hash_table_iter_init (&iter, table); + g_hash_table_iter_next (&iter, &instance, &id); + #else + g_hash_table_find(table, (GHRFunc)find_first_item_in_hash_table, &instance); + #endif + return instance; +} + // Functions prefixed by ITNP_ are instance functions. They are called // by the browser and operate on instances of ITNPPluginData. // Functions prefixed by plugin_ are static helper functions. @@ -915,12 +954,7 @@ get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len) if (browser_functions.getvalueforurl) { - GHashTableIter iter; - gpointer id, instance; - - g_hash_table_iter_init (&iter, instance_to_id_map); - g_hash_table_iter_next (&iter, &instance, &id); - + gpointer instance=getFirstInTableInstance(instance_to_id_map); return browser_functions.getvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len); } else { @@ -1367,12 +1401,7 @@ get_proxy_info(const char* siteAddr, char** proxy, uint32_t* len) { // As in get_cookie_info, we use the first active instance - GHashTableIter iter; - gpointer id, instance; - - g_hash_table_iter_init (&iter, instance_to_id_map); - g_hash_table_iter_next (&iter, &instance, &id); - + gpointer instance=getFirstInTableInstance(instance_to_id_map); browser_functions.getvalueforurl((NPP) instance, NPNURLVProxy, siteAddr, proxy, len); } else { |