diff options
author | Brent Cook <busterb@gmail.com> | 2014-07-10 22:06:10 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2015-07-21 12:08:18 -0500 |
commit | 5d8a1cf7155130bd8101090d7e1d0c2f90d9b123 (patch) | |
tree | 286f7d12e3647f94bd1e6e8e180a4bf6215a0740 /patches | |
parent | 7a4a37cf596697ae96eeb1c555989e6d1a443187 (diff) | |
download | portable-5d8a1cf7155130bd8101090d7e1d0c2f90d9b123.tar.gz portable-5d8a1cf7155130bd8101090d7e1d0c2f90d9b123.tar.bz2 portable-5d8a1cf7155130bd8101090d7e1d0c2f90d9b123.zip |
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.
Diffstat (limited to 'patches')
-rw-r--r-- | patches/arc4random.c.patch | 15 | ||||
-rw-r--r-- | patches/openssl.c.patch | 27 | ||||
-rw-r--r-- | patches/opensslconf.h.patch | 13 | ||||
-rw-r--r-- | patches/ossl_typ.h.patch | 4 | ||||
-rw-r--r-- | patches/pkcs7.h.patch | 4 | ||||
-rw-r--r-- | patches/x509.h.patch | 6 |
6 files changed, 57 insertions, 12 deletions
diff --git a/patches/arc4random.c.patch b/patches/arc4random.c.patch new file mode 100644 index 0000000..9f9c476 --- /dev/null +++ b/patches/arc4random.c.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | --- crypto/compat/arc4random.c.orig 2015-07-20 07:41:17.000000000 -0600 | ||
2 | +++ crypto/compat/arc4random.c 2015-07-20 07:41:58.000000000 -0600 | ||
3 | @@ -36,8 +36,11 @@ | ||
4 | #define KEYSTREAM_ONLY | ||
5 | #include "chacha_private.h" | ||
6 | |||
7 | +#ifndef min | ||
8 | #define min(a, b) ((a) < (b) ? (a) : (b)) | ||
9 | -#ifdef __GNUC__ | ||
10 | +#endif | ||
11 | + | ||
12 | +#if defined(__GNUC__) || defined(_MSC_VER) | ||
13 | #define inline __inline | ||
14 | #else /* !__GNUC__ */ | ||
15 | #define inline | ||
diff --git a/patches/openssl.c.patch b/patches/openssl.c.patch index c086ba5..275e9ea 100644 --- a/patches/openssl.c.patch +++ b/patches/openssl.c.patch | |||
@@ -1,10 +1,11 @@ | |||
1 | --- apps/openssl.c.orig 2015-06-05 03:42:12.956112944 -0500 | 1 | --- apps/openssl.c.orig 2015-07-20 02:01:42.000000000 -0600 |
2 | +++ apps/openssl.c 2015-06-05 03:41:54.215381908 -0500 | 2 | +++ apps/openssl.c 2015-07-20 02:02:00.000000000 -0600 |
3 | @@ -130,6 +130,18 @@ | 3 | @@ -130,6 +130,19 @@ |
4 | #include <openssl/engine.h> | 4 | #include <openssl/engine.h> |
5 | #endif | 5 | #endif |
6 | 6 | ||
7 | +#ifdef _WIN32 | 7 | +#ifdef _WIN32 |
8 | +#include <io.h> | ||
8 | +#include <fcntl.h> | 9 | +#include <fcntl.h> |
9 | +static void set_stdio_binary(void) | 10 | +static void set_stdio_binary(void) |
10 | +{ | 11 | +{ |
@@ -18,12 +19,22 @@ | |||
18 | + | 19 | + |
19 | #include "progs.h" | 20 | #include "progs.h" |
20 | #include "s_apps.h" | 21 | #include "s_apps.h" |
21 | 22 | ||
22 | @@ -216,6 +228,7 @@ | 23 | @@ -204,7 +216,9 @@ |
24 | static void | ||
25 | openssl_startup(void) | ||
26 | { | ||
27 | +#ifndef _WIN32 | ||
28 | signal(SIGPIPE, SIG_IGN); | ||
29 | +#endif | ||
30 | |||
31 | CRYPTO_malloc_init(); | ||
32 | OpenSSL_add_all_algorithms(); | ||
33 | @@ -216,6 +230,7 @@ | ||
23 | #endif | 34 | #endif |
24 | 35 | ||
25 | setup_ui_method(); | 36 | setup_ui_method(); |
26 | + set_stdio_binary(); | 37 | + set_stdio_binary(); |
27 | } | 38 | } |
28 | 39 | ||
29 | static void | 40 | static void |
diff --git a/patches/opensslconf.h.patch b/patches/opensslconf.h.patch new file mode 100644 index 0000000..0507c92 --- /dev/null +++ b/patches/opensslconf.h.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- include/openssl/opensslconf.h.orig 2015-07-19 23:21:47.000000000 -0600 | ||
2 | +++ include/openssl/opensslconf.h 2015-07-19 23:21:17.000000000 -0600 | ||
3 | @@ -1,6 +1,10 @@ | ||
4 | #include <openssl/opensslfeatures.h> | ||
5 | /* crypto/opensslconf.h.in */ | ||
6 | |||
7 | +#if defined(_MSC_VER) && !defined(__attribute__) | ||
8 | +#define __attribute__(a) | ||
9 | +#endif | ||
10 | + | ||
11 | /* Generate 80386 code? */ | ||
12 | #undef I386_ONLY | ||
13 | |||
diff --git a/patches/ossl_typ.h.patch b/patches/ossl_typ.h.patch index af9419a..f213347 100644 --- a/patches/ossl_typ.h.patch +++ b/patches/ossl_typ.h.patch | |||
@@ -1,15 +1,17 @@ | |||
1 | --- include/openssl/ossl_typ.h.orig 2015-07-06 13:21:18.788571423 -0700 | 1 | --- include/openssl/ossl_typ.h.orig 2015-07-06 13:21:18.788571423 -0700 |
2 | +++ include/openssl/ossl_typ.h 2015-07-06 13:24:14.906468003 -0700 | 2 | +++ include/openssl/ossl_typ.h 2015-07-06 13:24:14.906468003 -0700 |
3 | @@ -100,6 +100,20 @@ | 3 | @@ -100,6 +100,22 @@ |
4 | typedef struct ASN1_ITEM_st ASN1_ITEM; | 4 | typedef struct ASN1_ITEM_st ASN1_ITEM; |
5 | typedef struct asn1_pctx_st ASN1_PCTX; | 5 | typedef struct asn1_pctx_st ASN1_PCTX; |
6 | 6 | ||
7 | +#if defined(_WIN32) && defined(__WINCRYPT_H__) | 7 | +#if defined(_WIN32) && defined(__WINCRYPT_H__) |
8 | +#ifndef LIBRESSL_INTERNAL | ||
8 | +#ifdef _MSC_VER | 9 | +#ifdef _MSC_VER |
9 | +#pragma message("Warning, overriding WinCrypt defines") | 10 | +#pragma message("Warning, overriding WinCrypt defines") |
10 | +#else | 11 | +#else |
11 | +#warning overriding WinCrypt defines | 12 | +#warning overriding WinCrypt defines |
12 | +#endif | 13 | +#endif |
14 | +#endif | ||
13 | +#undef X509_NAME | 15 | +#undef X509_NAME |
14 | +#undef X509_CERT_PAIR | 16 | +#undef X509_CERT_PAIR |
15 | +#undef X509_EXTENSIONS | 17 | +#undef X509_EXTENSIONS |
diff --git a/patches/pkcs7.h.patch b/patches/pkcs7.h.patch index fa8b297..4c6f6ba 100644 --- a/patches/pkcs7.h.patch +++ b/patches/pkcs7.h.patch | |||
@@ -1,15 +1,17 @@ | |||
1 | --- include/openssl/pkcs7.h.orig 2015-07-06 13:26:27.369203527 -0700 | 1 | --- include/openssl/pkcs7.h.orig 2015-07-06 13:26:27.369203527 -0700 |
2 | +++ include/openssl/pkcs7.h 2015-07-06 13:27:37.637051967 -0700 | 2 | +++ include/openssl/pkcs7.h 2015-07-06 13:27:37.637051967 -0700 |
3 | @@ -69,6 +69,16 @@ | 3 | @@ -69,6 +69,18 @@ |
4 | extern "C" { | 4 | extern "C" { |
5 | #endif | 5 | #endif |
6 | 6 | ||
7 | +#if defined(_WIN32) && defined(__WINCRYPT_H__) | 7 | +#if defined(_WIN32) && defined(__WINCRYPT_H__) |
8 | +#ifndef LIBRESSL_INTERNAL | ||
8 | +#ifdef _MSC_VER | 9 | +#ifdef _MSC_VER |
9 | +#pragma message("Warning, overriding WinCrypt defines") | 10 | +#pragma message("Warning, overriding WinCrypt defines") |
10 | +#else | 11 | +#else |
11 | +#warning overriding WinCrypt defines | 12 | +#warning overriding WinCrypt defines |
12 | +#endif | 13 | +#endif |
14 | +#endif | ||
13 | +#undef PKCS7_ISSUER_AND_SERIAL | 15 | +#undef PKCS7_ISSUER_AND_SERIAL |
14 | +#undef PKCS7_SIGNER_INFO | 16 | +#undef PKCS7_SIGNER_INFO |
15 | +#endif | 17 | +#endif |
diff --git a/patches/x509.h.patch b/patches/x509.h.patch index 13686c1..f0e59b2 100644 --- a/patches/x509.h.patch +++ b/patches/x509.h.patch | |||
@@ -1,15 +1,17 @@ | |||
1 | --- include/openssl/x509.h.orig 2015-07-06 13:15:15.059306046 -0700 | 1 | --- include/openssl/x509.h.orig 2015-07-06 13:15:15.059306046 -0700 |
2 | +++ include/openssl/x509.h 2015-07-06 13:16:10.506118278 -0700 | 2 | +++ include/openssl/x509.h 2015-07-06 13:16:10.506118278 -0700 |
3 | @@ -112,6 +112,17 @@ | 3 | @@ -112,6 +112,19 @@ |
4 | extern "C" { | 4 | extern "C" { |
5 | #endif | 5 | #endif |
6 | 6 | ||
7 | +#if defined(_WIN32) && defined(__WINCRYPT_H__) | 7 | +#if defined(_WIN32) |
8 | +#ifndef LIBRESSL_INTERNAL | ||
8 | +#ifdef _MSC_VER | 9 | +#ifdef _MSC_VER |
9 | +#pragma message("Warning, overriding WinCrypt defines") | 10 | +#pragma message("Warning, overriding WinCrypt defines") |
10 | +#else | 11 | +#else |
11 | +#warning overriding WinCrypt defines | 12 | +#warning overriding WinCrypt defines |
12 | +#endif | 13 | +#endif |
14 | +#endif | ||
13 | +#undef X509_NAME | 15 | +#undef X509_NAME |
14 | +#undef X509_CERT_PAIR | 16 | +#undef X509_CERT_PAIR |
15 | +#undef X509_EXTENSIONS | 17 | +#undef X509_EXTENSIONS |