From 29209bc5efc823322ed539ae434cba1765cb5082 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 5 Jul 1999 19:59:48 +0000 Subject: [PATCH] Hack SOCKS support some more plus a patch from Andy Dougherty that addresses the notorious "Additional libraries" question. p4raw-id: //depot/cfgperl@3597 --- Configure | 74 ++++++++++++++++++++++++++++++++++------------------ Porting/Glossary | 4 +++ Porting/config.sh | 5 ++-- Porting/config_H | 8 +++++- config_h.SH | 6 +++++ doio.c | 2 +- ext/Socket/Socket.xs | 2 +- hints/aix.sh | 50 +---------------------------------- perl.c | 4 +++ pp_sys.c | 2 +- 10 files changed, 76 insertions(+), 81 deletions(-) diff --git a/Configure b/Configure index 1901789..a3ba9b2 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Mon Jul 5 02:09:55 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Mon Jul 5 22:55:23 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <&4 @@ -3956,6 +3979,11 @@ esac case "$libswanted" in '') libswanted='c_s';; esac +case "$usesocks" in +$define) + libswanted="$libswanted socks5 socks5_sh" + ;; +esac for thislib in $libswanted; do if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; @@ -4011,20 +4039,14 @@ case "$dflt" in esac $cat <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$useperlio USE_PERLIO /**/ +/* USE_SOCKS: + * This symbol, if defined, indicates that Perl should + * be built to use socks. + */ +#$usesocks USE_SOCKS /**/ + /* HAS_DRAND48_PROTO: * This symbol, if defined, indicates that the system provides * a prototype for the drand48() function. Otherwise, it is up diff --git a/doio.c b/doio.c index 6b92d69..0fc139c 100644 --- a/doio.c +++ b/doio.c @@ -64,7 +64,7 @@ #if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */ # include -# if (defined(SOCKS) || defined(USE_SOCKS)) && defined(I_SOCKS) +# if defined(USE_SOCKS) && defined(I_SOCKS) # include # endif # ifdef I_NETBSD diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 016a461..c09c313 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -7,7 +7,7 @@ # include # endif # include -# if (defined(SOCKS) || defined(USE_SOCKS)) && defined(I_SOCKS) +# if defined(USE_SOCKS) && defined(I_SOCKS) # include # endif # ifdef MPE diff --git a/hints/aix.sh b/hints/aix.sh index fcf4adb..e24874b 100644 --- a/hints/aix.sh +++ b/hints/aix.sh @@ -17,7 +17,7 @@ # # - use nm in AIX 43x and above # - gcc + threads now builds -# - added support for socks, when Dccflags=-DSOCKS specified +# [(added support for socks) Jul 99 SOCKS support rewritten] # # Notes: # @@ -113,54 +113,6 @@ case "$osvers" in ;; esac -# Save this for backward compatibility for now. -# Configure already (5.005_58) knows how to probe for -# and libsocks. What sucks is that the name -# of the socks library seems to be version dependent -# (e.g. libsocks5), bleagh. -# -# if $ccflags contains -DSOCKS, then add socks library support. -# -# It is expected that libsocks.a resides in /usr/local/lib and that -# socks.h resides in /usr/local/include. If these files live some -# different place then modify -# - -for arg in $ccflags ; do - - if [ "$arg" = "-DSOCKS" ] ; then - - sockslib=socks5 - incpath=/usr/local/include - libpath=/usr/local/lib - - lddlflags="$lddlflags -l$sockslib" - - # setting $libs here breaks the optional libraries search - # for some reason, so use $libswanted instead - #libs="$libs -lsocks5" - - libswanted="$libswanted $sockslib" - - # - # path for include file - # - - locincpth="$locincpath /usr/local/include" - - # - # path for library not needed, if in /usr/local/lib as that - # directory is already searched. - # - - #loclibpth="$loclibpath /usr/local/lib" - - break - - fi - -done - # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. cat > UU/usethreads.cbu <<'EOCBU' diff --git a/perl.c b/perl.c index a869678..39eaf30 100644 --- a/perl.c +++ b/perl.c @@ -948,6 +948,10 @@ print \" \\@INC:\\n @INC\\n\";"); init_os_extras(aTHX); #endif +#ifdef USE_SOCKS + SOCKSinit(argv[0]); +#endif + init_predump_symbols(); /* init_postdump_symbols not currently designed to be called */ /* more than once (ENV isn't cleared first, for example) */ diff --git a/pp_sys.c b/pp_sys.c index 0470598..b11259b 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -46,7 +46,7 @@ extern "C" int syscall(unsigned long,...); #if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */ # include -# if (defined(SOCKS) || defined(USE_SOCKS)) && defined(I_SOCKS) +# if defined(USE_SOCKS) && defined(I_SOCKS) # include # endif # ifdef I_NETDB -- 1.8.3.1