summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2013-03-07 18:51:44 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2013-03-12 11:44:04 +0100
commite7776c27f43104cf564fc684369150d72c1248bf (patch)
tree5fc93b47efad851fdc6272faf7b5edd73d58ed6d
parenta719e69b8a2effc52db34f852ede867d8b7ef85d (diff)
Make spice.xpi build optional
Now that we switched to using the headers from npapi-sdk to build the spice-xpi plugin, the only reason we are depending on xulrunner is to build an xpi package for the plugin for easier installation in firefox. However, this .xpi is not installed by default nor packaged by distributions, so it's not in wide use. This commit makes its build optional as this has the side-effect on making the xulrunner dependency optional as well, which is a good thing as xulrunner is huge and not necessarily available on all platforms we'd like to build spice-xpi on.
-rw-r--r--SpiceXPI/Makefile.am2
-rw-r--r--SpiceXPI/src/plugin/Makefile.am7
-rw-r--r--configure.ac8
3 files changed, 16 insertions, 1 deletions
diff --git a/SpiceXPI/Makefile.am b/SpiceXPI/Makefile.am
index d4bf15a..de058b5 100644
--- a/SpiceXPI/Makefile.am
+++ b/SpiceXPI/Makefile.am
@@ -1,5 +1,6 @@
SUBDIRS = src
+if BUILD_XPI
spicedatadir = $(datadir)/spice
DISTDIR = dist
@@ -18,3 +19,4 @@ SpiceXPI.xpi: $(srcdir)/src/install.rdf src/plugin/nsISpicec.xpt src/plugin/.lib
distclean-local:
rm -rf $(DISTDIR)
+endif
diff --git a/SpiceXPI/src/plugin/Makefile.am b/SpiceXPI/src/plugin/Makefile.am
index 4e114ff..d5434e5 100644
--- a/SpiceXPI/src/plugin/Makefile.am
+++ b/SpiceXPI/src/plugin/Makefile.am
@@ -36,7 +36,6 @@ libnsISpicec_la_SOURCES = \
npn_gate.cpp \
npp_gate.cpp \
npplat.h \
- nsISpicec.h \
nsISpicec.idl \
nsScriptablePeer.cpp \
nsScriptablePeer.h \
@@ -48,6 +47,11 @@ libnsISpicec_la_SOURCES = \
pluginbase.h \
$(NULL)
+if BUILD_XPI
+libnsISpicec_la_SOURCES += \
+ nsISpicec.h \
+ $(NULL)
+
nsISpicec.h: nsISpicec.idl
$(AM_V_GEN)$(PYTHON) `pkg-config --variable=sdkdir libxul`/sdk/bin/header.py --cachedir . -I $(SDK_INCLUDE_DIR) $< -o $@
@@ -68,3 +72,4 @@ CLEANFILES = \
xpidlyacc.py \
xpidlyacc.pyc \
xpidl_debug
+endif
diff --git a/configure.ac b/configure.ac
index fa7a253..0ca271c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,11 @@ PKG_CHECK_MODULES(GLIB, glib-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
+AC_ARG_ENABLE([xpi],
+ [AS_HELP_STRING([--enable-xpi],
+ [Enable compilation of an xpi package])],
+ [], [enable_xpi=no])
+if test x"$enable_xpi" != xno; then
PKG_CHECK_MODULES(XUL, libxul-embedding >= 10)
AC_SUBST(XUL_CFLAGS)
AC_SUBST(XUL_LIBS)
@@ -36,6 +41,8 @@ XUL_INCLUDEDIR=`pkg-config --variable=includedir libxul`
XUL_IDLDIR=`pkg-config --variable=idldir libxul`
AC_SUBST(XUL_INCLUDEDIR)
AC_SUBST(XUL_IDLDIR)
+fi
+AM_CONDITIONAL([BUILD_XPI], [test x"$enable_xpi" != xno])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
@@ -65,6 +72,7 @@ AC_MSG_NOTICE([
XUL includes: ${XUL_INCLUDEDIR}
XUL IDL files: ${XUL_IDLDIR}
Build test page generator: ${enable_generator}
+ Build XPI package: ${enable_xpi}
Now type 'make' to build $PACKAGE
])