Commit Graph

201 Commits

Author SHA1 Message Date
Yury V. Zaytsev 6ea7bd0196 buildsys: disable buggy or unhelpful warnings
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-11-04 17:23:22 +01:00
Yury V. Zaytsev 43e6c040de buildsys: add `-Wall` and `-Wextra`, remove duplicate flags, set standard to C99
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-11-04 17:23:22 +01:00
Yury V. Zaytsev 93b539444b Ticket #4584: re-implement mocking via weak symbols instead of symbol duplication
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-19 08:56:40 +02:00
Yury V. Zaytsev fc96f96c6a buildsys: sync `ax_check_compile_flag.m4` with autoconf archive
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-18 21:05:37 +02:00
Yury V. Zaytsev 901a1a98a9 buildsys: remove orphaned rpc checks after samba was deleted
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-05 15:07:14 +03:00
Andrew Borodin 72d0b4f878 Add some files and code rom Gnulib as preparation to TAR updates.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Yury V. Zaytsev 1e0e6b5e1e charset: rename IBM866 to CP866 for iconv and adjust charset names for codeset
```
linux $ iconv -l | grep 866
866//
866NAV//
CP866//
CP866NAV//
CSIBM866//
IBM866//
IBM866NAV//

solaris $ iconv -l | grep 866
    CP866 (CP866, CP-866, CP_866, 866),
    IBM-866,

macos % iconv -l | grep 866
CP866 866 CSIBM866 IBM866 MSCP866

musl/src/locale/codepages.h: "cp866\0"
```

On glibc-based systems, codeset will be set to charmap name, on most other systems it seems to be taken from locale name.

## Linux

```
zaytsev@fedora:~$ locale -a | grep ru
ru_RU
ru_RU.cp866
ru_RU.ibm866
ru_RU.iso88595
ru_RU.koi8r
ru_RU.utf8
russian
ru_UA
ru_UA.koi8u
ru_UA.utf8

zaytsev@fedora:~/src$ LC_ALL=ru_RU.cp866 LANG=ru_RU.cp866 ./a.out
IBM866

zaytsev@fedora:~/src$ LC_ALL=ru_RU.koi8r LANG=ru_RU.koi8r ./a.out
KOI8-R

zaytsev@fedora:~/src$ LC_ALL=ru_RU.iso88595 LANG=ru_RU.iso88595 ./a.out
ISO-8859-5
```

## macOS

```
ru_RU.ISO8859-5
ru_RU.CP866
ru_RU.CP1251
ru_RU.UTF-8
ru_RU.KOI8-R
ru_RU

zaytsev@Yurys-MBP mc % LANG=ru_RU.CP866 LC_ALL=ru_RU.CP866 ./a.out
CP866

zaytsev@Yurys-MBP mc % LANG=ru_RU.ISO8859-5 LC_ALL=ru_RU.ISO8859-5 ./a.out
ISO8859-5
```

## FreeBSD

```
ru_RU.CP1251
ru_RU.CP866
ru_RU.ISO8859-5
ru_RU.KOI8-R
ru_RU.UTF-8

zaytsev@cfarm240:~ $ LANG=ru_RU.ISO8859-5 LC_ALL=ru_RU.ISO8859-5 ./a.out
ISO8859-5

zaytsev@cfarm240:~ $ LANG=ru_RU.CP866 LC_ALL=ru_RU.CP866 ./a.out
CP866
```

## Solaris

```
ru
ru.UTF-8
ru.koi8-r
ru_RU
ru_RU.ANSI1251
ru_RU.ISO8859-5
ru_RU.KOI8-R
ru_RU.UTF-8

zaytsev@gcc-solaris10:~/src$ LANG=ru_RU.ISO8859-5 LC_ALL=ru_RU.ISO8859-5 ./a.o>
ISO8859-5

zaytsev@gcc-solaris10:~/src$ LANG=ru.koi8-r LC_ALL=ru.koi8-r ./a.out
KOI8-R
```

## AIX

```
zaytsev@gcc111:[/home/zaytsev]locale -a
C
POSIX
en_US.8859-15
en_US.IBM-858
en_US.ISO8859-1
en_US

-bash-5.1$ LANG=en_US.ISO8859-1 LC_ALL=en_US.ISO8859-1 ./a.out
ISO8859-1
```

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-05 11:49:26 +02:00
Yury V. Zaytsev 55e7f8321b buildsys: make it possible to specify aspell prefix (for macOS)
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-07-28 18:42:51 +02:00
Yury V. Zaytsev 57dddea47c buildsys: fix broken detection for termcap libraries when using slang
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-06-15 10:40:22 +02:00
Yury V. Zaytsev 87bdeeb591 buildsys: update ax_gcc_func_attribute to fix fallthrough detection
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-06-02 12:49:13 +03:00
Yury V. Zaytsev 3d75fad259 m4: add Werror when checking for compiler flags
Seemingly that at some point clang started accepting _any_ flags,
whereas previously it would error out.

These days, you can give it -Whamsandwich and it will succeed, while
at the same time throwing an annoying warning.

Add -Werror so that everything gets flagged and set accordingly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108082
Cc: Vinson Lee <vlee@freedesktop.org>
Repored-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-06-02 12:49:13 +03:00
Andrew Borodin 56f31e03ff Bump minimum GLib requirenment to 2.32.0.
This is required for g_array_set_clear_func().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-11-06 21:06:14 +03:00
Andrew Borodin 6ca4ab4b4e Rename FISH VFS to SHELL one. 2023-10-15 16:04:39 +03:00
Andrew Borodin 9688e7d015 Ticket #4439: FTBFS on FreeBSD with ext2fs attribute support:
local.c:35:10: fatal error: 'e2p/e2p.h' file not found
         ^~~~~~~~~~~

  * m4.include/mc-ext2fs-attr.m4: add EXT2FS_CFLAGS E2P_CFLAGS to
    CPPFLAGS here...
  * src/filemanager/Makefile.am: ...not here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-08-19 20:51:07 +03:00
Evgeny Grin 8fba56d40f Ticket #4465: remove duplicated libs from MCLIBS (again).
Fixed copy-paste error.
This is a correction for 92ae4c6b20.

Closes MidnightCommander/mc#190.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-21 20:15:30 +03:00
Evgeny Grin 92ae4c6b20 Ticket #4463: ncurses library is duplicated in MCLIBS.
AC_SEARCH_LIBS macro adds required library to 'LIBS' variable.
Currently 'LIBS' could be appended to 'MCLIBS' several times leading to
duplication of found values.
Also fixed duplication for 'stdscr' function detection.
Additionally fixed potential problematic situation when 'addwstr' or
'has_colors' detected in one ncurses library (for example 'ncurses'),
while 'stdscr' detected in other ncurses library (for example 'curses').
Such combination leads to problems.

Closes MidnightCommander/mc#187.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 20:54:50 +03:00
Evgeny Grin 1f732f0a14 Ticket #4462: FTBFS if ncurses used without --with-ncurses-includes= configure parameter.
If ncurses location is not specified by configure parameters like
'--with-ncurses-includes=/some/dir' then automatic detection at compiler
default location is used. With automatic detection the header
'ncurses/term.h' is not checked therefore macro HAVE_NCURSES_TERM_H is
not defined.

Closes MidnightCommander/mc#186.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 20:42:48 +03:00
Evgeny Grin f45d02ba2a Use configure detected or user specified sed in build system
Sometimes system default sed is not the best option.
With this modification user may easily override sed used by build system
without editing any file.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-05-20 19:56:53 +03:00
Andrew Borodin 49624e473b Ticket #4450: support PCRE2 in the search engine.
* m4.include/ax_path_lib_pcre.m4: replace by recent version from GNU
Autoconf Archive.
  * m4.include/ax_check_pcre2.m4: get grom GNU Autoconf Archive.
  * m4.include/mc-check-search-type.m4: support both PCRE versions.
  * */*/Makefile.am: remove @CHECK_CFLAGS@ and @PCRE_LIBS@ ads they are
added via AX_PATH_LIB_PCRE and AX_CHECK_PCRE2.
  * lib/search.h, lib/search/: add support of PCRE2. Thanks broly <gagan@hotmail.com>
for the initial patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-25 10:07:41 +03:00
Andrew Borodin fe89441f3d gl_POSIX_FALLOCATE: rename to POSIX_FALLOCATE.
Remove the gl_ prefix because this macro isn't from Gnulib.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:23 +03:00
Florian Weimer b7e4fb9ef6 Ticket #4438: autoconf: fix C99 compatibility issue in mc_GET_FS_INFO check.
Include <fcntl.h> for the declaration of posix_fallocate.  This
avoids an implicit function declaration and build issues with future
compilers.

Signed-off-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:23 +03:00
Kian-Meng Ang 5001232704 Fix various typos in the source code (closes MidnightCommander/mc#177).
Found via `codespell -S
po,doc,./misc/syntax,./src/vfs/extfs/helpers/README.it -L
parm,rouge,sav,ect,vie,te,dum,clen,wee,dynamc,childs,ths,fo,nin,unx,nd,iif,iterm,ser,makrs,wil`

Co-authored-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Kian-Meng Ang <kianmeng@cpan.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-28 21:38:05 +03:00
Andrew Borodin b69168cfb5 Ticket #4420: fail to build with only SFTP network VFS enabled.
* m4.include/mc-vfs.m4: use $enable_vfs_sftp to test functions
    required for network VFSes. Define ENABLE_VFS_NET preprocessor
    macro here...
  * lib/vfs/vfs.h: ...not here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-12-30 08:08:47 +03:00
Andrew Borodin 39e7a048f7 tests/lib/strutil/filevercmp.c: minor improvements.
Use ck_assert_int_lt() and ck_assert_int_gt() to check integer values.

Increase minimal version of Check up to 0.9.10.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 62d2580302 Reimplement compiler options checking. 2021-11-21 15:00:39 +03:00
Andrew Borodin 89d8fa4ac1 Ticket #1: remove SMB suport.
The mc's built-in samba library which is used to access data across
smb links is taken from an old samba version.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-26 10:03:49 +03:00
Andrew Borodin b0450a1e18 Ticket #4259: SFTPFS VFS: verify server fingerprint (CVE-2021-36370).
This vulnerability was discovered by AUT-milCERT during an audit of open
source software.

Initial changeset: set minimal version of libssh2 to 1.2.8.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-07-26 20:33:48 +03:00
Andrew Borodin 4ed3e4b0f6 Sync with gnulib 80a344e3237b878734295cbe696b7f1e4a8541f0.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin 5fc84f2cfe m4.include/mc-subshell.m4: minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin 0a26014ca4 m4.include/mc-with-screen-slang.m4: check S-Lang using pkg-config only.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin 3b16728742 Rename DISTR_VERSION macro to MAN_VERSION.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 16:58:31 +03:00
Andrew Borodin 30480df7c9 Rename version.h to mc-version.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 16:58:31 +03:00
Andreas Mohr 1409eddde3 Ticket #3603: configure.ac: proper AC_INIT and AM_INIT_AUTOMAKE usage.
Fix deprecate warning
configure.ac:13: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:13: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Support of m4_esyscmd_s() since autoconf-2.64 (release 2009-07-26).

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-28 19:37:58 +03:00
Andrew Borodin 63d50df5d9 Ticket #4217: remove OS/distro-specific stuff.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-21 20:30:30 +03:00
Andrew Borodin f5b813a0ab undelfs simplifications.
m4.include/vfs/mc-vfs-undelfs.m4: simplify test of required libraries.
Don't test Linux kernel specific header.

src/vfs/undelfs/undelfs.c: don't include Linux kernel specific header.
Use headers from ext2fs library only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin 6af68462dd Sync with gnulib 1b357ec51ac32ebc6262373a354ffd33e5bba8c0.
Remove some of the support for obsolete IRIX 4 and 5.

* m4.include/gnulib/mountlist.m4 (AC_FUNC_GETMNTENT): Don't test for
getmntent in libsun.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin d640a1630a m4.include/gnulib/stat-size.m4: shorten https://lists.gnu.org/archive/html/... link.
Sync with gnulib 2a3dbe99a2aeb058ecb033d7d830e6600e16c91c.

/archive/html/ part can be replace with /r/.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:37:41 +03:00
Andrew Borodin b0dba0a2b5 m4.include/gnulib/fsusage.m4: produce more regular configure output.
Sync with gnulib 875dff5812cb9de949727e1aa399a06b07a886a9.

Remove AC_MSG_CHECKING without corresponding AC_MSG_RESULT.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin d21c5946ce Sync with gnulib 85d1d48f6fa89de6a5de9e7794bda3255f0f32aa.
Fix quoting of AC_LANG_PROGRAM arguments.

* m4.include/gnulib//mountlist.m4 (gl_MOUNTLIST): Quote the
AC_LANG_PROGRAM arguments through [[...]].

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin e14d44c839 Ticket #3847: chattr command implementattion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-05 19:06:18 +03:00
Andrew Borodin 91688ab76e Ticket #4052: reimplement SIGWINCH handling.
Bump minimum GLib requirenment to 2.30.0.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-08 19:35:36 +03:00
Andrew Borodin dd8c827987 Replace [] in AS_HELP_STRING.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-29 15:11:53 +03:00
Sergei Trofimovich f30e6ff283 Ticket #3629: configure.ac: drop bundled gettext
Bundled libintl did not support linking to internal static
libraries (libmc in our case): directly specified static
libraries are not pulled by libtool and are not usable for
dynamic libraries as PIC-related flags are not passed for
compilation.

This renders bundled libintl library unusable.

The change drops libintl bundling support and always relies
on external libintl (or falls back to disabled NLS).

On a related note gettext-0.20 drops support for bundling
or libintl and this change will ease migration to newer version.

The change is tested on x86_64-gentoo-linux-musl: mc builds
and links all tests successfully. A few tests fail for lack
of NLS support.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-22 13:10:46 +03:00
Andrew Borodin 76a5f70f5b Ticket #3992: improve support of Windows 1251 encoding on Solaris.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-07-13 08:58:27 +03:00
Andrew Borodin 4f06ba9346 Ticket #3971: clarify sighandler_t usage in non-GNU OSes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-06-15 09:38:53 +03:00
Andrew Borodin 8388de9b50 m4.include/mc-tests.m4: fix bash-isms.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin dc999a23eb (mc_AC_GET_FS_INFO): rename to mc_GET_FS_INFO...
since it is not from Autoconf.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 13:10:01 +03:00
Andrew Borodin 392a9b6f92 Sync with gnulib 5d6ca1aeeb04b9b0cd760529d548ac26675ef9b9.
Merge m4.include/gnuluib/{mountlist,ls-mntd-fs}.m4 files.
Remove m4.include/gnuluib/ls-mntd-fs.m4.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 13:10:01 +03:00
Andrew Borodin 1c621d1a86 Sync with gnulib a3d1c7849936e481ae10dea5312a36a448a5d5bf.
src/filemanager/mountlist.c: use Linux code on Android.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 13:10:00 +03:00
Andrew Borodin 5505ed054d Sync with gnulib 248cb6a2499ffa5a9e652d05e61c4a959fbae605.
src/filemanager/mountlist.c: port better to Android.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 13:10:00 +03:00