58 Commits

Author SHA1 Message Date
kinichiro
5a29b0472d Link crypto and ssl object files directly instead of static library
- Output object files list variable for libcrypto and libssl to .mk file.
- Include object files list variable .mk from tls/Makefile
- Link .lo files directly instead of static library for libtls.
2020-10-04 03:50:18 -05:00
Brent Cook
fe42a8011b Configure libtls and nc(1) to statically link to libcrypto/ssl
An issue that Reyk Floeter noted while building a Debian package for
LibreSSL is that installing libtls along with OpenSSL causes linker
issues since it will often pick up the wrong libcrypto/libssl. This
change makes libtls statically link the object files it needs rather
than relying on the shared libraries, effectively making libtls
self-contained and able to be packaged independently.

This should make it possible for other projects that also use libtls to
be able to package support without requiring the target OS to ship
libcrypto / libssl from LibreSSL.

678278df55
2020-10-04 03:50:18 -05:00
Dan Nestor
b10a3363df
TLS target properties when building static libs 2020-03-02 11:44:04 +01:00
kinichiro
0ab2955f9e Override the default path of cert.pem in libtls 2019-11-16 20:17:37 +09:00
Brent Cook
5269dbb279 update cmake 2019-01-31 13:56:56 -06:00
Brent Cook
a6d7ea9562 update autoconf for latest compat functions 2019-01-31 13:56:56 -06:00
kinichiro
0b8343ace3 Fix cmake to generate proper Libs.private in .pc files 2018-10-05 22:59:44 +09:00
kinichiro
f819a2bce7 Fix cmake linking libraries 2018-10-03 20:35:36 +09:00
Brent Cook
64b6951576 make headers under include/compat private again 2018-06-14 04:48:59 -05:00
Brent Cook
4fcfc82d83 scope private/public headers when embedding into other projects
thanks to Cameron Palmer
2018-05-29 05:46:54 -05:00
Don
26bebfc564 Use BUILD_SHARED_LIBS to specify library type 2018-03-21 10:24:52 -07:00
Brent Cook
1b84f79f4c Land #402, Remove CMAKE_HOST_ references 2018-03-18 09:53:37 -05:00
Brent Cook
c9c8e32fbe Land #400, Use groups in CMake install command for libraries 2018-03-18 09:52:27 -05:00
kinichiro
1fb8c9c6be Fix using right functions for file descriptor with MS Visual Studio 2018-03-18 00:48:49 +09:00
Don
09590953d0 Remove CMAKE_HOST_ references
CMAKE_HOST_ describes the host system not the target. For cross compilation to work the actual target system should be used for making decisions in CMake.
2018-03-16 14:59:53 -07:00
Don
5fb488de9f Use groups in CMake install command for libraries
On Windows shared libraries should be installed into the bin directory. Using grouping within CMake based on the target type fixes this issue.
2018-03-16 13:59:26 -07:00
kinichiro
3681d02253 Add compat bits for libtls on Windows 2018-02-25 21:56:05 +09:00
kinichiro
57ea69ec10 Add tls/tls_keypair.c 2018-02-11 22:38:15 +09:00
Masud Rahman
1dd6a52f2d ssl/tls cmake: fix shared library dependencies
Ensure that the 'ssl' depends on 'crypto' and that 'tls' depends on
'ssl' and 'crypto' for all platforms.  Prior to this commit, the
dependency was only specified for the 'WIN32' CMake build.
2017-07-24 15:26:29 -04:00
d3x0r
a4d80ca56a Merge branch 'master' of https://github.com/libressl-portable/portable into SkipInstall
Fix merge conflicts from GNUInstallDirs merge to master.
2017-07-06 23:11:11 -07:00
d3x0r
2557dd7439 Add option LIBRESSL_SKIP_INSTALL
Internally LIBRESSL_SKIP_INSTALL, if not set becomes ENABLE_LIBRESSL_INSTALL so this by default is enabled.  defining LIBRESSL_SKIP_INSTALL before hand will disable all install() rules.
This is useful if another project includes and links to this statically.
I chose to add a prefix to avoid potential name collision because the options are cached globally.

If the installation is skipped, maybe it should also disable building apps?  I didn't do that.
2017-07-06 02:09:44 -07:00
d3x0r
a2bd5ebaba use GNUInstallDirs from cmake to specify install paths.
Primarily this is to select whether 'lib64' or 'lib' is used on linux type systems.
2017-07-06 01:49:43 -07:00
kinichiro
91a8bd7914 Move strsep.c to crypto/compat/ and add ocspcheck build to CMake 2017-01-25 21:31:04 +09:00
kinichiro
484feaae91 Stop generating .def files by update.sh 2017-01-18 21:05:43 +09:00
kinichiro
3b8cf47307 Add export symbol support to CMake 2017-01-18 00:34:20 +09:00
Matt Stancliff
63add73d0b Define CMake library object lists globally
OBJECT collections in CMake don't generate any artifacts so these
are safe to hoist out and define globally.

library OBJECT targets are just a list of filenames.  It can be useful for
other projects to include lists of sources directly regardless of build mode
(shared, static, or library).
2017-01-12 13:46:22 +08:00
Brent Cook
77a2a9f3ef remove check-in .def and ignore .sym files 2016-11-06 00:24:22 +09:00
Brent Cook
7770e4f2e4 implement support for hiding symbols in libtls / libssl 2016-11-06 00:24:12 +09:00
kinichiro
d3abaf5fe7 Add tls_ocsp.c to Makefile.am and CMakeLists.txt 2016-11-04 22:43:34 +09:00
kinichiro
62f2a73061 export DLLs functions for MSVC with CMake
- Add 3 DEF files to export functions from Windows DLLs
  - Add gettimeofday to crypto/crypto.def (*1)
  - Remove gai_strerrorA from tls/tls.def (*1)
- Fix CMakeLists.txt to use DEF files as PRIVATE
- Change DLL import library file name since it duplicates with static library
- Ignore compiler warning C4267, and Edit CMAKE_C_FLAGS not to overwrite it (*1)
- Add USE_SHARED option to build openssl.exe with shared libraries (*1)

  (*1) recommended by @mcnameej
2016-10-30 21:39:36 -05:00
Brent Cook
5532f007d3 Land #203, add libtls callback API 2016-09-04 08:58:30 -05:00
Satoshi Yasushima
829b21581f build Windows DLL on CMake
like below.
* libcrypto-38.dll
* libssl-39.dll
* libtls-11.dll
2016-08-25 18:17:27 +09:00
Satoshi Yasushima
971892766d build MinGW on CMake 2016-08-25 18:17:12 +09:00
Brent Cook
a7f754a663 set link library dependencies with MSVC, fixes #221 2016-07-31 17:11:19 -05:00
Tobias Pape
a69063be10
Portable code part for callbacks in accept/connect
see https://github.com/libressl-portable/openbsd/pull/64
2016-06-28 03:29:54 +02:00
Brent Cook
552817b77f Land #192, fix fix ld warning "attempted multiple inclusion of file" on Solaris 2016-05-02 02:03:03 -05:00
kinichiro
02e1cc4df1 fix ld warning "attempted multiple inclusion of file" on Solaris
- To avoid ld warning on Solaris, use abs_top_builddir in Makefile.am
2016-04-21 16:12:47 +09:00
kinichiro
bda62f7fe4 add cmake build options
- add cmake build options as configure provides
  * -DENABLE_ASM (default ON)
  * -DENABLE_EXTRATESTS (default OFF)
  * -DENABLE_NC (default OFF)
  * -DOPENSSLDIR (default ${CMAKE_INSTALL_PREFIX}/etc/ssl)

- add biotest and pidwraptest if ENABLE_EXTRATESTS is ON

- add compiler flag `-fno-common` if CMAKE_SYSTEM_NAME is Darwin
  to prevent link error Undefined symbols "_OPENSSL_ia32cap_P"
2016-04-14 15:16:52 +09:00
kinichiro
3207606f11 fix cmake on HP-UX
- CMakeLists.txt
  * add OS specific compiler flags and library
  * add checking size of time_t
  * add checking memmem()

- tests/CMakeLists.txt
  * add if(HAVE_MEMMEM) for explicit_bzero
  * add checking SMALL_TIME_T for rfc5280time

- crypto/CMakeLists.txt
  * add getentropy_hpux.c

- tls/CMakeLists.txt
  * fix checking strsep
2016-04-04 14:27:43 +09:00
Brent Cook
1988b8f65e fixup cert.pem path override for libtls, add for nc(1)
this also fixes the formatting of help for nc(1)
2015-12-07 07:55:05 -06:00
Brent Cook
5b49c30cbc override _PATH_SSL_CA_FILE with OPENSSLDIR at build time
fix #160
2015-12-06 20:35:09 -06:00
Brent Cook
82e96d3565 include new tls headers 2015-09-13 03:48:46 -05:00
Brent Cook
854f4f69af add 'nc' to the distribution as an example of libtls client and server 2015-09-12 08:08:24 -05:00
Brent Cook
adfb2bf722 Do not build lib-objects targets if we are just building static libs.
This confuses some cmake targets.
2015-09-09 06:03:52 -05:00
Brent Cook
ca56c332e3 disable shared CMake builds for OS X / Windows for now 2015-09-07 01:05:33 -05:00
Jeff Davey
5461dea7f1 Add install targets and shared libraries to CMake 2015-08-18 13:20:19 -06:00
Brent Cook
5d8a1cf715 add initial CMake and Visual Studio build support
This moves the compatibility include files from include to
include/compat so we can use the awful MS C compiler
<../include/> trick to emulate the GNU #include_next extension.

This also removes a few old compat files we do not need anymore.
2015-07-21 12:08:18 -05:00
Brent Cook
189cdf7103 revert changes to libtls-standalone Makefile.am that ended up in tls 2015-05-23 19:27:57 -05:00
Brent Cook
28353c1df1 stub in initial libtls standalone tree 2015-05-23 19:26:51 -05:00
Brent Cook
ad2a38ab4a rework CFLAGS/CPPFLAGS settings during configuration
Move define adjustments to CPPFLAGS.
Adjust user CFLAGS directly, do not override during configuration.
USER_CFLAGS is not necessary to build libcompat_noopt correctly.
2015-03-22 07:43:55 -05:00