diff --git a/dist-win.sh b/dist-win.sh index cfb6414..88836a5 100755 --- a/dist-win.sh +++ b/dist-win.sh @@ -29,20 +29,11 @@ for ARCH in X86 X64; do make -j 4 install DESTDIR=`pwd`/stage-$ARCHDIR mkdir -p $DIST/$ARCHDIR - #cp -a stage-$ARCHDIR/usr/local/lib/* $DIST/$ARCHDIR if [ ! -e $DIST/include ]; then - cp -a stage-$ARCHDIR/usr/local/include $DIST - sed -i -e 'N;/\n.*__non/s/"\? *\n/ /;P;D' \ - $DIST/include/openssl/*.h $DIST/include/*.h - sed -i -e 'N;/\n.*__attr/s/"\? *\n/ /;P;D' \ - $DIST/include/openssl/*.h $DIST/include/*.h - sed -i -e "s/__attr.*;/;/" \ - -e "s/sys\/time.h/winsock2.h/" \ - $DIST/include/openssl/*.h $DIST/include/*.h + cp -r stage-$ARCHDIR/usr/local/include $DIST fi cp stage-$ARCHDIR/usr/local/bin/* $DIST/$ARCHDIR - #cp /usr/$HOST/sys-root/mingw/bin/libssp* $DIST/$ARCHDIR for i in libcrypto libssl libtls; do DLL=$(basename `ls -1 $DIST/$ARCHDIR/$i*.dll`|cut -d. -f1) diff --git a/patches/opensslconf.h.patch b/patches/opensslconf.h.patch deleted file mode 100644 index 0507c92..0000000 --- a/patches/opensslconf.h.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- include/openssl/opensslconf.h.orig 2015-07-19 23:21:47.000000000 -0600 -+++ include/openssl/opensslconf.h 2015-07-19 23:21:17.000000000 -0600 -@@ -1,6 +1,10 @@ - #include - /* crypto/opensslconf.h.in */ - -+#if defined(_MSC_VER) && !defined(__attribute__) -+#define __attribute__(a) -+#endif -+ - /* Generate 80386 code? */ - #undef I386_ONLY - diff --git a/patches/ossl_typ.h.patch b/patches/ossl_typ.h.patch deleted file mode 100644 index f213347..0000000 --- a/patches/ossl_typ.h.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- include/openssl/ossl_typ.h.orig 2015-07-06 13:21:18.788571423 -0700 -+++ include/openssl/ossl_typ.h 2015-07-06 13:24:14.906468003 -0700 -@@ -100,6 +100,22 @@ - typedef struct ASN1_ITEM_st ASN1_ITEM; - typedef struct asn1_pctx_st ASN1_PCTX; - -+#if defined(_WIN32) && defined(__WINCRYPT_H__) -+#ifndef LIBRESSL_INTERNAL -+#ifdef _MSC_VER -+#pragma message("Warning, overriding WinCrypt defines") -+#else -+#warning overriding WinCrypt defines -+#endif -+#endif -+#undef X509_NAME -+#undef X509_CERT_PAIR -+#undef X509_EXTENSIONS -+#undef OCSP_REQUEST -+#undef OCSP_RESPONSE -+#undef PKCS7_ISSUER_AND_SERIAL -+#endif -+ - #ifdef BIGNUM - #undef BIGNUM - #endif diff --git a/patches/pkcs7.h.patch b/patches/pkcs7.h.patch deleted file mode 100644 index 4c6f6ba..0000000 --- a/patches/pkcs7.h.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- include/openssl/pkcs7.h.orig 2015-07-06 13:26:27.369203527 -0700 -+++ include/openssl/pkcs7.h 2015-07-06 13:27:37.637051967 -0700 -@@ -69,6 +69,18 @@ - extern "C" { - #endif - -+#if defined(_WIN32) && defined(__WINCRYPT_H__) -+#ifndef LIBRESSL_INTERNAL -+#ifdef _MSC_VER -+#pragma message("Warning, overriding WinCrypt defines") -+#else -+#warning overriding WinCrypt defines -+#endif -+#endif -+#undef PKCS7_ISSUER_AND_SERIAL -+#undef PKCS7_SIGNER_INFO -+#endif -+ - /* - Encryption_ID DES-CBC - Digest_ID MD5 diff --git a/patches/windows_headers.patch b/patches/windows_headers.patch new file mode 100644 index 0000000..f6b799c --- /dev/null +++ b/patches/windows_headers.patch @@ -0,0 +1,100 @@ +diff -urN include/openssl.orig/dtls1.h include/openssl/dtls1.h +--- include/openssl.orig/dtls1.h Mon Sep 21 21:45:45 2015 ++++ include/openssl/dtls1.h Mon Sep 21 21:58:56 2015 +@@ -60,7 +60,11 @@ + #ifndef HEADER_DTLS1_H + #define HEADER_DTLS1_H + ++#if defined(_WIN32) ++#include ++#else + #include ++#endif + + #include + #include +diff -urN include/openssl.orig/opensslconf.h include/openssl/opensslconf.h +--- include/openssl.orig/opensslconf.h Mon Sep 21 21:45:45 2015 ++++ include/openssl/opensslconf.h Mon Sep 21 21:56:13 2015 +@@ -1,6 +1,10 @@ + #include + /* crypto/opensslconf.h.in */ + ++#if defined(_MSC_VER) && !defined(__attribute__) ++#define __attribute__(a) ++#endif ++ + /* Generate 80386 code? */ + #undef I386_ONLY + +diff -urN include/openssl.orig/ossl_typ.h include/openssl/ossl_typ.h +--- include/openssl.orig/ossl_typ.h Mon Sep 21 21:45:45 2015 ++++ include/openssl/ossl_typ.h Mon Sep 21 21:56:22 2015 +@@ -100,6 +100,22 @@ + typedef struct ASN1_ITEM_st ASN1_ITEM; + typedef struct asn1_pctx_st ASN1_PCTX; + ++#if defined(_WIN32) && defined(__WINCRYPT_H__) ++#ifndef LIBRESSL_INTERNAL ++#ifdef _MSC_VER ++#pragma message("Warning, overriding WinCrypt defines") ++#else ++#warning overriding WinCrypt defines ++#endif ++#endif ++#undef X509_NAME ++#undef X509_CERT_PAIR ++#undef X509_EXTENSIONS ++#undef OCSP_REQUEST ++#undef OCSP_RESPONSE ++#undef PKCS7_ISSUER_AND_SERIAL ++#endif ++ + #ifdef BIGNUM + #undef BIGNUM + #endif +diff -urN include/openssl.orig/pkcs7.h include/openssl/pkcs7.h +--- include/openssl.orig/pkcs7.h Mon Sep 21 21:45:45 2015 ++++ include/openssl/pkcs7.h Mon Sep 21 21:56:29 2015 +@@ -69,6 +69,18 @@ + extern "C" { + #endif + ++#if defined(_WIN32) && defined(__WINCRYPT_H__) ++#ifndef LIBRESSL_INTERNAL ++#ifdef _MSC_VER ++#pragma message("Warning, overriding WinCrypt defines") ++#else ++#warning overriding WinCrypt defines ++#endif ++#endif ++#undef PKCS7_ISSUER_AND_SERIAL ++#undef PKCS7_SIGNER_INFO ++#endif ++ + /* + Encryption_ID DES-CBC + Digest_ID MD5 +diff -urN include/openssl.orig/x509.h include/openssl/x509.h +--- include/openssl.orig/x509.h Mon Sep 21 21:45:45 2015 ++++ include/openssl/x509.h Mon Sep 21 21:56:35 2015 +@@ -112,6 +112,19 @@ + extern "C" { + #endif + ++#if defined(_WIN32) ++#ifndef LIBRESSL_INTERNAL ++#ifdef _MSC_VER ++#pragma message("Warning, overriding WinCrypt defines") ++#else ++#warning overriding WinCrypt defines ++#endif ++#endif ++#undef X509_NAME ++#undef X509_CERT_PAIR ++#undef X509_EXTENSIONS ++#endif ++ + #define X509_FILETYPE_PEM 1 + #define X509_FILETYPE_ASN1 2 + #define X509_FILETYPE_DEFAULT 3 diff --git a/patches/x509.h.patch b/patches/x509.h.patch deleted file mode 100644 index f0e59b2..0000000 --- a/patches/x509.h.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- include/openssl/x509.h.orig 2015-07-06 13:15:15.059306046 -0700 -+++ include/openssl/x509.h 2015-07-06 13:16:10.506118278 -0700 -@@ -112,6 +112,19 @@ - extern "C" { - #endif - -+#if defined(_WIN32) -+#ifndef LIBRESSL_INTERNAL -+#ifdef _MSC_VER -+#pragma message("Warning, overriding WinCrypt defines") -+#else -+#warning overriding WinCrypt defines -+#endif -+#endif -+#undef X509_NAME -+#undef X509_CERT_PAIR -+#undef X509_EXTENSIONS -+#endif -+ - #define X509_FILETYPE_PEM 1 - #define X509_FILETYPE_ASN1 2 - #define X509_FILETYPE_DEFAULT 3 diff --git a/update.sh b/update.sh index 6df4290..aef190e 100755 --- a/update.sh +++ b/update.sh @@ -300,7 +300,7 @@ add_man_links() { done } -# apply local patches (Windows support) +# apply local patches for i in patches/*.patch; do patch -p0 < $i done