Ticket #3628: mc-3628-05-extend-version-print-by-glib-screen-version.patch

File mc-3628-05-extend-version-print-by-glib-screen-version.patch, 2.9 KB (added by and, 8 years ago)
  • src/textconf.c

    From 1fbf83f7ad3da52eff1d5222d7de04f5e06e1fae Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 10 Apr 2016 16:05:52 +0000
    Subject: [PATCH] Extend version print by glib/screen version
    
    Extend version print by compiled and inuse lib version.
    
    Now version print looks like:
    
    Built with GLib 2.43.2 (using GLib 2.43.2)
    Built with NCursesw 5.9.20110404 (using ncurses 6.0.20150808)
    ...
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/textconf.c | 44 +++++++++++++++++++++++++++++++++-----------
     1 file changed, 33 insertions(+), 11 deletions(-)
    
    diff --git a/src/textconf.c b/src/textconf.c
    index d6ee671..9bc5681 100644
    a b  
    3636 
    3737#include "src/textconf.h" 
    3838 
     39#ifdef HAVE_SLANG 
     40#include "lib/tty/tty-slang.h" 
     41#elif defined HAVE_NCURSES 
     42#include "lib/tty/tty-ncurses.h" 
     43#endif 
     44 
    3945/*** global variables ****************************************************************************/ 
    4046 
    4147/*** file scope macro definitions ****************************************************************/ 
    static const char *const vfs_supported[] = { 
    7884#endif /* ENABLE_VFS */ 
    7985 
    8086static const char *const features[] = { 
    81 #ifdef HAVE_SLANG 
    82     N_("Using the S-Lang library with terminfo database\n"), 
    83 #elif defined(USE_NCURSES) 
    84     N_("Using the ncurses library\n"), 
    85 #elif defined(USE_NCURSESW) 
    86     N_("Using the ncursesw library\n"), 
    87 #else 
    88 #error "Cannot compile mc without S-Lang or ncurses" 
    89 #endif /* !HAVE_SLANG && !USE_NCURSES */ 
    9087 
    9188#ifdef USE_INTERNAL_EDIT 
    9289    N_("With builtin Editor\n"), 
    show_version (void) 
    139136 
    140137    printf (_("GNU Midnight Commander %s\n"), VERSION); 
    141138 
    142     printf (_("Built with GLib %d.%d.%d\n"), 
    143             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); 
     139    printf (_("Built with GLib %d.%d.%d (using GLib %d.%d.%d)\n"), 
     140            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION, 
     141            glib_major_version, glib_minor_version, glib_micro_version); 
     142 
     143#ifdef HAVE_SLANG 
     144    printf (_("Built with S-Lang")); 
     145#ifdef SLANG_VERSION_STRING 
     146    printf (" %s", SLANG_VERSION_STRING); 
     147#elif defined SLANG_VERSION 
     148    printf (" %d", SLANG_VERSION); 
     149#endif /* SLANG_VERSION_STRING || SLANG_VERSION */ 
     150    printf (_(" and terminfo database (using S-Lang %s)\n"), SLang_Version_String); 
     151#elif defined HAVE_NCURSES 
     152    printf (_("Built with %s"), NCURSES_LIB_DISPLAYNAME); 
     153#ifdef NCURSES_VERSION_MAJOR 
     154    printf (" %d", NCURSES_VERSION_MAJOR); 
     155#ifdef NCURSES_VERSION_MINOR 
     156    printf (".%d", NCURSES_VERSION_MINOR); 
     157#endif 
     158#endif /* NCURSES_VERSION_MAJOR */ 
     159#ifdef NCURSES_VERSION_PATCH 
     160    printf (".%d", NCURSES_VERSION_PATCH); 
     161#endif 
     162    printf (_(" (using %s)\n"), curses_version()); 
     163#else /* !HAVE_SLANG && !HAVE_NCURSES */ 
     164#error "Cannot compile mc without S-Lang or ncurses" 
     165#endif /* !HAVE_SLANG && !HAVE_NCURSES */ 
    144166 
    145167    for (i = 0; features[i] != NULL; i++) 
    146168        printf ("%s", _(features[i]));