Kaydet (Commit) 93a34900 authored tarafından Colomban Wendling's avatar Colomban Wendling

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
üst c955de3f
......@@ -5,7 +5,7 @@
* configure.ac, m4/geany-revision.m4, m4/geany-binreloc.m4,
m4/geany-gnu-regex.m4, m4/geany-plugins.m4, m4/geany-i18n.m4,
m4/geany-mingw.m4, m4/geany-socket.m4, m4/geany-vte.m4,
m4/geany-utils.m4:
m4/geany-utils.m4, m4/geany-status.m4:
Extract some configure logic to separate files for better
readability.
......
......@@ -45,6 +45,13 @@ AC_CHECK_FUNCS([gethostname ftruncate fgetpos mkstemp strerror strstr])
GEANY_PREFIX
GEANY_DOCDIR
GEANY_STATUS_ADD([Install Geany in], [${prefix}])
if test -n "${build}" -a -n "${target}"; then
GEANY_STATUS_ADD([Building Geany on], [${build}])
GEANY_STATUS_ADD([Building Geany for], [${target}])
fi
# check for SVN revision
GEANY_CHECK_REVISION([dnl force debug mode for a SVN working copy
CFLAGS="-g -DGEANY_DEBUG $CFLAGS"])
......@@ -60,6 +67,7 @@ PKG_CHECK_MODULES([GTK], [$gtk_modules])
AC_SUBST([GTK_CFLAGS])
AC_SUBST([GTK_LIBS])
GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
GEANY_STATUS_ADD([Using GTK version], [${GTK_VERSION}])
# GTHREAD checks
gthread_modules="gthread-2.0"
PKG_CHECK_MODULES([GTHREAD], [$gthread_modules])
......@@ -139,25 +147,7 @@ AC_OUTPUT
# Summary
echo "----------------------------------------"
echo "Install Geany in : ${prefix}"
if test -n "${build}" -a -n "${target}"; then
echo "Building Geany on : ${build}"
echo "Building Geany for : ${target}"
fi
echo "Using GTK version : ${GTK_VERSION}"
echo "Build with plugin support : ${geany_enable_plugins}"
echo "Use virtual terminal support : ${geany_enable_vte}"
echo "Use (UNIX domain) socket support : ${geany_enable_socket}"
if test "x$enable_gnu_regex" = "xyes" ; then
echo "GNU regex library : built-in"
else
echo "GNU regex library : system"
fi
if test "${REVISION}" != "-1"; then
echo "Compiling Subversion revision : ${REVISION}"
fi
GEANY_STATUS_OUTPUT
echo ""
echo "Configuration is done OK."
echo ""
......@@ -55,4 +55,6 @@ AC_DEFUN([GEANY_CHECK_BINRELOC],
if test "$enable_binreloc" = "yes"; then
AC_DEFINE([ENABLE_BINRELOC],,[Use AutoPackage?])
fi
GEANY_STATUS_ADD([Enable binary relocation], [$enable_binreloc])
])
......@@ -18,7 +18,9 @@ AC_DEFUN([GEANY_CHECK_GNU_REGEX],
AC_DEFINE([USE_INCLUDED_REGEX], [1], [Define if included GNU regex code should be used.])
AC_DEFINE([HAVE_REGCOMP], [1], [Define if you have the 'regcomp' function.])
AM_CONDITIONAL([USE_INCLUDED_REGEX], true)
GEANY_STATUS_ADD([GNU regex library], [built-in])
else
AM_CONDITIONAL([USE_INCLUDED_REGEX], false)
GEANY_STATUS_ADD([GNU regex library], [system])
fi
])
......@@ -24,4 +24,6 @@ AC_DEFUN([GEANY_CHECK_PLUGINS],
else
AM_CONDITIONAL([PLUGINS], false)
fi
GEANY_STATUS_ADD([Build with plugin support], [$geany_enable_plugins])
])
......@@ -30,6 +30,7 @@ AC_DEFUN([GEANY_CHECK_REVISION],
if test "x${REVISION}" != "xr0"; then
AC_MSG_RESULT([$REVISION])
GEANY_STATUS_ADD([Compiling Subversion revision], [$REVISION])
# call action-if-found
$1
......
......@@ -37,6 +37,7 @@ AC_DEFUN([GEANY_CHECK_SOCKET],
AC_SEARCH_LIBS([connect],[socket])
fi
GEANY_STATUS_ADD([Use (UNIX domain) socket support], [$geany_enable_socket])
_geany_enable_socket_done=yes
fi
])
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
])
......@@ -41,6 +41,7 @@ AC_DEFUN([GEANY_CHECK_VTE],
AC_DEFINE([HAVE_VTE], [1], [Define if you want VTE support])
fi
GEANY_STATUS_ADD([Use virtual terminal support], [$geany_enable_vte])
_geany_enable_vte_done=yes
fi
])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment