Merged pidgin/main into default
[pidgin-git.git] / libpurple / tag.sh
blob99eb2481d4a40e2af94b0439920795699efe27fa
1 #!/bin/bash
2 # Script to silence win32 and perl build by displaying a neat one-line notice
3 # instead of full command contents when executing compilers.
5 # Written by Tomek Wasilczyk <tomkiewicz@cpw.pidgin.im>, licensed under GNU GPL
7 tag=$1
8 found=0
9 object=""
10 file_1=""
11 file_2=""
12 is_final=0
13 for arg in "$@"
15 if [ "$found" == 1 ]; then
16 object="$arg"
17 break
19 if [ "$arg" == "-o" ]; then
20 found=1
22 if [ "$tag" == "auto" ] && [ "$arg" == "-shared" ]; then
23 tag="CCLD"
25 ext_1=${arg#${arg%??}}
26 if [ "${ext_1}" == ".c" ]; then
27 file_1="$arg"
29 ext_2=${arg#${arg%???}}
30 if [ "${ext_2}" == ".xs" ]; then
31 file_2="$arg"
33 ext_3=${arg#${arg%????}}
34 if [ "${ext_3}" == ".3pm" ]; then
35 file_2="$arg"
37 done
39 if [ "$tag" == "auto" ]; then
40 tag="CC"
43 if [ "$object" == "" ] && [ "${file_1}" != "" ]; then
44 object="${file_1}"
46 if [ "$object" == "" ] && [ "${file_2}" != "" ]; then
47 object="${file_2}"
50 shift 1
51 if [ "$object" == "" ]; then
52 echo "$@" >&2
53 else
54 echo -e " $tag\t$object" >&2
56 "$@"