blob: 30cb7fd7bee170ef3a44d80edcb3ea1703144373 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001
2include $(COMMON_BASE_MK)
3
4NAME=openvpn
5SRC_DIR=openvpn-2.4.4
6INSTALL_DIR=$(APP_DIR)/$(NAME)/install
7BUILD_DIR=build
8GEN_MAKEFILE=$(BUILD_DIR)/Makefile
9
10CONFIG_OPTS = --host=arm-linux
11CONFIG_OPTS += --with-sysroot=$(CROSS_COMPILE_SYSROOT)
12CONFIG_OPTS += --enable-lzo
13CONFIG_OPTS += --disable-plugin-auth-pam
14CONFIG_OPTS += --disable-plugin-down-root
15CONFIG_OPTS += --with-crypto-library=openssl
16
17CFLAGS += -I$(LIB_DIR)/liblzo/install/include
18CFLAGS += -I$(LIB_DIR)/libssl/install/include
19
20LDFLAGS += -L$(LIB_DIR)/liblzo/install/lib
21LDFLAGS += -L$(LIB_DIR)/libssl/install/lib
22LDFLAGS += -ldl
23
24all: $(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
32clean:
33 -rm -fr $(BUILD_DIR) $(INSTALL_DIR)
34
35romfs:
36 $(ROMFSINST) $(INSTALL_DIR)/sbin/openvpn /sbin/openvpn