2 Print features specific for this build
4 Copyright (C) 2000-2024
5 Free Software Foundation, Inc.
7 This file is part of the Midnight Commander.
9 The Midnight Commander is free software: you can redistribute it
10 and/or modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation, either version 3 of the License,
12 or (at your option) any later version.
14 The Midnight Commander is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * \brief Source: prints features specific for this build
31 #include <sys/types.h>
32 #include <stdint.h> /* uintmax_t */
34 #if defined (ENABLE_VFS) && defined(ENABLE_VFS_SFTP)
36 #endif /* ENABLE_VFS_SFTP && ENABLE_VFS */
38 #include "lib/global.h"
39 #include "lib/fileloc.h"
40 #include "lib/mcconfig.h"
41 #include "lib/util.h" /* mc_get_profile_root() */
42 #include "lib/tty/tty.h" /* S-Lang or ncurses version */
44 #include "src/textconf.h"
46 /*** global variables ****************************************************************************/
48 /*** file scope macro definitions ****************************************************************/
50 /*** file scope type declarations ****************************************************************/
52 /*** forward declarations (file scope functions) *************************************************/
54 /*** file scope variables ************************************************************************/
57 static const char *const vfs_supported
[] = {
58 #ifdef ENABLE_VFS_CPIO
67 #ifdef ENABLE_VFS_EXTFS
70 #ifdef ENABLE_VFS_UNDELFS
76 #ifdef ENABLE_VFS_SFTP
79 #ifdef ENABLE_VFS_SHELL
84 #endif /* ENABLE_VFS */
86 static const char *const features
[] = {
88 #ifdef USE_INTERNAL_EDIT
90 N_("With builtin editor and aspell support"),
92 N_("With builtin editor"),
93 #endif /* HAVE_ASPELL */
94 #endif /* USE_INTERNAL_EDIT */
96 #ifdef ENABLE_SUBSHELL
97 #ifdef SUBSHELL_OPTIONAL
98 N_("With optional subshell support"),
100 N_("With subshell support as default"),
102 #endif /* !ENABLE_SUBSHELL */
104 #ifdef ENABLE_BACKGROUND
105 N_("With support for background operations"),
109 N_("With mouse support on xterm and Linux console"),
111 N_("With mouse support on xterm"),
114 #ifdef HAVE_TEXTMODE_X11_SUPPORT
115 N_("With support for X11 events"),
119 N_("With internationalization support"),
123 N_("With multiple codepages support"),
126 #ifdef ENABLE_EXT2FS_ATTR
127 N_("With ext2fs attributes support"),
133 /*** file scope functions ************************************************************************/
134 /* --------------------------------------------------------------------------------------------- */
136 /* --------------------------------------------------------------------------------------------- */
137 /*** public functions ****************************************************************************/
138 /* --------------------------------------------------------------------------------------------- */
145 printf (_("GNU Midnight Commander %s\n"), mc_global
.mc_version
);
147 printf (_("Built with GLib %d.%d.%d\n"),
148 GLIB_MAJOR_VERSION
, GLIB_MINOR_VERSION
, GLIB_MICRO_VERSION
);
151 printf (_("Built with S-Lang %s with terminfo database\n"), SLANG_VERSION_STRING
);
152 #elif defined(USE_NCURSES)
153 #ifdef NCURSES_VERSION
154 printf (_("Built with ncurses %s\n"), NCURSES_VERSION
);
156 puts (_("Built with ncurses (unknown version)"));
157 #endif /* !NCURSES_VERSION */
158 #elif defined(USE_NCURSESW)
159 #ifdef NCURSES_VERSION
160 printf (_("Built with ncursesw %s\n"), NCURSES_VERSION
);
162 puts (_("Built with ncursesw (unknown version)"));
163 #endif /* !NCURSES_VERSION */
165 #error "Cannot compile mc without S-Lang or ncurses"
166 #endif /* !HAVE_SLANG && !USE_NCURSES */
168 #if defined (ENABLE_VFS) && defined(ENABLE_VFS_SFTP)
169 printf (_("Built with libssh2 %d.%d.%d\n"),
170 LIBSSH2_VERSION_MAJOR
, LIBSSH2_VERSION_MINOR
, LIBSSH2_VERSION_PATCH
);
171 #endif /* ENABLE_VFS_SFTP && ENABLE_VFS */
173 for (i
= 0; features
[i
] != NULL
; i
++)
174 puts (_(features
[i
]));
177 puts (_("Virtual File Systems:"));
178 for (i
= 0; vfs_supported
[i
] != NULL
; i
++)
179 printf ("%s %s", i
== 0 ? "" : ",", _(vfs_supported
[i
]));
181 #endif /* ENABLE_VFS */
183 (void) puts (_("Data types:"));
184 #define TYPE_INFO(T) \
185 (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
192 TYPE_INFO (uintmax_t);
197 /* --------------------------------------------------------------------------------------------- */
198 #define PRINTF_GROUP(a) \
199 (void) printf ("[%s]\n", a)
200 #define PRINTF_SECTION(a,b) \
201 (void) printf (" %-17s %s\n", a, b)
202 #define PRINTF_SECTION2(a,b) \
203 (void) printf (" %-17s %s/\n", a, b)
204 #define PRINTF(a, b, c) \
205 (void) printf ("\t%-15s %s/%s\n", a, b, c)
206 #define PRINTF2(a, b, c) \
207 (void) printf ("\t%-15s %s%s\n", a, b, c)
210 show_datadirs_extended (void)
212 (void) printf ("%s %s\n", _("Home directory:"), mc_config_get_home_dir ());
213 (void) printf ("%s %s\n", _("Profile root directory:"), mc_get_profile_root ());
216 PRINTF_GROUP (_("System data"));
218 PRINTF_SECTION (_("Config directory:"), mc_global
.sysconfig_dir
);
219 PRINTF_SECTION (_("Data directory:"), mc_global
.share_data_dir
);
221 PRINTF_SECTION (_("File extension handlers:"), EXTHELPERSDIR
);
223 #if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_SHELL
224 PRINTF_SECTION (_("VFS plugins and scripts:"), LIBEXECDIR
);
225 #ifdef ENABLE_VFS_EXTFS
226 PRINTF2 ("extfs.d:", LIBEXECDIR
, MC_EXTFS_DIR PATH_SEP_STR
);
228 #ifdef ENABLE_VFS_SHELL
229 PRINTF2 ("shell:", LIBEXECDIR
, VFS_SHELL_PREFIX PATH_SEP_STR
);
231 #endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_SHELL */
234 PRINTF_GROUP (_("User data"));
236 PRINTF_SECTION2 (_("Config directory:"), mc_config_get_path ());
237 PRINTF_SECTION2 (_("Data directory:"), mc_config_get_data_path ());
238 PRINTF ("skins:", mc_config_get_data_path (), MC_SKINS_DIR PATH_SEP_STR
);
239 #ifdef ENABLE_VFS_EXTFS
240 PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR PATH_SEP_STR
);
242 #ifdef ENABLE_VFS_SHELL
243 PRINTF ("shell:", mc_config_get_data_path (), VFS_SHELL_PREFIX PATH_SEP_STR
);
245 #ifdef USE_INTERNAL_EDIT
246 PRINTF ("mcedit macros:", mc_config_get_data_path (), MC_MACRO_FILE
);
247 PRINTF ("mcedit external macros:", mc_config_get_data_path (), EDIT_HOME_MACRO_FILE
".*");
249 PRINTF_SECTION2 (_("Cache directory:"), mc_config_get_cache_path ());
253 #undef PRINTF_SECTION
256 /* --------------------------------------------------------------------------------------------- */
258 #ifdef ENABLE_CONFIGURE_ARGS
260 show_configure_options (void)
262 (void) puts (MC_CONFIGURE_ARGS
);
266 /* --------------------------------------------------------------------------------------------- */