diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-02-22 21:28:25 +0000 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-04-18 23:12:52 +0100 |
commit | aacaf147b62e121d23dad3bea9053a5801e52cbd (patch) | |
tree | 9f2a816c1fb3c4f3f880cf03565376100f9efbfe | |
parent | ec82339984d5d61774ab4a905f60b43abeb53583 (diff) | |
download | telepathy-glib-aacaf147b62e121d23dad3bea9053a5801e52cbd.tar.gz |
Moved tp-glib to use shave and made make output legible.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | examples/extensions/Makefile.am | 28 | ||||
-rw-r--r-- | m4/Makefile.am | 3 | ||||
-rw-r--r-- | m4/shave.m4 | 77 | ||||
-rw-r--r-- | shave-libtool.in | 69 | ||||
-rw-r--r-- | shave.in | 79 | ||||
-rw-r--r-- | telepathy-glib/Makefile.am | 32 | ||||
-rw-r--r-- | tests/dbus/Makefile.am | 8 | ||||
-rw-r--r-- | tools/Makefile.am | 22 |
10 files changed, 286 insertions, 38 deletions
diff --git a/.gitignore b/.gitignore index f0607525f..77cdda986 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,5 @@ tests/test-* tests/tools/actual.h tests/tools/actual-body.h tools/telepathy-glib-env +shave +shave-libtool
\ No newline at end of file diff --git a/configure.ac b/configure.ac index ad1eab0a1..72ef375c7 100644 --- a/configure.ac +++ b/configure.ac @@ -194,6 +194,8 @@ if test -z "$NM"; then fi AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], [test $HAVE_LD_VERSION_SCRIPT = yes]) +SHAVE_INIT(.) + AC_OUTPUT( Makefile \ docs/Makefile \ docs/reference/Makefile \ @@ -218,4 +220,6 @@ AC_OUTPUT( Makefile \ tests/tools/Makefile \ tools/Makefile \ m4/Makefile \ + shave \ + shave-libtool ) diff --git a/examples/extensions/Makefile.am b/examples/extensions/Makefile.am index 52aa58fb2..84b304140 100644 --- a/examples/extensions/Makefile.am +++ b/examples/extensions/Makefile.am @@ -7,6 +7,10 @@ # class, or by omitting those options entirely we could have made an extension # that will work on TpProxy or any subclass of TpProxy. +V = @ +Q = $(V:1=) +QUIET_GEN = $(Q:@=@echo ' GEN '$@;) + tools_dir = $(top_srcdir)/tools AM_CFLAGS = \ @@ -66,43 +70,43 @@ XSLTPROCFLAGS = --nonet --novalid _gen/all.xml: all.xml $(wildcard *.xml) $(tools_dir)/xincludator.py $(mkdir_p) _gen - $(PYTHON) $(tools_dir)/xincludator.py $< > $@ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ extensions.html: _gen/all.xml $(tools_dir)/doc-generator.xsl - $(XSLTPROC) $(XSLTPROCFLAGS) \ + $(QUIET_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ $(tools_dir)/doc-generator.xsl \ $< > $@ _gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \ $(top_srcdir)/tools/glib-gtypes-generator.py - $(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ + $(QUIET_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ $< _gen/gtypes Example _gen/signals-marshal.list: _gen/all.xml \ $(tools_dir)/glib-signals-marshal-gen.py - $(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@ _gen/signals-marshal.h: _gen/signals-marshal.list Makefile.am - $(GLIB_GENMARSHAL) --header --prefix=_example_ext_marshal $< > $@ + $(QUIET_GEN)$(GLIB_GENMARSHAL) --header --prefix=_example_ext_marshal $< > $@ _gen/signals-marshal.c: _gen/signals-marshal.list Makefile.am - { echo '#include "_gen/signals-marshal.h"' && \ + $(QUIET_GEN){ echo '#include "_gen/signals-marshal.h"' && \ $(GLIB_GENMARSHAL) --body --prefix=_example_ext_marshal $< ; } > $@ _gen/register-dbus-glib-marshallers-body.h: _gen/all.xml \ $(tools_dir)/glib-client-marshaller-gen.py - $(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \ _example_ext > $@ _gen/enums.h: _gen/all.xml \ $(tools_dir)/c-constants-gen.py - $(PYTHON) $(tools_dir)/c-constants-gen.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py \ Example \ $< > $@ _gen/interfaces-body.h _gen/interfaces.h: _gen/all.xml \ $(tools_dir)/glib-interfaces-gen.py - $(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ Example _gen/interfaces-body.h _gen/interfaces.h $< # Generated files which must be generated per "category". Each TpProxy @@ -111,11 +115,11 @@ _gen/interfaces-body.h _gen/interfaces.h: _gen/all.xml \ _gen/connection.xml: connection.xml $(wildcard *.xml) $(tools_dir)/xincludator.py $(mkdir_p) _gen - $(PYTHON) $(tools_dir)/xincludator.py $< > $@ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ _gen/cli-connection-body.h _gen/cli-connection.h: _gen/connection.xml \ $(tools_dir)/glib-client-gen.py - $(PYTHON) $(tools_dir)/glib-client-gen.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ --group=connection \ --subclass=TpConnection \ --subclass-assert=TP_IS_CONNECTION \ @@ -125,7 +129,7 @@ _gen/cli-connection-body.h _gen/cli-connection.h: _gen/connection.xml \ _gen/svc-connection.c _gen/svc-connection.h: _gen/connection.xml \ $(tools_dir)/glib-ginterface-gen.py - $(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/svc-connection \ --signal-marshal-prefix=_example_ext \ --include='<telepathy-glib/dbus.h>' \ diff --git a/m4/Makefile.am b/m4/Makefile.am index e04d0cb39..e72117c91 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -3,4 +3,5 @@ compiler.m4 \ gtk-doc.m4 \ linker.m4 \ tp-compiler-flag.m4 \ -tp-compiler-warnings.m4 +tp-compiler-warnings.m4 \ +shave.m4 diff --git a/m4/shave.m4 b/m4/shave.m4 new file mode 100644 index 000000000..0a3509e59 --- /dev/null +++ b/m4/shave.m4 @@ -0,0 +1,77 @@ +dnl Make automake/libtool output more friendly to humans +dnl Damien Lespiau <damien.lespiau@gmail.com> +dnl +dnl SHAVE_INIT([shavedir],[default_mode]) +dnl +dnl shavedir: the directory where the shave scripts are, it defaults to +dnl $(top_builddir) +dnl default_mode: (enable|disable) default shave mode. This parameter +dnl controls shave's behaviour when no option has been +dnl given to configure. It defaults to disable. +dnl +dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just +dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and +dnl LIBTOOL, you don't want the configure tests to have these variables +dnl re-defined. +dnl * This macro requires GNU make's -s option. + +AC_DEFUN([_SHAVE_ARG_ENABLE], +[ + AC_ARG_ENABLE([shave], + AS_HELP_STRING( + [--enable-shave], + [use shave to make the build pretty [[default=$1]]]),, + [enable_shave=$1] + ) +]) + +AC_DEFUN([SHAVE_INIT], +[ + dnl you can tweak the default value of enable_shave + m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)]) + + if test x"$enable_shave" = xyes; then + dnl where can we find the shave scripts? + m4_if([$1],, + [shavedir="$ac_pwd"], + [shavedir="$ac_pwd/$1"]) + AC_SUBST(shavedir) + + dnl make is now quiet + AC_SUBST([MAKEFLAGS], [-s]) + AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`']) + + dnl we need sed + AC_CHECK_PROG(SED,sed,sed,false) + + dnl substitute libtool + SHAVE_SAVED_LIBTOOL=$LIBTOOL + LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'" + AC_SUBST(LIBTOOL) + + dnl substitute cc/cxx + SHAVE_SAVED_CC=$CC + SHAVE_SAVED_CXX=$CXX + SHAVE_SAVED_FC=$FC + SHAVE_SAVED_F77=$F77 + SHAVE_SAVED_OBJC=$OBJC + CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}" + CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}" + FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}" + F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}" + OBJC="${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}" + AC_SUBST(CC) + AC_SUBST(CXX) + AC_SUBST(FC) + AC_SUBST(F77) + AC_SUBST(OBJC) + + V=@ + else + V=1 + fi + Q='$(V:1=)' + AC_SUBST(V) + AC_SUBST(Q) +]) + diff --git a/shave-libtool.in b/shave-libtool.in new file mode 100644 index 000000000..1f3a720c1 --- /dev/null +++ b/shave-libtool.in @@ -0,0 +1,69 @@ +#!/bin/sh + +# we need sed +SED=@SED@ +if test -z "$SED" ; then +SED=sed +fi + +lt_unmangle () +{ + last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` +} + +# the real libtool to use +LIBTOOL="$1" +shift + +# if 1, don't print anything, the underlaying wrapper will do it +pass_though=0 + +# scan the arguments, keep the right ones for libtool, and discover the mode +preserved_args= +while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --mode=*) + mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` + preserved_args="$preserved_args $opt" + ;; + -o) + lt_output="$1" + preserved_args="$preserved_args $opt" + ;; + *) + preserved_args="$preserved_args $opt" + ;; + esac +done + +case "$mode" in +compile) + # shave will be called and print the actual CC/CXX/LINK line + preserved_args="$preserved_args --shave-mode=$mode" + pass_though=1 + ;; +link) + preserved_args="$preserved_args --shave-mode=$mode" + Q=" LINK " + ;; +*) + # let's u + # echo "*** libtool: Unimplemented mode: $mode, fill a bug report" + ;; +esac + +lt_unmangle "$lt_output" +output=$last_result + +if test -z $V; then + if test $pass_though -eq 0; then + echo "$Q$output" + fi + $LIBTOOL --silent $preserved_args +else + echo $LIBTOOL $preserved_args + $LIBTOOL $preserved_args +fi diff --git a/shave.in b/shave.in new file mode 100644 index 000000000..5c16f27ae --- /dev/null +++ b/shave.in @@ -0,0 +1,79 @@ +#!/bin/sh + +# we need sed +SED=@SED@ +if test -z "$SED" ; then +SED=sed +fi + +lt_unmangle () +{ + last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` +} + +# the tool to wrap (cc, cxx, ar, ranlib, ..) +tool="$1" +shift + +# the reel tool (to call) +REEL_TOOL="$1" +shift + +pass_through=0 +preserved_args= +while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --shave-mode=*) + mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` + ;; + -o) + lt_output="$1" + preserved_args="$preserved_args $opt" + ;; + *) + preserved_args="$preserved_args $opt" + ;; + esac +done + +# mode=link is handled in the libtool wrapper +case "$mode,$tool" in +link,*) + pass_through=1 + ;; +*,cxx) + Q=" CXX " + ;; +*,cc) + Q=" CC " + ;; +*,fc) + Q=" FC " + ;; +*,f77) + Q=" F77 " + ;; +*,objc) + Q=" OBJC " + ;; +*,*) + # should not happen + Q=" CC " + ;; +esac + +lt_unmangle "$lt_output" +output=$last_result + +if test -z $V; then + if test $pass_through -eq 0; then + echo "$Q$output" + fi + $REEL_TOOL $preserved_args +else + echo $REEL_TOOL $preserved_args + $REEL_TOOL $preserved_args +fi diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am index c243e19c7..5285a2bb2 100644 --- a/telepathy-glib/Makefile.am +++ b/telepathy-glib/Makefile.am @@ -1,3 +1,7 @@ +V = @ +Q = $(V:1=) +QUIET_GEN = $(Q:@=@echo ' GEN '$@;) + tpgincludedir=$(includedir)/telepathy-1.0/telepathy-glib genincludedir=$(tpgincludedir)/_gen @@ -79,7 +83,7 @@ endif _gen/version-script.txt: $(ABI_LISTS) _gen/abi.txt Makefile.am \ $(top_srcdir)/tools/make-version-script.py - $(PYTHON) $(top_srcdir)/tools/make-version-script.py \ + $(QUIET_GEN)$(PYTHON) $(top_srcdir)/tools/make-version-script.py \ --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ $(ABI_LISTS:%=$(srcdir)/%) > $@ $(PYTHON) $(top_srcdir)/tools/make-version-script.py \ @@ -97,7 +101,7 @@ _gen/abi.txt: libtelepathy-glib-internal.la Makefile.am grep " [DT] " < _gen/abi.nm > _gen/abi.funcs cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames - sort -u < _gen/abi.tpfuncnames > $@ + $(QUIET_GEN)sort -u < _gen/abi.tpfuncnames > $@ libtelepathy_glib_la_LDFLAGS += \ $(VERSION_SCRIPT_ARG)=_gen/version-script.txt @@ -288,55 +292,55 @@ _gen/stable-stamp: $(wildcard *.xml) _gen/spec-stamp touch $@ _gen/stable-spec.xml: stable-interfaces.xml _gen/stable-stamp $(tools_dir)/xincludator.py - $(PYTHON) $(tools_dir)/xincludator.py $< > $@ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ # Things generated from the whole spec at once _gen/gtypes.h _gen/gtypes-body.h: _gen/stable-spec.xml \ $(tools_dir)/glib-gtypes-generator.py - $(PYTHON) $(tools_dir)/glib-gtypes-generator.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-gtypes-generator.py \ _gen/stable-spec.xml \ _gen/gtypes Tp _gen/telepathy-enums.h: _gen/stable-spec.xml \ $(tools_dir)/c-constants-gen.py - $(PYTHON) $(tools_dir)/c-constants-gen.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py \ Tp \ $< > $@ _gen/interfaces-body.h _gen/telepathy-interfaces.h: _gen/stable-spec.xml \ $(tools_dir)/glib-interfaces-gen.py - $(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ Tp _gen/interfaces-body.h _gen/telepathy-interfaces.h $< _gen/register-dbus-glib-marshallers-body.h: _gen/stable-spec.xml \ $(tools_dir)/glib-client-marshaller-gen.py - $(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< _tp > $@ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< _tp > $@ _gen/tp-signals-marshal.list: $(tools_dir)/glib-signals-marshal-gen.py \ _gen/stable-spec.xml - $(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py \ _gen/stable-spec.xml > $@ _gen/signals-marshal.list: signals-marshal.list _gen/tp-signals-marshal.list - sort -u $^ > $@ + $(QUIET_GEN)sort -u $^ > $@ _gen/signals-marshal.h: _gen/signals-marshal.list Makefile.am - $(GLIB_GENMARSHAL) --header --prefix=_tp_marshal $< > $@ + $(QUIET_GEN)$(GLIB_GENMARSHAL) --header --prefix=_tp_marshal $< > $@ _gen/signals-marshal.c: _gen/signals-marshal.list Makefile.am - { echo '#include "_gen/signals-marshal.h"' && \ + $(QUIET_GEN){ echo '#include "_gen/signals-marshal.h"' && \ $(GLIB_GENMARSHAL) --body --prefix=_tp_marshal $< ; } > $@ # Things generated per interface _gen/tp-spec-%.xml: %.xml _gen/spec-stamp $(tools_dir)/xincludator.py - $(PYTHON) $(tools_dir)/xincludator.py $< > $@ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ _gen/tp-svc-%.c _gen/tp-svc-%.h: _gen/tp-spec-%.xml \ $(tools_dir)/glib-ginterface-gen.py \ Makefile.am - $(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ + $(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/tp-svc-$* \ --signal-marshal-prefix=_tp \ --include='<telepathy-glib/dbus.h>' \ @@ -347,7 +351,7 @@ _gen/tp-svc-%.c _gen/tp-svc-%.h: _gen/tp-spec-%.xml \ _gen/tp-cli-%-body.h _gen/tp-cli-%.h: _gen/tp-spec-%.xml \ $(tools_dir)/glib-client-gen.py \ Makefile.am - set -e; \ + $(QUIET_GEN)set -e; \ subclass= ; \ subclass_assert= ; \ case $* in \ diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am index c7db62e3f..af72934bb 100644 --- a/tests/dbus/Makefile.am +++ b/tests/dbus/Makefile.am @@ -1,3 +1,7 @@ +V = @ +Q = $(V:1=) +QUIET_GEN = $(Q:@=@echo ' GEN '$@;) + noinst_PROGRAMS = \ test-call-cancellation \ test-callable-example \ @@ -172,7 +176,7 @@ _gen/svc.c _gen/svc.h: with-properties.xml \ $(top_srcdir)/tools/glib-ginterface-gen.py \ Makefile.am $(mkdir_p) _gen - $(PYTHON) $(top_srcdir)/tools/glib-ginterface-gen.py \ + $(QUIET_GEN)$(PYTHON) $(top_srcdir)/tools/glib-ginterface-gen.py \ --filename=_gen/svc \ --signal-marshal-prefix=NOT_NEEDED \ $< Test_Svc_ @@ -180,4 +184,4 @@ _gen/svc.c _gen/svc.h: with-properties.xml \ _gen/errors-check.h: $(top_srcdir)/spec/errors.xml \ $(top_srcdir)/tools/glib-errors-check-gen.py $(mkdir_p) _gen - $(PYTHON) $(top_srcdir)/tools/glib-errors-check-gen.py $< > $@ + $(QUIET_GEN)$(PYTHON) $(top_srcdir)/tools/glib-errors-check-gen.py $< > $@ diff --git a/tools/Makefile.am b/tools/Makefile.am index 7f7ba4d3b..8f0ee4db3 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,3 +1,7 @@ +V = @ +Q = $(V:1=) +QUIET_GEN = $(Q:@=@echo ' GEN '$@;) + abs_top_builddir = @abs_top_builddir@ noinst_SCRIPTS = telepathy-glib-env @@ -37,23 +41,23 @@ CLEANFILES = libtpcodegen.pyc libtpcodegen.pyo libglibcodegen.pyc libglibcodegen all: $(EXTRA_DIST) libglibcodegen.py: libtpcodegen.py - touch $@ + $(QUIET_GEN)touch $@ c-constants-gen.py: libglibcodegen.py - touch $@ + $(QUIET_GEN)touch $@ glib-client-marshaller-gen.py: libglibcodegen.py - touch $@ + $(QUIET_GEN)touch $@ glib-errors-enum-body-gen.py: libglibcodegen.py - touch $@ + $(QUIET_GEN)touch $@ glib-errors-enum-header-gen.py: libglibcodegen.py - touch $@ + $(QUIET_GEN)touch $@ glib-ginterface-gen.py: libglibcodegen.py - touch $@ + $(QUIET_GEN)touch $@ glib-gtypes-generator.py: libglibcodegen.py - touch $@ + $(QUIET_GEN)touch $@ glib-interfaces-gen.py: libglibcodegen.py - touch $@ + $(QUIET_GEN)touch $@ glib-signals-marshal-gen.py: libglibcodegen.py - touch $@ + $(QUIET_GEN)touch $@ TELEPATHY_SPEC_SRCDIR = $(top_srcdir)/../telepathy-spec maintainer-update-from-telepathy-spec: |