Icedtea-web f16

Deepak Bhole dbhole at redhat.com
Mon Dec 5 07:25:35 PST 2011


* Jiri Vanek <jvanek at redhat.com> [2011-11-22 07:10]:
> Hi!
> 
> I remember, then when new api for xulrunner reached fedoras, You have added icedtea-web-1.0.6-npapi-fix.patch to specfiles. Then you said (IIRC) that you will add it to sources, but you are not able to detect version correctly. How does this goes? Any progress?
> Compiling small program during  configure is not enough? Something similar (nasty) I have done at first when I was trying to make it compatible with rhel5?
> 

Hmm, missed this email.

The issue is that none of the npapi headers expose an API version. As a
result, there is no way to conditionally compile based on version. There
is a bug open for this:

http://code.google.com/p/npapi-sdk/issues/detail?id=10

Danesh is looking into a solution involving compiling a test program,
seeing it it fails and setting a flag accordingly. Adding him to cc:

Cheers,
Deepak

> Best Regards
>    J.

> diff -up ./plugin/icedteanp/IcedTeaNPPlugin.cc.sav ./plugin/icedteanp/IcedTeaNPPlugin.cc
> --- ./plugin/icedteanp/IcedTeaNPPlugin.cc.sav	2011-11-08 17:27:29.046520865 -0500
> +++ ./plugin/icedteanp/IcedTeaNPPlugin.cc	2011-11-08 17:27:40.469611421 -0500
> @@ -2262,7 +2262,7 @@ NP_Initialize (NPNetscapeFuncs* browserT
>  
>  // Returns a string describing the MIME type that this plugin
>  // handles.
> -char*
> +const char*
>  NP_GetMIMEDescription ()
>  {
>    PLUGIN_DEBUG ("NP_GetMIMEDescription\n");

> diff -r bd59947fa857 Makefile.am
> --- a/Makefile.am	Mon Aug 22 15:09:47 2011 -0400
> +++ b/Makefile.am	Thu Aug 25 11:41:59 2011 +0200
> @@ -208,9 +208,16 @@
>  		IcedTeaPluginUtils.o
>  
>  $(PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc
> +	if [ "$(GLIBCVERSION)" == "no" ] ; then \
> +	  RHEL5COMPATIBLE="-DRhel5Compatible" ;\
> +	else \
> +	  RHEL5COMPATIBLE="" ;\
> +	fi; \
> +	echo "rhel5comaptible="$$RHEL5COMPATIBLE ;\
>  	mkdir -p $(PLUGIN_DIR) && \
>  	cd $(PLUGIN_DIR) && \
>  	$(CXX) $(CXXFLAGS) \
> +	   $$RHEL5COMPATIBLE \
>  	  -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
>  	  -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \
>  	  -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \
> @@ -224,8 +231,15 @@
>  	  -fPIC -o $@ -c $<
>  
>  $(PLUGIN_DIR)/IcedTeaPlugin.so: $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS))
> +	if [ "$(GLIBCVERSION)" == "no" ] ; then \
> +	  RHEL5COMPATIBLE="-DRhel5Compatible";\
> +	else \
> +	  RHEL5COMPATIBLE=""; \
> +	fi; \
> +	echo "rhel5comaptible="$$RHEL5COMPATIBLE ;\
>  	cd $(PLUGIN_DIR) && \
>  	$(CXX) $(CXXFLAGS) \
> +	  $$RHEL5COMPATIBLE \
>  	  $(PLUGIN_OBJECTS) \
>  	  $(GLIB_LIBS) \
>  	  $(GTK_LIBS) \
> diff -r bd59947fa857 acinclude.m4
> --- a/acinclude.m4	Mon Aug 22 15:09:47 2011 -0400
> +++ b/acinclude.m4	Thu Aug 25 11:41:59 2011 +0200
> @@ -458,6 +458,34 @@
>  AC_SUBST(PKGVERSION)
>  ])
>  
> +AC_DEFUN_ONCE([IT_GET_GLIBCVERSION],
> +[
> +AC_MSG_CHECKING([for glibc  version >= 2.12])
> +AC_LANG_PUSH(C++)
> +CXXFLAGS_BACKUP=$CXXFLAGS
> +CXXFLAGS=$CXXFLAGS" "$GLIB_CFLAGS" "$GTK_CFLAGS" "$GLIB_LIBS" "$GTK_LIB
> +AC_TRY_LINK([
> +#include <glib.h>
> +],[
> +GHashTable* instance_to_id_map = g_hash_table_new(NULL, NULL);
> +GHashTableIter iter;
> +gpointer id, instance;
> +g_hash_table_iter_init (&iter, instance_to_id_map);
> +g_hash_table_iter_next (&iter, &instance, &id);
> +g_strcmp0 ("hell", "hello");
> +],[
> +AC_MSG_RESULT(yes)
> +GLIBCVERSION="yes"
> +],[
> +GLIBCVERSION="no"
> +])
> +CXXFLAGS=$CXXFLAGS_BACKUP
> +AC_LANG_POP(C++)
> +AC_MSG_RESULT([${GLIBCVERSION}])
> +AC_SUBST(GLIBCVERSION)
> +]
> +)
> +
>  AC_DEFUN([IT_CHECK_WITH_GCJ],
>  [
>    AC_MSG_CHECKING([whether to compile ecj natively])
> diff -r bd59947fa857 configure.ac
> --- a/configure.ac	Mon Aug 22 15:09:47 2011 -0400
> +++ b/configure.ac	Thu Aug 25 11:41:59 2011 +0200
> @@ -82,7 +82,7 @@
>  #
>  # Find optional depedencies
>  #
> -
> +IT_GET_GLIBCVERSION
>  IT_FIND_OPTIONAL_JAR([rhino], RHINO,
>      [/usr/share/java/js.jar /usr/share/rhino-1.6/lib/js.jar])
>  IT_FIND_OPTIONAL_JAR([junit], JUNIT,
> diff -r bd59947fa857 plugin/icedteanp/IcedTeaNPPlugin.cc
> --- a/plugin/icedteanp/IcedTeaNPPlugin.cc	Mon Aug 22 15:09:47 2011 -0400
> +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc	Thu Aug 25 11:41:59 2011 +0200
> @@ -47,6 +47,10 @@
>  #include <sys/types.h>
>  #include <unistd.h>
>  
> +#ifdef Rhel5Compatible
> +#include <glib.h>
> +#endif
> +
>  // Liveconnect extension
>  #include "IcedTeaScriptablePluginObject.h"
>  #include "IcedTeaNPPlugin.h"
> @@ -869,6 +873,16 @@
>    PLUGIN_DEBUG ("ITNP_URLNotify return\n");
>  }
>  
> +#ifdef Rhel5Compatible
> +// 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;
> +}
> +#endif
> +
>  NPError
>  get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len)
>  {
> @@ -913,19 +927,33 @@
>    // valid. So we just pick the first valid one and use it. Proxy/Cookie
>    // information is not instance specific anyway, it is URL specific.
>  
> +#ifdef Rhel5Compatible
>    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);
> +      g_hash_table_find(instance_to_id_map, (GHRFunc)find_first_item_in_hash_table, &instance);
>  
>        return browser_functions.getvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len);
>    } else
>    {
>        return NPERR_GENERIC_ERROR;
>    }
> +#else
> +  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);
> +
> +      return browser_functions.getvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len);
> +  } else
> +  {
> +      return NPERR_GENERIC_ERROR;
> +  }
> +#endif
>  
>  #endif
>  
> @@ -1363,21 +1391,38 @@
>  
>  #else
>  
> +#ifdef Rhel5Compatible
>    if (browser_functions.getvalueforurl)
>    {
>  
>        // 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);
> +      g_hash_table_find(instance_to_id_map, (GHRFunc)find_first_item_in_hash_table, &instance);
>  
>        browser_functions.getvalueforurl((NPP) instance, NPNURLVProxy, siteAddr, proxy, len);
>    } else
>    {
>        return NPERR_GENERIC_ERROR;
>    }
> +#else
> +  if (browser_functions.getvalueforurl)
> +  {
> +
> +      // 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);
> +
> +      browser_functions.getvalueforurl((NPP) instance, NPNURLVProxy, siteAddr, proxy, len);
> +  } else
> +  {
> +      return NPERR_GENERIC_ERROR;
> +  }
> +#endif
> +
>  #endif
>  
>    return NPERR_NO_ERROR;
> @@ -1403,6 +1448,17 @@
>    return FALSE;
>  }
>  
> +#ifdef Rhel5Compatible
> +int
> +strcmp0(char *str1, char *str2)
> +{
> +   if (str1 != NULL)
> +     return str2 != NULL ? strcmp(str1, str2) : 1;
> +   else // str1 == NULL
> +     return str2 != NULL ? 1 : 0;
> +}
> +#endif
> +
>  // remove all components from LD_LIBRARY_PATH, which start with
>  // MOZILLA_FIVE_HOME; firefox has its own NSS based security provider,
>  // which conflicts with the one configured in nss.cfg.
> @@ -1424,7 +1480,11 @@
>    components = g_strsplit (path_old, ":", -1);
>    for (i1 = 0, i2 = 0; components[i1] != NULL; i1++)
>      {
> +#ifdef Rhel5Compatible
> +      if (strcmp0 (components[i1], moz_home) == 0
> +#else
>        if (g_strcmp0 (components[i1], moz_home) == 0
> +#endif
>  	  || g_str_has_prefix (components[i1], moz_home))
>  	components[i2] = components[i1];
>        else




More information about the distro-pkg-dev mailing list