[Spice-commits] 5 commits - autogen.sh configure.ac NEWS SpiceXPI/Makefile.am SpiceXPI/src
Marc-André Lureau
elmarco at kemper.freedesktop.org
Fri Jan 27 08:11:33 PST 2012
NEWS | 5 +++
SpiceXPI/Makefile.am | 13 +++-------
SpiceXPI/src/plugin/Makefile.am | 27 +++++++++++----------
SpiceXPI/src/plugin/np_entry.cpp | 7 +++++
SpiceXPI/src/plugin/plugin.cpp | 7 +++++
autogen.sh | 13 ++++++++++
configure.ac | 49 ++++++++++++++++++++++++++++++---------
7 files changed, 89 insertions(+), 32 deletions(-)
New commits:
commit 9b964a0218568e35e42144114967e743786eb8cc
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Fri Jan 27 15:43:18 2012 +0100
Release v2.7
diff --git a/NEWS b/NEWS
index e69de29..36f9455 100644
--- a/NEWS
+++ b/NEWS
@@ -0,0 +1,5 @@
+spice-xpi 2.7
+=============
+
+- build fixes for newer and older xul
+- fix out of tree build
commit 3024396f3a6f5e8444f5d16ecd85c56c32ceb8bd
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Fri Jan 27 15:39:34 2012 +0100
build: deal with non-const return values of NPP_GetMIMEDescription()
Deal with const and non-const return value of NPP_GetMIMEDescription().
Although it is hard to find evidences of how this value is used, I
think the non-const value could return a static string. But I prefer
being on the safe side and return a strdup() to the risk of leaking
that string on older versions.
Fixes the build on RHEL6 with xulrunner-1.9.2.24-2.el6.
diff --git a/SpiceXPI/src/plugin/np_entry.cpp b/SpiceXPI/src/plugin/np_entry.cpp
index 021694c..4eba645 100644
--- a/SpiceXPI/src/plugin/np_entry.cpp
+++ b/SpiceXPI/src/plugin/np_entry.cpp
@@ -209,10 +209,17 @@ NPError NP_Initialize(NPNetscapeFuncs *aNPNFuncs, NPPluginFuncs *aNPPFuncs)
return NS_PluginInitialize();
}
+#ifdef NPAPI_USE_CONSTCHARS
const char *NP_GetMIMEDescription()
{
return NPP_GetMIMEDescription();
}
+#else
+char *NP_GetMIMEDescription()
+{
+ return NPP_GetMIMEDescription();
+}
+#endif
NPError NP_GetValue(void *future, NPPVariable aVariable, void *aValue)
{
diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index 2dada12..816ac63 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -106,10 +106,17 @@ namespace {
}
}
+#ifdef NPAPI_USE_CONSTCHARS
const char *NPP_GetMIMEDescription(void)
{
return const_cast<char *>(MIME_TYPES_DESCRIPTION.c_str());
}
+#else
+char *NPP_GetMIMEDescription(void)
+{
+ return strdup(MIME_TYPES_DESCRIPTION.c_str());
+}
+#endif
//////////////////////////////////////
//
diff --git a/configure.ac b/configure.ac
index 061ea56..42e130b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,34 @@ PKG_CHECK_MODULES(XUL, libxul-embedding >= 1.9 nspr >= 4.7.1)
AC_SUBST(XUL_CFLAGS)
AC_SUBST(XUL_LIBS)
+# test for const return value of NPP_GetMIMEDescription, based on gecko-mediaplayer
+AC_MSG_CHECKING([for const return value of NPP_GetMIMEDescription])
+oCFLAGS=$CFLAGS
+CFLAGS="$XUL_CFLAGS"
+AC_LANG_PUSH([C])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#ifndef XP_UNIX
+#define XP_UNIX 1
+#endif
+#include <npapi.h>
+#if NP_VERSION_MAJOR == 0 && NP_VERSION_MINOR < 27
+#error
+#else
+const char*NPP_GetMIMEDescription(void) {
+ return "test";
+}
+#endif
+],[
+const char *f=NPP_GetMIMEDescription();
+])],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([NPAPI_USE_CONSTCHARS],[1],[Define if NPAPI declares NPP_GetMIMEDescription as a const char*])
+],[
+ AC_MSG_RESULT([no])
+])
+AC_LANG_POP([C])
+CFLAGS=$oCFLAGS
+
# Find xpidl
XPIDL=`pkg-config --variable=libdir libxul`/xpidl
AM_CONDITIONAL([HAVE_XPIDL], [test -x "$XPIDL"])
commit 8d91018450eb01fcce0155be72815b80b9dbd5ae
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Thu Jan 26 19:18:45 2012 +0100
build: fix out-of-tree build
Fix out of tree build, and some minor clean-up.
diff --git a/SpiceXPI/Makefile.am b/SpiceXPI/Makefile.am
index 9f0ad0b..5cef195 100644
--- a/SpiceXPI/Makefile.am
+++ b/SpiceXPI/Makefile.am
@@ -3,13 +3,8 @@ SUBDIRS=src
XPI=SpiceXPI.xpi
EXTRA_DIST = logger.ini
-sharedir=/usr/share/spice
-share_DATA = \
- logger.ini \
- $(NULL)
-
-logger.ini :
- echo do nothing
+spicedatadir = $(datadir)/spice
+spicedata_DATA = logger.ini
DISTDIR=dist
ZIP=zip
@@ -19,10 +14,10 @@ all-local: SpiceXPI.xpi
CLEANFILES = SpiceXPI.xpi
SpiceXPI.xpi: $(top_builddir)/SpiceXPI/src/install.rdf $(top_builddir)/SpiceXPI/src/plugin/nsISpicec.xpt $(top_builddir)/SpiceXPI/src/plugin/.libs/libnsISpicec.so
- rm -rf dist
+ rm -rf $(DISTDIR)
@[ -d $(DISTDIR)/plugins ] || mkdir -p $(DISTDIR)/plugins
cp $(top_srcdir)/SpiceXPI/src/install.rdf $(DISTDIR)
- cp $(top_srcdir)/SpiceXPI/src/plugin/*.xpt $(DISTDIR)/plugins
+ cp $(top_builddir)/SpiceXPI/src/plugin/*.xpt $(DISTDIR)/plugins
cp $(top_builddir)/SpiceXPI/src/plugin/.libs/libnsISpicec.so* $(DISTDIR)/plugins/nsISpicec.so
cp $(top_srcdir)/SpiceXPI/logger.ini $(DISTDIR)/plugins/logger.ini
(cd $(DISTDIR); $(ZIP) -r ../$(XPI) .)
diff --git a/SpiceXPI/src/plugin/Makefile.am b/SpiceXPI/src/plugin/Makefile.am
index c6ba8f0..b2c83ab 100644
--- a/SpiceXPI/src/plugin/Makefile.am
+++ b/SpiceXPI/src/plugin/Makefile.am
@@ -81,3 +81,5 @@ BUILT_SOURCES = \
nsISpicec.xpt \
$(NULL)
+distclean-local:
+ rm -f $(BUILT_SOURCES)
commit 56975c0f4d51b7130ae46f933d3f7e9f45805b11
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Thu Jan 26 19:14:46 2012 +0100
build: add simple autogen.sh file
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..e5a152d
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e # exit on errors
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+mkdir -p "$srcdir"/m4
+
+autoreconf -vfi "$srcdir"
+
+if [ -z "$NOCONFIGURE" ]; then
+ "$srcdir"/configure --enable-maintainer-mode ${1+"$@"}
+fi
commit a234f6d223d43a2a90c5bec8036fd5f050640aab
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Thu Jan 26 19:14:13 2012 +0100
build: fix build on both rhel6/<f16 and f16
diff --git a/SpiceXPI/src/plugin/Makefile.am b/SpiceXPI/src/plugin/Makefile.am
index 1c3d3db..c6ba8f0 100644
--- a/SpiceXPI/src/plugin/Makefile.am
+++ b/SpiceXPI/src/plugin/Makefile.am
@@ -2,7 +2,6 @@ NULL =
EXTENSION_ID = SpiceXPI at redhat.com
FIREFOX_APPID = {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
extensiondir = $(libdir)/mozilla
-XPIDL_BIN = `pkg-config --variable=libdir libxul`/xpidl
SDK_INCLUDE_DIR = `pkg-config --variable=idldir libxul`
INCLUDES = \
@@ -63,20 +62,22 @@ libnsISpicec_la_SOURCES = \
npplat.h \
$(NULL)
-BUILT_SOURCEFILES = \
- nsISpicec.h \
- nsISpicec.xpt \
- $(NULL)
-
+if HAVE_XPIDL
nsISpicec.h: nsISpicec.idl
- $(XPIDL_BIN) -m header -I $(SDK_INCLUDE_DIR) $<
+ $(XPIDL) -m header -I $(SDK_INCLUDE_DIR) $<
nsISpicec.xpt: nsISpicec.idl
- $(XPIDL_BIN) -m typelib -I $(SDK_INCLUDE_DIR) $<
+ $(XPIDL) -m typelib -I $(SDK_INCLUDE_DIR) $<
+else
+nsISpicec.h: nsISpicec.idl
+ $(PYTHON) `pkg-config --variable=sdkdir libxul`/sdk/bin/header.py -I $(SDK_INCLUDE_DIR) $< -o $@
-BUILT_SOURCES = $(BUILT_SOURCEFILES)
+nsISpicec.xpt: nsISpicec.idl
+ $(PYTHON) `pkg-config --variable=sdkdir libxul`/sdk/bin/typelib.py -I $(SDK_INCLUDE_DIR) $< -o $@
+endif
-MAINTAINERCLEANFILES = \
- $(BUILT_SOURCEFILES)
+BUILT_SOURCES = \
+ nsISpicec.h \
+ nsISpicec.xpt \
+ $(NULL)
-EXTRA_DIST = nsISpicec.xpt
diff --git a/configure.ac b/configure.ac
index 46dc6c2..061ea56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ([2.57])
-AC_INIT(spice-xpi, [2.6], [], spice-xpi)
+AC_INIT(spice-xpi, [2.7], [], spice-xpi)
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])
@@ -47,16 +47,16 @@ AC_SUBST(XUL_CFLAGS)
AC_SUBST(XUL_LIBS)
# Find xpidl
-for i in `pkg-config --variable=libdir libxul`/xpidl ; do
- if test -x $i ; then
- XPIDL=$i
- fi
-done
-if test x"XPIDL" = x ; then
- AC_MSG_ERROR([Can't find xpidl based on libxulrunner .pc file])
-fi
+XPIDL=`pkg-config --variable=libdir libxul`/xpidl
+AM_CONDITIONAL([HAVE_XPIDL], [test -x "$XPIDL"])
AC_SUBST(XPIDL)
+if ! test -x "$XPIDL"; then
+ AM_PATH_PYTHON
+ AC_CHECK_FILE([`pkg-config --variable=sdkdir libxul`/sdk/bin/header.py])
+ AC_CHECK_FILE([`pkg-config --variable=sdkdir libxul`/sdk/bin/typelib.py])
+fi
+
XUL_INCLUDEDIR=`pkg-config --variable=includedir libxul`
XUL_IDLDIR=`pkg-config --variable=idldir libxul`
AC_SUBST(XUL_INCLUDEDIR)
@@ -68,9 +68,8 @@ PKG_CHECK_MODULES(XUL191,
have_xul191=yes,
have_xul191=no)
-AM_CONDITIONAL([HAVE_XUL191], [test "x$have_xul191" = "xyes"])
if test "x$have_xul191" = "xyes" ; then
- AC_DEFINE([HAVE_XUL191], [], [Define if we have libxul >= 1.9.1])
+ AC_DEFINE([HAVE_XUL191], [1], [Define if we have libxul >= 1.9.1])
fi
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
More information about the Spice-commits
mailing list