summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-07-05 19:59:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-07-05 19:59:48 +0000
commit29209bc5efc823322ed539ae434cba1765cb5082 (patch)
tree5497276ac24576eaa422b59e9f1a2e3f3ae34087
parent5b877257c279c72efd65c092c32959c904c739e8 (diff)
downloadperl-29209bc5efc823322ed539ae434cba1765cb5082.tar.gz
Hack SOCKS support some more plus a patch from Andy Dougherty
that addresses the notorious "Additional libraries" question. p4raw-id: //depot/cfgperl@3597
-rwxr-xr-xConfigure74
-rw-r--r--Porting/Glossary4
-rw-r--r--Porting/config.sh5
-rw-r--r--Porting/config_H8
-rw-r--r--config_h.SH6
-rw-r--r--doio.c2
-rw-r--r--ext/Socket/Socket.xs2
-rw-r--r--hints/aix.sh50
-rw-r--r--perl.c4
-rw-r--r--pp_sys.c2
10 files changed, 76 insertions, 81 deletions
diff --git a/Configure b/Configure
index 1901789b0a..a3ba9b2bd9 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$$ <<EOF
@@ -818,6 +818,7 @@ nm_so_opt=''
runnm=''
usenm=''
useperlio=''
+usesocks=''
d_oldpthreads=''
usethreads=''
incpath=''
@@ -951,6 +952,7 @@ useposix=true
: set useopcode=false in your hint file to disable the Opcode extension.
useopcode=true
: set usemultiplicity on the Configure command line to enable multiplicity.
+: set usesocks on the Configure command line to enable socks.
: set usethreads on the Configure command line to enable threads.
: List of libraries we want.
: If anyone needs -lnet, put it in a hint file.
@@ -3946,6 +3948,27 @@ case "$firstmakefile" in
'') firstmakefile='makefile';;
esac
+cat <<EOM
+
+Perl can be built to use the SOCKS proxy protocol library. To do so,
+Configure must be run with -Dusesocks.
+
+Normally you do not need this and you should answer no.
+
+EOM
+case "$usesocks" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
+esac
+rp='Build Perl for SOCKS?'
+. ./myread
+case "$ans" in
+y|Y) val="$define" ;;
+*) val="$undef" ;;
+esac
+set usesocks
+eval $setvar
+
: Looking for optional libraries
echo " "
echo "Checking for optional libraries..." >&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 <<EOM
-
-Some versions of Unix support shared libraries, which make executables smaller
-but make load time slightly longer.
-
-On some systems, mostly System V Release 3's, the shared library is included
-by putting the option "-lc_s" as the last thing on the cc command line when
-linking. Other systems use shared libraries by default. There may be other
-libraries needed to compile $package on your machine as well. If your system
-needs the "-lc_s" option, include it here. Include any other special libraries
-here as well. Say "none" for none.
+
+In order to compile $package on your machine, a number of libraries
+are usually needed. Include any other special libraries here as well.
+Say "none" for none. The default list is almost always right.
EOM
echo " "
-rp="Any additional libraries?"
+rp="What libraries to use?"
. ./myread
case "$ans" in
none) libs=' ';;
@@ -4106,6 +4128,12 @@ fi'
set signal.h LANGUAGE_C; eval $inctest
+case "$usesocks" in
+$define)
+ ccflags="$ccflags -DSOCKS"
+ ;;
+esac
+
case "$hint" in
none|recommended) dflt="$ccflags $dflt" ;;
*) dflt="$ccflags";;
@@ -4369,26 +4397,18 @@ $grep "^[ ]*#.*\$wanted" | \
while read cline; do
name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
case "\$name" in
- *[/\\\\]\$wanted) echo "\$name"; exit 1;;
- *[\\\\/]\$wanted) echo "\$name"; exit 1;;
- *) exit 2;;
+ *[/\\\\]\$wanted) echo "\$name"; exit 0;;
+ *[\\\\/]\$wanted) echo "\$name"; exit 0;;
+ *) name='';;
esac;
done;
-#
-#status=0: grep returned 0 lines, case statement not executed
-#status=1: headerfile found
-#status=2: while loop executed, no headerfile found
-#
-status=\$?
$rm -f foo\$\$.c;
-if test \$status -eq 1; then
- exit 0;
-fi
-exit 1
+case "\$name" in
+'') exit 1;;
+esac
EOF
chmod +x findhdr
-
: define an alternate in-header-list? function
inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
cont=true; xxf="echo \"<\$1> found.\" >&4";
@@ -10992,6 +11012,7 @@ $rm -f tebcdic.c tebcdic
set ebcdic
eval $setvar
+echo " "
$cat >&4 <<EOM
Checking how to flush all pending stdio output...
EOM
@@ -13569,6 +13590,7 @@ useperlio='$useperlio'
useposix='$useposix'
usesfio='$usesfio'
useshrplib='$useshrplib'
+usesocks='$usesocks'
usethreads='$usethreads'
usevfork='$usevfork'
usrinc='$usrinc'
diff --git a/Porting/Glossary b/Porting/Glossary
index c7457b9bf1..0b8a099dc7 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -3022,6 +3022,10 @@ useshrplib (libperl.U):
This variable is set to 'yes' if the user wishes
to build a shared libperl, and 'no' otherwise.
+usesocks (usesocks.U):
+ This variable conditionally defines the USE_SOCKS symbol,
+ and indicates that Perl should be built to use SOCKS.
+
usethreads (usethreads.U):
This variable conditionally defines the USE_THREADS symbol,
and indicates that Perl should be built to use threads.
diff --git a/Porting/config.sh b/Porting/config.sh
index f4df11856e..be9251a513 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -8,7 +8,7 @@
# Package name : perl5
# Source directory : .
-# Configuration time: Mon Jul 5 02:12:38 EET DST 1999
+# Configuration time: Mon Jul 5 22:50:29 EET DST 1999
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
@@ -55,7 +55,7 @@ ccflags='-pthread -std -DLANGUAGE_C'
ccsymbols='__LANGUAGE_C__=1 _LONGLONG=1 LANGUAGE_C=1 SYSTYPE_BSD=1'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Mon Jul 5 02:12:38 EET DST 1999'
+cf_time='Mon Jul 5 22:50:29 EET DST 1999'
chgrp=''
chmod=''
chown=''
@@ -668,6 +668,7 @@ useperlio='undef'
useposix='true'
usesfio='false'
useshrplib='true'
+usesocks='undef'
usethreads='define'
usevfork='false'
usrinc='/usr/include'
diff --git a/Porting/config_H b/Porting/config_H
index e3cf445f0b..c4dbe72004 100644
--- a/Porting/config_H
+++ b/Porting/config_H
@@ -17,7 +17,7 @@
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Mon Jul 5 02:12:38 EET DST 1999
+ * Configuration time: Mon Jul 5 22:50:29 EET DST 1999
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
@@ -2524,6 +2524,12 @@
*/
/*#define USE_PERLIO / **/
+/* USE_SOCKS:
+ * This symbol, if defined, indicates that Perl should
+ * be built to use socks.
+ */
+/*#define 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/config_h.SH b/config_h.SH
index 94c7b66ee9..2f565976b4 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -2538,6 +2538,12 @@ sed <<!GROK!THIS! >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 6b92d69d8a..0fc139cbfc 100644
--- a/doio.c
+++ b/doio.c
@@ -64,7 +64,7 @@
#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
# include <sys/socket.h>
-# if (defined(SOCKS) || defined(USE_SOCKS)) && defined(I_SOCKS)
+# if defined(USE_SOCKS) && defined(I_SOCKS)
# include <socks.h>
# endif
# ifdef I_NETBSD
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index 016a4616e1..c09c313d99 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -7,7 +7,7 @@
# include <sys/types.h>
# endif
# include <sys/socket.h>
-# if (defined(SOCKS) || defined(USE_SOCKS)) && defined(I_SOCKS)
+# if defined(USE_SOCKS) && defined(I_SOCKS)
# include <socks.h>
# endif
# ifdef MPE
diff --git a/hints/aix.sh b/hints/aix.sh
index fcf4adbfa1..e24874bc17 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
-# <socks.h> 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 a869678048..39eaf300ee 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 0470598e76..b11259b450 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 <sys/socket.h>
-# if (defined(SOCKS) || defined(USE_SOCKS)) && defined(I_SOCKS)
+# if defined(USE_SOCKS) && defined(I_SOCKS)
# include <socks.h>
# endif
# ifdef I_NETDB