[empathy] Add shave support to build process.



commit 658bb59ac654bc4bbe95ae1aec17eec2fe9bb499
Author: Jonny Lamb <jonny lamb collabora co uk>
Date:   Tue Apr 21 15:27:50 2009 +0100

    Add shave support to build process.
    
    Use --enable-shave to enable building with shave.
    
    Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>
---
 .gitignore                      |    2 +
 Makefile.am                     |    2 +-
 autogen.sh                      |    8 ++++
 configure.ac                    |    4 ++
 extensions/Makefile.am          |   26 +++++++------
 libempathy-gtk/Makefile.am      |   14 ++++---
 libempathy/Makefile.am          |   14 ++++---
 m4/shave.m4                     |   77 ++++++++++++++++++++++++++++++++++++++
 megaphone/data/Makefile.am      |    4 +-
 nothere/data/Makefile.am        |    4 +-
 python/pyempathy/Makefile.am    |    4 +-
 python/pyempathygtk/Makefile.am |    4 +-
 shave-libtool.in                |   69 ++++++++++++++++++++++++++++++++++
 shave.in                        |   79 +++++++++++++++++++++++++++++++++++++++
 src/Makefile.am                 |    6 ++-
 tools/Makefile.am               |   20 +++++----
 tools/shave.mk                  |    1 +
 17 files changed, 298 insertions(+), 40 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6f64467..e67be83 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,3 +44,5 @@ cscope.out
 tags
 TAGS
 gnome-doc-utils.make
+shave
+shave-libtool
diff --git a/Makefile.am b/Makefile.am
index 20e1962..3929d39 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,7 +38,7 @@ DISTCLEANFILES = 		\
 distuninstallcheck_listfiles = find . -type f -print | grep -v '^\./var/scrollkeeper'
 
 distclean-local:
-	if test $(srdcir) = .; then :; else \
+	if test "x$(srdcir)" = "x."; then :; else \
 		rm -f ChangeLog; \
 	fi
 
diff --git a/autogen.sh b/autogen.sh
index b1a24fc..e1bf4d5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -13,6 +13,14 @@ REQUIRED_AUTOMAKE_VERSION=1.9
     exit 1
 }
 
+# Fix to make shave + libtool 1.x + gtk-doc work.
+# See http://git.lespiau.name/cgit/shave/tree/README#n83
+sed -e 's#) --mode=compile#) --tag=CC --mode=compile#' gtk-doc.make \
+    > gtk-doc.temp \
+        && mv gtk-doc.temp gtk-doc.make
+sed -e 's#) --mode=link#) --tag=CC --mode=link#' gtk-doc.make \
+                > gtk-doc.temp \
+        && mv gtk-doc.temp gtk-doc.make
 
 which gnome-autogen.sh || {
     echo "You need to install gnome-common from the GNOME CVS"
diff --git a/configure.ac b/configure.ac
index 0ff1739..7d2d5d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -303,6 +303,8 @@ AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
 
 # -----------------------------------------------------------
 
+SHAVE_INIT(.)
+
 AC_OUTPUT([
    Makefile
    data/Makefile
@@ -333,4 +335,6 @@ AC_OUTPUT([
    tests/Makefile
    tests/xml/Makefile
    tools/Makefile
+   shave
+   shave-libtool
 ])
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index e5b1ea1..7591109 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 tools_dir = $(top_srcdir)/tools
 
 AM_CPPFLAGS = $(DISABLE_DEPRECATED)
@@ -60,45 +62,45 @@ XSLTPROCFLAGS = --nonet --novalid
 
 _gen/all.xml: all.xml $(wildcard *.xml)
 	$(mkdir_p) _gen
-	$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
+	$(QUIET_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
 		$< > $@
 
 extensions.html: _gen/all.xml $(tools_dir)/doc-generator.xsl
-	$(XSLTPROC) $(XSLTPROCFLAGS) \
+	$(QUIET_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \
 		--param "allow-undefined-interfaces" "true()" \
 		$(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 Emp
 
 _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=_emp_ext_marshal $< > $@
+	$(QUIET_GEN)$(GLIB_GENMARSHAL) --header --prefix=_emp_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=_emp_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 $< \
 		_emp_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 \
 		Emp \
 		$< > $@
 
 _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 \
 		Emp _gen/interfaces-body.h _gen/interfaces.h $<
 
 # Generated files which must be generated per "category". Each TpProxy
@@ -107,12 +109,12 @@ _gen/interfaces-body.h _gen/interfaces.h: _gen/all.xml \
 
 _gen/misc.xml: misc.xml $(wildcard *.xml)
 	$(mkdir_p) _gen
-	$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
+	$(QUIET_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
 		$< > $@
 
 _gen/cli-misc-body.h _gen/cli-misc.h: _gen/misc.xml \
 	$(tools_dir)/glib-client-gen.py
-	$(PYTHON) $(tools_dir)/glib-client-gen.py \
+	$(QUIET_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \
 		--group=misc \
 		--subclass=TpProxy \
 		--subclass-assert=TP_IS_PROXY \
@@ -122,7 +124,7 @@ _gen/cli-misc-body.h _gen/cli-misc.h: _gen/misc.xml \
 
 _gen/svc-misc.c _gen/svc-misc.h: _gen/misc.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-misc \
 		--signal-marshal-prefix=_emp_ext \
 		--include='<telepathy-glib/dbus.h>' \
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index 2065589..210b6d4 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 AM_CPPFLAGS =                                           \
 	-I.                                             \
 	-I$(top_srcdir)                                 \
@@ -133,7 +135,7 @@ ui_DATA = 					\
 	empathy-new-message-dialog.ui
 
 empathy-gtk-marshal.list: $(libempathy_gtk_la_SOURCES) Makefile.am
-	( cd $(srcdir) && \
+	$(QUIET_GEN)( cd $(srcdir) && \
 	sed -n -e 's/.*empathy_gtk_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
 	$(libempathy_gtk_la_SOURCES) ) \
 	| sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $  tmp
@@ -144,16 +146,16 @@ empathy-gtk-marshal.list: $(libempathy_gtk_la_SOURCES) Makefile.am
 	fi
 
 %-marshal.h: %-marshal.list Makefile
-	$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
+	$(QUIET_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
 
 %-marshal.c: %-marshal.list Makefile
-	echo "#include \"empathy-gtk-marshal.h\"" > $@ && \
+	$(QUIET_GEN)echo "#include \"empathy-gtk-marshal.h\"" > $@ && \
 	$(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
 
 empathy-gtk-enum-types.h: stamp-empathy-gtk-enum-types.h
-	@true
+	$(QUIET_GEN)true
 stamp-empathy-gtk-enum-types.h: Makefile $(libempathy_gtk_headers)
-	(cd $(srcdir) \
+	$(QUIET_GEN)(cd $(srcdir) \
 	&& glib-mkenums \
 			--fhead "#ifndef __LIBEMPATHY_GTK_ENUM_TYPES_H__\n" \
 			--fhead "#define __LIBEMPATHY_GTK_ENUM_TYPES_H__ 1\n\n" \
@@ -170,7 +172,7 @@ stamp-empathy-gtk-enum-types.h: Makefile $(libempathy_gtk_headers)
 	&& echo timestamp > $(@F)
 
 empathy-gtk-enum-types.c: Makefile $(libempathy_gtk_headers)
-	(cd $(srcdir) \
+	$(QUIET_GEN)(cd $(srcdir) \
 	&& glib-mkenums \
 			--fhead "#include <config.h>\n" \
 			--fhead "#include <glib-object.h>\n" \
diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am
index ba1f6f8..6796669 100644
--- a/libempathy/Makefile.am
+++ b/libempathy/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 AM_CPPFLAGS =                                           \
 	-I.                                             \
 	-I$(top_srcdir)                                 \
@@ -104,7 +106,7 @@ libempathy_include_HEADERS =			\
 	empathy-enum-types.h
 
 empathy-marshal.list: $(libempathy_la_SOURCES) Makefile.am
-	( cd $(srcdir) && \
+	$(QUIET_GEN)( cd $(srcdir) && \
 	sed -n -e 's/.*empathy_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
 	$(libempathy_la_SOURCES) ) \
 	| sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $  tmp
@@ -115,16 +117,16 @@ empathy-marshal.list: $(libempathy_la_SOURCES) Makefile.am
 	fi
 
 %-marshal.h: %-marshal.list Makefile
-	$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
+	$(QUIET_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
 
 %-marshal.c: %-marshal.list Makefile
-	echo "#include \"empathy-marshal.h\"" > $@ && \
+	$(QUIET_GEN)echo "#include \"empathy-marshal.h\"" > $@ && \
 	$(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
 
 empathy-enum-types.h: stamp-empathy-enum-types.h
-	@true
+	$(QUIET_GEN)true
 stamp-empathy-enum-types.h: $(libempathy_headers) Makefile
-	(cd $(srcdir) \
+	$(QUIET_GEN)(cd $(srcdir) \
 	&& glib-mkenums \
 			--fhead "#ifndef __LIBEMPATHY_ENUM_TYPES_H__\n" \
 			--fhead "#define __LIBEMPATHY_ENUM_TYPES_H__ 1\n\n" \
@@ -141,7 +143,7 @@ stamp-empathy-enum-types.h: $(libempathy_headers) Makefile
 	&& echo timestamp > $(@F)
 
 empathy-enum-types.c: $(libempathy_headers) Makefile
-	(cd $(srcdir) \
+	$(QUIET_GEN)(cd $(srcdir) \
 	&& glib-mkenums \
 			--fhead "#include <config.h>\n" \
 			--fhead "#include <glib-object.h>\n" \
diff --git a/m4/shave.m4 b/m4/shave.m4
new file mode 100644
index 0000000..0a3509e
--- /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/megaphone/data/Makefile.am b/megaphone/data/Makefile.am
index c2e378f..875756c 100644
--- a/megaphone/data/Makefile.am
+++ b/megaphone/data/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 # Panel applet bonobo stuff
 serverdir = $(libdir)/bonobo/servers
 server_in_files = GNOME_Megaphone_Applet.server.in
@@ -21,7 +23,7 @@ megaphonebindir = $(libexecdir)
 @INTLTOOL_SCHEMAS_RULE@
 
 $(server_in_files): $(server_in_files:.server.in=.server.in.in)
-	sed -e "s|\ LIBEXECDIR\@|$(megaphonebindir)|" $< > $@
+	$(QUIET_GEN)sed -e "s|\ LIBEXECDIR\@|$(megaphonebindir)|" $< > $@
 
 DISTCLEANFILES = \
 	$(server_DATA) \
diff --git a/nothere/data/Makefile.am b/nothere/data/Makefile.am
index ce60c3c..7304065 100644
--- a/nothere/data/Makefile.am
+++ b/nothere/data/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 # Panel applet bonobo stuff
 serverdir = $(libdir)/bonobo/servers
 server_in_files = GNOME_NotHere_Applet.server.in
@@ -21,7 +23,7 @@ notherebindir = $(libexecdir)
 @INTLTOOL_SCHEMAS_RULE@
 
 $(server_in_files): $(server_in_files:.server.in=.server.in.in)
-	sed -e "s|\ LIBEXECDIR\@|$(notherebindir)|" $< > $@
+	$(QUIET_GEN)sed -e "s|\ LIBEXECDIR\@|$(notherebindir)|" $< > $@
 
 DISTCLEANFILES = \
 	$(server_DATA) \
diff --git a/python/pyempathy/Makefile.am b/python/pyempathy/Makefile.am
index 8ec61ff..ef6faa0 100644
--- a/python/pyempathy/Makefile.am
+++ b/python/pyempathy/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 PYDEFS=`pkg-config --variable=defsdir pygtk-2.0`
 
 AM_CPPFLAGS =                                           \
@@ -31,7 +33,7 @@ empathy_la_LDFLAGS =					\
 	-module -avoid-version
 
 pyempathy.c: pyempathy.override pyempathy.defs
-	$(PYGOBJECTCODEGEN)				\
+	$(QUIET_GEN)$(PYGOBJECTCODEGEN)				\
 		--prefix empathy 			\
 		--register $(PYDEFS)/gdk-types.defs 	\
 		--register $(PYDEFS)/gtk-types.defs 	\
diff --git a/python/pyempathygtk/Makefile.am b/python/pyempathygtk/Makefile.am
index 84204e7..3f4c6d5 100644
--- a/python/pyempathygtk/Makefile.am
+++ b/python/pyempathygtk/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 PYDEFS=`pkg-config --variable=defsdir pygtk-2.0`
 
 AM_CPPFLAGS =                                           \
@@ -31,7 +33,7 @@ empathygtk_la_LDFLAGS =					\
 	-module -avoid-version
 
 pyempathygtk.c: pyempathygtk.override pyempathygtk.defs
-	$(PYGOBJECTCODEGEN)							\
+	$(QUIET_GEN)$(PYGOBJECTCODEGEN)							\
 		--prefix empathy 					\
 		--register $(PYDEFS)/gdk-types.defs 			\
 		--register $(PYDEFS)/gtk-types.defs 			\
diff --git a/shave-libtool.in b/shave-libtool.in
new file mode 100644
index 0000000..1f3a720
--- /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 0000000..5c16f27
--- /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/src/Makefile.am b/src/Makefile.am
index 76a5aa7..f24ef3e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 AM_CPPFLAGS =						\
 	-I$(top_srcdir)                          	\
 	$(EMPATHY_CFLAGS)				\
@@ -63,7 +65,7 @@ dist_man_MANS =			\
 
 # rules for making the glib enum objects
 %-enumtypes.h: %.h Makefile.in
-	glib-mkenums \
+	$(QUIET_GEN)glib-mkenums \
 	--fhead "#ifndef __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__\n#define __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
 	--fprod "/* enumerations from \"@filename \" */\n" \
 	--vhead "GType @enum_name _get_type (void);\n#define $(shell echo $* | tr [:lower:]- [:upper:]_ | sed 's/_.*//')_TYPE_ ENUMSHORT@ (@enum_name _get_type())\n"         \
@@ -71,7 +73,7 @@ dist_man_MANS =			\
 	$< > $@
 
 %-enumtypes.c: %.h Makefile.in
-	glib-mkenums \
+	$(QUIET_GEN)glib-mkenums \
 	--fhead "#include <$*.h>\n#include <$*-enumtypes.h>" \
 	--fprod "\n/* enumerations from \"@filename \" */" \
 	--vhead "GType\n enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G Type@Value values[] = {"     \
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 8171000..05da743 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tools/shave.mk
+
 abs_top_builddir = @abs_top_builddir@
 
 noinst_SCRIPTS = telepathy-glib-env
@@ -36,23 +38,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:
diff --git a/tools/shave.mk b/tools/shave.mk
new file mode 100644
index 0000000..53cb3bf
--- /dev/null
+++ b/tools/shave.mk
@@ -0,0 +1 @@
+QUIET_GEN = $(Q:@= echo '  GEN   '$@;)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]