aboutsummaryrefslogtreecommitdiffstats
path: root/package/libs
diff options
context:
space:
mode:
Diffstat (limited to 'package/libs')
-rw-r--r--package/libs/openssl/Config.in5
-rw-r--r--package/libs/openssl/Makefile9
2 files changed, 12 insertions, 2 deletions
diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in
index b949d3beb7..96d3ba3e9d 100644
--- a/package/libs/openssl/Config.in
+++ b/package/libs/openssl/Config.in
@@ -55,6 +55,11 @@ config OPENSSL_HARDWARE_SUPPORT
default n
prompt "Enable hardware support"
+config OPENSSL_OPTIMIZE_SPEED
+ bool
+ default n
+ prompt "Enable optimization for speed instead of size"
+
endif
config OPENSSL_ENGINE_CRYPTO
diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index b95b462bde..db20b7e6a9 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -41,7 +41,8 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_OPENSSL_WITH_COMPRESSION \
CONFIG_OPENSSL_WITH_NPN \
CONFIG_OPENSSL_WITH_PSK \
- CONFIG_OPENSSL_WITH_SRP
+ CONFIG_OPENSSL_WITH_SRP \
+ CONFIG_OPENSSL_OPTIMIZE_SPEED
include $(INCLUDE_DIR)/package.mk
@@ -155,6 +156,10 @@ ifndef CONFIG_OPENSSL_WITH_SRP
OPENSSL_OPTIONS += no-srp
endif
+ifeq ($(CONFIG_OPENSSL_OPTIMIZE_SPEED),y)
+ TARGET_CFLAGS := $(filter-out -Os,$(TARGET_CFLAGS)) -O3
+endif
+
ifeq ($(CONFIG_x86_64),y)
OPENSSL_TARGET:=linux-x86_64-openwrt
OPENSSL_MAKEFLAGS += LIBDIR=lib
@@ -185,7 +190,7 @@ define Build/Configure
--openssldir=/etc/ssl \
$(TARGET_CPPFLAGS) \
$(TARGET_LDFLAGS) -ldl \
- -DOPENSSL_SMALL_FOOTPRINT \
+ $(if $(CONFIG_OPENSSL_OPTIMIZE_SPEED),,-DOPENSSL_SMALL_FOOTPRINT) \
$(OPENSSL_NO_CIPHERS) \
$(OPENSSL_OPTIONS) \
)