1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-01-27 00:18:12 +03:00
Commit Graph

80 Commits

Author SHA1 Message Date
Viktor Szakats
14de8476c3 checksrc: replace bash starter with checksrc-all.pl
To remove dependence on a shell script to start `checksrc.pl`.

Fixes #1775
Closes #1778
2026-01-12 12:42:57 +01:00
Viktor Szakats
f97fb271e3 scripts: fix shellcheck SC2046 warnings
Also:
- use more `--` end-of-options markers.
- checksrc.sh: use literal quotes.

Closes #1739
2025-11-10 19:06:10 +01:00
Patrick Monnerat
40e817ff50 os400: drop vsprintf() use
Follow-up to discussion in #1457

Plus e-mail address update.

Closes #1462
2024-10-02 16:04:30 +02:00
Viktor Szakats
1117b677a0 checksrc: update, check all sources, fix fallouts
update from curl:
cff75acfec/scripts/checksrc.pl

Closes #1457
2024-09-28 11:41:52 +02:00
Viktor Szakats
814a850c97 buildconf: drop
Use `autoreconf -fi` instead.

Follow-up to fc5d77881e
Closes #1441
2024-08-07 18:19:15 +02:00
Patrick Monnerat
e4c65e5b1b os400: Add two recent files to the distribution
Closes #1364
2024-04-14 03:20:23 +00:00
Viktor Szakats
5e0ec99134 ci: add OmniOS job, fix issues
- use GNU Make, to avoid errors:
  ```
  make: Fatal error in reader: Makefile, line 983: Badly formed macro assignment
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7134629175/job/19429838379#step:3:1956

  Caused by `?=` in `Makefile.am`. Fix it just in case.

  ```
  make: Fatal error in reader: Makefile, line 438: Unexpected end of line seen
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7135524843/job/19432451767#step:3:1966

  It's around line 43 in `Makefile.am`, reason undiscovered.

- fix error:
  ```
  ../../src/hostkey.c:1227:44: error: pointer targets in passing argument 5 of '_libssh2_ed25519_sign' differ in signedness [-Werror=pointer-sign]
     1227 |                                  datavec[0].iov_base, datavec[0].iov_len);
          |                                  ~~~~~~~~~~^~~~~~~~~
          |                                            |
          |                                            caddr_t {aka char *}
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7135102832/job/19431233967#step:3:2225

  https://docs.oracle.com/cd/E36784_01/html/E36887/iovec-9s.html

- FIXME: new `-Wsign-conversion` warnings appeared in examples:
  ```
  ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion]
    251 |         FD_SET(forwardsock, &fds);
        |         ^~~~~~
  ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion]
  ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion]
  ../../example/direct_tcpip.c:251:9: warning: conversion to 'long int' from 'long unsigned int' may change the sign of the result [-Wsign-conversion]
  ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion]
    259 |         if(rc && FD_ISSET(forwardsock, &fds)) {
        |                  ^~~~~~~~
  ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion]
  ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion]
  [...]
  ```
  Ref: https://github.com/libssh2/libssh2/actions/runs/7136086865/job/19433997429#step:3:3450

Cherry-picked from #1277
2023-12-08 02:02:44 +00:00
Viktor Szakats
e051ae343a autotools: delete --disable-tests option, fix CI tests
Originally added to improve build performance by skipping building
tests. But, there seems to be no point in this, because autotools
doesn't build tests by default, unless explicitly invoking
`make check`.

Delete this option from Cygwin and FreeBSD CI tests, where it caused
`make check` to do nothing. Tests are built now, and runtime tests are
too, where supported.

Also disable Docker-based tests for these, and add a missing `make -j3`
for FreeBSD.

Reverts 7483edfada #715

Closes #1271
2023-12-06 00:55:15 +00:00
Viktor Szakats
4348557960 Makefile.mk: delete Windows-focused raw GNU Make build
We recommend using CMake instead. Especially in unity mode, it's faster
and probably more familiar for most. It's also easily portable.

(`Makefile.mk` was also portable, but in practice only usable for
Windows. Other platforms required a manual config header.)

Also:
- migrate `LIBSSH2_NO_*` option CI tests to CMake.
- make MSYS2 CMake builds verbose to show compilation options.

Closes #1204
2023-11-06 21:41:12 +00:00
Viktor Szakats
f64e6318f0 Makefile.am: fix cp to preserve attributes and timestamp 2023-10-30 11:23:50 +00:00
Viktor Szakats
c515eed398 NMakefile: delete
This make file was for long time unmaintained (last updated in 2014).
Despite best efforts to keep it working in the recent round of major
overhauls, it appears to be broken now. There is also no way to test it
without an actual MSVC env and it's also missing from our CI. Based on
our Issue tracker, it's also not widely used.

Since its addition in 2005, libssh2 got support for CMake in 2014.
CMake should be able to generate NMake makefiles with the option
`-G "NMake Makefiles"`. (I haven't tested this.)

Ref: https://github.com/libssh2/libssh2/discussions/1129
Closes #1134
2023-07-26 09:38:02 +00:00
Daniel Stenberg
f6aa31f48f provide SPDX identifiers
- All files have prominent copyright and SPDX identifier
- If not embedded in the file, in the .reuse/dep5 file
- All used licenses are in LICENSES/ (not shipped in tarballs)
- A new REUSE CI job verify that all files are OK

Assisted-by: Viktor Szakats

Closes #1084
2023-06-07 08:18:55 +02:00
Viktor Szakats
d67a91aa10 checksrc: switch to dot file
Closes #1052
2023-05-30 17:24:28 +00:00
Viktor Szakats
5d399233d8 checksrc: fix EQUALSNULL warnings
`s/([a-z0-9._>*-]+) == NULL/!\1/g`

Closes #964
2023-04-15 02:46:09 +00:00
Viktor Szakats
cd5b114e7d Makefile.am: add new OS400 header [ci skip]
Follow-up to 6dc42e9d62
2023-04-14 19:28:36 +00:00
Viktor Szakats
1b0c93b755 checksrc: fix NOTEQUALSZERO warnings
Closes #963
2023-04-14 19:16:27 +00:00
Viktor Szakats
8b4387d0dc checksrc: fix SIZEOFNOPAREN warnings
`s/sizeof ([a-z0-9._>*-]+)/sizeof(\1)/g`

Closes #962
2023-04-14 19:15:18 +00:00
Viktor Szakats
0924632fa0 tidy-up: misc & minor cmake MSVS fix
- `libssh2.rc`: document language/codepage codes.

  Ref: https://learn.microsoft.com/windows/win32/intl/code-page-identifiers

- convert to Markdown: `docs/BINDINGS`, `docs/HACKING`

  Blind update for `vms/libssh2_make_help.dcl`. Please double-check.

- cmake: fix to recognize dash-style warning options (`-Wn`) with MSVC.

- `NMakefile`: sync `rd` command with `Makefile.mk`.

- delete a CVS header.

- cmake: simplify a `LIBSSH2_HAVE_ZLIB` macro.

- few other nits and whitespace mods.

Closes #943
2023-04-10 23:03:43 +00:00
Viktor Szakats
4f0f4bff5a build: unify source lists
- introduce `src/crypto.c` as an umbrella source that does nothing else
  than include the selected crypto backend source. Moving this job from
  the built-tool to the C preprocessor.

- this allows dropping the various techniques to pick the correct crypto
  backend sources in autotools, CMake and other build method. Including
  the per-backend `Makefile.<crypto-backend>.inc` makefiles.

- copy a trick from curl and instead of maintaining duplicate source
  lists for CMake, convert the GNU Makefile kept for autotools
  automatically. Do this in `docs`, `examples` and `src`.

  Ref: dfabe8bca2/CMakeLists.txt (L1399-L1413)

  Also fixes missing `libssh2_setup.h` from `src/CMakeFiles.txt` after
  59666e03f0.

- move `Makefile.inc` from root to `src`.

- reformat `src/Makefile.inc` to list each source in separate lines,
  re-align the continuation character and sort the lists alphabetically.

- update `docs/HACKING-CRYPTO` accordingly.

- autotools: update the way we add crypto-backends to `LIBS`.

- delete old CSV headers, indent, and merge two lines in
  `docs/Makefile.am` and `src/Makefile.am`.

- add `libssh2.pc` to `.gitignore`, while there.

Closes #941
2023-04-10 09:20:13 +00:00
Viktor Szakats
59666e03f0 build: hand-crafted config rework & header tidy-up
- introduce the concept of a project level setup header
  `src/libssh2_setup.h`, that is used by `src`, `example` and `tests`
  alike. Move there all common platform/compiler configuration from
  `src/libssh2_priv.h`, individual sources and `CMakeFiles.txt` files.
  Also move there our hand-crafted (= not auto-generated by CMake or
  autotools) configuration `win32/libssh2-config.h`.

- `win32` directory is empty now, delete it.

- `Makefile.mk`: adapt to the above. Build-directory is the target
  triplet, or any custom name set via `BLD_DIR`.

- sync header path order between build systems:
  build/src -> source/src -> source/include

- delete redundant references to `windows.h`, `winsock2.h`,
  `ws2tcpip.h`.

- delete unnecessary #includes, update order (`libssh2_setup.h` first,
  `winsock2.h` first), simplify where possible.

  This makes the code warning-free without `WIN32_LEAN_AND_MEAN`.
  At the same time this patch applies this macro globally, to avoid
  header bloat.

- example: add missing *nix header guards.

- example: fix misindented `HAVE_UNISTD_H` `#ifdef`s.

- set `WIN32` with all build-tools.

- set `HAVE_SYS_PARAM_H` in the hand-crafted config for MinGW.
  To match auto-detection.

- move a source-specific macro to `misc.c` from `libssh2_priv.h`.

See the PR's individual commits for step-by-step updates.

Closes #932
2023-04-07 23:44:43 +00:00
Viktor Szakats
901bf00d02 Makefile.mk: move portable GNU Make file to the root
Move the GNU Make file formerly known as `win32/GNUmakefile` to the
root directory from `win32`. It now supports any platform with a
GCC-like toolchain, while also keeping support for win32.

For non-Windows platforms it's necessary to provide a hand-crafted
`libssh2_config.h` header for now.

Usage: `make -f Makefile.mk`
2023-04-04 02:57:29 +02:00
Viktor Szakats
194cfc0f84 windows: move libssh2.rc to the src directory
Closes #918
2023-04-03 12:07:13 +00:00
Viktor Szakats
bcb5eda096 tidy-up: NMakefile (#903) 2023-03-31 00:17:46 +02:00
Viktor Szakats
46f233fd7d build: delete references to deleted NMake files [ci skip]
Follow-up to 057522bb0f
2023-03-30 19:05:27 +00:00
Viktor Szakats
0b61317e6f tidy-up: tabs to spaces in Makefile.am [ci skip]
Follow-up to 2f16d8105c
2023-03-29 00:35:40 +00:00
Viktor Szakats
84f5cb9f23 netware: delete support (#888)
Last related commit happened 15 years ago.
NetWare had it last release in 2009.

All links referenced from the make file are inaccessible.
2023-03-29 02:09:30 +02:00
Viktor Szakats
243e7a82f7 build: delete MS Dev Studio build files (#891)
Last updated in 2007.

Also delete `VCPROJ` target remains (necessary files seem to have
been missing from the repo all along) for Visual Studio 2008.
2023-03-28 14:58:07 +02:00
Viktor Szakats
4e0f0ceeb3 checksrc: fix reference in Makefile.am, update options [ci skip] 2023-03-28 07:59:24 +00:00
Viktor Szakats
b35381e446 build: delete native Watcom wmake support with Win32 (#889)
CMake supports generating Watcom wmake files:
https://cmake.org/cmake/help/v3.1/generator/Watcom%20WMake.html
2023-03-28 09:40:51 +02:00
Viktor Szakats
2f16d8105c tidy-up: replace tabs and other whitespace (#885)
There are a few non-whitespace changes, see them here:
https://github.com/libssh2/libssh2/pull/885/files?w=1
2023-03-27 18:28:27 +02:00
Viktor Szakats
dbe5e680b7 dist: delete reference to recently deleted file [ci skip]
Follow-up to b8762c1003
2023-03-23 23:27:29 +00:00
Dan Fandrich
16619a8edd Add missing files to automake makefiles & build tests
Many files have been added to the cmake build files but not the automake
ones in recent years. Missing ones have been added so automake "make
dist" will now create a usable tar ball.

The integration tests using Docker are now built with automake as well
(with "make check").  They are not run yet since they aren't working yet
on Linux.
2023-01-06 10:47:32 -08:00
Viktor Szakats
7483edfada configure: add --disable-tests option 2022-07-02 11:54:39 +02:00
yann-morin-1998
fc5d77881e buildsystem: drop custom buildconf script, rely on autoreconf (#224)
Notes:
The buildconf script is currently required, because we need to copy a
header around, because it is used both from the library and the examples
sources.

However, having a custom 'buildconf'-like script is not needed if we can
ensure that the header exists by the time it is needed. For that, we can
just append the src/ directory to the headers search path for the
examples.

And then it means we no longer need to generate the same header twice,
so we remove the second one from configure.ac.

Now, we can just call "autoreconf -fi" to generate the autotools files,
instead of relying on the canned sequence in "buildconf", since
autoreconf has now long known what to do at the correct moment (future
versions of autotools, automake, autopoint, autoheader etc... may
require an other ordering, or other intermediate steps, etc...).

Eventually, get rid of buildconf now it is no longer needed. In fact, we
really keep it for legacy, but have it just call autoreconf (and print a
nice user-friendly warning). Don't include it in the release tarballs,
though.

Update doc, gitignore, and travis-CI jobs accordingly.

Credit:
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Sam Voss <sam.voss@rockwellcollins.com>
2020-07-01 11:44:08 -07:00
Marc Hoersken
87c5883a42 Makefile: also run checksrc on test source files 2020-06-22 21:24:05 +02:00
Thomas Klausner
159d4c8138 Makefile.am: Fix unportable test(1) operator. (#459)
file: Makefile.am

Notes:
The POSIX comparison operator for test(1) is =; bash supports == but not even test from GNU coreutils does.

Credit:
Thomas Klausner
2020-03-20 11:37:16 -07:00
Daniel Stenberg
452517d96c style: make includes and examples code style strict
make travis and the makefile rule verify them too

Closes #334
2019-03-21 13:04:07 +01:00
Daniel Stenberg
12bddb0d45 code style: unify code style
Indent-level: 4
Max columns: 79
No spaces after if/for/while
Unified brace positions
Unified white spaces
2019-03-20 14:21:38 +01:00
Keno Fischer
dc8f7ca3ab configure: Add support for building with mbedtls 2016-09-27 08:06:35 +02:00
Patrick Monnerat
7a37c33264 os400: implement character encoding conversion support 2016-01-18 13:35:28 +01:00
Patrick Monnerat
c367e61294 os400: Add specific README and include new files in dist tarball 2016-01-18 13:35:28 +01:00
Kamil Dudka
d48d7c3a87 cmake: include CMake files in the release tarballs
Despite we announced the CMake support in libssh2-1.6.0 release notes,
the files required by the CMake build system were not included in the
release tarballs.  Hence, the only way to use CMake for build was the
upstream git repository.

This commit makes CMake actually supported in the release tarballs.
2015-07-02 13:09:49 +02:00
Daniel Stenberg
8bb6cf7f95 docs: move INSTALL, AUTHORS, HACKING and TODO to docs/
And with this, cleanup README to be shorter and mention the new source
code home.
2015-03-07 11:42:14 +01:00
Marc Hoersken
fc94046e6e win32: Added WinCNG targets to generated Visual Studio project
Inspired by Bob Kast's reports, this commit enables the compilation
of libssh2 with WinCNG using the generated Visual Studio project files.
This commit adds WinCNG support to parts of the existing Win32 build
infrastructure, until new build systems, like pre-defined VS project
files or CMake files may be added.

This commit and b20bfeb3e5 raise one
question: How to handle build systems, like VS project files, that
need to include all source files regardless of the desired target,
including all supported crypto backends? For now the mentioned commit
added a check for LIBSSH2_OPENSSL to openssl.c and with this commit
the supported crypto backends are hardcoded within Makefile.am.
2014-05-18 00:07:59 +02:00
Peter Stuge
f5c1a0d98b Move automake conditionals added by commit d512b25f out of Makefile.inc
Commit d512b25f69 added automake
conditionals to Makefile.inc but since Makefile.inc is included
from Makefile for all other build systems that does not work.

This commit instead adds Makefile.OpenSSL.inc and Makefile.libgcrypt.inc
and moves the automake conditional to its proper place, src/Makefile.am.

The automake conditional includes the correct Makefile.$name.inc per
the crypto library selection/detection done by configure.

All non-autotools build system files in libssh2 are hardcoded to use
OpenSSL and do not get a conditional but at least there is some reuse
because they can all include the new Makefile.OpenSSL.inc.
2013-11-13 02:37:06 +01:00
Daniel Stenberg
5237177daf Revert "config.rpath: generated file, no need to keep in git"
This reverts commit 1ac7bd09cc.

This file still used by lib/*m4 functions so we need to keep the file
around.
2012-06-11 14:52:31 +02:00
Guenter Knauf
29e256e817 Renamed NetWare makefiles. 2012-06-04 15:27:02 +02:00
Peter Stuge
ededdfa9c2 configure.ac: Add option to disable build of the example applications
Examples are built by default. Any of the following options on the
configure command line will skip building them:

  --disable-examples-build
  --enable-examples-build=no
  --enable-examples-build=false
2012-04-18 16:35:05 +02:00
Guenter Knauf
c75ae587c0 More MinGW makefile tweaks.
Renamed *.mingw makefiles to GNUmakefile since GNU make picks these
up automatically, and therefore win32/Makefile removed.
2011-09-10 14:10:45 +02:00
Guenter Knauf
3f2b1dea5e The files were not gone but renamed ... 2011-09-08 11:59:49 +02:00