| 1 | ifeq ($(CONFIG_POLARSSL),y) |
|---|
| 2 | OVPN=openvpn-polarssl |
|---|
| 3 | SSLPATH=$(TOP)/polarssl |
|---|
| 4 | SSL_LIB_PATH=$(SSLPATH)/library |
|---|
| 5 | SSL_TYPE=polarssl |
|---|
| 6 | SSL_DEP=polarssl |
|---|
| 7 | SSL_ADDOPT=--with-pkcs11-helper-headers=$(TOP)/pkcs11-helper/include \ |
|---|
| 8 | --with-pkcs11-helper-lib=$(TOP)/pkcs11-helper/lib/.libs |
|---|
| 9 | else |
|---|
| 10 | OVPN=openvpn |
|---|
| 11 | SSLPATH=$(TOP)/openssl |
|---|
| 12 | SSL_LIB_PATH=openssl |
|---|
| 13 | SSL_TYPE=openssl |
|---|
| 14 | SSL_DEP=openssl |
|---|
| 15 | endif |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | CONFIGURE_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 | |
|---|
| 38 | openvpn-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 | |
|---|
| 44 | openvpn: $(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 |
|---|
| 51 | ifneq ($(CONFIG_MADWIFI),y) |
|---|
| 52 | ifneq ($(CONFIG_DANUBE),y) |
|---|
| 53 | ifneq ($(CONFIG_FREERADIUS),y) |
|---|
| 54 | ifneq ($(CONFIG_POUND),y) |
|---|
| 55 | rm -f openssl/*.so* |
|---|
| 56 | endif |
|---|
| 57 | endif |
|---|
| 58 | endif |
|---|
| 59 | endif |
|---|
| 60 | ifeq ($(CONFIG_NEWMEDIA),y) |
|---|
| 61 | make -j 4 -C $(OVPN) clean |
|---|
| 62 | else |
|---|
| 63 | make -j 4 -C $(OVPN) clean |
|---|
| 64 | endif |
|---|
| 65 | ifeq ($(CONFIG_OPENVPN_SSLSTATIC),y) |
|---|
| 66 | rm -f openssl/*.so* |
|---|
| 67 | endif |
|---|
| 68 | make -j 4 -C $(OVPN) |
|---|
| 69 | |
|---|
| 70 | openvpn-install: |
|---|
| 71 | install -D $(OVPN)/openvpn $(INSTALLDIR)/openvpn/usr/sbin/openvpn |
|---|
| 72 | |
|---|
| 73 | ifeq ($(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 |
|---|
| 78 | else |
|---|
| 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 |
|---|
| 83 | endif |
|---|
| 84 | cp -f openvpn/config/*.sh $(INSTALLDIR)/openvpn/etc |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | openvpn-clean: |
|---|
| 88 | if test -e "$(OVPN)/Makefile"; then make -C $(OVPN) clean; fi |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|