1 ################################################################################
5 ################################################################################
7 OPENSSL_VERSION
= 1.0.2k
8 OPENSSL_SITE
= http
://www.openssl.org
/source
9 OPENSSL_LICENSE
= OpenSSL or SSLeay
10 OPENSSL_LICENSE_FILES
= LICENSE
11 OPENSSL_INSTALL_STAGING
= YES
12 OPENSSL_DEPENDENCIES
= zlib
13 HOST_OPENSSL_DEPENDENCIES
= host-zlib
14 OPENSSL_TARGET_ARCH
= generic32
15 OPENSSL_CFLAGS
= $(TARGET_CFLAGS
)
17 https
://gitweb.gentoo.org
/repo
/gentoo.git
/plain
/dev-libs
/openssl
/files
/openssl-1.0
.2d-parallel-build.patch?id
=c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d \
18 https
://gitweb.gentoo.org
/repo
/gentoo.git
/plain
/dev-libs
/openssl
/files
/openssl-1.0
.2a-parallel-obj-headers.patch?id
=c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d \
19 https
://gitweb.gentoo.org
/repo
/gentoo.git
/plain
/dev-libs
/openssl
/files
/openssl-1.0
.2a-parallel-install-dirs.patch?id
=c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d \
20 https
://gitweb.gentoo.org
/repo
/gentoo.git
/plain
/dev-libs
/openssl
/files
/openssl-1.0
.2a-parallel-symlinking.patch?id
=c8abcbe8de5d3b6cdd68c162f398c011ff6e2d9d
22 # relocation truncated to fit: R_68K_GOT16O
23 ifeq ($(BR2_m68k_cf
),y
)
24 OPENSSL_CFLAGS
+= -mxgot
27 ifeq ($(BR2_USE_MMU
),)
28 OPENSSL_CFLAGS
+= -DHAVE_FORK
=0
31 ifeq ($(BR2_PACKAGE_HAS_CRYPTODEV
),y
)
32 OPENSSL_CFLAGS
+= -DHAVE_CRYPTODEV
-DUSE_CRYPTODEV_DIGESTS
33 OPENSSL_DEPENDENCIES
+= cryptodev
36 # Some architectures are optimized in OpenSSL
37 # Doesn't work for thumb-only (Cortex-M?)
38 ifeq ($(BR2_ARM_CPU_HAS_ARM
),y
)
39 OPENSSL_TARGET_ARCH
= armv4
41 ifeq ($(ARCH
),aarch64
)
42 OPENSSL_TARGET_ARCH
= aarch64
44 ifeq ($(ARCH
),powerpc
)
45 # 4xx cores seem to have trouble with openssl's ASM optimizations
46 ifeq ($(BR2_powerpc_401
)$(BR2_powerpc_403
)$(BR2_powerpc_405
)$(BR2_powerpc_405fp
)$(BR2_powerpc_440
)$(BR2_powerpc_440fp
),)
47 OPENSSL_TARGET_ARCH
= ppc
50 ifeq ($(ARCH
),powerpc64
)
51 OPENSSL_TARGET_ARCH
= ppc64
53 ifeq ($(ARCH
),powerpc64le
)
54 OPENSSL_TARGET_ARCH
= ppc64le
57 OPENSSL_TARGET_ARCH
= x86_64
60 define HOST_OPENSSL_CONFIGURE_CMDS
62 $(HOST_CONFIGURE_OPTS
) \
64 --prefix=$(HOST_DIR
)/usr \
65 --openssldir
=$(HOST_DIR
)/etc
/ssl \
70 $(SED
) "s#-O[0-9]#$(HOST_CFLAGS)#" $(@D
)/Makefile
73 define OPENSSL_CONFIGURE_CMDS
75 $(TARGET_CONFIGURE_ARGS
) \
76 $(TARGET_CONFIGURE_OPTS
) \
78 linux-
$(OPENSSL_TARGET_ARCH
) \
80 --openssldir
=/etc
/ssl \
82 $(if
$(BR2_TOOLCHAIN_HAS_THREADS
),threads
,no-threads
) \
83 $(if
$(BR2_STATIC_LIBS
),no-shared
,shared
) \
88 $(if
$(BR2_STATIC_LIBS
),zlib
,zlib-dynamic
) \
89 $(if
$(BR2_STATIC_LIBS
),no-dso
) \
91 $(SED
) "s#-march=[-a-z0-9] ##" -e
"s#-mcpu=[-a-z0-9] ##g" $(@D
)/Makefile
92 $(SED
) "s#-O[0-9]#$(OPENSSL_CFLAGS)#" $(@D
)/Makefile
93 $(SED
) "s# build_tests##" $(@D
)/Makefile
96 # libdl is not available in a static build, and this is not implied by no-dso
97 ifeq ($(BR2_STATIC_LIBS
),y
)
98 define OPENSSL_FIXUP_STATIC_MAKEFILE
99 $(SED
) 's#-ldl##g' $(@D
)/Makefile
101 OPENSSL_POST_CONFIGURE_HOOKS
+= OPENSSL_FIXUP_STATIC_MAKEFILE
104 define HOST_OPENSSL_BUILD_CMDS
105 $(HOST_MAKE_ENV
) $(MAKE
) -C
$(@D
)
108 define OPENSSL_BUILD_CMDS
109 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
)
112 define OPENSSL_INSTALL_STAGING_CMDS
113 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
) INSTALL_PREFIX
=$(STAGING_DIR
) install
116 define HOST_OPENSSL_INSTALL_CMDS
117 $(HOST_MAKE_ENV
) $(MAKE
) -C
$(@D
) install
120 define OPENSSL_INSTALL_TARGET_CMDS
121 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
) INSTALL_PREFIX
=$(TARGET_DIR
) install
122 rm -rf
$(TARGET_DIR
)/usr
/lib
/ssl
123 rm -f
$(TARGET_DIR
)/usr
/bin
/c_rehash
126 # libdl has no business in a static build
127 ifeq ($(BR2_STATIC_LIBS
),y
)
128 define OPENSSL_FIXUP_STATIC_PKGCONFIG
129 $(SED
) 's#-ldl##' $(STAGING_DIR
)/usr
/lib
/pkgconfig
/libcrypto.
pc
130 $(SED
) 's#-ldl##' $(STAGING_DIR
)/usr
/lib
/pkgconfig
/libssl.
pc
131 $(SED
) 's#-ldl##' $(STAGING_DIR
)/usr
/lib
/pkgconfig
/openssl.
pc
133 OPENSSL_POST_INSTALL_STAGING_HOOKS
+= OPENSSL_FIXUP_STATIC_PKGCONFIG
136 ifneq ($(BR2_STATIC_LIBS
),y
)
137 # libraries gets installed read only, so strip fails
138 define OPENSSL_INSTALL_FIXUPS_SHARED
139 chmod
+w
$(TARGET_DIR
)/usr
/lib
/engines
/lib
*.so
140 for i in
$(addprefix $(TARGET_DIR
)/usr
/lib
/,libcrypto.so.
* libssl.so.
*); \
141 do chmod
+w
$$i; done
143 OPENSSL_POST_INSTALL_TARGET_HOOKS
+= OPENSSL_INSTALL_FIXUPS_SHARED
146 ifeq ($(BR2_PACKAGE_PERL
),)
147 define OPENSSL_REMOVE_PERL_SCRIPTS
148 $(RM
) -f
$(TARGET_DIR
)/etc
/ssl
/misc
/{CA.pl
,tsget
}
150 OPENSSL_POST_INSTALL_TARGET_HOOKS
+= OPENSSL_REMOVE_PERL_SCRIPTS
153 ifeq ($(BR2_PACKAGE_OPENSSL_BIN
),)
154 define OPENSSL_REMOVE_BIN
155 $(RM
) -f
$(TARGET_DIR
)/usr
/bin
/openssl
156 $(RM
) -f
$(TARGET_DIR
)/etc
/ssl
/misc
/{CA.
*,c_
*}
158 OPENSSL_POST_INSTALL_TARGET_HOOKS
+= OPENSSL_REMOVE_BIN
161 ifneq ($(BR2_PACKAGE_OPENSSL_ENGINES
),y
)
162 define OPENSSL_REMOVE_OPENSSL_ENGINES
163 rm -rf
$(TARGET_DIR
)/usr
/lib
/engines
165 OPENSSL_POST_INSTALL_TARGET_HOOKS
+= OPENSSL_REMOVE_OPENSSL_ENGINES
168 $(eval
$(generic-package
))
169 $(eval
$(host-generic-package
))