Move public headers to include/openssl/

Previously, public headers lived next to the respective code and there
were symlinks from include/openssl to them.

This doesn't work on Windows.

This change moves the headers to live in include/openssl. In cases where
some symlinks pointed to the same header, I've added a file that just
includes the intended target. These cases are all for backwards-compat.

Change-Id: I6e285b74caf621c644b5168a4877db226b07fd92
Reviewed-on: https://boringssl-review.googlesource.com/1180
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/asn1/asn1_error.c b/crypto/asn1/asn1_error.c
index 3354ffe..12692a0 100644
--- a/crypto/asn1/asn1_error.c
+++ b/crypto/asn1/asn1_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "asn1.h"
+#include <openssl/asn1.h>
 
 const ERR_STRING_DATA ASN1_error_string_data[] = {
   {ERR_PACK(ERR_LIB_ASN1, ASN1_F_ASN1_BIT_STRING_set_bit, 0), "ASN1_BIT_STRING_set_bit"},
diff --git a/crypto/bio/bio_error.c b/crypto/bio/bio_error.c
index f4ce8f8..c67da28 100644
--- a/crypto/bio/bio_error.c
+++ b/crypto/bio/bio_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "bio.h"
+#include <openssl/bio.h>
 
 const ERR_STRING_DATA BIO_error_string_data[] = {
   {ERR_PACK(ERR_LIB_BIO, BIO_F_BIO_callback_ctrl, 0), "BIO_callback_ctrl"},
diff --git a/crypto/bn/bn_error.c b/crypto/bn/bn_error.c
index e0404d9..b522c2a 100644
--- a/crypto/bn/bn_error.c
+++ b/crypto/bn/bn_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "bn.h"
+#include <openssl/bn.h>
 
 const ERR_STRING_DATA BN_error_string_data[] = {
   {ERR_PACK(ERR_LIB_BN, BN_F_BN_CTX_get, 0), "BN_CTX_get"},
diff --git a/crypto/buf/buf_error.c b/crypto/buf/buf_error.c
index 66be604..fac6011 100644
--- a/crypto/buf/buf_error.c
+++ b/crypto/buf/buf_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "buf.h"
+#include <openssl/buf.h>
 
 const ERR_STRING_DATA BUF_error_string_data[] = {
   {ERR_PACK(ERR_LIB_BUF, BUF_F_BUF_MEM_new, 0), "BUF_MEM_new"},
diff --git a/crypto/cipher/cipher_error.c b/crypto/cipher/cipher_error.c
index 295b961..fa28f63 100644
--- a/crypto/cipher/cipher_error.c
+++ b/crypto/cipher/cipher_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "cipher.h"
+#include <openssl/cipher.h>
 
 const ERR_STRING_DATA CIPHER_error_string_data[] = {
   {ERR_PACK(ERR_LIB_CIPHER, CIPHER_F_EVP_AEAD_CTX_init, 0), "EVP_AEAD_CTX_init"},
diff --git a/crypto/conf/conf_error.c b/crypto/conf/conf_error.c
index b739d19..b5dd001 100644
--- a/crypto/conf/conf_error.c
+++ b/crypto/conf/conf_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "conf.h"
+#include <openssl/conf.h>
 
 const ERR_STRING_DATA CONF_error_string_data[] = {
   {ERR_PACK(ERR_LIB_CONF, CONF_F_CONF_parse_list, 0), "CONF_parse_list"},
diff --git a/crypto/crypto_error.c b/crypto/crypto_error.c
index 483bbe3..3e63dca 100644
--- a/crypto/crypto_error.c
+++ b/crypto/crypto_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "crypto_error.h"
+#include <openssl/crypto.h>
 
 const ERR_STRING_DATA CRYPTO_error_string_data[] = {
   {ERR_PACK(ERR_LIB_CRYPTO, CRYPTO_F_CRYPTO_set_ex_data, 0), "CRYPTO_set_ex_data"},
diff --git a/crypto/dh/dh_error.c b/crypto/dh/dh_error.c
index 8a7041c..5ecc5d1 100644
--- a/crypto/dh/dh_error.c
+++ b/crypto/dh/dh_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "dh.h"
+#include <openssl/dh.h>
 
 const ERR_STRING_DATA DH_error_string_data[] = {
   {ERR_PACK(ERR_LIB_DH, DH_F_DH_new_method, 0), "DH_new_method"},
diff --git a/crypto/digest/digest_error.c b/crypto/digest/digest_error.c
index e80a5df..0cc6702 100644
--- a/crypto/digest/digest_error.c
+++ b/crypto/digest/digest_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "digest.h"
+#include <openssl/digest.h>
 
 const ERR_STRING_DATA DIGEST_error_string_data[] = {
   {ERR_PACK(ERR_LIB_DIGEST, DIGEST_F_EVP_DigestInit_ex, 0), "EVP_DigestInit_ex"},
diff --git a/crypto/dsa/dsa_error.c b/crypto/dsa/dsa_error.c
index b6e08ae..5a83908 100644
--- a/crypto/dsa/dsa_error.c
+++ b/crypto/dsa/dsa_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "dsa.h"
+#include <openssl/dsa.h>
 
 const ERR_STRING_DATA DSA_error_string_data[] = {
   {ERR_PACK(ERR_LIB_DSA, DSA_F_DSA_new_method, 0), "DSA_new_method"},
diff --git a/crypto/ec/ec_error.c b/crypto/ec/ec_error.c
index 195b1af..3b5d158 100644
--- a/crypto/ec/ec_error.c
+++ b/crypto/ec/ec_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "ec.h"
+#include <openssl/ec.h>
 
 const ERR_STRING_DATA EC_error_string_data[] = {
   {ERR_PACK(ERR_LIB_EC, EC_F_EC_GROUP_copy, 0), "EC_GROUP_copy"},
diff --git a/crypto/ecdh/ecdh_error.c b/crypto/ecdh/ecdh_error.c
index 9e53467..8ba1854 100644
--- a/crypto/ecdh/ecdh_error.c
+++ b/crypto/ecdh/ecdh_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "ecdh.h"
+#include <openssl/ecdh.h>
 
 const ERR_STRING_DATA ECDH_error_string_data[] = {
   {ERR_PACK(ERR_LIB_ECDH, ECDH_F_ECDH_compute_key, 0), "ECDH_compute_key"},
diff --git a/crypto/ecdsa/ecdsa_error.c b/crypto/ecdsa/ecdsa_error.c
index 39ba873..cbd69ce 100644
--- a/crypto/ecdsa/ecdsa_error.c
+++ b/crypto/ecdsa/ecdsa_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "ecdsa.h"
+#include <openssl/ecdsa.h>
 
 const ERR_STRING_DATA ECDSA_error_string_data[] = {
   {ERR_PACK(ERR_LIB_ECDSA, ECDSA_F_ECDSA_do_sign_ex, 0), "ECDSA_do_sign_ex"},
diff --git a/crypto/evp/evp_error.c b/crypto/evp/evp_error.c
index 8b3d0f6..76a802a 100644
--- a/crypto/evp/evp_error.c
+++ b/crypto/evp/evp_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "evp.h"
+#include <openssl/evp.h>
 
 const ERR_STRING_DATA EVP_error_string_data[] = {
   {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_CTX_ctrl, 0), "EVP_PKEY_CTX_ctrl"},
diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c
index b601480..ce1741a 100644
--- a/crypto/lhash/lhash.c
+++ b/crypto/lhash/lhash.c
@@ -53,7 +53,7 @@
  * copied and put under another distribution licence
  * [including the GNU Public Licence.] */
 
-#include "lhash.h"
+#include <openssl/lhash.h>
 
 #include <assert.h>
 #include <limits.h>
diff --git a/crypto/obj/obj.c b/crypto/obj/obj.c
index 970346d..624e731 100644
--- a/crypto/obj/obj.c
+++ b/crypto/obj/obj.c
@@ -66,7 +66,7 @@
 #include <openssl/mem.h>
 #include <openssl/thread.h>
 
-#include "obj_dat.h"
+#include <openssl/obj_dat.h>
 
 /* These globals are protected by CRYPTO_LOCK_OBJ. */
 static LHASH_OF(ASN1_OBJECT) *global_added_by_data = NULL;
diff --git a/crypto/obj/obj_error.c b/crypto/obj/obj_error.c
index c98f10f..1ec9771 100644
--- a/crypto/obj/obj_error.c
+++ b/crypto/obj/obj_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "obj.h"
+#include <openssl/obj.h>
 
 const ERR_STRING_DATA OBJ_error_string_data[] = {
   {ERR_PACK(ERR_LIB_OBJ, OBJ_F_OBJ_create, 0), "OBJ_create"},
diff --git a/crypto/pem/pem_error.c b/crypto/pem/pem_error.c
index 99c9b32..2745f4c 100644
--- a/crypto/pem/pem_error.c
+++ b/crypto/pem/pem_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "pem.h"
+#include <openssl/pem.h>
 
 const ERR_STRING_DATA PEM_error_string_data[] = {
   {ERR_PACK(ERR_LIB_PEM, PEM_F_PEM_ASN1_read, 0), "PEM_ASN1_read"},
diff --git a/crypto/pkcs8/pkcs8_error.c b/crypto/pkcs8/pkcs8_error.c
index 02129f0..7536bd1 100644
--- a/crypto/pkcs8/pkcs8_error.c
+++ b/crypto/pkcs8/pkcs8_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "pkcs8.h"
+#include <openssl/pkcs8.h>
 
 const ERR_STRING_DATA PKCS8_error_string_data[] = {
   {ERR_PACK(ERR_LIB_PKCS8, PKCS8_F_EVP_PKCS82PKEY, 0), "EVP_PKCS82PKEY"},
diff --git a/crypto/rsa/rsa_error.c b/crypto/rsa/rsa_error.c
index 6bcf850..665c70e 100644
--- a/crypto/rsa/rsa_error.c
+++ b/crypto/rsa/rsa_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "rsa.h"
+#include <openssl/rsa.h>
 
 const ERR_STRING_DATA RSA_error_string_data[] = {
   {ERR_PACK(ERR_LIB_RSA, RSA_F_BN_BLINDING_convert_ex, 0), "BN_BLINDING_convert_ex"},
diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c
index 074b1e1..f0b31cd 100644
--- a/crypto/stack/stack.c
+++ b/crypto/stack/stack.c
@@ -54,7 +54,7 @@
  * copied and put under another distribution licence
  * [including the GNU Public Licence.] */
 
-#include "stack.h"
+#include <openssl/stack.h>
 
 #include <openssl/mem.h>
 
diff --git a/crypto/x509/x509_error.c b/crypto/x509/x509_error.c
index 53d2faf..f8f6847 100644
--- a/crypto/x509/x509_error.c
+++ b/crypto/x509/x509_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "x509.h"
+#include <openssl/x509.h>
 
 const ERR_STRING_DATA X509_error_string_data[] = {
   {ERR_PACK(ERR_LIB_X509, X509_F_ASN1_digest, 0), "ASN1_digest"},
diff --git a/crypto/x509v3/x509v3_error.c b/crypto/x509v3/x509v3_error.c
index e87ddfc..9fbca5f 100644
--- a/crypto/x509v3/x509v3_error.c
+++ b/crypto/x509v3/x509v3_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "x509v3.h"
+#include <openssl/x509v3.h>
 
 const ERR_STRING_DATA X509V3_error_string_data[] = {
   {ERR_PACK(ERR_LIB_X509V3, X509V3_F_SXNET_add_id_INTEGER, 0), "SXNET_add_id_INTEGER"},
diff --git a/include/openssl/aead.h b/include/openssl/aead.h
deleted file mode 120000
index d90b92d..0000000
--- a/include/openssl/aead.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/cipher/aead.h
\ No newline at end of file
diff --git a/crypto/cipher/aead.h b/include/openssl/aead.h
similarity index 100%
rename from crypto/cipher/aead.h
rename to include/openssl/aead.h
diff --git a/include/openssl/aes.h b/include/openssl/aes.h
deleted file mode 120000
index f555c13..0000000
--- a/include/openssl/aes.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/aes/aes.h
\ No newline at end of file
diff --git a/crypto/aes/aes.h b/include/openssl/aes.h
similarity index 100%
rename from crypto/aes/aes.h
rename to include/openssl/aes.h
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h
deleted file mode 120000
index dd51495..0000000
--- a/include/openssl/asn1.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/asn1/asn1.h
\ No newline at end of file
diff --git a/crypto/asn1/asn1.h b/include/openssl/asn1.h
similarity index 100%
rename from crypto/asn1/asn1.h
rename to include/openssl/asn1.h
diff --git a/include/openssl/asn1_mac.h b/include/openssl/asn1_mac.h
deleted file mode 120000
index 97781d9..0000000
--- a/include/openssl/asn1_mac.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/asn1/asn1_mac.h
\ No newline at end of file
diff --git a/crypto/asn1/asn1_mac.h b/include/openssl/asn1_mac.h
similarity index 100%
rename from crypto/asn1/asn1_mac.h
rename to include/openssl/asn1_mac.h
diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h
deleted file mode 120000
index 31c87c3..0000000
--- a/include/openssl/asn1t.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/asn1/asn1t.h
\ No newline at end of file
diff --git a/crypto/asn1/asn1t.h b/include/openssl/asn1t.h
similarity index 100%
rename from crypto/asn1/asn1t.h
rename to include/openssl/asn1t.h
diff --git a/include/openssl/base.h b/include/openssl/base.h
deleted file mode 120000
index e59dd0e..0000000
--- a/include/openssl/base.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/base.h
\ No newline at end of file
diff --git a/crypto/base.h b/include/openssl/base.h
similarity index 100%
rename from crypto/base.h
rename to include/openssl/base.h
diff --git a/include/openssl/base64.h b/include/openssl/base64.h
deleted file mode 120000
index 618bf6e..0000000
--- a/include/openssl/base64.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/base64/base64.h
\ No newline at end of file
diff --git a/crypto/base64/base64.h b/include/openssl/base64.h
similarity index 100%
rename from crypto/base64/base64.h
rename to include/openssl/base64.h
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
deleted file mode 120000
index c598b6f..0000000
--- a/include/openssl/bio.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/bio/bio.h
\ No newline at end of file
diff --git a/crypto/bio/bio.h b/include/openssl/bio.h
similarity index 100%
rename from crypto/bio/bio.h
rename to include/openssl/bio.h
diff --git a/include/openssl/bn.h b/include/openssl/bn.h
deleted file mode 120000
index 5c251c1..0000000
--- a/include/openssl/bn.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/bn/bn.h
\ No newline at end of file
diff --git a/crypto/bn/bn.h b/include/openssl/bn.h
similarity index 100%
rename from crypto/bn/bn.h
rename to include/openssl/bn.h
diff --git a/include/openssl/buf.h b/include/openssl/buf.h
deleted file mode 120000
index 0459327..0000000
--- a/include/openssl/buf.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/buf/buf.h
\ No newline at end of file
diff --git a/crypto/buf/buf.h b/include/openssl/buf.h
similarity index 100%
rename from crypto/buf/buf.h
rename to include/openssl/buf.h
diff --git a/include/openssl/bytestring.h b/include/openssl/bytestring.h
deleted file mode 120000
index 83b015a..0000000
--- a/include/openssl/bytestring.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/bytestring/bytestring.h
\ No newline at end of file
diff --git a/crypto/bytestring/bytestring.h b/include/openssl/bytestring.h
similarity index 100%
rename from crypto/bytestring/bytestring.h
rename to include/openssl/bytestring.h
diff --git a/include/openssl/chacha.h b/include/openssl/chacha.h
deleted file mode 120000
index d42715f..0000000
--- a/include/openssl/chacha.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/chacha/chacha.h
\ No newline at end of file
diff --git a/crypto/chacha/chacha.h b/include/openssl/chacha.h
similarity index 100%
rename from crypto/chacha/chacha.h
rename to include/openssl/chacha.h
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
deleted file mode 120000
index 1b0723a..0000000
--- a/include/openssl/cipher.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/cipher/cipher.h
\ No newline at end of file
diff --git a/crypto/cipher/cipher.h b/include/openssl/cipher.h
similarity index 100%
rename from crypto/cipher/cipher.h
rename to include/openssl/cipher.h
diff --git a/include/openssl/conf.h b/include/openssl/conf.h
deleted file mode 120000
index 44156b1..0000000
--- a/include/openssl/conf.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/conf/conf.h
\ No newline at end of file
diff --git a/crypto/conf/conf.h b/include/openssl/conf.h
similarity index 100%
rename from crypto/conf/conf.h
rename to include/openssl/conf.h
diff --git a/include/openssl/cpu.h b/include/openssl/cpu.h
deleted file mode 120000
index b15e4a8..0000000
--- a/include/openssl/cpu.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/cpu.h
\ No newline at end of file
diff --git a/crypto/cpu.h b/include/openssl/cpu.h
similarity index 100%
rename from crypto/cpu.h
rename to include/openssl/cpu.h
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h
deleted file mode 120000
index 60f6840..0000000
--- a/include/openssl/crypto.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/mem.h
\ No newline at end of file
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h
new file mode 100644
index 0000000..ddb97be
--- /dev/null
+++ b/include/openssl/crypto.h
@@ -0,0 +1,23 @@
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+/* This header is provided in order to make compiling against code that expects
+   OpenSSL easier. */
+
+#define CRYPTO_F_CRYPTO_set_ex_data 100
+#define CRYPTO_F_get_class 101
+#define CRYPTO_F_get_new_index 102
+#define CRYPTO_F_get_func_pointers 103
+
+#include "mem.h"
diff --git a/include/openssl/des.h b/include/openssl/des.h
deleted file mode 120000
index 5eb7c88..0000000
--- a/include/openssl/des.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/des/des.h
\ No newline at end of file
diff --git a/crypto/des/des.h b/include/openssl/des.h
similarity index 100%
rename from crypto/des/des.h
rename to include/openssl/des.h
diff --git a/include/openssl/dh.h b/include/openssl/dh.h
deleted file mode 120000
index c0eacb5..0000000
--- a/include/openssl/dh.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/dh/dh.h
\ No newline at end of file
diff --git a/crypto/dh/dh.h b/include/openssl/dh.h
similarity index 100%
rename from crypto/dh/dh.h
rename to include/openssl/dh.h
diff --git a/include/openssl/digest.h b/include/openssl/digest.h
deleted file mode 120000
index a1ba3d4..0000000
--- a/include/openssl/digest.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/digest/digest.h
\ No newline at end of file
diff --git a/crypto/digest/digest.h b/include/openssl/digest.h
similarity index 100%
rename from crypto/digest/digest.h
rename to include/openssl/digest.h
diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h
deleted file mode 120000
index ad4695f..0000000
--- a/include/openssl/dsa.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/dsa/dsa.h
\ No newline at end of file
diff --git a/crypto/dsa/dsa.h b/include/openssl/dsa.h
similarity index 100%
rename from crypto/dsa/dsa.h
rename to include/openssl/dsa.h
diff --git a/include/openssl/dtls1.h b/include/openssl/dtls1.h
deleted file mode 120000
index 95aef99..0000000
--- a/include/openssl/dtls1.h
+++ /dev/null
@@ -1 +0,0 @@
-../../ssl/dtls1.h
\ No newline at end of file
diff --git a/ssl/dtls1.h b/include/openssl/dtls1.h
similarity index 100%
rename from ssl/dtls1.h
rename to include/openssl/dtls1.h
diff --git a/include/openssl/ec.h b/include/openssl/ec.h
deleted file mode 120000
index 245497e..0000000
--- a/include/openssl/ec.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/ec/ec.h
\ No newline at end of file
diff --git a/crypto/ec/ec.h b/include/openssl/ec.h
similarity index 100%
rename from crypto/ec/ec.h
rename to include/openssl/ec.h
diff --git a/include/openssl/ec_key.h b/include/openssl/ec_key.h
deleted file mode 120000
index b31d219..0000000
--- a/include/openssl/ec_key.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/ec/ec_key.h
\ No newline at end of file
diff --git a/crypto/ec/ec_key.h b/include/openssl/ec_key.h
similarity index 100%
rename from crypto/ec/ec_key.h
rename to include/openssl/ec_key.h
diff --git a/include/openssl/ecdh.h b/include/openssl/ecdh.h
deleted file mode 120000
index 3fd1c3b..0000000
--- a/include/openssl/ecdh.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/ecdh/ecdh.h
\ No newline at end of file
diff --git a/crypto/ecdh/ecdh.h b/include/openssl/ecdh.h
similarity index 100%
rename from crypto/ecdh/ecdh.h
rename to include/openssl/ecdh.h
diff --git a/include/openssl/ecdsa.h b/include/openssl/ecdsa.h
deleted file mode 120000
index e48acc6..0000000
--- a/include/openssl/ecdsa.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/ecdsa/ecdsa.h
\ No newline at end of file
diff --git a/crypto/ecdsa/ecdsa.h b/include/openssl/ecdsa.h
similarity index 100%
rename from crypto/ecdsa/ecdsa.h
rename to include/openssl/ecdsa.h
diff --git a/include/openssl/engine.h b/include/openssl/engine.h
deleted file mode 120000
index a02073e..0000000
--- a/include/openssl/engine.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/engine/engine.h
\ No newline at end of file
diff --git a/crypto/engine/engine.h b/include/openssl/engine.h
similarity index 100%
rename from crypto/engine/engine.h
rename to include/openssl/engine.h
diff --git a/include/openssl/err.h b/include/openssl/err.h
deleted file mode 120000
index 20f65bd..0000000
--- a/include/openssl/err.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/err/err.h
\ No newline at end of file
diff --git a/crypto/err/err.h b/include/openssl/err.h
similarity index 100%
rename from crypto/err/err.h
rename to include/openssl/err.h
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
deleted file mode 120000
index 7e3a904..0000000
--- a/include/openssl/evp.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/evp/evp.h
\ No newline at end of file
diff --git a/crypto/evp/evp.h b/include/openssl/evp.h
similarity index 100%
rename from crypto/evp/evp.h
rename to include/openssl/evp.h
diff --git a/include/openssl/ex_data.h b/include/openssl/ex_data.h
deleted file mode 120000
index 0a39dc3..0000000
--- a/include/openssl/ex_data.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/ex_data.h
\ No newline at end of file
diff --git a/crypto/ex_data.h b/include/openssl/ex_data.h
similarity index 100%
rename from crypto/ex_data.h
rename to include/openssl/ex_data.h
diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h
deleted file mode 120000
index de19ba7..0000000
--- a/include/openssl/hmac.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/hmac/hmac.h
\ No newline at end of file
diff --git a/crypto/hmac/hmac.h b/include/openssl/hmac.h
similarity index 100%
rename from crypto/hmac/hmac.h
rename to include/openssl/hmac.h
diff --git a/include/openssl/lhash.h b/include/openssl/lhash.h
deleted file mode 120000
index 56eb099..0000000
--- a/include/openssl/lhash.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/lhash/lhash.h
\ No newline at end of file
diff --git a/crypto/lhash/lhash.h b/include/openssl/lhash.h
similarity index 100%
rename from crypto/lhash/lhash.h
rename to include/openssl/lhash.h
diff --git a/include/openssl/lhash_macros.h b/include/openssl/lhash_macros.h
deleted file mode 120000
index cf29d16..0000000
--- a/include/openssl/lhash_macros.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/lhash/lhash_macros.h
\ No newline at end of file
diff --git a/crypto/lhash/lhash_macros.h b/include/openssl/lhash_macros.h
similarity index 100%
rename from crypto/lhash/lhash_macros.h
rename to include/openssl/lhash_macros.h
diff --git a/include/openssl/md5.h b/include/openssl/md5.h
deleted file mode 120000
index 26fa47e..0000000
--- a/include/openssl/md5.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/md5/md5.h
\ No newline at end of file
diff --git a/crypto/md5/md5.h b/include/openssl/md5.h
similarity index 100%
rename from crypto/md5/md5.h
rename to include/openssl/md5.h
diff --git a/include/openssl/mem.h b/include/openssl/mem.h
deleted file mode 120000
index 60f6840..0000000
--- a/include/openssl/mem.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/mem.h
\ No newline at end of file
diff --git a/crypto/mem.h b/include/openssl/mem.h
similarity index 100%
rename from crypto/mem.h
rename to include/openssl/mem.h
diff --git a/include/openssl/modes.h b/include/openssl/modes.h
deleted file mode 120000
index ccc1728..0000000
--- a/include/openssl/modes.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/modes/modes.h
\ No newline at end of file
diff --git a/crypto/modes/modes.h b/include/openssl/modes.h
similarity index 100%
rename from crypto/modes/modes.h
rename to include/openssl/modes.h
diff --git a/include/openssl/obj.h b/include/openssl/obj.h
deleted file mode 120000
index 6166546..0000000
--- a/include/openssl/obj.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/obj/obj.h
\ No newline at end of file
diff --git a/crypto/obj/obj.h b/include/openssl/obj.h
similarity index 100%
rename from crypto/obj/obj.h
rename to include/openssl/obj.h
diff --git a/include/openssl/obj_dat.h b/include/openssl/obj_dat.h
deleted file mode 120000
index 313024e..0000000
--- a/include/openssl/obj_dat.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/obj/obj_dat.h
\ No newline at end of file
diff --git a/crypto/obj/obj_dat.h b/include/openssl/obj_dat.h
similarity index 100%
rename from crypto/obj/obj_dat.h
rename to include/openssl/obj_dat.h
diff --git a/include/openssl/obj_mac.h b/include/openssl/obj_mac.h
deleted file mode 120000
index 5e6b9c0..0000000
--- a/include/openssl/obj_mac.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/obj/obj_mac.h
\ No newline at end of file
diff --git a/crypto/obj/obj_mac.h b/include/openssl/obj_mac.h
similarity index 100%
rename from crypto/obj/obj_mac.h
rename to include/openssl/obj_mac.h
diff --git a/include/openssl/objects.h b/include/openssl/objects.h
deleted file mode 120000
index 6166546..0000000
--- a/include/openssl/objects.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/obj/obj.h
\ No newline at end of file
diff --git a/include/openssl/objects.h b/include/openssl/objects.h
new file mode 100644
index 0000000..dd6556f
--- /dev/null
+++ b/include/openssl/objects.h
@@ -0,0 +1,18 @@
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+/* This header is provided in order to make compiling against code that expects
+   OpenSSL easier. */
+
+#include "obj.h"
diff --git a/include/openssl/opensslv.h b/include/openssl/opensslv.h
deleted file mode 120000
index e59dd0e..0000000
--- a/include/openssl/opensslv.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/base.h
\ No newline at end of file
diff --git a/include/openssl/opensslv.h b/include/openssl/opensslv.h
new file mode 100644
index 0000000..c2b3fe7
--- /dev/null
+++ b/include/openssl/opensslv.h
@@ -0,0 +1,18 @@
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+/* This header is provided in order to make compiling against code that expects
+   OpenSSL easier. */
+
+#include "base.h"
diff --git a/include/openssl/ossl_typ.h b/include/openssl/ossl_typ.h
deleted file mode 120000
index e59dd0e..0000000
--- a/include/openssl/ossl_typ.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/base.h
\ No newline at end of file
diff --git a/include/openssl/ossl_typ.h b/include/openssl/ossl_typ.h
new file mode 100644
index 0000000..c2b3fe7
--- /dev/null
+++ b/include/openssl/ossl_typ.h
@@ -0,0 +1,18 @@
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+/* This header is provided in order to make compiling against code that expects
+   OpenSSL easier. */
+
+#include "base.h"
diff --git a/include/openssl/pem.h b/include/openssl/pem.h
deleted file mode 120000
index ca37142..0000000
--- a/include/openssl/pem.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/pem/pem.h
\ No newline at end of file
diff --git a/crypto/pem/pem.h b/include/openssl/pem.h
similarity index 100%
rename from crypto/pem/pem.h
rename to include/openssl/pem.h
diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h
deleted file mode 120000
index 8464cf4..0000000
--- a/include/openssl/pkcs12.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/pkcs8/pkcs8.h
\ No newline at end of file
diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h
new file mode 100644
index 0000000..b5e9516
--- /dev/null
+++ b/include/openssl/pkcs12.h
@@ -0,0 +1,18 @@
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+/* This header is provided in order to make compiling against code that expects
+   OpenSSL easier. */
+
+#include "pkcs8.h"
diff --git a/include/openssl/pkcs7.h b/include/openssl/pkcs7.h
deleted file mode 120000
index 955ae2e..0000000
--- a/include/openssl/pkcs7.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/header_removed.h
\ No newline at end of file
diff --git a/include/openssl/pkcs7.h b/include/openssl/pkcs7.h
new file mode 100644
index 0000000..6e5e433
--- /dev/null
+++ b/include/openssl/pkcs7.h
@@ -0,0 +1,16 @@
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+/* This header is provided in order to make compiling against code that expects
+   OpenSSL easier. */
diff --git a/include/openssl/pkcs8.h b/include/openssl/pkcs8.h
deleted file mode 120000
index 8464cf4..0000000
--- a/include/openssl/pkcs8.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/pkcs8/pkcs8.h
\ No newline at end of file
diff --git a/crypto/pkcs8/pkcs8.h b/include/openssl/pkcs8.h
similarity index 100%
rename from crypto/pkcs8/pkcs8.h
rename to include/openssl/pkcs8.h
diff --git a/include/openssl/poly1305.h b/include/openssl/poly1305.h
deleted file mode 120000
index e0985cd..0000000
--- a/include/openssl/poly1305.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/poly1305/poly1305.h
\ No newline at end of file
diff --git a/crypto/poly1305/poly1305.h b/include/openssl/poly1305.h
similarity index 100%
rename from crypto/poly1305/poly1305.h
rename to include/openssl/poly1305.h
diff --git a/include/openssl/pqueue.h b/include/openssl/pqueue.h
deleted file mode 120000
index 43fa4da..0000000
--- a/include/openssl/pqueue.h
+++ /dev/null
@@ -1 +0,0 @@
-../../ssl/pqueue/pqueue.h
\ No newline at end of file
diff --git a/ssl/pqueue/pqueue.h b/include/openssl/pqueue.h
similarity index 100%
rename from ssl/pqueue/pqueue.h
rename to include/openssl/pqueue.h
diff --git a/include/openssl/rand.h b/include/openssl/rand.h
deleted file mode 120000
index 11231f8..0000000
--- a/include/openssl/rand.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/rand/rand.h
\ No newline at end of file
diff --git a/crypto/rand/rand.h b/include/openssl/rand.h
similarity index 100%
rename from crypto/rand/rand.h
rename to include/openssl/rand.h
diff --git a/include/openssl/rc4.h b/include/openssl/rc4.h
deleted file mode 120000
index ef7deeb..0000000
--- a/include/openssl/rc4.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/rc4/rc4.h
\ No newline at end of file
diff --git a/crypto/rc4/rc4.h b/include/openssl/rc4.h
similarity index 100%
rename from crypto/rc4/rc4.h
rename to include/openssl/rc4.h
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h
deleted file mode 120000
index 3e5a654..0000000
--- a/include/openssl/rsa.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/rsa/rsa.h
\ No newline at end of file
diff --git a/crypto/rsa/rsa.h b/include/openssl/rsa.h
similarity index 100%
rename from crypto/rsa/rsa.h
rename to include/openssl/rsa.h
diff --git a/include/openssl/safe_stack.h b/include/openssl/safe_stack.h
deleted file mode 120000
index 955ae2e..0000000
--- a/include/openssl/safe_stack.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/header_removed.h
\ No newline at end of file
diff --git a/include/openssl/safe_stack.h b/include/openssl/safe_stack.h
new file mode 100644
index 0000000..6e5e433
--- /dev/null
+++ b/include/openssl/safe_stack.h
@@ -0,0 +1,16 @@
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+/* This header is provided in order to make compiling against code that expects
+   OpenSSL easier. */
diff --git a/include/openssl/sha.h b/include/openssl/sha.h
deleted file mode 120000
index 3025cd5..0000000
--- a/include/openssl/sha.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/sha/sha.h
\ No newline at end of file
diff --git a/crypto/sha/sha.h b/include/openssl/sha.h
similarity index 100%
rename from crypto/sha/sha.h
rename to include/openssl/sha.h
diff --git a/include/openssl/srtp.h b/include/openssl/srtp.h
deleted file mode 120000
index 9800e4e..0000000
--- a/include/openssl/srtp.h
+++ /dev/null
@@ -1 +0,0 @@
-../../ssl/srtp.h
\ No newline at end of file
diff --git a/ssl/srtp.h b/include/openssl/srtp.h
similarity index 100%
rename from ssl/srtp.h
rename to include/openssl/srtp.h
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
deleted file mode 120000
index e87d9be..0000000
--- a/include/openssl/ssl.h
+++ /dev/null
@@ -1 +0,0 @@
-../../ssl/ssl.h
\ No newline at end of file
diff --git a/ssl/ssl.h b/include/openssl/ssl.h
similarity index 100%
rename from ssl/ssl.h
rename to include/openssl/ssl.h
diff --git a/include/openssl/ssl2.h b/include/openssl/ssl2.h
deleted file mode 120000
index 7287688..0000000
--- a/include/openssl/ssl2.h
+++ /dev/null
@@ -1 +0,0 @@
-../../ssl/ssl2.h
\ No newline at end of file
diff --git a/ssl/ssl2.h b/include/openssl/ssl2.h
similarity index 100%
rename from ssl/ssl2.h
rename to include/openssl/ssl2.h
diff --git a/include/openssl/ssl23.h b/include/openssl/ssl23.h
deleted file mode 120000
index 5605052..0000000
--- a/include/openssl/ssl23.h
+++ /dev/null
@@ -1 +0,0 @@
-../../ssl/ssl23.h
\ No newline at end of file
diff --git a/ssl/ssl23.h b/include/openssl/ssl23.h
similarity index 100%
rename from ssl/ssl23.h
rename to include/openssl/ssl23.h
diff --git a/include/openssl/ssl3.h b/include/openssl/ssl3.h
deleted file mode 120000
index 5ae2507..0000000
--- a/include/openssl/ssl3.h
+++ /dev/null
@@ -1 +0,0 @@
-../../ssl/ssl3.h
\ No newline at end of file
diff --git a/ssl/ssl3.h b/include/openssl/ssl3.h
similarity index 100%
rename from ssl/ssl3.h
rename to include/openssl/ssl3.h
diff --git a/include/openssl/stack.h b/include/openssl/stack.h
deleted file mode 120000
index 61d342f..0000000
--- a/include/openssl/stack.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/stack/stack.h
\ No newline at end of file
diff --git a/crypto/stack/stack.h b/include/openssl/stack.h
similarity index 100%
rename from crypto/stack/stack.h
rename to include/openssl/stack.h
diff --git a/include/openssl/stack_macros.h b/include/openssl/stack_macros.h
deleted file mode 120000
index 2ad0316..0000000
--- a/include/openssl/stack_macros.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/stack/stack_macros.h
\ No newline at end of file
diff --git a/crypto/stack/stack_macros.h b/include/openssl/stack_macros.h
similarity index 100%
rename from crypto/stack/stack_macros.h
rename to include/openssl/stack_macros.h
diff --git a/include/openssl/thread.h b/include/openssl/thread.h
deleted file mode 120000
index d7067d5..0000000
--- a/include/openssl/thread.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/thread.h
\ No newline at end of file
diff --git a/crypto/thread.h b/include/openssl/thread.h
similarity index 100%
rename from crypto/thread.h
rename to include/openssl/thread.h
diff --git a/include/openssl/time_support.h b/include/openssl/time_support.h
deleted file mode 120000
index 8574718..0000000
--- a/include/openssl/time_support.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/time_support.h
\ No newline at end of file
diff --git a/crypto/time_support.h b/include/openssl/time_support.h
similarity index 100%
rename from crypto/time_support.h
rename to include/openssl/time_support.h
diff --git a/include/openssl/tls1.h b/include/openssl/tls1.h
deleted file mode 120000
index 53d998f..0000000
--- a/include/openssl/tls1.h
+++ /dev/null
@@ -1 +0,0 @@
-../../ssl/tls1.h
\ No newline at end of file
diff --git a/ssl/tls1.h b/include/openssl/tls1.h
similarity index 100%
rename from ssl/tls1.h
rename to include/openssl/tls1.h
diff --git a/include/openssl/type_check.h b/include/openssl/type_check.h
deleted file mode 120000
index 6f92bba..0000000
--- a/include/openssl/type_check.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/type_check.h
\ No newline at end of file
diff --git a/crypto/type_check.h b/include/openssl/type_check.h
similarity index 100%
rename from crypto/type_check.h
rename to include/openssl/type_check.h
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
deleted file mode 120000
index b2b85c5..0000000
--- a/include/openssl/x509.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/x509/x509.h
\ No newline at end of file
diff --git a/crypto/x509/x509.h b/include/openssl/x509.h
similarity index 100%
rename from crypto/x509/x509.h
rename to include/openssl/x509.h
diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h
deleted file mode 120000
index bb99ad4..0000000
--- a/include/openssl/x509_vfy.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/x509/x509_vfy.h
\ No newline at end of file
diff --git a/crypto/x509/x509_vfy.h b/include/openssl/x509_vfy.h
similarity index 100%
rename from crypto/x509/x509_vfy.h
rename to include/openssl/x509_vfy.h
diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h
deleted file mode 120000
index 63d12f9..0000000
--- a/include/openssl/x509v3.h
+++ /dev/null
@@ -1 +0,0 @@
-../../crypto/x509v3/x509v3.h
\ No newline at end of file
diff --git a/crypto/x509v3/x509v3.h b/include/openssl/x509v3.h
similarity index 100%
rename from crypto/x509v3/x509v3.h
rename to include/openssl/x509v3.h
diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c
index 59108c2..d21abad 100644
--- a/ssl/d1_srtp.c
+++ b/ssl/d1_srtp.c
@@ -123,7 +123,7 @@
 #include <openssl/err.h>
 
 #include "ssl_locl.h"
-#include "srtp.h"
+#include <openssl/srtp.h>
 
 
 static SRTP_PROTECTION_PROFILE srtp_known_profiles[]=
diff --git a/ssl/pqueue/pqueue.c b/ssl/pqueue/pqueue.c
index c6cd34d..e8d0ac5 100644
--- a/ssl/pqueue/pqueue.c
+++ b/ssl/pqueue/pqueue.c
@@ -54,7 +54,7 @@
  * (eay@cryptsoft.com).  This product includes software written by Tim
  * Hudson (tjh@cryptsoft.com). */
 
-#include "pqueue.h"
+#include <openssl/pqueue.h>
 
 #include <openssl/mem.h>
 
diff --git a/ssl/ssl_error.c b/ssl/ssl_error.c
index eaac152..19d9ed8 100644
--- a/ssl/ssl_error.c
+++ b/ssl/ssl_error.c
@@ -14,7 +14,7 @@
 
 #include <openssl/err.h>
 
-#include "ssl.h"
+#include <openssl/ssl.h>
 
 const ERR_STRING_DATA SSL_error_string_data[] = {
   {ERR_PACK(ERR_LIB_SSL, SSL_F_D2I_SSL_SESSION, 0), "D2I_SSL_SESSION"},
diff --git a/util/make_errors.go b/util/make_errors.go
index 3c94766..20b3e2d 100644
--- a/util/make_errors.go
+++ b/util/make_errors.go
@@ -16,6 +16,7 @@
 
 import (
 	"bufio"
+	"errors"
 	"flag"
 	"fmt"
 	"io"
@@ -36,13 +37,16 @@
 	}
 
 	lib := filepath.Base(dirName)
-	headerPath := lib + ".h"
+	headerPath, err := findHeader(lib + ".h")
+	if err != nil {
+		return err
+	}
 	sourcePath := lib + "_error.c"
 
 	headerFile, err := os.Open(headerPath)
 	if err != nil {
 		if os.IsNotExist(err) {
-			return fmt.Errorf("No %s in current directory. Run in the right directory or touch the file.", headerPath)
+			return fmt.Errorf("No header %s. Run in the right directory or touch the file.", headerPath)
 		}
 
 		return err
@@ -92,7 +96,7 @@
 	}
 	defer headerFile.Close()
 
-	newHeaderFile, err := os.OpenFile(headerPath + ".tmp", os.O_CREATE | os.O_WRONLY | os.O_TRUNC, 0666)
+	newHeaderFile, err := os.OpenFile(headerPath+".tmp", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0666)
 	if err != nil {
 		return err
 	}
@@ -101,7 +105,7 @@
 	if err := writeHeaderFile(newHeaderFile, headerFile, prefix, functions, reasons); err != nil {
 		return err
 	}
-	os.Rename(headerPath + ".tmp", headerPath)
+	os.Rename(headerPath+".tmp", headerPath)
 
 	sourceFile, err := os.OpenFile(sourcePath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
 	if err != nil {
@@ -125,7 +129,7 @@
 
 #include <openssl/err.h>
 
-#include "%s.h"
+#include <openssl/%s.h>
 
 const ERR_STRING_DATA %s_error_string_data[] = {
 `, lib, prefix)
@@ -137,6 +141,23 @@
 	return nil
 }
 
+func findHeader(basename string) (path string, err error) {
+	includeDir := filepath.Join("..", "include")
+
+	fi, err := os.Stat(includeDir)
+	if err != nil && os.IsNotExist(err) {
+		includeDir = filepath.Join("..", includeDir)
+		fi, err = os.Stat(includeDir)
+	}
+	if err != nil {
+		return "", errors.New("cannot find path to include directory")
+	}
+	if !fi.IsDir() {
+		return "", errors.New("include node is not a directory")
+	}
+	return filepath.Join(includeDir, "openssl", basename), nil
+}
+
 type assignment struct {
 	key   string
 	value int
@@ -294,7 +315,7 @@
 
 func handleDeclareMacro(line, join, macroName string, m map[string]int) {
 	if i := strings.Index(line, macroName); i >= 0 {
-		contents := line[i + len(macroName):]
+		contents := line[i+len(macroName):]
 		if i := strings.Index(contents, ")"); i >= 0 {
 			contents = contents[:i]
 			args := strings.Split(contents, ",")