Skip to content

Commit

Permalink
generate opensslconf.h based on host cpu architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
busterb committed Feb 15, 2023
1 parent 20fb2bd commit 3c7747f
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ stamp-h1
stamp-h2

include/openssl/Makefile.am
include/arch

VERSION
crypto/VERSION
ssl/VERSION
tls/VERSION
libtls-standalone/VERSION

ssl/hidden
ssl/*.c
ssl/*.h
tls/*.c
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS = crypto ssl tls include apps man
SUBDIRS = include crypto ssl tls apps man
if ENABLE_TESTS
SUBDIRS += tests
endif
Expand Down
4 changes: 3 additions & 1 deletion Makefile.am.common
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
AM_CFLAGS =
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/compat -DLIBRESSL_INTERNAL
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(abs_top_builddir)/include
AM_CPPFLAGS += -I$(top_srcdir)/include/compat -DLIBRESSL_INTERNAL
AM_CPPFLAGS += -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS=
14 changes: 14 additions & 0 deletions include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,18 @@ noinst_HEADERS += compat/sys/time.h
noinst_HEADERS += compat/sys/types.h
noinst_HEADERS += compat/sys/uio.h

noinst_HEADERS += arch/aarch64/opensslconf.h
noinst_HEADERS += arch/alpha/opensslconf.h
noinst_HEADERS += arch/amd64/opensslconf.h
noinst_HEADERS += arch/arm/opensslconf.h
noinst_HEADERS += arch/hppa/opensslconf.h
noinst_HEADERS += arch/i386/opensslconf.h
noinst_HEADERS += arch/m88k/opensslconf.h
noinst_HEADERS += arch/mips64/opensslconf.h
noinst_HEADERS += arch/powerpc/opensslconf.h
noinst_HEADERS += arch/powerpc64/opensslconf.h
noinst_HEADERS += arch/riscv64/opensslconf.h
noinst_HEADERS += arch/sh/opensslconf.h
noinst_HEADERS += arch/sparc64/opensslconf.h

include_HEADERS = tls.h
15 changes: 15 additions & 0 deletions include/openssl/opensslconf.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#if defined(_MSC_VER) && !defined(__clang__) && !defined(__attribute__)
#define __attribute__(a)
#endif

#if defined(LIBRESSL_INTERNAL) && !defined(LIBRESSL_NAMESPACE)
# define LCRYPTO_UNUSED(x)
# define LCRYPTO_USED(x)
# define LCRYPTO_ALIAS1(pre, x)
# define LCRYPTO_ALIAS(x)

# define LSSL_UNUSED(x)
# define LSSL_USED(x)
# define LSSL_ALIAS(x)
#endif /* LIBRESSL_INTERNAL && !LIBRESSL_NAMESPACE */

24 changes: 0 additions & 24 deletions patches/opensslconf.h.patch

This file was deleted.

7 changes: 6 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ fi

$CP $libssl_src/LICENSE COPYING

$CP $libcrypto_src/arch/amd64/opensslconf.h include/openssl
$CP $libcrypto_src/opensslfeatures.h include/openssl
$CP $libssl_src/pqueue.h include

Expand Down Expand Up @@ -152,6 +151,12 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' crypto/Makefile.am` ; do
fi
done

for i in $libcrypto_src/arch/*; do
arch=`basename $i`
mkdir -p include/arch/$arch
$CP $libcrypto_src/arch/$arch/opensslconf.h include/arch/$arch/
done

for i in $libcrypto_src/bn/arch/*; do
arch=`basename $i`
mkdir -p crypto/bn/arch/$arch
Expand Down

0 comments on commit 3c7747f

Please sign in to comment.