lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | |
| 2 | include $(COMMON_BASE_MK) |
| 3 | |
| 4 | NAME=openvpn |
| 5 | SRC_DIR=openvpn-2.4.4 |
| 6 | INSTALL_DIR=$(APP_DIR)/$(NAME)/install |
| 7 | BUILD_DIR=build |
| 8 | GEN_MAKEFILE=$(BUILD_DIR)/Makefile |
| 9 | |
| 10 | CONFIG_OPTS = --host=arm-linux |
| 11 | CONFIG_OPTS += --with-sysroot=$(CROSS_COMPILE_SYSROOT) |
| 12 | CONFIG_OPTS += --enable-lzo |
| 13 | CONFIG_OPTS += --disable-plugin-auth-pam |
| 14 | CONFIG_OPTS += --disable-plugin-down-root |
| 15 | CONFIG_OPTS += --with-crypto-library=openssl |
| 16 | |
| 17 | CFLAGS += -I$(LIB_DIR)/liblzo/install/include |
| 18 | CFLAGS += -I$(LIB_DIR)/libssl/install/include |
| 19 | |
| 20 | LDFLAGS += -L$(LIB_DIR)/liblzo/install/lib |
| 21 | LDFLAGS += -L$(LIB_DIR)/libssl/install/lib |
| 22 | LDFLAGS += -ldl |
| 23 | |
| 24 | all: $(GEN_MAKEFILE) |
| 25 | make -C build all |
| 26 | make -C build install |
| 27 | |
| 28 | $(GEN_MAKEFILE): |
| 29 | mkdir -p $(BUILD_DIR) |
| 30 | cd $(BUILD_DIR); ../$(SRC_DIR)/configure --prefix=$(INSTALL_DIR) $(CONFIG_OPTS) |
| 31 | |
| 32 | clean: |
| 33 | -rm -fr $(BUILD_DIR) $(INSTALL_DIR) |
| 34 | |
| 35 | romfs: |
| 36 | $(ROMFSINST) $(INSTALL_DIR)/sbin/openvpn /sbin/openvpn |