source: src/router/rules/openvpn.mk

Last change on this file was 20485, checked in by BrainSlayer, 4 months ago

fix flags for 2.3.0

File size: 3.9 KB
Line 
1ifeq ($(CONFIG_POLARSSL),y)
2OVPN=openvpn-polarssl
3SSLPATH=$(TOP)/polarssl
4SSL_LIB_PATH=$(SSLPATH)/library
5SSL_TYPE=polarssl
6SSL_DEP=polarssl
7SSL_ADDOPT=--with-pkcs11-helper-headers=$(TOP)/pkcs11-helper/include \
8           --with-pkcs11-helper-lib=$(TOP)/pkcs11-helper/lib/.libs
9else
10OVPN=openvpn
11SSLPATH=$(TOP)/openssl
12SSL_LIB_PATH=openssl
13SSL_TYPE=openssl
14SSL_DEP=openssl
15endif
16
17
18
19CONFIGURE_ARGS += \
20        --host=$(ARCH)-linux \
21        CPPFLAGS="-I$(TOP)/lzo/include -I$(SSLPATH)/include -L$(TOP)/lzo -L$(SSL_LIB_PATH) -L$(TOP)/lzo/src/.libs" \
22        --enable-pthread \
23        --disable-plugins \
24        --enable-debug \
25        --enable-password-save \
26        --enable-management \
27        --enable-lzo \
28        --enable-server \
29        --enable-multihome \
30        --with-ssl-headers=$(SSLPATH)/include \
31        --with-ssl-lib=$(SSL_LIB_PATH) \
32        --with-ssl-type=$(SSL_TYPE) \
33        $(SSL_ADDOPT) \
34        CFLAGS="$(COPTS) -DNEED_PRINTF -ffunction-sections -fdata-sections -Wl,--gc-sections" \
35        LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -L$(TOP)/$(SSL_LIB_PATH) -L$(TOP)/lzo -L$(TOP)/lzo/src/.libs -ldl" \
36        ac_cv_func_epoll_create=yes
37
38openvpn-conf-prep:
39        -rm -f openvpn/Makefile
40
41openvpn-conf: $(SSL_DEP)
42        if ! test -e "lzo/Makefile"; then cd lzo && ./configure --host=$(ARCH)-linux CFLAGS="$(COPTS)"; fi
43        make -j 4 -C lzo
44        #if ! test -e "$(OVPN)/Makefile"; then cd $(OVPN) && ./configure --host=$(ARCH)-linux CPPFLAGS="-I../lzo/include -I../openssl/include -L../lzo -L../openssl -L../lzo/src/.libs" --enable-pthread --disable-plugins --enable-debug --enable-password-save --enable-management --enable-lzo --enable-server --enable-multihome CFLAGS="$(COPTS)" LDFLAGS="-L../openssl -L../lzo -L../lzo/src/.libs -ldl" ac_cv_func_epoll_create=no; fi
45        if ! test -e "$(OVPN)/Makefile"; then cd $(OVPN) && ./configure $(CONFIGURE_ARGS); fi
46
47
48openvpn-configure: openvpn-conf-prep openvpn-conf
49
50openvpn: $(SSL_DEP) openvpn-conf
51#ifeq ($(CONFIG_NEWMEDIA),y)
52#else
53#       cd $(OVPN) && ./configure --host=$(ARCH)-linux CPPFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -I../lzo/include -I../openssl/include -L../lzo -L../openssl -L../lzo/src/.libs" --enable-static --disable-shared --disable-pthread --disable-plugins --disable-debug --disable-management --disable-socks --enable-lzo --enable-small --enable-server --enable-http --enable-password-save CFLAGS="$(COPTS)  -ffunction-sections -fdata-sections -Wl,--gc-sections" LDFLAGS="-L../openssl -L../lzo -L../lzo/src/.libs  -ffunction-sections -fdata-sections -Wl,--gc-sections"
54#endif
55        make -j 4 -C lzo clean
56        make -j 4 -C lzo
57ifneq ($(CONFIG_FREERADIUS),y)
58ifneq ($(CONFIG_ASTERISK),y)
59ifneq ($(CONFIG_AIRCRACK),y)
60ifneq ($(CONFIG_POUND),y)
61ifneq ($(CONFIG_IPETH),y)
62ifneq ($(CONFIG_VPNC),y)
63        rm -f openssl/*.so*
64endif
65endif
66endif
67endif
68endif
69endif
70ifeq ($(CONFIG_NEWMEDIA),y)
71        make -j 4 -C $(OVPN) clean
72else
73        make -j 4 -C $(OVPN) clean
74endif
75ifeq ($(CONFIG_OPENVPN_SSLSTATIC),y)
76        rm -f openssl/*.so*
77endif
78        make -j 4 -C $(OVPN)
79
80openvpn-install:
81        install -D $(OVPN)/src/openvpn/openvpn $(INSTALLDIR)/openvpn/usr/sbin/openvpn
82
83ifeq ($(CONFIG_AIRNET),y)
84        install -D openvpn/config-airnet/openvpncl.nvramconfig $(INSTALLDIR)/openvpn/etc/config/openvpncl.nvramconfig
85        install -D openvpn/config-airnet/openvpncl.webvpn $(INSTALLDIR)/openvpn/etc/config/openvpncl.webvpn
86        install -D openvpn/config-airnet/openvpn.nvramconfig $(INSTALLDIR)/openvpn/etc/config/openvpn.nvramconfig
87        install -D openvpn/config-airnet/openvpn.webvpn $(INSTALLDIR)/openvpn/etc/config/openvpn.webvpn
88else
89        install -D openvpn/config/openvpncl.nvramconfig $(INSTALLDIR)/openvpn/etc/config/openvpncl.nvramconfig
90        install -D openvpn/config/openvpncl.webvpn $(INSTALLDIR)/openvpn/etc/config/openvpncl.webvpn
91        install -D openvpn/config2/openvpn.nvramconfig $(INSTALLDIR)/openvpn/etc/config/openvpn.nvramconfig
92        install -D openvpn/config2/openvpn.webvpn $(INSTALLDIR)/openvpn/etc/config/openvpn.webvpn
93endif
94        cp -f openvpn/config/*.sh $(INSTALLDIR)/openvpn/etc
95
96
97openvpn-clean:
98        if test -e "$(OVPN)/Makefile"; then make -C $(OVPN) clean; fi
99
100
101
Note: See TracBrowser for help on using the repository browser.