source: src/router/rules/openvpn.mk @ 18563

Last change on this file since 18563 was 18563, checked in by BrainSlayer, 15 months ago

fix arguments

File size: 3.6 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../lzo/include -I$(SSLPATH)/include -L../lzo -L$(SSL_LIB_PATH) -L../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" \
35        LDFLAGS="-L../$(SSL_LIB_PATH) -L../lzo -L../lzo/src/.libs -ldl" \
36        ac_cv_func_epoll_create=yes
37
38openvpn-configure: $(SSL_DEP)
39        if ! test -e "lzo/Makefile"; then cd lzo && ./configure --host=$(ARCH)-linux CFLAGS="$(COPTS)"; fi
40        make -j 4 -C lzo
41        #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
42        if ! test -e "$(OVPN)/Makefile"; then cd $(OVPN) && ./configure $(CONFIGURE_ARGS); fi
43
44openvpn: $(SSL_DEP) openvpn-configure
45#ifeq ($(CONFIG_NEWMEDIA),y)
46#else
47#       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"
48#endif
49        make -j 4 -C lzo clean
50        make -j 4 -C lzo
51ifneq ($(CONFIG_MADWIFI),y)
52ifneq ($(CONFIG_DANUBE),y)
53ifneq ($(CONFIG_FREERADIUS),y)
54ifneq ($(CONFIG_POUND),y)
55        rm -f openssl/*.so*
56endif
57endif
58endif
59endif
60ifeq ($(CONFIG_NEWMEDIA),y)
61        make -j 4 -C $(OVPN) clean
62else
63        make -j 4 -C $(OVPN) clean
64endif
65ifeq ($(CONFIG_OPENVPN_SSLSTATIC),y)
66        rm -f openssl/*.so*
67endif
68        make -j 4 -C $(OVPN)
69
70openvpn-install:
71        install -D $(OVPN)/openvpn $(INSTALLDIR)/openvpn/usr/sbin/openvpn
72
73ifeq ($(CONFIG_AIRNET),y)
74        install -D openvpn/config-airnet/openvpncl.nvramconfig $(INSTALLDIR)/openvpn/etc/config/openvpncl.nvramconfig
75        install -D openvpn/config-airnet/openvpncl.webvpn $(INSTALLDIR)/openvpn/etc/config/openvpncl.webvpn
76        install -D openvpn/config-airnet/openvpn.nvramconfig $(INSTALLDIR)/openvpn/etc/config/openvpn.nvramconfig
77        install -D openvpn/config-airnet/openvpn.webvpn $(INSTALLDIR)/openvpn/etc/config/openvpn.webvpn
78else
79        install -D openvpn/config/openvpncl.nvramconfig $(INSTALLDIR)/openvpn/etc/config/openvpncl.nvramconfig
80        install -D openvpn/config/openvpncl.webvpn $(INSTALLDIR)/openvpn/etc/config/openvpncl.webvpn
81        install -D openvpn/config2/openvpn.nvramconfig $(INSTALLDIR)/openvpn/etc/config/openvpn.nvramconfig
82        install -D openvpn/config2/openvpn.webvpn $(INSTALLDIR)/openvpn/etc/config/openvpn.webvpn
83endif
84        cp -f openvpn/config/*.sh $(INSTALLDIR)/openvpn/etc
85
86
87openvpn-clean:
88        if test -e "$(OVPN)/Makefile"; then make -C $(OVPN) clean; fi
89
90
91
Note: See TracBrowser for help on using the repository browser.