I am indebted to Luke Mewburn <lm@melb.cpr.itg.telecom.com.au> for his recipe for perl4 and socks4, and he in turn credits David Crow <crow@tivoli.com> for his socks & perl recipe.
NEC's socks5 Implementation pageTraditionally you would install this in a place like /usr/local/lib. If you already have a socks server, likely this library is already installed.
http://www.socks.nec.com/socks5.html
CPAN: Perl Source CodeAt the time of this writing (27jul1999) I used perl5.005_03.
http://www.cpan.org/src/index.html
./ConfigureIn the following notes there are literal sets of options. They are straight from my own Configure run. Please do not cut/paste out of this recipe into your run; instead, use the values from your run, amending them as described below.
When it asks you
Directories to use for library searches?make sure the directory containing libsocks5.a is listed. If not, enter that directory plus all the ones listed between the [] marks.
[/usr/local/lib /usr/gnu/lib /opt/gnu/lib /lib /usr/lib /usr/ccs/lib]
When it asks you
Any additional libraries?enter
[-lsfio -lsocket -lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt]
-lsocks5 -lsfio -lsocket -lnsl -lgdbm -ldb -ldl -lm -lc -lcrypti.e. repeat the supplied list with "-lsocks5 " prepended to it.
When it asks you
Any additional cc flags? [-I/usr/local/include -I/usr/gnu/include]enter
-I/usr/local/include -I/usr/gnu/include -Dconnect=SOCKSconnect -Dgetsockname=SOCKSgetsockname -Dbind=SOCKSbind -Daccept=SOCKSaccept -Dlisten=SOCKSlisten -Dselect=SOCKSselecti.e. the supplied -I options with the above "-Draw=SOCKSraw" options appended. This is the primary difference between this recipe and the others: socks5 uses "SOCKS" as a call prefix, not "R".
Then proceed as normal. Once it's in and looks happy just make symlinks in the usual spots (/usr/bin, /usr/local/bin) to the things from the /opt/perl.../bin dir. Maybe call it rperl instead of perl.
If this is a pristine install, you'll have to install all the usual extra perl modules. Indeed, any modules which themselves call the networking calls (bind, connect, accept, etc) will probably need a reinstall anyway so that they use the socks library. Fortunately, these are very few; most will use the networking which is included in the perl you just made. Don't worry about the reinstalls - they will pick up the special compile options automatically from the work you've done above. Just make sure you use the sockified perl executable when you run the
perl Makefile.PLstep of the module install.