1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-08 19:02:07 +03:00

docs/HACKING.CRYPTO: Improve documentation for autoconf build system

This commit is contained in:
Peter Stuge
2016-11-16 22:20:02 +01:00
parent 8dc9f4c156
commit ddb0c65856

View File

@@ -15,29 +15,34 @@ indicates the libssh2 core modules never use the function result.
0) Build system. 0) Build system.
Add a new crypto backend to the autotools build system (./configure) as such: Adding a crypto backend to the autotools build system (./configure) is easy:
* Add one new line to configure.ac: 0.1) Add one new line in configure.ac
m4_set_add([crypto_backends], [newname]) m4_set_add([crypto_backends], [newname])
This automatically creates a new --with-crypto=newname option which users can This automatically creates a --with-crypto=newname option.
specify when invoking configure at compile-time to select the new backend.
* Add a new m4_case stanza to acinclude.m4 within LIBSSH2_CRYPTO_CHECK, 0.2) Add an m4_case stanza to LIBSSH2_CRYPTO_CHECK in acinclude.m4
with checks for library availability. A successful check should set
library linking variables. The LIBSSH2_LIB_HAVE_LINKFLAGS macro creates
such a variable automatically if the checked library can be found.
* Add a Makefile.newname.inc in the top-level directory which sets This must check for all required libraries, and if found set and AC_SUBST a
CRYPTO_CSOURCES and CRYPTO_HHEADERS to the new backend source files, variable with the library linking flags. The recommended method is to use
and CRYPTO_LTLIBS to the libtool linking parameters for the library, set LIBSSH2_LIB_HAVE_LINKFLAGS from LIBSSH2_CRYPTO_CHECK, which automatically
e.g. by a LIBSSH2_LIB_HAVE_LINKFLAGS call in LIBSSH2_CRYPTO_CHECK. creates and handles a --with-$newname-prefix option and sets an
LTLIBNEWNAME variable on success.
* Add a new block to src/Makefile.am: 0.3) Create Makefile.newname.inc in the top-level directory
if NEWNAME
include ../Makefile.newname.inc This must set CRYPTO_CSOURCES, CRYPTO_HHEADERS and CRYPTO_LTLIBS.
endif Set CRYPTO_CSOURCES and CRYPTO_HHEADERS to the new backend source files
and set CRYPTO_LTLIBS to the required library linking parameters, e.g.
$(LTLIBNEWNAME) as generated by by LIBSSH2_LIB_HAVE_LINKFLAGS.
0.4) Add a new block in src/Makefile.am
if NEWNAME
include ../Makefile.newname.inc
endif
1) Crypto library initialization/termination. 1) Crypto library initialization/termination.