/pidgin/main: 68be92b95def: win32: silence win32 build by displa...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Mon Apr 8 10:57:12 EDT 2013


Changeset: 68be92b95def585eb7bb92260d7e808d75d06fd5
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-04-08 16:57 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/68be92b95def

Description:

win32: silence win32 build by displaying neat CC/CCLD/PERL tags instead of compilation command contents

diffstat:

 libpurple/win32/global.mak |   4 ++++
 libpurple/win32/rules.mak  |   2 +-
 libpurple/win32/tag.sh     |  37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletions(-)

diffs (75 lines):

diff --git a/libpurple/win32/global.mak b/libpurple/win32/global.mak
--- a/libpurple/win32/global.mak
+++ b/libpurple/win32/global.mak
@@ -65,6 +65,7 @@ GCCWARNINGS ?= -Waggregate-return -Wcast
 CC_HARDENING_OPTIONS ?= -Wstack-protector -fwrapv -fno-strict-overflow -Wno-missing-field-initializers -Wformat-security -fstack-protector-all --param ssp-buffer-size=1
 LD_HARDENING_OPTIONS ?= -Wl,--dynamicbase -Wl,--nxcompat
 
+TAG := @$(PURPLE_TOP)/win32/tag.sh
 
 # parse the version number from the configure.ac file if it is newer
 #m4_define([purple_major_version], [2])
@@ -106,6 +107,9 @@ DLL_LD_FLAGS += -Wl,--enable-auto-image-
 ifeq "$(origin CC)" "default"
   CC := gcc.exe
 endif
+# comment out the next line to make output more verbose
+CC := $(TAG) "auto" $(CC)
+
 GMSGFMT ?= $(WIN32_DEV_TOP)/gettext-0.18/bin/msgfmt
 MAKENSIS ?= makensis.exe
 PERL ?= perl
diff --git a/libpurple/win32/rules.mak b/libpurple/win32/rules.mak
--- a/libpurple/win32/rules.mak
+++ b/libpurple/win32/rules.mak
@@ -4,7 +4,7 @@
 	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
 
 %.c: %.xs
-	$(PERL) -MExtUtils::ParseXS -e 'ExtUtils::ParseXS::process_file(filename => "$<", output => "$@", typemap => "$(PURPLE_PERL_TOP)/common/typemap");'
+	$(TAG) "PERL" $(PERL) -MExtUtils::ParseXS -e 'ExtUtils::ParseXS::process_file(filename => "$<", output => "$@", typemap => "$(PURPLE_PERL_TOP)/common/typemap");'
 
 %.o: %.rc
 	$(WINDRES) -I$(PURPLE_TOP) -i $< -o $@
diff --git a/libpurple/win32/tag.sh b/libpurple/win32/tag.sh
new file mode 100644
--- /dev/null
+++ b/libpurple/win32/tag.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Script to silence win32 build by displaying a neat one-line notice instead of
+# full command contents when executing compilers.
+#
+# Written by Tomek Wasilczyk <tomkiewicz at cpw.pidgin.im>, licensed under GNU GPL
+
+tag=$1
+found=0
+object=""
+for arg in "$@"
+do
+	if [ "$found" == 1 ]; then
+		object="$arg"
+		break
+	fi
+	if [ "$arg" == "-o" ]; then
+		found=1
+	fi
+	if [ "$tag" == "auto" ] && [ "$arg" == "-shared" ]; then
+		tag="CCLD"
+	fi
+	if [ "$tag" == "PERL" ] && [ "$arg" == "-e" ]; then
+		found=1
+	fi
+done
+
+if [ "$tag" == "auto" ]; then
+	tag="CC"
+fi
+
+if [ "$tag" == "PERL" ]; then
+	object=`echo "$object" | sed 's|.*output *=> *"\([^"]*\)".*|\1|'`
+fi
+
+echo -e "  $tag\t$object"
+shift 1
+"$@"



More information about the Commits mailing list