# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Sep 11 21:59:48 EET DST 1998 [metaconfig 3.0 PL70]
+# Generated on Tue Sep 29 00:08:14 EET DST 1998 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by jhi@iki.fi)
cat >/tmp/c1$$ <<EOF
d_dlsymun=''
d_dosuid=''
d_suidsafe=''
+d_drand48proto=''
d_dup2=''
d_eaccess=''
d_endgrent=''
privlibexp=''
prototype=''
ptrsize=''
+drand01=''
randbits=''
+randfunc=''
+randseedtype=''
+seedfunc=''
installscript=''
scriptdir=''
scriptdirexp=''
sysman=''
trnl=''
uidtype=''
+archname64=''
use64bits=''
+usemultiplicity=''
nm_opt=''
nm_so_opt=''
runnm=''
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 usethreads on the Configure command line to enable threads.
: List of libraries we want.
: If anyone needs -lnet, put it in a hint file.
cp
echo
expr
-find
grep
ls
make
egrep
gzip
less
-line
ln
more
nm
nroff
-perl
pg
-sendmail
tee
test
uname
osvers="$2.$3"
fi
fi
- $test -f /sys/posix.dll &&
- $test -f /usr/bin/what &&
- set X `/usr/bin/what /sys/posix.dll` &&
- $test "$3" = UWIN &&
- osname=uwin &&
- osvers="$5"
+ $test -f /sys/posix.dll &&
+ $test -f /usr/bin/what &&
+ set X `/usr/bin/what /sys/posix.dll` &&
+ $test "$3" = UWIN &&
+ osname=uwin &&
+ osvers="$5"
if $test -f $uname; then
set X $myuname
shift
set d_oldpthreads
eval $setvar
+cat <<EOM
+
+Perl can be built so that multiple Perl interpreters can coexist
+within the same Perl executable. To do so, Configure must be run with
+-Dusemultiplicity.
+
+Normally you do not need this and you should answer no.
+
+EOM
+case "$usemultiplicity" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
+esac
+rp='Build Perl for multiplicity?'
+. ./myread
+case "$ans" in
+y|Y) val="$define" ;;
+*) val="$undef" ;;
+esac
+set usemultiplicity
+eval $setvar
+
+cat <<EOM
+
+Perl can be built to take advantage of explicit 64-bit interfaces,
+on some systems. To do so, Configure must be run with -Duse64bits.
+
+If this doesn't make any sense to you, just accept the default 'n'.
+EOM
+case "$use64bits" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
+esac
+rp='Try to use explicit 64-bit interfaces, if available?'
+. ./myread
+case "$ans" in
+y|Y)
+ val="$define"
+ ;;
+*)
+ val="$undef"
+ ;;
+esac
+set use64bits
+eval $setvar
+
+archname64=''
+
: determine the architecture name
echo " "
if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
archname=''
;;
esac
+myarchname="$tarch"
case "$archname" in
'') dflt="$tarch";;
*) dflt="$archname";;
esac
rp='What is your architecture name'
. ./myread
+archname="$ans"
case "$usethreads" in
-$define) echo "Threads selected." >&4
- case "$ans" in
- *-thread) echo "...and architecture name already ends in -thread." >&4
- archname="$ans"
- ;;
- *) archname="$ans-thread"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
-*) archname="$ans" ;;
+$define)
+ echo "Threads selected." >&4
+ case "$archname" in
+ *-thread*) echo "...and architecture name already has -thread." >&4
+ ;;
+ *) archname="$archname-thread"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
esac
-myarchname="$tarch"
+case "$usemultiplicity" in
+$define)
+ echo "Multiplicity selected." >&4
+ case "$archname" in
+ *-multi*) echo "...and architecture name already has -multi." >&4
+ ;;
+ *) archname="$archname-multi"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+esac
+case "$use64bits" in
+$define)
+ echo "Explicit 64-bitness selected." >&4
+ case "$archname64" in
+ '')
+ ;;
+ *)
+ case "$archname" in
+ *-$archname64*) echo "...and architecture name already has $archname64." >&4
+ ;;
+ *) archname="$archname-$archname64"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+ esac
+esac
+
: is AFS running?
echo " "
case "$afs" in
*) dflt="$ccflags";;
esac
+case "$usemultiplicity" in
+$define)
+ case "$dflt" in
+ *-DMULTIPLICITY* ) ;;
+ *) dflt="$dflt -DMULTIPLICITY"
+ ;;
+ esac
+ ;;
+esac
+
case "$dflt" in
''|' ') dflt=none;;
esac
cat <<EOM
-Perl can be built to take advantage of 64-bit interfaces, on some systems.
-To do so, Configure must be run with -Dusethreads.
-
-If this doesn't make any sense to you, just accept the default 'n'.
-EOM
-case "$use64bits" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
-esac
-rp='Try to use 64-bit APIs, if available?'
-. ./myread
-case "$ans" in
-y|Y)
- val="$define"
- ;;
-*)
- val="$undef"
- ;;
-esac
-set use64bits
-eval $setvar
-
-cat <<EOM
-
Previous version of $package used the standard IO mechanisms as defined
in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
shift 2;
done > try.c;
echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
-set try;
-if eval $cc $optimize $ccflags -c try.c; then
- echo "Your struct $struct has field $field."; >&4
+if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
val="$define";
else
- echo "Your struct $struct does not have field $field."; >&4
val="$undef";
fi;
set $varname;
eval $setvar;
-$rm -f try.c try'
+$rm -f try.c try.o'
if $test X"$use64bits" = X"$define"; then
: check for struct flock64
echo " "
+ echo "Checking to see if your system supports struct flock64..." >&4
if $h_fcntl; then
set d_flock64s flock64 l_len define fcntl.h
eval $hasfield
+ else
+ val="$undef"
+ set d_flock64s
+ eval $setvar
fi
+ case "$d_flock64s" in
+ "$define") echo "Yup, it does." >&4
+ ;;
+ *) echo "Nope, it doesn't." >&4
+ ;;
+ esac
: check for struct dirent64
echo " "
+ echo "Checking to see if your system supports struct dirent64..." >&4
set d_dirent64s dirent64 d_off $i_dirent dirent.h
eval $hasfield
+ case "$d_flock64s" in
+ "$define") echo "Yup, it does." >&4
+ ;;
+ *) echo "Nope, it doesn't." >&4
+ ;;
+ esac
+
else
val="$undef"
for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64t d_ino64t d_flock64s d_dirent64s
set d_dlsymun
eval $setvar
+hasproto='varname=$1; func=$2; shift; shift;
+while $test $# -ge 2; do
+ case "$1" in
+ $define) echo "#include <$2>";;
+ esac ;
+ shift 2;
+done > try.c;
+$cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
+if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
+ echo "$func() prototype found.";
+ val="$define";
+else
+ echo "$func() prototype NOT found.";
+ val="$undef";
+fi;
+set $varname;
+eval $setvar;
+$rm -f try.c tryout.c'
+
+: see if prototype for drand48 is available
+echo " "
+set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
+eval $hasproto
+
: see if dup2 exists
set dup2 d_dup2
eval $inlibc
set gethostent d_gethent
eval $inlibc
-hasproto='varname=$1; func=$2; shift; shift;
-while $test $# -ge 2; do
- case "$1" in
- $define) echo "#include <$2>";;
- esac ;
- shift 2;
-done > try.c;
-$cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
-if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
- echo "$func() prototype found.";
- val="$define";
-else
- echo "$func() prototype NOT found.";
- val="$undef";
-fi;
-set $varname;
-eval $setvar;
-$rm -f try.c tryout.c'
-
: see if this is a netdb.h system
set netdb.h i_netdb
eval $inhdr
set inttypes.h i_inttypes
eval $inhdr
: check for int64_t
-echo " "
-echo $n "Checking to see if your system supports int64_t...$c" >&4
-$cat >try.c <<EOCP
+case "$use64bits" in
+"$define" )
+ echo " "
+ echo $n "Checking to see if your system supports int64_t...$c" >&4
+ $cat >try.c <<EOCP
#include <sys/types.h>
#$i_inttypes I_INTTYPES
#ifdef I_INTTYPES
#endif
int64_t foo() { int64_t x; x = 7; return x; }'
EOCP
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
- val="$define"
- echo " Yup, it does." >&4
-else
- val="$undef"
- echo " Nope, it doesn't." >&4
-fi
-$rm -f try.*
+ if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+ val="$define"
+ echo " Yup, it does." >&4
+ else
+ val="$undef"
+ echo " Nope, it doesn't." >&4
+ fi
+ $rm -f try.*
+ ;;
+*) val="$undef"
+ ;;
+esac
set d_int64t
eval $setvar
set lockf d_lockf
eval $inlibc
+: check for length of double
+echo " "
+case "$doublesize" in
+'')
+ $echo $n "Checking to see how big your double precision numbers are...$c" >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+main()
+{
+ printf("%d\n", sizeof(double));
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ doublesize=`./try`
+ $echo " $doublesize bytes." >&4
+ else
+ dflt='8'
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of a double precision number (in bytes)?"
+ . ./myread
+ doublesize="$ans"
+ fi
+ ;;
+esac
+$rm -f try.c try
+
: check for long doubles
echo " "
echo $n "Checking to see if your system supports long doubles...$c" >&4
. ./myread
longdblsize="$ans"
fi
+ if $test "X$doublesize" = "X$longdblsize"; then
+ echo "(That isn't any different from an ordinary double.)"
+ fi
;;
esac
$rm -f try.c try
. ./myread
longlongsize="$ans"
fi
+ if $test "X$longsize" = "X$longlongsize"; then
+ echo "(That isn't any different from an ordinary long.)"
+ fi
;;
esac
$rm -f try.c try
echo "You do not have union semun in <sys/sem.h>." >&4
val="$undef"
fi
-$rm -f try try.c
+$rm -f try try.c try.h
set d_union_semun
eval $setvar
$define)
: see whether semctl IPC_STAT can use union semun
echo " "
+ $cat > try.h <<END
+#ifndef S_IRUSR
+# ifdef S_IREAD
+# define S_IRUSR S_IREAD
+# define S_IWUSR S_IWRITE
+# define S_IXUSR S_IEXEC
+# else
+# define S_IRUSR 0400
+# define S_IWUSR 0200
+# define S_IXUSR 0100
+# endif
+# define S_IRGRP (S_IRUSR>>3)
+# define S_IWGRP (S_IWUSR>>3)
+# define S_IXGRP (S_IXUSR>>3)
+# define S_IROTH (S_IRUSR>>6)
+# define S_IWOTH (S_IWUSR>>6)
+# define S_IXOTH (S_IXUSR>>6)
+#endif
+#ifndef S_IRWXU
+# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
+# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
+# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
+#endif
+END
+
$cat > try.c <<END
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
+#include "try.h"
#ifndef errno
extern int errno;
#endif
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
+#include "try.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
*) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4
;;
esac
+ $rm -f try.h
;;
*) val="$undef"
esac
$rm -f try.* .out
-: check for length of double
+
+: How can we generate normalized random numbers ?
echo " "
-case "$doublesize" in
+case "$randfunc" in
'')
- $echo $n "Checking to see how big your double precision numbers are...$c" >&4
- $cat >try.c <<'EOCP'
+ if set drand48 val -f; eval $csym; $val; then
+ dflt="drand48"
+ echo "Good, found drand48()." >&4
+ elif set random val -f; eval $csym; $val; then
+ dflt="random"
+ echo "OK, found random()." >&4
+ else
+ dflt="rand"
+ echo "Yick, looks like I have to use rand()." >&4
+ fi
+ echo " "
+ ;;
+*)
+ dflt="$randfunc"
+ ;;
+esac
+cont=true
+
+case "$ccflags" in
+*-Dmy_rand=*|*-Dmy_srand=*)
+ echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
+ ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
+ ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
+ ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
+ ;;
+esac
+
+while $test "$cont"; do
+ rp="Use which function to generate random numbers?"
+ . ./myread
+ if $test "$ans" = "$dflt"; then
+ : null
+ else
+ randbits=''
+ fi
+ randfunc="$ans"
+ if set $ans val -f; eval $csym; $val; then
+ cont=''
+ else
+ dflt=n
+ rp="Function $ans does not exists. Use that name anyway?"
+ . ./myread
+ dflt=rand
+ case "$ans" in
+ [yY]*) cont='';;
+ esac
+ fi
+ case "$cont" in
+ '')
+ case "$randfunc" in
+ drand48)
+ drand01="drand48()"
+ seedfunc="srand48"
+ randbits=48
+ randseedtype=long
+ ;;
+ rand|random)
+ case "$randbits" in
+ '')
+echo "Checking to see how many bits your $randfunc() function produces..." >&4
+ $cat >try.c <<EOCP
+#$i_unistd I_UNISTD
+#$i_stdlib I_STDLIB
#include <stdio.h>
+#ifdef I_UNISTD
+# include <unistd.h>
+#endif
+#ifdef I_STDLIB
+# include <stdlib.h>
+#endif
main()
{
- printf("%d\n", sizeof(double));
+ register int i;
+ register unsigned long tmp;
+ register unsigned long max = 0L;
+
+ for (i = 1000; i; i--) {
+ tmp = (unsigned long) $randfunc();
+ if (tmp > max) max = tmp;
+ }
+ for (i = 0; max; i++)
+ max /= 2;
+ printf("%d\n",i);
}
EOCP
- set try
- if eval $compile_ok; then
- doublesize=`./try`
- $echo " $doublesize bytes." >&4
- else
- dflt='8'
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of a double precision number (in bytes)?"
- . ./myread
- doublesize="$ans"
- fi
- ;;
-esac
-$rm -f try.c try
+ set try
+ if eval $compile_ok; then
+ dflt=`try`
+ else
+ dflt='?'
+ echo "(I can't seem to compile the test program...)"
+ fi
+ ;;
+ *)
+ dflt="$randbits"
+ ;;
+ esac
+ rp="How many bits does your $randfunc() function produce?"
+ . ./myread
+ randbits="$ans"
+ $rm -f try.c try
+ drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
+ seedfunc="s$randfunc"
+ randseedtype=unsigned
+ ;;
+ *)
+ dflt="31"
+ rp="How many bits does your $randfunc() function produce?"
+ . ./myread
+ randbits="$ans"
+ seedfunc="s$randfunc"
+ drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
+ if set $seedfunc val -f; eval $csym; $val; then
+ echo "(Using $seedfunc() to seed random generator)"
+ else
+ echo "(Warning: no $seedfunc() to seed random generator)"
+ seedfunc=rand
+ fi
+ randseedtype=unsigned
+ ;;
+ esac
+ ;;
+ esac
+done
echo " "
echo "Determining whether or not we are on an EBCDIC system..." >&4
esac
$rm -f try.c try
-: check for size of random number generator
-echo " "
-case "$randbits" in
-'')
- echo "Checking to see how many bits your rand function produces..." >&4
- $cat >try.c <<EOCP
-#$i_unistd I_UNISTD
-#$i_stdlib I_STDLIB
-#include <stdio.h>
-#ifdef I_UNISTD
-# include <unistd.h>
-#endif
-#ifdef I_STDLIB
-# include <stdlib.h>
-#endif
-EOCP
- $cat >>try.c <<'EOCP'
-main()
-{
- register int i;
- register unsigned long tmp;
- register unsigned long max = 0L;
-
- for (i = 1000; i; i--) {
- tmp = (unsigned long)rand();
- if (tmp > max) max = tmp;
- }
- for (i = 0; max; i++)
- max /= 2;
- printf("%d\n",i);
-}
-EOCP
- set try
- if eval $compile_ok; then
- dflt=`./try$_exe`
- else
- dflt='?'
- echo "(I can't seem to compile the test program...)"
- fi
- ;;
-*)
- dflt="$randbits"
- ;;
-esac
-rp='How many bits does your rand() function produce?'
-. ./myread
-randbits="$ans"
-$rm -f try.* try
-
: see if ar generates random libraries by itself
echo " "
echo "Checking how to generate random libraries on your machine..." >&4
$define)
$cat <<EOM
-Checking to see how on how many bits at a time your select() operates...
+Checking to see on how many bits at a time your select() operates...
EOM
$cat >try.c <<EOCP
#include <sys/types.h>
set try
if eval $compile_ok; then
selectminbits=`./try`
- echo "Your select() operates on $selectminbits bits at a time." >&4
+ case "$selectminbits" in
+ 1) bits="1 bit" ;;
+ *) bits="$selectminbits bits" ;;
+ esac
+ echo "Your select() operates on $bits at a time." >&4
else
rp='What is the minimum number of bits your select() operates on?'
case "$byteorder" in
eval $inhdr
: see if sys/access.h is available
-set sysaccess.h i_sysaccess
+set sys/access.h i_sysaccess
eval $inhdr
: see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
eval $inhdr
: see if sys/security.h is available
-set syssecrt.h i_syssecrt
+set sys/security.h i_syssecrt
eval $inhdr
: see if this is a sys/un.h system
ar='$ar'
archlib='$archlib'
archlibexp='$archlibexp'
+archname64='$archname64'
archname='$archname'
archobjs='$archobjs'
awk='$awk'
d_dlopen='$d_dlopen'
d_dlsymun='$d_dlsymun'
d_dosuid='$d_dosuid'
+d_drand48proto='$d_drand48proto'
d_dup2='$d_dup2'
d_eaccess='$d_eaccess'
d_endgrent='$d_endgrent'
dlext='$dlext'
dlsrc='$dlsrc'
doublesize='$doublesize'
+drand01='$drand01'
dynamic_ext='$dynamic_ext'
eagain='$eagain'
ebcdic='$ebcdic'
prototype='$prototype'
ptrsize='$ptrsize'
randbits='$randbits'
+randfunc='$randfunc'
+randseedtype='$randseedtype'
ranlib='$ranlib'
rd_nodata='$rd_nodata'
rm='$rm'
scriptdir='$scriptdir'
scriptdirexp='$scriptdirexp'
sed='$sed'
+seedfunc='$seedfunc'
selectminbits='$selectminbits'
selecttype='$selecttype'
sendmail='$sendmail'
uniq='$uniq'
use64bits='$use64bits'
usedl='$usedl'
+usemultiplicity='$usemultiplicity'
usemymalloc='$usemymalloc'
usenm='$usenm'
useopcode='$useopcode'
*)
$cat <<EOM
-Now you need to generate make dependencies by running "make depend".
-You might prefer to run it in background: "make depend > makedepend.out &"
+Now you need to generate make dependencies by running "$make depend".
+You might prefer to run it in background: "$make depend > makedepend.out &"
It can take a while, so you might not want to run it right now.
EOM
;;
esac
- rp="Run make depend now?"
+ rp="Run $make depend now?"
. UU/myread
case "$ans" in
y*)
- make depend && echo "Now you must run a make."
+ $make depend && echo "Now you must run a $make."
;;
*)
- echo "You must run 'make depend' then 'make'."
+ echo "You must run '$make depend' then '$make'."
;;
esac
elif test -f [Mm]akefile; then
echo " "
- echo "Now you must run a make."
+ echo "Now you must run a $make."
else
echo "Done."
fi
by adding appropriate -D directives to your ccflags variable in
config.sh.
-For example, you can replace the rand() and srand() functions in the
-perl source by any other random number generator by a trick such as the
-following (this should all be on one line):
-
- sh Configure -Dccflags='-Dmy_rand=random -Dmy_srand=srandom' \
- -Drandbits=31
-
-or you can use the drand48 family of functions with
-
- sh Configure -Dccflags='-Dmy_rand=lrand48 -Dmy_srand=srand48' \
- -Drandbits=31
-
-or by adding the -D flags to your ccflags at the appropriate Configure
-prompt. (Read pp.c to see how this works.)
+Starting from Perl 5.005_53 you no more need to replace the rand() and
+srand() functions in the perl source by any other random number
+generator because Configure chooses the widest one available
+(drand48(), srandom(), or rand()).
You should also run Configure interactively to verify that a hint file
doesn't inadvertently override your ccflags setting. (Hints files
ext/IO/lib/IO/Select.pm IO::Select extension Perl module
ext/IO/lib/IO/Socket.pm IO::Socket extension Perl module
ext/IPC/SysV/ChangeLog IPC::SysV extension Perl module
+ext/IPC/SysV/hints/next_3.pl Hint for IPC::SysV for named architecture
ext/IPC/SysV/MANIFEST IPC::SysV extension Perl module
ext/IPC/SysV/Makefile.PL IPC::SysV extension Perl module
ext/IPC/SysV/Msg.pm IPC::SysV extension Perl module
/* I_SYS_ACCESS:
* This symbol, if defined, indicates to the C program that it should
- * include <sysaccess.h>.
+ * include <sys/access.h>.
*/
#$i_sysaccess I_SYS_ACCESS /**/
*/
#define PTRSIZE $ptrsize /**/
+/* Drand01:
+ * This macro is to be used to generate uniformly distributed
+ * random numbers over the range [0., 1.[. You may have to supply
+ * an 'extern double drand48();' in your program since SunOS 4.1.3
+ * doesn't provide you with anything relevant in it's headers.
+ * See HAS_DRAND48_PROTO.
+ */
+/* Rand_seed_t:
+ * This symbol defines the type of the argument of the
+ * random seed function.
+ */
+/* seedDrand01:
+ * This symbol defines the macro to be used in seeding the
+ * random number generator (see Drand01).
+ */
/* RANDBITS:
- * This symbol contains the number of bits of random number the rand()
- * function produces. Usual values are 15, 16, and 31.
+ * This symbol indicates how many bits are produced by the
+ * function used to generate normalized random numbers.
+ * Values include 15, 16, 31, and 48.
*/
-#define RANDBITS $randbits /**/
+#define Drand01() $drand01 /**/
+#define Rand_seed_t $randseedtype /**/
+#define seedDrand01(x) $seedfunc((Rand_seed_t)x) /**/
+#define RANDBITS $randbits /**/
/* SSize_t:
* This symbol holds the type used by functions that return
* This symbol is defined if this system has a stat structure declaring
* st_blksize and st_blocks.
*/
-#$d_statblks USE_STAT_BLOCKS /* backward compatibility */
+#$d_statblks USE_STAT_BLOCKS /**/
/* HAS_STRERROR:
* This symbol, if defined, indicates that the strerror routine is
* available to seekdir files larger than 2 gigabytes.
*/
/* HAS_STAT64:
- * This symbol, if defined, indicates that the fstat64 routine is
+ * This symbol, if defined, indicates that the stat64 routine is
* available to stat files larger than 2 gigabytes.
*/
/* HAS_TELLDIR64:
#$d_tmpfile64 HAS_TMPFILE64 /**/
/* USE_64_BITS:
- * This symbol, if defined, indicates that 64-bit APIs should
- * be used when available. If not defined, the native default APIs
+ * This symbol, if defined, indicates that 64-bit interfaces should
+ * be used when available. If not defined, the native default interfaces
* will be used (be they 32 or 64 bits).
*/
#$use64bits USE_64_BITS /**/
*/
#$useperlio USE_PERLIO /**/
+/* HAS_DRAND48_PROTO:
+ * This symbol, if defined, indicates that the system provides
+ * a prototype for the drand48() function. Otherwise, it is up
+ * to the program to supply one. A good guess is
+ * extern double drand48 _((void));
+ */
+#$d_drand48proto HAS_DRAND48_PROTO /**/
+
/* HAS_GETHOST_PROTOS:
* This symbol, if defined, indicates that <netdb.h> includes
* prototypes for gethostent(), gethostbyname(), and
# include <vm/vm_param.h>
#endif
+#ifndef S_IRWXU
+# ifdef S_IRUSR
+# define S_IRWXU (S_IRUSR|S_IWUSR|S_IWUSR)
+# define S_IRWXG (S_IRGRP|S_IWGRP|S_IWGRP)
+# define S_IRWXO (S_IROTH|S_IWOTH|S_IWOTH)
+# else
+# define S_IRWXU 0700
+# define S_IRWXG 0070
+# define S_IRWXO 0007
+# endif
+#endif
+
MODULE=IPC::SysV PACKAGE=IPC::Msg::stat
PROTOTYPES: ENABLE
--- /dev/null
+$self->{CCFLAGS} = $Config{ccflags} . ' -D_POSIX_SOURCE' ;
# new.) useshrplib="$define" ;;
#esac
-# The EFF_ONLY_OK from <sys/access.h> is dysfunctional for [RWX]_OK
-# as of Digital UNIX 4.0[A-D]?. If and when this gets fixed, adjust
-# this appropriately.
+# The EFF_ONLY_OK from <sys/access.h> is present but dysfunctional for
+# [RWX]_OK as of Digital UNIX 4.0[A-D]?. If and when this gets fixed,
+# please adjust this appropriately. See also pp_sys.c just before the
+# emulate_eaccess().
pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"'
#
# History:
#
+# perl5.005_51:
+#
+# September-1998 Jarkko Hietaniemi <jhi@iki.fi>
+#
+# * Added the -DNO_EFF_ONLY_OK flag ('use filetest;' support).
+#
# perl5.004_57:
#
# 19-Dec-1997 Spider Boardman <spider@Orb.Nashua.NH.US>
#
-# * Newer Digial UNIX compilers enforce signaling for NaN without
+# * Newer Digital UNIX compilers enforce signaling for NaN without
# -ieee. Added -fprm d at the same time since it's friendlier for
# embedding.
#
case "$ccflags" in
*-n32*)
ccflags="$ccflags -DUSE_LONG_LONG"
+ archname64="-n32"
+ d_open64="$undef"
+ # In -n32 mode (ILP32LL64) we use the standard open().
+ # In -64 we will use the open64().
+ cat << 'EOM' >&2
+
+You will see a *** WHOA THERE!!! *** message from Configure for
+d_open64. Keep the recommended value. See hints/irix6_2.sh
+for more information.
+
+EOM
;;
+ *-64*)
+ ;;
esac
- ccflags="$ccflags -DUSE_64_BIT_FILES -DNO_OPEN64"
+ ccflags="$ccflags -DUSE_64_BIT_FILES"
fi
# This is true whether we're on an HPPA machine or cross-compiling
# for one.
pp_cflags='optimize=""'
+
+# The SysV IPC is optional (ftp://ftp.nluug.nl/pub/comp/next/SysVIPC/)
+# Gerben_Wierda@RnA.nl
+if [ -f /usr/local/lib/libIPC.a ]; then
+ libswanted="$libswanted IPC"
+ # As of Sep 1998 d_msg wasn't supported in that library,
+ # only d_sem and d_shm, but Configure should be able to
+ # figure that out. --jhi
+ # Note also the next3 ext/IPC/SysV hints file.
+fi
fi
fi
+# 64-bitness
+# jhi@iki.fi, inspired by Alan Burlison.
+
+if [ "X$use64bits" = "X$define" ]; then
+ uname_r=`uname -r`
+ case "$uname_r" in
+ 1.*|2.[1-5])
+ echo >&4 "Solaris $uname_r does not support 64-bit types."
+ echo >&4 "You should upgrade to at least Solaris 2.6."
+ exit 1
+ ;;
+ esac
+ ccflags="$ccflags `getconf LFS_CFLAGS` -DUSE_LONG_LONG"
+ ldflags="$ldflags `getconf LFS_LDFLAGS`"
+ libswanted="$libswanted `getconf LFS_LIBS`"
+ # When a 64-bit cc becomes available $archname64 may need setting
+ # so that $archname gets it attached.
+fi
+
# This is just a trick to include some useful notes.
cat > /dev/null <<'End_of_Solaris_Notes'
because then IV/UV have been 32 bits, too. Which, in turn means
that even if the system has quads (e.g. long long), IV cannot be a
quad. Introducing a 64-bit IV (because of long long existing)
- would introduce binary incompatibility. Therefore the
- USE_LONG_LONG guard below when probing for quads and the check for
- PTRSIZE further down when defining IV/UV.
+ will introduce binary incompatibility.
Summary: a long long system needs to add -DUSE_LONG_LONG to $ccflags
to get quads -- and if its pointers are still 32 bits, this will break
#endif
/* See above note on LP32 about the PTRSIZE test. --jhi */
-#if defined(HAS_QUAD) && PTRSIZE > 4
+#if defined(HAS_QUAD) && (PTRSIZE > 4 || defined(USE_LONG_LONG))
typedef Quad_t IV;
typedef unsigned Quad_t UV;
# if defined(PERL_QUAD_IS_INT64_T) && defined(INT64_MAX)
# endif
/* Some systems have open64() in libc but use that only
* for true LP64 mode, in mixed mode (ILP32LL64, for example)
- * they use the vanilla open(). --jhi */
-# if defined(HAS_OPEN64) && !defined(NO_OPEN64)
+ * they use the vanilla open(). Such systems should undefine
+ * d_open64 in their hints files. --jhi */
+# if defined(HAS_OPEN64)
# define open open64
# endif
# ifdef HAS_OPENDIR64
(F) An untrapped exception was raised while executing an END subroutine.
The interpreter is immediately exited.
-=item effective %s access is not implemented
+=item entering effective %s failed
-(F) We cannot switch the real and effective uids or gids.
-The C<filetest access> pragma is unavailable in this system.
-
-=item entering effective %s access failed
-
-(F) While under the C<filetest access> pragma, switching the real and
+(F) While under the C<use filetest> pragma, switching the real and
effective uids or gids failed.
=item Error converting file specification %s
that name, not even if you count where you were called from. See
L<perlfunc/last>.
-=item leaving effective %s access failed
+=item leaving effective %s failed
-(F) While under the C<filetest access> pragma, switching the real and
+(F) While under the C<use filetest> pragma, switching the real and
effective uids or gids failed.
=item listen() on closed fd
(F) Your Perl was compiled with B<-D>SETUID_SCRIPTS_ARE_SECURE_NOW, but a
version of the setuid emulator somehow got run anyway.
+=item switching effective %s is not implemented
+
+(F) While under the C<use filetest> pragma, we cannot switch the
+real and effective uids or gids.
+
=item syntax error
(F) Probably means you had a syntax error. Common reasons include:
compatibility by calling rand() but allow the user to override it.
See INSTALL for details. --Andy Dougherty 15 July 1998
*/
-#ifndef my_rand
-# define my_rand rand
-#endif
-#ifndef my_srand
-# define my_srand srand
+/* Now it's after 5.005, and Configure supports drand48() and random(),
+ in addition to rand(). So the overrides should not be needed any more.
+ --Jarkko Hietaniemi 27 September 1998
+ */
+
+#ifndef HAS_DRAND48_PROTO
+extern double drand48 _((void));
#endif
PP(pp_rand)
if (value == 0.0)
value = 1.0;
if (!srand_called) {
- (void)my_srand((unsigned)seed());
+ (void)seedDrand01((Rand_seed_t)seed());
srand_called = TRUE;
}
-#if RANDBITS == 31
- value = my_rand() * value / 2147483648.0;
-#else
-#if RANDBITS == 16
- value = my_rand() * value / 65536.0;
-#else
-#if RANDBITS == 15
- value = my_rand() * value / 32768.0;
-#else
- value = my_rand() * value / (double)(((unsigned long)1) << RANDBITS);
-#endif
-#endif
-#endif
+ value *= Drand01();
XPUSHn(value);
RETURN;
}
anum = seed();
else
anum = POPu;
- (void)my_srand((unsigned)anum);
+ (void)seedDrand01((Rand_seed_t)anum);
srand_called = TRUE;
EXTEND(SP, 1);
RETPUSHYES;
* This is really just a quick hack which grabs various garbage
* values. It really should be a real hash algorithm which
* spreads the effect of every input bit onto every output bit,
- * if someone who knows about such tings would bother to write it.
+ * if someone who knows about such things would bother to write it.
* Might be a good idea to add that function to CORE as well.
- * No numbers below come from careful analysis or anyting here,
+ * No numbers below come from careful analysis or anything here,
* except they are primes and SEED_C1 > 1E6 to get a full-width
* value from (tv_sec * SEED_C1 + tv_usec). The multipliers should
* probably be bigger too.
#endif /* no flock() */
+#ifndef MAXPATHLEN
+# ifdef PATH_MAX
+# define MAXPATHLEN PATH_MAX
+# else
+# define MAXPATHLEN 1024
+# endif
+#endif
+
+#define ZBTLEN 10
+static char zero_but_true[ZBTLEN + 1] = "0 but true";
+
#if defined(I_SYS_ACCESS) && !defined(R_OK)
# include <sys/access.h>
#endif
/* F_OK unused: if stat() cannot find it... */
#if !defined(PERL_EFF_ACCESS_R_OK) && defined(HAS_ACCESS) && defined(EFF_ONLY_OK) && !defined(NO_EFF_ONLY_OK)
-/* Digital UNIX, UnixWare */
+/* Digital UNIX (when the EFF_ONLY_OK gets fixed), UnixWare */
# define PERL_EFF_ACCESS_R_OK(p) (access((p), R_OK | EFF_ONLY_OK))
# define PERL_EFF_ACCESS_W_OK(p) (access((p), W_OK | EFF_ONLY_OK))
# define PERL_EFF_ACCESS_X_OK(p) (access((p), X_OK | EFF_ONLY_OK))
MUTEX_LOCK(&PL_cred_mutex);
#if !defined(HAS_SETREUID) && !defined(HAS_SETRESUID)
- croak("effective uid access is not implemented");
+ croak("switching effective uid is not implemented");
#else
#ifdef HAS_SETREUID
if (setreuid(euid, ruid))
if (setresuid(euid, ruid, (Uid_t)-1))
#endif
#endif
- croak("entering effective uid access failed");
+ croak("entering effective uid failed");
#endif
#if !defined(HAS_SETREGID) && !defined(HAS_SETRESGID)
- croak("effective gid access is not implemented");
+ croak("switching effective gid is not implemented");
#else
#ifdef HAS_SETREGID
if (setregid(egid, rgid))
if (setresgid(egid, rgid, (Gid_t)-1))
#endif
#endif
- croak("entering effective gid access failed");
+ croak("entering effective gid failed");
#endif
res = access(path, mode);
if (setresuid(ruid, euid, (Uid_t)-1))
#endif
#endif
- croak("leaving effective uid access failed");
+ croak("leaving effective uid failed");
#ifdef HAS_SETREGID
if (setregid(rgid, egid))
if (setresgid(rgid, egid, (Gid_t)-1))
#endif
#endif
- croak("leaving effective gid access failed");
+ croak("leaving effective gid failed");
MUTEX_UNLOCK(&PL_cred_mutex);
return res;
#if !defined(PERL_EFF_ACCESS_R_OK)
STATIC int
emulate_eaccess (const char* path, int mode) {
- croak("effective uid access is not implemented");
+ croak("switching effective uid is not implemented");
/*NOTREACHED*/
return -1;
}
#endif
-#ifndef MAXPATHLEN
-# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
-# else
-# define MAXPATHLEN 1024
-# endif
-#endif
-
-#define ZBTLEN 10
-static char zero_but_true[ZBTLEN + 1] = "0 but true";
-
PP(pp_backtick)
{
djSP; dTARGET;