Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Auto-generate final configure summary

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
  • Loading branch information...
commit 93a349005f7642266bb90af0c32daaa03999d1a2 1 parent c955de3
Colomban Wendling authored October 06, 2011
2  ChangeLog
@@ -5,7 +5,7 @@
5 5
  * configure.ac, m4/geany-revision.m4, m4/geany-binreloc.m4,
6 6
    m4/geany-gnu-regex.m4, m4/geany-plugins.m4, m4/geany-i18n.m4,
7 7
    m4/geany-mingw.m4, m4/geany-socket.m4, m4/geany-vte.m4,
8  
-   m4/geany-utils.m4:
  8
+   m4/geany-utils.m4, m4/geany-status.m4:
9 9
    Extract some configure logic to separate files for better
10 10
    readability.
11 11
 
28  configure.ac
@@ -45,6 +45,13 @@ AC_CHECK_FUNCS([gethostname ftruncate fgetpos mkstemp strerror strstr])
45 45
 GEANY_PREFIX
46 46
 GEANY_DOCDIR
47 47
 
  48
+GEANY_STATUS_ADD([Install Geany in], [${prefix}])
  49
+if test -n "${build}" -a -n "${target}"; then
  50
+	GEANY_STATUS_ADD([Building Geany on], [${build}])
  51
+	GEANY_STATUS_ADD([Building Geany for], [${target}])
  52
+fi
  53
+
  54
+
48 55
 # check for SVN revision
49 56
 GEANY_CHECK_REVISION([dnl force debug mode for a SVN working copy
50 57
 					  CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
@@ -60,6 +67,7 @@ PKG_CHECK_MODULES([GTK], [$gtk_modules])
60 67
 AC_SUBST([GTK_CFLAGS])
61 68
 AC_SUBST([GTK_LIBS])
62 69
 GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
  70
+GEANY_STATUS_ADD([Using GTK version], [${GTK_VERSION}])
63 71
 # GTHREAD checks
64 72
 gthread_modules="gthread-2.0"
65 73
 PKG_CHECK_MODULES([GTHREAD], [$gthread_modules])
@@ -139,25 +147,7 @@ AC_OUTPUT
139 147
 
140 148
 
141 149
 # Summary
142  
-echo "----------------------------------------"
143  
-echo "Install Geany in                   : ${prefix}"
144  
-if test -n "${build}" -a -n "${target}"; then
145  
-	echo "Building Geany on                  : ${build}"
146  
-	echo "Building Geany for                 : ${target}"
147  
-fi
148  
-echo "Using GTK version                  : ${GTK_VERSION}"
149  
-echo "Build with plugin support          : ${geany_enable_plugins}"
150  
-echo "Use virtual terminal support       : ${geany_enable_vte}"
151  
-echo "Use (UNIX domain) socket support   : ${geany_enable_socket}"
152  
-if test "x$enable_gnu_regex" = "xyes" ; then
153  
-	echo "GNU regex library                  : built-in"
154  
-else
155  
-	echo "GNU regex library                  : system"
156  
-fi
157  
-
158  
-if test "${REVISION}" != "-1"; then
159  
-	echo "Compiling Subversion revision      : ${REVISION}"
160  
-fi
  150
+GEANY_STATUS_OUTPUT
161 151
 echo ""
162 152
 echo "Configuration is done OK."
163 153
 echo ""
2  m4/geany-binreloc.m4
@@ -55,4 +55,6 @@ AC_DEFUN([GEANY_CHECK_BINRELOC],
55 55
 	if test "$enable_binreloc" = "yes"; then
56 56
 		AC_DEFINE([ENABLE_BINRELOC],,[Use AutoPackage?])
57 57
 	fi
  58
+
  59
+	GEANY_STATUS_ADD([Enable binary relocation], [$enable_binreloc])
58 60
 ])
2  m4/geany-gnu-regex.m4
@@ -18,7 +18,9 @@ AC_DEFUN([GEANY_CHECK_GNU_REGEX],
18 18
 		AC_DEFINE([USE_INCLUDED_REGEX], [1], [Define if included GNU regex code should be used.])
19 19
 		AC_DEFINE([HAVE_REGCOMP], [1], [Define if you have the 'regcomp' function.])
20 20
 		AM_CONDITIONAL([USE_INCLUDED_REGEX], true)
  21
+		GEANY_STATUS_ADD([GNU regex library], [built-in])
21 22
 	else
22 23
 		AM_CONDITIONAL([USE_INCLUDED_REGEX], false)
  24
+		GEANY_STATUS_ADD([GNU regex library], [system])
23 25
 	fi
24 26
 ])
2  m4/geany-plugins.m4
@@ -24,4 +24,6 @@ AC_DEFUN([GEANY_CHECK_PLUGINS],
24 24
 	else
25 25
 		AM_CONDITIONAL([PLUGINS], false)
26 26
 	fi
  27
+
  28
+	GEANY_STATUS_ADD([Build with plugin support], [$geany_enable_plugins])
27 29
 ])
1  m4/geany-revision.m4
@@ -30,6 +30,7 @@ AC_DEFUN([GEANY_CHECK_REVISION],
30 30
 
31 31
 	if test "x${REVISION}" != "xr0"; then
32 32
 		AC_MSG_RESULT([$REVISION])
  33
+		GEANY_STATUS_ADD([Compiling Subversion revision], [$REVISION])
33 34
 
34 35
 		# call action-if-found
35 36
 		$1
1  m4/geany-socket.m4
@@ -37,6 +37,7 @@ AC_DEFUN([GEANY_CHECK_SOCKET],
37 37
 			AC_SEARCH_LIBS([connect],[socket])
38 38
 		fi
39 39
 
  40
+		GEANY_STATUS_ADD([Use (UNIX domain) socket support], [$geany_enable_socket])
40 41
 		_geany_enable_socket_done=yes
41 42
 	fi
42 43
 ])
45  m4/geany-status.m4
... ...
@@ -0,0 +1,45 @@
  1
+dnl GEANY_STATUS_ADD(description, value)
  2
+dnl Add a status message to be displayed by GEANY_STATUS_OUTPUT
  3
+AC_DEFUN([GEANY_STATUS_ADD],
  4
+[
  5
+	_GEANY_STATUS="$_GEANY_STATUS
  6
+$1:$2"
  7
+])
  8
+
  9
+dnl GEANY_STATUS_OUTPUT
  10
+dnl Nicely displays all messages registered with GEANY_STATUS_ADD
  11
+AC_DEFUN([GEANY_STATUS_OUTPUT],
  12
+[
  13
+	# Count the max lengths
  14
+	dlen=0
  15
+	vlen=0
  16
+	while read l; do
  17
+		d=`echo "$l" | cut -d: -f1`
  18
+		v=`echo "$l" | cut -d: -f2`
  19
+		dl=${#d}
  20
+		vl=${#v}
  21
+		test $dlen -lt $dl && dlen=$dl
  22
+		test $vlen -lt $vl && vlen=$vl
  23
+	done << EOF
  24
+$_GEANY_STATUS
  25
+EOF
  26
+
  27
+	# Print a nice top bar
  28
+	# description + ' : ' + value
  29
+	total=`expr $dlen + 3 + $vlen`
  30
+	for i in `seq 1 $total`; do echo -n '-'; done
  31
+	echo
  32
+
  33
+	# And print the actual content
  34
+	# format is:
  35
+	#  key1       : value1
  36
+	#  second key : second value
  37
+	while read l; do
  38
+		test -z "$l" && continue
  39
+		d=`echo "$l" | cut -d: -f1`
  40
+		v=`echo "$l" | cut -d: -f2`
  41
+		printf '%-*s : %s\n' $dlen "$d" "$v"
  42
+	done << EOF
  43
+$_GEANY_STATUS
  44
+EOF
  45
+])
1  m4/geany-vte.m4
@@ -41,6 +41,7 @@ AC_DEFUN([GEANY_CHECK_VTE],
41 41
 			AC_DEFINE([HAVE_VTE], [1], [Define if you want VTE support])
42 42
 		fi
43 43
 
  44
+		GEANY_STATUS_ADD([Use virtual terminal support], [$geany_enable_vte])
44 45
 		_geany_enable_vte_done=yes
45 46
 	fi
46 47
 ])

0 notes on commit 93a3490

Please sign in to comment.
Something went wrong with that request. Please try again.