[Spice-devel] [PATCH spice-xpi 3/5] build: some clean-up
Alon Levy
alevy at redhat.com
Fri Feb 24 11:57:36 PST 2012
On Fri, Feb 24, 2012 at 03:20:23PM +0100, Marc-André Lureau wrote:
> - remove invalid or obsolete includes, variables
> - get rid of useless variables
> - make it more silent
> - shorten file location: /foo/baz/bar -> bar
> - prefer $(top_srcdir)/foo/bar vs ../../../foo/bar
> - remove useless configure check
The X86_64 configure check isn't used by anyone?
Daniel already Acked this, just a few unrelated questions below.
> - sort a few lines
> ---
> Makefile.am | 3 +-
> SpiceXPI/Makefile.am | 17 +++----
> SpiceXPI/src/plugin/Makefile.am | 102 ++++++++++++++++++--------------------
> configure.ac | 18 -------
> 4 files changed, 56 insertions(+), 84 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 934f055..6172c6e 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -3,6 +3,5 @@ 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 \
Do you have some macro for this or are you just tabulating by hand?
> $(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) $<
What's AM_V_GEN?
>
> 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/configure.ac b/configure.ac
> index 4c0f201..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
>
> --
> 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