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>
33 #if defined (ENABLE_VFS) && defined(ENABLE_VFS_SFTP)
35 #endif /* ENABLE_VFS_SFTP && ENABLE_VFS */
37 #include "lib/global.h"
38 #include "lib/fileloc.h"
39 #include "lib/mcconfig.h"
40 #include "lib/util.h" /* mc_get_profile_root() */
41 #include "lib/tty/tty.h" /* S-Lang or ncurses version */
43 #include "src/textconf.h"
45 /*** global variables ****************************************************************************/
47 /*** file scope macro definitions ****************************************************************/
49 /*** file scope type declarations ****************************************************************/
51 /*** forward declarations (file scope functions) *************************************************/
53 /*** file scope variables ************************************************************************/
56 static const char *const vfs_supported
[] = {
57 #ifdef ENABLE_VFS_CPIO
66 #ifdef ENABLE_VFS_EXTFS
69 #ifdef ENABLE_VFS_UNDELFS
75 #ifdef ENABLE_VFS_SFTP
78 #ifdef ENABLE_VFS_SHELL
83 #endif /* ENABLE_VFS */
85 static const char *const features
[] = {
87 #ifdef USE_INTERNAL_EDIT
89 N_("With builtin editor and aspell support"),
91 N_("With builtin editor"),
92 #endif /* HAVE_ASPELL */
93 #endif /* USE_INTERNAL_EDIT */
95 #ifdef ENABLE_SUBSHELL
96 #ifdef SUBSHELL_OPTIONAL
97 N_("With optional subshell support"),
99 N_("With subshell support as default"),
101 #endif /* !ENABLE_SUBSHELL */
103 #ifdef ENABLE_BACKGROUND
104 N_("With support for background operations"),
108 N_("With mouse support on xterm and Linux console"),
110 N_("With mouse support on xterm"),
113 #ifdef HAVE_TEXTMODE_X11_SUPPORT
114 N_("With support for X11 events"),
118 N_("With internationalization support"),
122 N_("With multiple codepages support"),
125 #ifdef ENABLE_EXT2FS_ATTR
126 N_("With ext2fs attributes support"),
132 /*** file scope functions ************************************************************************/
133 /* --------------------------------------------------------------------------------------------- */
135 /* --------------------------------------------------------------------------------------------- */
136 /*** public functions ****************************************************************************/
137 /* --------------------------------------------------------------------------------------------- */
144 printf (_("GNU Midnight Commander %s\n"), mc_global
.mc_version
);
146 printf (_("Built with GLib %d.%d.%d\n"),
147 GLIB_MAJOR_VERSION
, GLIB_MINOR_VERSION
, GLIB_MICRO_VERSION
);
150 printf (_("Built with S-Lang %s with terminfo database\n"), SLANG_VERSION_STRING
);
151 #elif defined(USE_NCURSES)
152 #ifdef NCURSES_VERSION
153 printf (_("Built with ncurses %s\n"), NCURSES_VERSION
);
155 puts (_("Built with ncurses (unknown version)"));
156 #endif /* !NCURSES_VERSION */
157 #elif defined(USE_NCURSESW)
158 #ifdef NCURSES_VERSION
159 printf (_("Built with ncursesw %s\n"), NCURSES_VERSION
);
161 puts (_("Built with ncursesw (unknown version)"));
162 #endif /* !NCURSES_VERSION */
164 #error "Cannot compile mc without S-Lang or ncurses"
165 #endif /* !HAVE_SLANG && !USE_NCURSES */
167 #if defined (ENABLE_VFS) && defined(ENABLE_VFS_SFTP)
168 printf (_("Built with libssh2 %d.%d.%d\n"),
169 LIBSSH2_VERSION_MAJOR
, LIBSSH2_VERSION_MINOR
, LIBSSH2_VERSION_PATCH
);
170 #endif /* ENABLE_VFS_SFTP && ENABLE_VFS */
172 for (i
= 0; features
[i
] != NULL
; i
++)
173 puts (_(features
[i
]));
176 puts (_("Virtual File Systems:"));
177 for (i
= 0; vfs_supported
[i
] != NULL
; i
++)
178 printf ("%s %s", i
== 0 ? "" : ",", _(vfs_supported
[i
]));
180 #endif /* ENABLE_VFS */
182 (void) puts (_("Data types:"));
183 #define TYPE_INFO(T) \
184 (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
195 /* --------------------------------------------------------------------------------------------- */
196 #define PRINTF_GROUP(a) \
197 (void) printf ("[%s]\n", a)
198 #define PRINTF_SECTION(a,b) \
199 (void) printf (" %-17s %s\n", a, b)
200 #define PRINTF_SECTION2(a,b) \
201 (void) printf (" %-17s %s/\n", a, b)
202 #define PRINTF(a, b, c) \
203 (void) printf ("\t%-15s %s/%s\n", a, b, c)
204 #define PRINTF2(a, b, c) \
205 (void) printf ("\t%-15s %s%s\n", a, b, c)
208 show_datadirs_extended (void)
210 (void) printf ("%s %s\n", _("Home directory:"), mc_config_get_home_dir ());
211 (void) printf ("%s %s\n", _("Profile root directory:"), mc_get_profile_root ());
214 PRINTF_GROUP (_("System data"));
216 PRINTF_SECTION (_("Config directory:"), mc_global
.sysconfig_dir
);
217 PRINTF_SECTION (_("Data directory:"), mc_global
.share_data_dir
);
219 PRINTF_SECTION (_("File extension handlers:"), EXTHELPERSDIR
);
221 #if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_SHELL
222 PRINTF_SECTION (_("VFS plugins and scripts:"), LIBEXECDIR
);
223 #ifdef ENABLE_VFS_EXTFS
224 PRINTF2 ("extfs.d:", LIBEXECDIR
, MC_EXTFS_DIR PATH_SEP_STR
);
226 #ifdef ENABLE_VFS_SHELL
227 PRINTF2 ("shell:", LIBEXECDIR
, VFS_SHELL_PREFIX PATH_SEP_STR
);
229 #endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_SHELL */
232 PRINTF_GROUP (_("User data"));
234 PRINTF_SECTION2 (_("Config directory:"), mc_config_get_path ());
235 PRINTF_SECTION2 (_("Data directory:"), mc_config_get_data_path ());
236 PRINTF ("skins:", mc_config_get_data_path (), MC_SKINS_DIR PATH_SEP_STR
);
237 #ifdef ENABLE_VFS_EXTFS
238 PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR PATH_SEP_STR
);
240 #ifdef ENABLE_VFS_SHELL
241 PRINTF ("shell:", mc_config_get_data_path (), VFS_SHELL_PREFIX PATH_SEP_STR
);
243 #ifdef USE_INTERNAL_EDIT
244 PRINTF ("mcedit macros:", mc_config_get_data_path (), MC_MACRO_FILE
);
245 PRINTF ("mcedit external macros:", mc_config_get_data_path (), EDIT_HOME_MACRO_FILE
".*");
247 PRINTF_SECTION2 (_("Cache directory:"), mc_config_get_cache_path ());
251 #undef PRINTF_SECTION
254 /* --------------------------------------------------------------------------------------------- */
256 #ifdef ENABLE_CONFIGURE_ARGS
258 show_configure_options (void)
260 (void) puts (MC_CONFIGURE_ARGS
);
264 /* --------------------------------------------------------------------------------------------- */