[Spice-devel] [PATCH spice-xpi 1/5] build: fix build on both rhel6/<f16 and f16

Marc-André Lureau marcandre.lureau at gmail.com
Fri Jan 27 06:45:10 PST 2012


---
 SpiceXPI/src/plugin/Makefile.am |   25 +++++++++++++------------
 configure.ac                    |   21 ++++++++++-----------
 2 files changed, 23 insertions(+), 23 deletions(-)

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])])
-- 
1.7.7.6



More information about the Spice-devel mailing list