Skip to content

Commit

Permalink
srelay: init
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwckf committed May 8, 2019
1 parent 56543bf commit f8c7230
Show file tree
Hide file tree
Showing 21 changed files with 112 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Contributors of this project are not responsible for what happens next.
>- [samba3.6](https://github.com/Linaro1985/padavan-ng/tree/master/trunk/user/samba36) ```CONFIG_FIRMWARE_INCLUDE_SMBD36```
>- [mtr](https://github.com/traviscross/mtr) ```CONFIG_FIRMWARE_INCLUDE_MTR```
>- [socat](http://www.dest-unreach.org/socat) ```CONFIG_FIRMWARE_INCLUDE_SOCAT```
>- [srelay](https://socks-relay.sourceforge.io) ```CONFIG_FIRMWARE_INCLUDE_SRELAY```
- 已适配除官方适配外的以下机型
>- WR1200JS (128M,USB)
>- NEWIFI3(D2) (512M,USB)
Expand Down
2 changes: 2 additions & 0 deletions trunk/configs/templates/5K-W20.config
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/HC5661A.config
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/JCG-AC860M.config
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/K2P.config
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/K2P_DRV.config
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,5 @@ CONFIG_FIRMWARE_INCLUDE_MTR=y
CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/K2P_USB_32M_512M.config
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=y
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/K2P_nano.config
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/MI-3.config
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/MI-MINI.config
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/MZ-R13.config
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/MZ-R13P.config
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/NEWIFI3.config
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=y
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/OYE-001.config
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=y
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/PSG1218.config
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/PSG1218_nano.config
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=n
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
2 changes: 2 additions & 0 deletions trunk/configs/templates/WR1200JS.config
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,5 @@ CONFIG_FIRMWARE_INCLUDE_RTL_SDR=y
CONFIG_FIRMWARE_INCLUDE_MTR=y

CONFIG_FIRMWARE_INCLUDE_SOCAT=y

CONFIG_FIRMWARE_INCLUDE_SRELAY=y
1 change: 1 addition & 0 deletions trunk/user/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ dir_$(CONFIG_FIRMWARE_INCLUDE_XUPNPD) += xupnpd
dir_$(CONFIG_FIRMWARE_INCLUDE_TCPDUMP) += tcpdump
dir_$(CONFIG_FIRMWARE_INCLUDE_MTR) += mtr
dir_$(CONFIG_FIRMWARE_INCLUDE_SOCAT) += socat
dir_$(CONFIG_FIRMWARE_INCLUDE_SRELAY) += srelay
ifeq ($(CONFIG_FIRMWARE_INCLUDE_SMBD36),y)
dir_$(SAMBA_ENABLED) += samba36
else
Expand Down
35 changes: 35 additions & 0 deletions trunk/user/srelay/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
SRC_NAME = srelay-0.4.8p3
THISDIR = $(shell pwd)

all: extract_test config_test
$(MAKE) -j$(HOST_NCPU) -C $(SRC_NAME)

extract_test:
( if [ ! -d $(SRC_NAME) ]; then \
tar xf $(SRC_NAME).tar.gz; \
patch -p1 -d $(SRC_NAME) < ./fix-cross-compile.patch ; \
fi )

config_test:
( if [ -f ./config_done ]; then \
echo "the same configuration"; \
else \
make configure && touch config_done; \
fi )

configure:
( cd $(SRC_NAME) ; \
./configure \
--prefix=/usr \
--host=$(HOST_TARGET) \
--build=$(HOST_BUILD) ; \
)

clean:
if [ -f $(SRC_NAME)/Makefile ] ; then \
$(MAKE) -C $(SRC_NAME) distclean ; \
fi ; \
rm -f config_done

romfs:
$(ROMFSINST) -p +x $(THISDIR)/$(SRC_NAME)/srelay /usr/bin/srelay
43 changes: 43 additions & 0 deletions trunk/user/srelay/fix-cross-compile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--- a/configure 2018-08-05 13:53:26.000000000 +0800
+++ b/configure 2019-05-08 18:06:25.654605000 +0800
@@ -3998,40 +3998,10 @@ $as_echo_n "checking whether enabling th
elif test "$OS" = "SOLARIS"; then
LDFLAGS="$LDFLAGS -lpthread"
fi
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */

-#include <pthread.h>
-void
-init_routine()
-{
- return;
-}
-main()
-{
- pthread_once_t once_control = PTHREAD_ONCE_INIT;
- pthread_once(&once_control, &init_routine);
- return(0);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
$as_echo "#define USE_THREAD 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
-else
- CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi

fi
fi
Binary file added trunk/user/srelay/srelay-0.4.8p3.tar.gz
Binary file not shown.

0 comments on commit f8c7230

Please sign in to comment.