1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
$NetBSD: patch-aa,v 1.7 2003/05/01 22:03:50 jmmv Exp $
--- Makefile.orig Wed Sep 6 22:24:02 1995
+++ Makefile
@@ -3,9 +3,11 @@
SHELL=/bin/sh
+OPSYS!= uname -s
+
#SOCKS=-DSOCKS
# or
-SOCKS=-Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dlisten=Rlisten -Daccept=Raccept -Drcmd=Rrcmd -Dbind=Rbind -Dselect=Rselect
+SOCKS=-Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dlisten=Rlisten -Daccept=Raccept -Drcmd=Rrcmd -Dbind=Rbind -Dselect=Rselect -Dunix=1
# If the second definition of SOCKS is used, you MUST also
# define SHORTENED_RBIND
@@ -19,7 +21,7 @@
# It should be this current directory.
# If your system has getcwd() but no getwd(), uncomment the next line:
-#GETCWD=-DGETCWD
+GETCWD=-DGETCWD
#If your system doesn't have waitpid(), uncomment the nextline:
#NO_WAITPID=-DNO_WAITPID
@@ -43,15 +45,15 @@
# Define RCMD and SUPPORT_RCMD if you want to support Rrcmd, which is required
# for SOCKSified rlogin, rsh, and rcp.
-#RCMD=Rrcmd.o
-#SUPPORT_RCMD=-DSUPPORT_RCMD
+RCMD=Rrcmd.o
+SUPPORT_RCMD=-DSUPPORT_RCMD
# Define FOR_PS if your system is not SYSV and you want to have the
# command 'ps' show some details of sockd's activity.
#FOR_PS=-DFOR_PS
# optimization flag for cc
-OPTIMIZE=-g
+#OPTIMIZE=-g
#OPTIMIZE=-O
# Be careful with the OPTIMIZE flag. SunPro's SC2.0.1, for example, is
# knwon to produce incorrect code when -O is used.
@@ -73,13 +75,13 @@
#BIND_RESOLVER=-DBIND_RESOLVER
# Directory into which to install the man pages
-MAN_DEST_DIR = /usr/local/man
+MAN_DEST_DIR = ${PREFIX}/man
# Directory into which the SOCKS server should be installed
-SERVER_BIN_DIR = /usr/etc
+SERVER_BIN_DIR = ${PREFIX}/libexec
# Directory into the client programs should be installed
-CLIENTS_BIN_DIR = /usr/local/bin
+CLIENTS_BIN_DIR = ${PREFIX}/bin
# SunOS 4.1.x should use
#CC=cc
@@ -103,13 +105,13 @@
#GETPASS=getpass.o
# IRIX 5 should use
-CC=cc
-RESOLV_LIB=-lsun
-OTHER_CFLAGS=-cckr $(GETCWD) $(FASCIST) $(SHORTENED_RBIND) -DCOMPAT -DSVR3 -DNCARGS=`sysconf ARG_MAX` -D_BSD_SIGNALS $(TRY_PASV)
-RANLIB=/bin/true
-OS=irix5
-INSTALL=bsdinstall
-GETPASS=getpass.o
+#CC=cc
+#RESOLV_LIB=-lsun
+#OTHER_CFLAGS=-cckr $(GETCWD) $(FASCIST) $(SHORTENED_RBIND) -DCOMPAT -DSVR3 -DNCARGS=`sysconf ARG_MAX` -D_BSD_SIGNALS $(TRY_PASV)
+#RANLIB=/bin/true
+#OS=irix5
+#INSTALL=bsdinstall
+#GETPASS=getpass.o
# Ultrix 4.0 should use
#CC=cc
@@ -156,13 +158,15 @@
#GETPASS=
# SOLARIS should use
+.if ${OPSYS} == "SunOS"
#CC=cc
-#RESOLV_LIB=-lresolv -lnsl -lsocket
-#OTHER_CFLAGS=-DSOLARIS -Dindex=strchr -Drindex=strrchr $(SHORTENED_RBIND) -DUSE_DIRENT $(GETCWD) $(FASCIST) -DCOMPAT $(TRY_PASV)
-#RANLIB=/bin/true
-#OS=solaris2.2
-#INSTALL=install
-#GETPASS=getpass.o
+RESOLV_LIB=-lresolv -lnsl -lsocket
+OTHER_CFLAGS=-DSOLARIS -Dindex=strchr -Drindex=strrchr $(SHORTENED_RBIND) -DUSE_DIRENT $(GETCWD) $(FASCIST) -DCOMPAT $(TRY_PASV)
+RANLIB=/bin/true
+OS=solaris2.2
+INSTALL=install
+GETPASS=getpass.o
+.endif
# Interactive Systems Unix should use
#OTHER_CFLAGS = -DISC -DSVR3 -Dindex=strchr -Drindex=strrchr -D_XOPEN_SOURCE -DGETCWD $(FASCIST) $(SHORTENED_RBIND) -DCOMPAT $(TRY_PASV)
@@ -174,13 +178,15 @@
#RESOLV_LIB=-linet -lc_s
# netBSD should use
-#OTHER_CFLAGS = $(GETCWD) $(SHORTENED_RBIND) $(FASCIST) $(TRY_PASV)
-#CC=cc
-#RANLIB=ranlib
-#OS=netbsd0.9
-#INSTALL=install
-#GETPASS=
-#RESOLV_LIB=
+.if ${OPSYS} == "NetBSD"
+OTHER_CFLAGS = $(GETCWD) $(SHORTENED_RBIND) $(FASCIST) $(TRY_PASV) -Dunix=1
+CC=cc
+RANLIB=ranlib
+OS=netbsd0.9
+INSTALL=install -c
+GETPASS=
+RESOLV_LIB=
+.endif
# FreeBSD should use:
#CC=cc
@@ -413,3 +419,11 @@
( cd $$i ; $(MAKE) clean) done
+install.conf:
+ ${INSTALL} -m 0644 socks.conf ${PREFIX}/share/examples/socks4
+
+install.lib:
+ ${INSTALL} -m 0644 lib/libsocks.a ${PREFIX}/lib/libsocks4.a
+ ${RANLIB} ${PREFIX}/lib/libsocks4.a
+
+install: install.server install.clients install.man install.conf install.lib
|