diff options
author | Brent Cook <busterb@gmail.com> | 2023-02-15 07:56:44 -0600 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2023-02-15 07:56:44 -0600 |
commit | 3c7747fd8bcaaf2eb2f901c34d573bae52fea0c5 (patch) | |
tree | 99051bae4bb93a8e36f9560dc39f0b85d52b3f6f | |
parent | 20fb2bdb1197008f46c080b8539084c69b7a8c92 (diff) | |
download | portable-3c7747fd8bcaaf2eb2f901c34d573bae52fea0c5.tar.gz portable-3c7747fd8bcaaf2eb2f901c34d573bae52fea0c5.tar.bz2 portable-3c7747fd8bcaaf2eb2f901c34d573bae52fea0c5.zip |
generate opensslconf.h based on host cpu architecture
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | Makefile.am.common | 4 | ||||
-rw-r--r-- | include/Makefile.am | 14 | ||||
-rw-r--r-- | include/openssl/opensslconf.h.in | 15 | ||||
-rw-r--r-- | patches/opensslconf.h.patch | 24 | ||||
-rwxr-xr-x | update.sh | 7 |
7 files changed, 41 insertions, 27 deletions
@@ -145,6 +145,7 @@ stamp-h1 | |||
145 | stamp-h2 | 145 | stamp-h2 |
146 | 146 | ||
147 | include/openssl/Makefile.am | 147 | include/openssl/Makefile.am |
148 | include/arch | ||
148 | 149 | ||
149 | VERSION | 150 | VERSION |
150 | crypto/VERSION | 151 | crypto/VERSION |
@@ -152,6 +153,7 @@ ssl/VERSION | |||
152 | tls/VERSION | 153 | tls/VERSION |
153 | libtls-standalone/VERSION | 154 | libtls-standalone/VERSION |
154 | 155 | ||
156 | ssl/hidden | ||
155 | ssl/*.c | 157 | ssl/*.c |
156 | ssl/*.h | 158 | ssl/*.h |
157 | tls/*.c | 159 | tls/*.c |
diff --git a/Makefile.am b/Makefile.am index ed59df0..d28692a 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -1,4 +1,4 @@ | |||
1 | SUBDIRS = crypto ssl tls include apps man | 1 | SUBDIRS = include crypto ssl tls apps man |
2 | if ENABLE_TESTS | 2 | if ENABLE_TESTS |
3 | SUBDIRS += tests | 3 | SUBDIRS += tests |
4 | endif | 4 | endif |
diff --git a/Makefile.am.common b/Makefile.am.common index 87aa807..5405704 100644 --- a/Makefile.am.common +++ b/Makefile.am.common | |||
@@ -1,3 +1,5 @@ | |||
1 | AM_CFLAGS = | 1 | AM_CFLAGS = |
2 | AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/compat -DLIBRESSL_INTERNAL | 2 | AM_CPPFLAGS = -I$(top_srcdir)/include |
3 | AM_CPPFLAGS += -I$(abs_top_builddir)/include | ||
4 | AM_CPPFLAGS += -I$(top_srcdir)/include/compat -DLIBRESSL_INTERNAL | ||
3 | AM_CPPFLAGS += -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= | 5 | AM_CPPFLAGS += -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= |
diff --git a/include/Makefile.am b/include/Makefile.am index aed6721..26e82fe 100644 --- a/include/Makefile.am +++ b/include/Makefile.am | |||
@@ -44,4 +44,18 @@ noinst_HEADERS += compat/sys/time.h | |||
44 | noinst_HEADERS += compat/sys/types.h | 44 | noinst_HEADERS += compat/sys/types.h |
45 | noinst_HEADERS += compat/sys/uio.h | 45 | noinst_HEADERS += compat/sys/uio.h |
46 | 46 | ||
47 | noinst_HEADERS += arch/aarch64/opensslconf.h | ||
48 | noinst_HEADERS += arch/alpha/opensslconf.h | ||
49 | noinst_HEADERS += arch/amd64/opensslconf.h | ||
50 | noinst_HEADERS += arch/arm/opensslconf.h | ||
51 | noinst_HEADERS += arch/hppa/opensslconf.h | ||
52 | noinst_HEADERS += arch/i386/opensslconf.h | ||
53 | noinst_HEADERS += arch/m88k/opensslconf.h | ||
54 | noinst_HEADERS += arch/mips64/opensslconf.h | ||
55 | noinst_HEADERS += arch/powerpc/opensslconf.h | ||
56 | noinst_HEADERS += arch/powerpc64/opensslconf.h | ||
57 | noinst_HEADERS += arch/riscv64/opensslconf.h | ||
58 | noinst_HEADERS += arch/sh/opensslconf.h | ||
59 | noinst_HEADERS += arch/sparc64/opensslconf.h | ||
60 | |||
47 | include_HEADERS = tls.h | 61 | include_HEADERS = tls.h |
diff --git a/include/openssl/opensslconf.h.in b/include/openssl/opensslconf.h.in new file mode 100644 index 0000000..8842f00 --- /dev/null +++ b/include/openssl/opensslconf.h.in | |||
@@ -0,0 +1,15 @@ | |||
1 | #if defined(_MSC_VER) && !defined(__clang__) && !defined(__attribute__) | ||
2 | #define __attribute__(a) | ||
3 | #endif | ||
4 | |||
5 | #if defined(LIBRESSL_INTERNAL) && !defined(LIBRESSL_NAMESPACE) | ||
6 | # define LCRYPTO_UNUSED(x) | ||
7 | # define LCRYPTO_USED(x) | ||
8 | # define LCRYPTO_ALIAS1(pre, x) | ||
9 | # define LCRYPTO_ALIAS(x) | ||
10 | |||
11 | # define LSSL_UNUSED(x) | ||
12 | # define LSSL_USED(x) | ||
13 | # define LSSL_ALIAS(x) | ||
14 | #endif /* LIBRESSL_INTERNAL && !LIBRESSL_NAMESPACE */ | ||
15 | |||
diff --git a/patches/opensslconf.h.patch b/patches/opensslconf.h.patch deleted file mode 100644 index ee5d645..0000000 --- a/patches/opensslconf.h.patch +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | --- include/openssl/opensslconf.h.orig Tue Nov 22 21:08:27 2022 | ||
2 | +++ include/openssl/opensslconf.h Wed Nov 23 12:38:07 2022 | ||
3 | @@ -1,6 +1,21 @@ | ||
4 | #include <openssl/opensslfeatures.h> | ||
5 | /* crypto/opensslconf.h.in */ | ||
6 | |||
7 | +#if defined(_MSC_VER) && !defined(__clang__) && !defined(__attribute__) | ||
8 | +#define __attribute__(a) | ||
9 | +#endif | ||
10 | + | ||
11 | +#if defined(LIBRESSL_INTERNAL) && !defined(LIBRESSL_NAMESPACE) | ||
12 | +# define LCRYPTO_UNUSED(x) | ||
13 | +# define LCRYPTO_USED(x) | ||
14 | +# define LCRYPTO_ALIAS1(pre, x) | ||
15 | +# define LCRYPTO_ALIAS(x) | ||
16 | + | ||
17 | +# define LSSL_UNUSED(x) | ||
18 | +# define LSSL_USED(x) | ||
19 | +# define LSSL_ALIAS(x) | ||
20 | +#endif /* LIBRESSL_INTERNAL && !LIBRESSL_NAMESPACE */ | ||
21 | + | ||
22 | #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) | ||
23 | #define OPENSSLDIR "/etc/ssl" | ||
24 | #endif | ||
@@ -70,7 +70,6 @@ fi | |||
70 | 70 | ||
71 | $CP $libssl_src/LICENSE COPYING | 71 | $CP $libssl_src/LICENSE COPYING |
72 | 72 | ||
73 | $CP $libcrypto_src/arch/amd64/opensslconf.h include/openssl | ||
74 | $CP $libcrypto_src/opensslfeatures.h include/openssl | 73 | $CP $libcrypto_src/opensslfeatures.h include/openssl |
75 | $CP $libssl_src/pqueue.h include | 74 | $CP $libssl_src/pqueue.h include |
76 | 75 | ||
@@ -152,6 +151,12 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' crypto/Makefile.am` ; do | |||
152 | fi | 151 | fi |
153 | done | 152 | done |
154 | 153 | ||
154 | for i in $libcrypto_src/arch/*; do | ||
155 | arch=`basename $i` | ||
156 | mkdir -p include/arch/$arch | ||
157 | $CP $libcrypto_src/arch/$arch/opensslconf.h include/arch/$arch/ | ||
158 | done | ||
159 | |||
155 | for i in $libcrypto_src/bn/arch/*; do | 160 | for i in $libcrypto_src/bn/arch/*; do |
156 | arch=`basename $i` | 161 | arch=`basename $i` |
157 | mkdir -p crypto/bn/arch/$arch | 162 | mkdir -p crypto/bn/arch/$arch |