[Spice-devel] [PATCH spice-xpi 2/4] build: use spice-protocol as a submodule
Alon Levy
alevy at redhat.com
Fri Feb 24 03:05:51 PST 2012
On Fri, Feb 24, 2012 at 11:54:36AM +0100, Marc-André Lureau wrote:
Is it just me or does this patch do way more then the subject says? I
don't feel I can review it the way it is.
> ---
> .gitmodules | 3 +
> Makefile.am | 4 +-
> SpiceXPI/Makefile.am | 17 +++----
> SpiceXPI/src/plugin/Makefile.am | 102 ++++++++++++++++++--------------------
> autogen.sh | 3 +
> configure.ac | 21 +-------
> spice-protocol | 1 +
> 7 files changed, 66 insertions(+), 85 deletions(-)
> create mode 100644 .gitmodules
> create mode 160000 spice-protocol
>
> diff --git a/.gitmodules b/.gitmodules
> new file mode 100644
> index 0000000..14b3beb
> --- /dev/null
> +++ b/.gitmodules
> @@ -0,0 +1,3 @@
> +[submodule "spice-protocol"]
> + path = spice-protocol
> + url = ./spice-protocol
> diff --git a/Makefile.am b/Makefile.am
> index b811df8..6172c6e 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1,7 +1,7 @@
> ACLOCAL_AMFLAGS = -I m4
>
> SUBDIRS = SpiceXPI data
> +DIST_SUBDIRS = spice-protocol $(SUBDIRS)
>
> -EXTRA_DIST = \
> - m4
> +EXTRA_DIST = m4
>
> diff --git a/SpiceXPI/Makefile.am b/SpiceXPI/Makefile.am
> index 5cef195..a2dee55 100644
> --- a/SpiceXPI/Makefile.am
> +++ b/SpiceXPI/Makefile.am
> @@ -1,26 +1,23 @@
> SUBDIRS=src
>
> -XPI=SpiceXPI.xpi
> -
> EXTRA_DIST = logger.ini
> spicedatadir = $(datadir)/spice
> spicedata_DATA = logger.ini
>
> DISTDIR=dist
> -ZIP=zip
>
> 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 $(DISTDIR)
> +SpiceXPI.xpi: $(srcdir)/src/install.rdf src/plugin/nsISpicec.xpt src/plugin/.libs/libnsISpicec.so
> + $(AM_V_GEN)rm -rf $(DISTDIR)
> @[ -d $(DISTDIR)/plugins ] || mkdir -p $(DISTDIR)/plugins
> - cp $(top_srcdir)/SpiceXPI/src/install.rdf $(DISTDIR)
> - 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) .)
> + @cp $(srcdir)/src/install.rdf $(DISTDIR)
> + @cp src/plugin/*.xpt $(DISTDIR)/plugins
> + @cp src/plugin/.libs/libnsISpicec.so $(DISTDIR)/plugins/nsISpicec.so
> + @cp $(srcdir)/logger.ini $(DISTDIR)/plugins/logger.ini
> + @(cd $(DISTDIR); zip -q -r ../$@ .)
>
> distclean-local:
> rm -rf $(DISTDIR)
> diff --git a/SpiceXPI/src/plugin/Makefile.am b/SpiceXPI/src/plugin/Makefile.am
> index 0bb28fe..e409d94 100644
> --- a/SpiceXPI/src/plugin/Makefile.am
> +++ b/SpiceXPI/src/plugin/Makefile.am
> @@ -4,20 +4,16 @@ FIREFOX_APPID = {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
> extensiondir = $(libdir)/mozilla
> SDK_INCLUDE_DIR = `pkg-config --variable=idldir libxul`
>
> -INCLUDES = \
> - $(XUL_CFLAGS) \
> - $(SPICE_PROTOCOL_CFLAGS) \
> - -I$(top_srcdir)/common \
> - -I.. \
> - -I$(top_srcdir)/red \
> - -I$(top_srcdir)/red/$(red_target)\
> - $(QCAIRO_CFLAGS) \
> - $(LOG4CPP_CFLAGS) \
> - -DCAIRO_CANVAS_ACCESS_TEST \
> - -DCAIRO_CANVAS_CACHE \
> - -DCAIRO_CANVAS_NO_CHUNKS \
> - -DXP_UNIX \
> - -DMOZILLA_INTERNAL_API \
> +INCLUDES = \
> + -I$(top_srcdir)/common \
> + $(XUL_CFLAGS) \
> + $(SPICE_PROTOCOL_CFLAGS) \
> + $(LOG4CPP_CFLAGS) \
> + -DCAIRO_CANVAS_ACCESS_TEST \
> + -DCAIRO_CANVAS_CACHE \
> + -DCAIRO_CANVAS_NO_CHUNKS \
> + -DMOZILLA_INTERNAL_API \
> + -DXP_UNIX \
> $(NULL)
>
> plugindir=$(extensiondir)/plugins
> @@ -25,55 +21,53 @@ plugindir=$(extensiondir)/plugins
> plugin_LTLIBRARIES = libnsISpicec.la
>
> libnsISpicec_la_LDFLAGS = -avoid-version -module
> -libnsISpicec_la_CPPFLAGS = \
> - $(AM_CPPFLAGS) \
> - -I $(XUL_INCLUDEDIR) \
> - -I $(XUL_INCLUDEDIR)/dom \
> - -I $(XUL_INCLUDEDIR)/necko \
> - -I $(XUL_INCLUDEDIR)/plugin \
> - -I $(XUL_INCLUDEDIR)/string \
> +libnsISpicec_la_CPPFLAGS = \
> + -I $(XUL_INCLUDEDIR) \
> + -I $(XUL_INCLUDEDIR)/dom \
> + -I $(XUL_INCLUDEDIR)/necko \
> + -I $(XUL_INCLUDEDIR)/plugin \
> + -I $(XUL_INCLUDEDIR)/string \
> $(NULL)
>
> -libnsISpicec_la_LIBADD = \
> - $(QCAIRO_LIBS) \
> - $(LOG4CPP_LIBS) \
> - $(XUL_LIBS) \
> +libnsISpicec_la_LIBADD = \
> + $(LOG4CPP_LIBS) \
> + $(XUL_LIBS) \
> $(NULL)
>
> -libnsISpicec_la_SOURCES = \
> - np_entry.cpp \
> - npn_gate.cpp \
> - npp_gate.cpp \
> - nsScriptablePeer.h \
> - nsScriptablePeer.cpp \
> - nsScriptablePeerBase.h \
> - nsScriptablePeerBase.cpp \
> - pluginbase.h \
> - pluginbase.cpp \
> - plugin.h \
> - plugin.cpp \
> - nsISpicec.h \
> - controller.cpp \
> - debug.h \
> - controller.h \
> - ../../../common/rederrorcodes.h \
> - ../../../common/common.h \
> - nsISpicec.idl \
> - npplat.h \
> +libnsISpicec_la_SOURCES = \
> + $(top_srcdir)/common/common.h \
> + $(top_srcdir)/common/rederrorcodes.h \
> + controller.cpp \
> + controller.h \
> + debug.h \
> + np_entry.cpp \
> + npn_gate.cpp \
> + npp_gate.cpp \
> + npplat.h \
> + nsISpicec.h \
> + nsISpicec.idl \
> + nsScriptablePeer.cpp \
> + nsScriptablePeer.h \
> + nsScriptablePeerBase.cpp \
> + nsScriptablePeerBase.h \
> + plugin.cpp \
> + plugin.h \
> + pluginbase.cpp \
> + pluginbase.h \
> $(NULL)
>
> if HAVE_XPIDL
> nsISpicec.h: nsISpicec.idl
> - $(XPIDL) -m header -I $(SDK_INCLUDE_DIR) $<
> + $(AM_V_GEN)$(XPIDL) -m header -I $(SDK_INCLUDE_DIR) $<
>
> nsISpicec.xpt: nsISpicec.idl
> - $(XPIDL) -m typelib -I $(SDK_INCLUDE_DIR) $<
> + $(AM_V_GEN)$(XPIDL) -m typelib -I $(SDK_INCLUDE_DIR) $<
> else
> nsISpicec.h: nsISpicec.idl
> - $(PYTHON) `pkg-config --variable=sdkdir libxul`/sdk/bin/header.py --cachedir . -I $(SDK_INCLUDE_DIR) $< -o $@
> + $(AM_V_GEN)$(PYTHON) `pkg-config --variable=sdkdir libxul`/sdk/bin/header.py --cachedir . -I $(SDK_INCLUDE_DIR) $< -o $@
>
> nsISpicec.xpt: nsISpicec.idl
> - $(PYTHON) `pkg-config --variable=sdkdir libxul`/sdk/bin/typelib.py --cachedir . -I $(SDK_INCLUDE_DIR) $< -o $@
> + $(AM_V_GEN)$(PYTHON) `pkg-config --variable=sdkdir libxul`/sdk/bin/typelib.py --cachedir . -I $(SDK_INCLUDE_DIR) $< -o $@
> endif
>
> BUILT_SOURCES = \
> @@ -84,9 +78,9 @@ BUILT_SOURCES = \
> distclean-local:
> rm -f $(BUILT_SOURCES)
>
> -CLEANFILES = \
> - xpidllex.py \
> - xpidllex.pyc \
> - xpidlyacc.py \
> - xpidlyacc.pyc \
> +CLEANFILES = \
> + xpidllex.py \
> + xpidllex.pyc \
> + xpidlyacc.py \
> + xpidlyacc.pyc \
> xpidl_debug
> diff --git a/autogen.sh b/autogen.sh
> index e5a152d..1932e04 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -6,6 +6,9 @@ test -z "$srcdir" && srcdir=.
>
> mkdir -p "$srcdir"/m4
>
> +git submodule init
> +git submodule update
> +
> autoreconf -vfi "$srcdir"
>
> if [ -z "$NOCONFIGURE" ]; then
> diff --git a/configure.ac b/configure.ac
> index eefb354..cb16269 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -15,24 +15,6 @@ AC_CANONICAL_HOST
> AC_PROG_LIBTOOL
> AM_PROG_CC_C_O
>
> -# Check for the CPU we are using
> -#
> -AC_MSG_CHECKING(for x86 or x86-64 platform)
> -case $host_cpu in
> - i386|i486|i586|i686|i786|k6|k7)
> - variant=32
> - ;;
> - x86_64)
> - variant=64
> - ;;
> - *)
> - AC_MSG_RESULT(no)
> - echo Only x86 and x86-64 are supported
> - exit 1
> -esac
> -AC_MSG_RESULT($variant bit)
> -AM_CONDITIONAL([X86_64], [test "$variant" = 64])
> -
> dnl =========================================================================
> dnl Check deps
>
> @@ -40,7 +22,8 @@ PKG_CHECK_MODULES(LOG4CPP, log4cpp)
> AC_SUBST(LOG4CPP_CFLAGS)
> AC_SUBST(LOG4CPP_LIBS)
>
> -PKG_CHECK_MODULES(SPICE_PROTOCOL, spice-protocol >= 0.10.2)
> +AC_CONFIG_SUBDIRS([spice-protocol])
> +SPICE_PROTOCOL_CFLAGS='-I ${top_srcdir}/spice-protocol'
> AC_SUBST(SPICE_PROTOCOL_CFLAGS)
>
> # The explicit nspr dep is needed because libxul-embedding
> diff --git a/spice-protocol b/spice-protocol
> new file mode 160000
> index 0000000..d5edafd
> --- /dev/null
> +++ b/spice-protocol
> @@ -0,0 +1 @@
> +Subproject commit d5edafd28ab762b1b5f663aec449d3e3743f1184
> --
> 1.7.7.6
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list