Pretty print the configure feedback.
authorWerner Koch <wk@gnupg.org>
Thu, 7 Mar 2013 13:13:33 +0000 (14:13 +0100)
committerWerner Koch <wk@gnupg.org>
Thu, 7 Mar 2013 13:13:33 +0000 (14:13 +0100)
* acinclude.m4 (GNUPG_MSG_PRINT): Remove.
(GCRY_MSG_SHOW, GCRY_MSG_WRAP): New.
* configure.ac: Use new macros for the feedback.

acinclude.m4
configure.ac

index e69291a..fdb2d17 100644 (file)
@@ -1,6 +1,7 @@
 dnl macros to configure Libgcrypt
 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002,
 dnl               2003 Free Software Foundation, Inc.
+dnl Copyright (C) 2013 g10 Code GmbH
 dnl
 dnl This file is part of Libgcrypt.
 dnl
@@ -18,13 +19,43 @@ dnl You should have received a copy of the GNU Lesser General Public
 dnl License along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
-dnl GNUPG_MSG_PRINT(STRING)
-dnl print a message
+dnl GCRY_MSG_SHOW(PREFIX,STRING)
+dnl Print a message with a prefix.
 dnl
-define([GNUPG_MSG_PRINT],
-  [ echo $ac_n "$1"" $ac_c" 1>&AS_MESSAGE_FD([])
+define([GCRY_MSG_SHOW],
+  [
+     echo "        $1 $2" 1>&AS_MESSAGE_FD([])
+  ])
+
+dnl GCRY_MSG_WRAP(PREFIX, ALGOLIST)
+dnl Print a nicely formatted list of algorithms
+dnl with an approriate line wrap.
+dnl
+define([GCRY_MSG_WRAP],
+  [
+    tmp="        $1"
+    tmpi="abc"
+    if test "${#tmpi}" -ne 3 >/dev/null 2>&1 ; then
+      dnl Without a POSIX shell, we don't botter to wrap it
+      echo "$tmp $2" 1>&AS_MESSAGE_FD([])
+    else
+      tmpi=`echo "$tmp"| sed 's/./ /g'`
+      echo $2 EOF | tr ' ' '\n' | \
+        while read word; do
+          if test "${#tmp}" -gt 70 ; then
+            echo "$tmp" 1>&AS_MESSAGE_FD([])
+            tmp="$tmpi"
+          fi
+          if test "$word" = "EOF" ; then
+            echo "$tmp" 1>&AS_MESSAGE_FD([])
+          else
+            tmp="$tmp $word"
+          fi
+        done
+    fi
   ])
 
+
 dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME)
 dnl Check whether a typedef exists and create a #define $2 if it exists
 dnl
index 1f057f7..7afd83d 100644 (file)
@@ -1380,21 +1380,21 @@ detection_module="${GCRYPT_HWF_MODULES%.lo}"
 test -n "$detection_module" || detection_module="none"
 
 # Give some feedback
-echo "
-        Libgcrypt v${VERSION} has been configured as follows:
-
-        Platform:                  $PRINTABLE_OS_NAME ($host)
-        Hardware detection module: $detection_module
-        Enabled cipher algorithms: $enabled_ciphers
-        Enabled digest algorithms: $enabled_digests
-        Enabled pubkey algorithms: $enabled_pubkey_ciphers
-        Random number generator:   $random
-        Using linux capabilities:  $use_capabilities
-        Try using Padlock crypto:  $padlocksupport
-        Try using AES-NI crypto:   $aesnisupport
-        Try using DRNG (RDRAND):   $drngsupport
-        Try using Intel AVX:       $avxsupport
-"
+GCRY_MSG_SHOW([],[])
+GCRY_MSG_SHOW([Libgcrypt],[v${VERSION} has been configured as follows:])
+GCRY_MSG_SHOW([],[])
+GCRY_MSG_SHOW([Platform:                 ],[$PRINTABLE_OS_NAME ($host)])
+GCRY_MSG_SHOW([Hardware detection module:],[$detection_module])
+GCRY_MSG_WRAP([Enabled cipher algorithms:],[$enabled_ciphers])
+GCRY_MSG_WRAP([Enabled digest algorithms:],[$enabled_digests])
+GCRY_MSG_WRAP([Enabled pubkey algorithms:],[$enabled_pubkey_ciphers])
+GCRY_MSG_SHOW([Random number generator:  ],[$random])
+GCRY_MSG_SHOW([Using linux capabilities: ],[$use_capabilities])
+GCRY_MSG_SHOW([Try using Padlock crypto: ],[$padlocksupport])
+GCRY_MSG_SHOW([Try using AES-NI crypto:  ],[$aesnisupport])
+GCRY_MSG_SHOW([Try using DRNG (RDRAND):  ],[$drngsupport])
+GCRY_MSG_SHOW([Try using Intel AVX:      ],[$avxsupport])
+GCRY_MSG_SHOW([],[])
 
 if test "$print_egd_notice" = "yes"; then
 cat <<G10EOF