93a349005f
Add and use macros to generate final configure summary rather than hard-code it. This allows for the status to be registered from where they comes rather than all in the end. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@6008 ea778897-0a13-0410-b9d1-a72fbfd435f5
46 lines
962 B
Plaintext
46 lines
962 B
Plaintext
dnl GEANY_STATUS_ADD(description, value)
|
|
dnl Add a status message to be displayed by GEANY_STATUS_OUTPUT
|
|
AC_DEFUN([GEANY_STATUS_ADD],
|
|
[
|
|
_GEANY_STATUS="$_GEANY_STATUS
|
|
$1:$2"
|
|
])
|
|
|
|
dnl GEANY_STATUS_OUTPUT
|
|
dnl Nicely displays all messages registered with GEANY_STATUS_ADD
|
|
AC_DEFUN([GEANY_STATUS_OUTPUT],
|
|
[
|
|
# Count the max lengths
|
|
dlen=0
|
|
vlen=0
|
|
while read l; do
|
|
d=`echo "$l" | cut -d: -f1`
|
|
v=`echo "$l" | cut -d: -f2`
|
|
dl=${#d}
|
|
vl=${#v}
|
|
test $dlen -lt $dl && dlen=$dl
|
|
test $vlen -lt $vl && vlen=$vl
|
|
done << EOF
|
|
$_GEANY_STATUS
|
|
EOF
|
|
|
|
# Print a nice top bar
|
|
# description + ' : ' + value
|
|
total=`expr $dlen + 3 + $vlen`
|
|
for i in `seq 1 $total`; do echo -n '-'; done
|
|
echo
|
|
|
|
# And print the actual content
|
|
# format is:
|
|
# key1 : value1
|
|
# second key : second value
|
|
while read l; do
|
|
test -z "$l" && continue
|
|
d=`echo "$l" | cut -d: -f1`
|
|
v=`echo "$l" | cut -d: -f2`
|
|
printf '%-*s : %s\n' $dlen "$d" "$v"
|
|
done << EOF
|
|
$_GEANY_STATUS
|
|
EOF
|
|
])
|