blob: 76cde2799d13525383273991f4b736e9df23d253 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001
2#
3# this makefile gets recursed through by various bits of the build
4# so we need to only setup some things when invoked from outside
5# this directory.
6#
7# davidm@snapgear.com
8#
9include $(COMMON_BASE_MK)
10
11NAME := libssl
12SRC_DIR := openssl-1.1.1o
13INSTALL_DIR := $(LIB_DIR)/$(NAME)/install
14
15export ac_cv_lbl_unaligned_fail=yes
16export ac_cv_func_mmap_fixed_mapped=yes
17export ac_cv_func_memcmp_working=yes
18export ac_cv_have_decl_malloc=yes
19export gl_cv_func_malloc_0_nonnull=yes
20export ac_cv_func_malloc_0_nonnull=yes
21export ac_cv_func_calloc_0_nonnull=yes
22export ac_cv_func_realloc_0_nonnull=yes
23export lt_cv_sys_lib_search_path_spec=""
24export ac_cv_c_bigendian=no
25export CROSS_COMPILE=$(CROSS_ROOT)/usr/bin/arm-buildroot-linux-uclibcgnueabi-
26export CC=gcc
27export GCC=gcc
28export CPP=cpp
29export AS=as
30export LD=ld
31export NM=nm
32export CXX=g++
33export AR=ar
34export RANLIB=ranlib
35export READELF=readelf
36export STRIP=strip
37export OBJCOPY=objcopy
38export OBJDUMP=objdump
39
40export CPPFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
41export CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0
42export CXXFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0
43
44CONFIG_OPTS := linux-armv4
45CONFIG_OPTS += --prefix=$(INSTALL_DIR)
46CONFIG_OPTS += --openssldir=$(INSTALL_DIR)/etc/ssl
47
48CONFIG_OPTS += no-shared
49ifeq ($(CONFIG_LIBSSL_SHARE_LIB), y)
50CONFIG_OPTS += shared
51endif
52#CONFIG_OPTS += -latomic
53CONFIG_OPTS += threads
54CONFIG_OPTS += no-rc5
55CONFIG_OPTS += enable-camellia
56CONFIG_OPTS += enable-mdc2
57CONFIG_OPTS += no-tests
58CONFIG_OPTS += no-fuzz-libfuzzer
59CONFIG_OPTS += no-fuzz-afl
60CONFIG_OPTS += no-rc5
61CONFIG_OPTS += no-rc2
62CONFIG_OPTS += no-rc4
63CONFIG_OPTS += no-md2
64ifneq ($(CONFIG_WIFI_MODULE), aic8800)
65CONFIG_OPTS += no-md4
66CONFIG_OPTS += no-des
67endif
68CONFIG_OPTS += no-mdc2
69CONFIG_OPTS += no-blake2
70CONFIG_OPTS += no-idea
71CONFIG_OPTS += no-seed
72
73CONFIG_OPTS += no-rmd160
74CONFIG_OPTS += no-whirlpool
75CONFIG_OPTS += no-ssl
76CONFIG_OPTS += no-ssl2
77CONFIG_OPTS += no-weak-ssl-ciphers
78CONFIG_OPTS += no-psk
79CONFIG_OPTS += no-cast
80CONFIG_OPTS += no-unit-test
81CONFIG_OPTS += no-crypto-mdebug-backtrace
82CONFIG_OPTS += no-crypto-mdebug
83CONFIG_OPTS += no-autoerrinit
84CONFIG_OPTS += no-dynamic-engine
85CONFIG_OPTS += no-comp
86CONFIG_OPTS += zlib-dynamic
87CONFIG_OPTS += no-async
88CONFIG_OPTS += no-dso
89CONFIG_OPTS += --with-rand-seed=devrandom
90
91all: $(SRC_DIR)/Makefile
92 make -C $(SRC_DIR)
93 make -C $(SRC_DIR) install
94
95$(SRC_DIR)/Makefile:
96 cd $(SRC_DIR) && ./Configure $(CONFIG_OPTS)
97
98clean:
99 -make -C $(SRC_DIR) distclean
100 -rm -rf $(INSTALL_DIR)
101
102romfs:
103ifeq ($(CONFIG_USE_WEBUI_SECURITY),yes)
104 $(ROMFSINST) $(INSTALL_DIR)/bin/openssl /bin/openssl
105endif
106 cd $(INSTALL_DIR)/lib; \
107 for i in *.so*; do \
108 if [ -L $$i ]; then \
109 $(ROMFSINST) -s `find $$i -printf %l` /lib/$$i; \
110 elif [ -f $$i ]; then \
111 $(ROMFSINST) /lib/$$i; \
112 fi; \
113 done
114