Example: $ ./mutt -v Mutt 1.5.21+66 (70810a88ce9f) (2011-07-01) Copyright (C) 1996-2009 Michael R. Elkins and others. Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'. Mutt is free software, and you are welcome to redistribute it under certain conditions; type `mutt -vv' for details.
System: Linux 2.6.32-316-ec2 (i686) ncurses: ncurses 5.7.20090803 (compiled with 5.7) hcache backend: GDBM version 1.8.3. 10/15/2002 (built Dec 5 2009 21:42:40) Compiler: gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Configure options: '--prefix=/sw/pkgs/mutt-dev-0.0' '--enable-pop' '--enable-imap' '--enable-smtp' '--enable-debug' '--enable-hcache' '--with-curses' '--with-ssl' '--with-sasl' 'CC=gcc' Compile options: ... * On 16 Oct 2012, David Champion wrote: > Comments? > > # HG changeset patch > # User David Champion <[email protected]> > # Date 1350429193 18000 > # Branch HEAD > # Node ID 778e6c6562508f686eb10b143e7911ea6d90dd87 > # Parent 70810a88ce9feb66d5c74e7ec3f2a633bd8b5312 > Add compiler and configure info to mutt -v output. > > This adds txt2c.py for coding text (on stdin) to a C byte array, and > adds methods in Makefile(.am) to produce constrings.c, containing these > two information strings. main.c is updated to print them. > > diff -r 70810a88ce9f -r 778e6c656250 Makefile.am > --- a/Makefile.am Sun Jul 22 11:15:30 2012 -0700 > +++ b/Makefile.am Tue Oct 16 18:13:13 2012 -0500 > @@ -17,7 +17,7 @@ > HCVERSION = hcversion.h > endif > > -BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h $(HCVERSION) > +BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h conststrings.c > $(HCVERSION) > > bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@ > mutt_SOURCES = \ > @@ -94,6 +94,17 @@ > mutt_dotlock.c: dotlock.c > cp $(srcdir)/dotlock.c mutt_dotlock.c > > +conststrings.c: txt2c.py > + ( \ > + $${CC-cc} --version || \ > + $${CC-cc} -v || \ > + $${CC-cc} -V || \ > + echo "unknown compiler"; \ > + ) 2>/dev/null | python txt2c.py cc_version >conststrings.c > + grep ac_cs_config= config.status | \ > + cut -d= -f2- | \ > + sed -e 's/^"//' -e 's/"$$//' | python txt2c.py configure_options > >>conststrings.c > + > CLEANFILES = mutt_dotlock.c keymap_alldefs.h $(BUILT_SOURCES) > > DISTCLEANFILES= flea smime_keys > diff -r 70810a88ce9f -r 778e6c656250 main.c > --- a/main.c Sun Jul 22 11:15:30 2012 -0700 > +++ b/main.c Tue Oct 16 18:13:13 2012 -0500 > @@ -154,6 +154,9 @@ > exit (0); > } > > +extern const char cc_version[]; > +extern const char configure_options[]; > + > static void show_version (void) > { > struct utsname uts; > @@ -193,6 +196,11 @@ > printf ("\nhcache backend: %s", mutt_hcache_backend ()); > #endif > > + puts ("\n\nCompiler:"); > + puts (cc_version); > + > + printf ("\nConfigure options: %s\n", configure_options); > + > puts (_("\nCompile options:")); > > #ifdef DOMAIN > diff -r 70810a88ce9f -r 778e6c656250 txt2c.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/txt2c.py Tue Oct 16 18:13:13 2012 -0500 > @@ -0,0 +1,15 @@ > +#!/usr/bin/env python > + > +def txt2c(sym, txt, per_line = 12): > + print 'const char %s[] = {' % sym > + off = 0 > + max = len(txt) > + while off + per_line < max: > + print '\t' + ', '.join(['0x%02x' % ord(x) for x in txt[off:off > + per_line]]) + ',' > + off += per_line > + print '\t' + ', '.join(['0x%02x' % ord(x) for x in txt[off:]]) + ',' > + print '\t0x00' > + print '};' > + > +import sys > +txt2c(sys.argv[1], sys.stdin.read().strip()) > -- David Champion • [email protected] • IT Services • University of Chicago
