yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | |
| 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 | # |
| 9 | include $(COMMON_BASE_MK) |
| 10 | |
| 11 | NAME := libssl |
| 12 | SRC_DIR := openssl-1.1.1o |
| 13 | INSTALL_DIR := $(LIB_DIR)/$(NAME)/install |
| 14 | |
| 15 | export ac_cv_lbl_unaligned_fail=yes |
| 16 | export ac_cv_func_mmap_fixed_mapped=yes |
| 17 | export ac_cv_func_memcmp_working=yes |
| 18 | export ac_cv_have_decl_malloc=yes |
| 19 | export gl_cv_func_malloc_0_nonnull=yes |
| 20 | export ac_cv_func_malloc_0_nonnull=yes |
| 21 | export ac_cv_func_calloc_0_nonnull=yes |
| 22 | export ac_cv_func_realloc_0_nonnull=yes |
| 23 | export lt_cv_sys_lib_search_path_spec="" |
| 24 | export ac_cv_c_bigendian=no |
| 25 | export CROSS_COMPILE=$(CROSS_ROOT)/usr/bin/arm-buildroot-linux-uclibcgnueabi- |
| 26 | export CC=gcc |
| 27 | export GCC=gcc |
| 28 | export CPP=cpp |
| 29 | export AS=as |
| 30 | export LD=ld |
| 31 | export NM=nm |
| 32 | export CXX=g++ |
| 33 | export AR=ar |
| 34 | export RANLIB=ranlib |
| 35 | export READELF=readelf |
| 36 | export STRIP=strip |
| 37 | export OBJCOPY=objcopy |
| 38 | export OBJDUMP=objdump |
| 39 | |
| 40 | export CPPFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 |
| 41 | export CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 |
| 42 | export CXXFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 |
| 43 | |
| 44 | CONFIG_OPTS := linux-armv4 |
| 45 | CONFIG_OPTS += --prefix=$(INSTALL_DIR) |
| 46 | CONFIG_OPTS += --openssldir=$(INSTALL_DIR)/etc/ssl |
| 47 | |
| 48 | CONFIG_OPTS += no-shared |
| 49 | ifeq ($(CONFIG_LIBSSL_SHARE_LIB), y) |
| 50 | CONFIG_OPTS += shared |
| 51 | endif |
| 52 | #CONFIG_OPTS += -latomic |
| 53 | CONFIG_OPTS += threads |
| 54 | CONFIG_OPTS += no-rc5 |
| 55 | CONFIG_OPTS += enable-camellia |
| 56 | CONFIG_OPTS += enable-mdc2 |
| 57 | CONFIG_OPTS += no-tests |
| 58 | CONFIG_OPTS += no-fuzz-libfuzzer |
| 59 | CONFIG_OPTS += no-fuzz-afl |
| 60 | CONFIG_OPTS += no-rc5 |
| 61 | CONFIG_OPTS += no-rc2 |
| 62 | CONFIG_OPTS += no-rc4 |
| 63 | CONFIG_OPTS += no-md2 |
| 64 | ifneq ($(CONFIG_WIFI_MODULE), aic8800) |
| 65 | CONFIG_OPTS += no-md4 |
| 66 | CONFIG_OPTS += no-des |
| 67 | endif |
| 68 | CONFIG_OPTS += no-mdc2 |
| 69 | CONFIG_OPTS += no-blake2 |
| 70 | CONFIG_OPTS += no-idea |
| 71 | CONFIG_OPTS += no-seed |
| 72 | |
| 73 | CONFIG_OPTS += no-rmd160 |
| 74 | CONFIG_OPTS += no-whirlpool |
| 75 | CONFIG_OPTS += no-ssl |
| 76 | CONFIG_OPTS += no-ssl2 |
| 77 | CONFIG_OPTS += no-weak-ssl-ciphers |
| 78 | CONFIG_OPTS += no-psk |
| 79 | CONFIG_OPTS += no-cast |
| 80 | CONFIG_OPTS += no-unit-test |
| 81 | CONFIG_OPTS += no-crypto-mdebug-backtrace |
| 82 | CONFIG_OPTS += no-crypto-mdebug |
| 83 | CONFIG_OPTS += no-autoerrinit |
| 84 | CONFIG_OPTS += no-dynamic-engine |
| 85 | CONFIG_OPTS += no-comp |
| 86 | CONFIG_OPTS += zlib-dynamic |
| 87 | CONFIG_OPTS += no-async |
| 88 | CONFIG_OPTS += no-dso |
| 89 | CONFIG_OPTS += --with-rand-seed=devrandom |
| 90 | |
| 91 | all: $(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 | |
| 98 | clean: |
| 99 | -make -C $(SRC_DIR) distclean |
| 100 | -rm -rf $(INSTALL_DIR) |
| 101 | |
| 102 | romfs: |
| 103 | ifeq ($(CONFIG_USE_WEBUI_SECURITY),yes) |
| 104 | $(ROMFSINST) $(INSTALL_DIR)/bin/openssl /bin/openssl |
| 105 | endif |
| 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 | |