--- /dev/null
+-------------
+Version 5.002
+-------------
+
+Summary of user-visible Configure and build changes since 5.001:
+
+Yet more enhancements and fixes have been made to the Configure and
+build process for perl. Most of these will not be visible to the
+ordinary user--they just make the process more robust and likely to
+work on a wider range of platforms.
+
+This is a brief summary of the most important changes:
+
+ Include 5.000 - 5.001 upgrage notes :-) (see below). You might
+ want to read through them as well as these notes.
+
+ Install documentation for perl modules and pod2* translators. You can
+ now view perl module documentation with either your system's man(1)
+ program or with the supplied perldoc script.
+
+ Support Linux ELF dynamic loading.
+
+ Many hint file updates.
+
+
+-------------
+Version 5.001
+-------------
+
+Summary of user-visible Configure and build changes since 5.000:
+
+A large number of enhancements and fixes have been made to the
+Configure and build process for perl. Most of these will not be
+visible to the ordinary user--they just make the process more robust
+and likely to work on a wider range of platforms.
+
+This is a brief summary of the most important changes.
+
+Configure changes:
+ New and improved Configure command line options. -O now overrides
+ config.sh settings. -D options can now include spaces, if
+ protected in quotes (e.g. -Dcc='gcc -posix'). Type Configure -h
+ for a full listing of options.
+
+ Users can now turn on the defaults for the rest of Configure by
+ typing &-d at any Configure prompt. This is useful if you just
+ want to change one or two answers.
+
+ Support on (non-Sun) SVR4 systems for dynamic loading and shared
+ libperl.so
+
+ Numerous new or updated hints files: PowerUnix, aix 3.x and 4.x,
+ bsd386, convexos, cxux, DEC OSF, Esix, FreeBSD, HP-UX (especially if
+ you're using the bundled compiler), irix 4.x, 5.x, and 6.x, Linux,
+ MPE/IX, NeXT 3.0 and 3.2, Solaris, SVR4, Ultrix (especially 4.3),
+ and Unicos.
+
+ Improved generation of a suitable name for architecture-dependent
+ library files. NOTE: This may differ from the name you had from
+ your 5.000 installation.
+
+ Many many portability enhancements and fixes.
+
+Build process:
+
+ The process for building extensions has been extensively revised. See
+ lib/ExtUtils/MakeMaker.pm for complete documentation. Basically, with
+ just a simple Makefile.PL (such as the one generated by h2xs), you can
+ now build an extension from anywhere on your system, even if you've
+ deleted the perl source.
+
+ Improved build/install documentation in README. A little.
+
+ Improved dynamic loading on HP-UX. Support dynamic loading on SVR4.
+
+ Installperl now gets the version correct :-)
+
+ Installperl now saves the perl *.h files and the libperl.a library
+ in your architecture-dependent library directory so that you can
+ later build extensions without having to re-install the perl
+ source.
+
+ Include x2p/a2p.c generated by byacc from x2p/a2p.y.
+
+ Many many portability fixes.
+
+Upgrade Traps and Pitfalls:
+
+Since a lot has changed in the build process, you are probably best
+off starting with a fresh copy of the perl5.000 sources. In particular,
+your 5.000 config.sh will contain several variables that are no longer
+needed. Further, improvements in the Configure tests may mean that some
+of the answers will be different than they were in 5.000, and which answer
+to keep can be difficult to sort out. Therefore, you are probably
+better off ignoring your old config.sh.
+
+One big change is that architecture-dependent library files may well
+be stored in a different location in 5.001. This is because the default
+name used in the 5.000 release was not sufficiently specific to
+distinguish incompatible architectures. The relevant variable is $archlib
+in config.sh. Before you run ``make install'' you should rename your old
+$archlib. Thus if your $archlib for version 5.000 was
+/usr/local/lib/perl5/foo, and your new value for 5.001 is
+/usr/local/lib/perl5/foo-bar, then you should
+ mv /usr/local/lib/perl5/foo /usr/local/lib/perl5/foo-bar
+before running ``make install''.
+
+Alternatively, you could override Configure's default guess for $archlib
+either by sh Configure -Darchname='foo', or by answering 'foo' when
+prompted by Configure for the architecture name.
+
+The following is the sequence of steps to upgrade to 5.001:
+ cd perl5.000
+ make realclean
+ rm config.sh
+ <apply 5.001 patch>
+ sh Configure
+ make depend
+ make
+ make test
+ <mv old architecture-dependent library to new location, if needed>
+ make install
+
+
+
+
+
+
+
+
+
# $Id: Head.U,v 3.0.1.7 1995/03/21 08:46:15 ram Exp $
#
-# Generated on Mon Apr 17 15:46:57 EDT 1995 [metaconfig 3.0 PL53]
+# Generated on Wed May 31 09:14:05 EDT 1995 [metaconfig 3.0 PL55]
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
: Proper PATH setting
paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
+paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
+paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
d_isascii=''
d_killpg=''
d_link=''
-d_linuxstd=''
d_locconv=''
d_lockf=''
d_lstat=''
sockethdr=''
socketlib=''
d_statblks=''
+d_stdiobase=''
d_stdstdio=''
+stdio_base=''
+stdio_bufsiz=''
+stdio_cnt=''
+stdio_ptr=''
d_index=''
d_strchr=''
d_strcoll=''
mallocsrc=''
malloctype=''
usemymalloc=''
-installmansrc=''
-manext=''
-mansrc=''
-mansrcexp=''
+installman1dir=''
+man1dir=''
+man1direxp=''
+man1ext=''
+installman3dir=''
+man3dir=''
+man3direxp=''
+man3ext=''
huge=''
large=''
medium=''
scriptdirexp=''
selecttype=''
sig_name=''
+d_sitelib=''
+installsitelib=''
+sitelib=''
+sitelibexp=''
sizetype=''
so=''
sharpbang=''
: produce awk script to parse command line options
cat >options.awk <<'EOF'
BEGIN {
- optstr = "dD:eEf:hOrsSU:V"; # getopt-style specification
+ optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
len = length(optstr);
for (i = 1; i <= len; i++) {
silent=''
extractsh=''
override=''
+knowitall=''
rm -f optdef.sh
: option parsing
-r) shift; reuseval=true;;
-s) shift; silent=true;;
-E) shift; alldone=exit;;
+ -K) shift; knowitall=true;;
-O) shift; override=true;;
-S) shift; extractsh=true;;
-D)
esac
shift
;;
- -V) echo "$me generated by metaconfig 3.0 PL53." >&2
+ -V) echo "$me generated by metaconfig 3.0 PL55." >&2
exit 0;;
--) break;;
-*) echo "$me: unknown option $1" >&2; shift; error=true;;
case "$error" in
true)
cat >&2 <<EOM
-Usage: $me [-dehrEOSV] [-f config.sh] [-D symbol] [-D symbol=value]
+Usage: $me [-dehrEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
[-U symbol] [-U symbol=]
-d : use defaults for all answers.
-e : go on without questioning past the production of config.sh.
-D symbol symbol gets the value 'define'
-D symbol=value symbol gets the value 'value'
-E : stop at the end of questions, after having produced config.sh.
+ -K : do not use unless you know what you are doing.
-O : let -D and -U override definitions from loaded configuration file.
-S : perform variable substitutions on all .SH files (can mix with -f)
-U : undefine symbol:
./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
newmyuname="$myuname"
dflt=n
-if test -f ../config.sh; then
- if $contains myuname= ../config.sh >/dev/null 2>&1; then
- eval "`grep myuname= ../config.sh`"
- fi
- if test "X$myuname" = "X$newmyuname"; then
- dflt=y
+case "$knowitall" in
+'')
+ if test -f ../config.sh; then
+ if $contains myuname= ../config.sh >/dev/null 2>&1; then
+ eval "`grep myuname= ../config.sh`"
+ fi
+ if test "X$myuname" = "X$newmyuname"; then
+ dflt=y
+ fi
fi
-fi
+ ;;
+*) dflt=y;;
+esac
: Get old answers from old config file if Configure was run on the
: same system, otherwise use the hints.
hint=default
cd ..
if test -f config.sh; then
- $cat <<EOM
-
-I see a config.sh file. Was it built on THIS system with THIS compiler?
-EOM
- rp="Shall I use config.sh to set the defaults?"
+ echo " "
+ rp="I see a config.sh file. Shall I use it to set the defaults?"
. UU/myread
case "$ans" in
n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
*) echo "You are using GNU cc $gccversion." ;;
esac
else
- echo "I can't compile the test program -- Assuming it isn't GNU cc."
+ echo " "
+ echo "*** WHOA THERE!!! ***" >&4
+ echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
+ case "$knowitall" in
+ '')
+ echo " You'd better start hunting for one and let me know about it." >&4
+ exit 1
+ ;;
+ esac
fi
$rm -f gccvers*
case "$gccversion" in
esac
rmlist="$rmlist pdp11"
+: coherency check
+echo " "
+echo "Checking your choice of C compiler and flags for coherency..." >&4
+set X $cc $optimize $ccflags try.c -o try $ldflags
+shift
+$cat >try.msg <<EOM
+I've tried to compile and run a simple program with:
+
+ $*
+ ./try
+
+and I got the following output:
+
+EOM
+$cat > try.c <<'EOF'
+#include <stdio.h>
+main() { exit(0); }
+EOF
+dflt=y
+if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then
+ if sh -c './try' >>try.msg 2>&1; then
+ dflt=n
+ else
+ echo "The program compiled OK, but exited with status $?." >>try.msg
+ rp="You have a problem. Shall I abort Configure"
+ dflt=y
+ fi
+else
+ echo "I can't compile the test program." >>try.msg
+ rp="You have a BIG problem. Shall I abort Configure"
+ dflt=y
+fi
+case "$dflt" in
+y)
+ $cat try.msg
+ case "$knowitall" in
+ '')
+ echo "(The supplied flags might be incorrect with this C compiler.)"
+ ;;
+ *) dflt=n;;
+ esac
+ echo " "
+ . ./myread
+ case "$ans" in
+ n*|N*) ;;
+ *) echo "Ok. Stopping Configure." >&4
+ exit 1
+ ;;
+ esac
+ ;;
+n) echo "OK, that should do.";;
+esac
+$rm -f try try.* core
+
: Set private lib path
case "$plibpth" in
'') if ./mips; then
set /usr/ccs/lib/libc.$so
$test -r $1 || set /usr/lib/libc.$so
$test -r $1 || set /usr/shlib/libc.$so
- $test -r $1 || set /usr/lib/libc.$so.[0-9]*
+ $test -r $1 || \
+ set `echo blurfl; echo /usr/lib/libc.$so.[0-9]* | \
+ tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
+ h
+ s/[0-9][0-9]*/0000&/g
+ s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
+ G
+ s/\n/ /' | \
+ sort | $sed -e 's/^.* //'`
+ eval set \$$#
$test -r $1 || set /lib/libc.$so
$test -r $1 || set /lib/libsys_s.a
- eval set \$$#
;;
*)
set blurfl
$grep fprintf libc.tmp > libc.ptf
xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
-if com="$sed -n -e 's/__IO//' -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
+xxx='[ADTSIW]'
+if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx //p'";\
eval $xscan;\
$contains '^fprintf$' libc.list >/dev/null 2>&1; then
eval $xrun
eval $xrun
else
nm -p $* 2>/dev/null >libc.tmp
- com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
- eval "<libc.tmp $com >libc.list"
- if $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ $grep fprintf libc.tmp > libc.ptf
+ if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
+ eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
+ then
nm_opt='-p'
- echo "done" >&4
+ eval $xrun
else
echo " "
echo "nm didn't seem to work right. Trying ar instead..." >&4
else
echo "ar didn't seem to work right." >&4
echo "Maybe this is a Cray...trying bld instead..." >&4
- if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
+ if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
+ then
for thisname in $libnames; do
bld t $libnames | \
$sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
else tval=false;
fi;;
*)
- echo "main() { extern int $1$tdc; printf(\"%d\", $1$tc); }" > t.c;
+ echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
then tval=true;
else tval=false;
esac'
: see if gconvert exists
+: On some SVR4 systems, gconvert is present but can not be used
+: because it requires some other unavailable functions.
+: Therefore, do not use the nm extraction, but use a real compile
+: and link test instead.
+xxx_runnm="$runnm"
+runnm=false
set gconvert d_gconvert
eval $inlibc
+runnm="$xxx_runnm"
case "$d_gconvert" in
$define)
$rm -f try.c
: see if dlerror exists
+: On NetBSD and FreeBSD, dlerror might be available, but it is in
+: /usr/lib/crt0.o, not in any of the libraries. Therefore, do not
+: use the nm extraction, but use a real compile and link test instead.
+xxx_runnm="$runnm"
+runnm=false
set dlerror d_dlerror
eval $inlibc
+runnm="$xxx_runnm"
: see if dld is available
set dld.h i_dld
eval $inhdr
: see if dlopen exists
+: On NetBSD and FreeBSD, dlopen is available, but it is in
+: /usr/lib/crt0.o, not in any of the libraries. Therefore, do not
+: use the nm extraction, but use a real compile and link test instead.
+xxx_runnm="$runnm"
+runnm=false
set dlopen d_dlopen
eval $inlibc
+runnm="$xxx_runnm"
: determine which dynamic loading, if any, to compile in
echo " "
'') case "$osname" in
hpux) dflt='+z' ;;
next) dflt='none' ;;
- solaris) dflt='-K pic' ;;
+ solaris|svr4*|esix*) dflt='-Kpic' ;;
sunos) dflt='-pic' ;;
- svr4*|esix*) dflt='-Kpic' ;;
*) dflt='none' ;;
esac ;;
*) dflt='-fpic' ;;
set link d_link
eval $inlibc
-: see if stdio is really std
-echo " "
-xxx=`./findhdr stdio.h`
-if $contains 'char.*_ptr;' "$xxx" >/dev/null 2>&1 ; then
- if $contains '_cnt;' "$xxx" >/dev/null 2>&1 ; then
- echo "Your stdio is pretty std." >&4
- val="$define"
- else
- echo "Your stdio isn't very std." >&4
- val="$undef"
- fi
-else
- echo "Your stdio isn't very std." >&4
- val="$undef"
-fi
-set d_stdstdio
-eval $setvar
-
-: see if stdio is like that in linux
-case "$d_stdstdio" in
-"$undef")
- echo " "
- xxx=`./findhdr stdio.h`
- $cppstdin $cppflags $cppminus < "$xxx" > stdio.E
- if $contains 'char.*_IO_read_base' stdio.E >/dev/null 2>&1 && \
- $contains '_IO_read_ptr' stdio.E >/dev/null 2>&1 && \
- $contains '_IO_read_end' stdio.E >/dev/null 2>&1 ; then
- echo "Your stdio looks like linux." >&4
- val="$define"
- else
- echo "You don't have linux stdio, either." >&4
- val="$undef"
- fi
- $rm -f stdio.E
- ;;
-*) val="$undef" ;;
-esac
-
-set d_linuxstd
-eval $setvar
-
: see if localeconv exists
set localeconv d_locconv
eval $inlibc
set d_shm
eval $setvar
+: determine whether the user wants to include a site-specific library
+: in addition to privlib.
+$cat <<EOM
+
+Some sites may wish to specify a local directory for $package
+to search by default in addition to $privlib.
+If you don't want to use such an additional directory, answer 'none'.
+
+EOM
+dflt=none
+fn=d~+n
+rp='Local directory for additional library files?'
+. ./getfile
+if $test "X$sitelibexp" != "X$ansexp"; then
+ installsitelib=''
+fi
+sitelib="$ans"
+sitelibexp="$ansexp"
+if $afs; then
+ $cat <<EOM
+
+Since you are running AFS, I need to distinguish the directory in which
+private files reside from the directory in which they are installed (and from
+which they are presumably copied to the former directory by occult means).
+
+EOM
+ case "$installsitelib" in
+ '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installsitelib";;
+ esac
+ fn=de~
+ rp='Where will additional local files be installed?'
+ . ./getfile
+ installsitelib="$ans"
+else
+ installsitelib="$sitelibexp"
+fi
+
+case "$sitelibexp" in
+''|' ') d_sitelib=undef ;;
+*) d_sitelib=define ;;
+esac
+
socketlib=''
sockethdr=''
: see whether socket exists
set d_statblks
eval $setvar
+: see if _ptr and _cnt from stdio act std
+echo " "
+if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+ echo "(Looks like you have stdio.h from Linux.)"
+ case "$stdio_ptr" in
+ '') stdio_ptr='((fp)->_IO_read_ptr)';;
+ esac
+ case "$stdio_cnt" in
+ '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)';;
+ esac
+ case "$stdio_base" in
+ '') stdio_base='((fp)->_IO_read_base)';;
+ esac
+ case "$stdio_bufsiz" in
+ '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base))';;
+ esac
+else
+ case "$stdio_ptr" in
+ '') stdio_ptr='((fp)->_ptr)';;
+ esac
+ case "$stdio_cnt" in
+ '') stdio_cnt='((fp)->_cnt)';;
+ esac
+ case "$stdio_base" in
+ '') stdio_base='((fp)->_base)';;
+ esac
+ case "$stdio_bufsiz" in
+ '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
+ esac
+fi
+: test whether _ptr and _cnt really work
+echo "Checking how std your stdio is..." >&4
+$cat >try.c <<EOP
+#include <stdio.h>
+#define FILE_ptr(fp) $stdio_ptr
+#define FILE_cnt(fp) $stdio_cnt
+main() {
+ FILE *fp = fopen("try.c", "r");
+ char c = getc(fp);
+ if (
+ 18 <= FILE_cnt(fp) &&
+ strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
+ )
+ exit(0);
+ exit(1);
+}
+EOP
+val="$undef"
+if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then
+ if ./try; then
+ echo "Your stdio acts pretty std."
+ val="$define"
+ else
+ echo "Your stdio isn't very std."
+ fi
+else
+ echo "Your stdio doesn't appear very std."
+fi
+$rm -f try.c try
+set d_stdstdio
+eval $setvar
+
+: see if _base is also standard
+val="$undef"
+case "$d_stdstdio" in
+$define)
+ $cat >try.c <<EOP
+#include <stdio.h>
+#define FILE_base(fp) $stdio_base
+#define FILE_bufsiz(fp) $stdio_bufsiz
+main() {
+ FILE *fp = fopen("try.c", "r");
+ char c = getc(fp);
+ if (
+ 19 <= FILE_bufsiz(fp) &&
+ strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
+ )
+ exit(0);
+ exit(1);
+}
+EOP
+ if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
+ if ./try; then
+ echo "Even its _base field acts std."
+ val="$define"
+ else
+ echo "But its _base field isn't std."
+ fi
+ else
+ echo "However, it seems to be lacking the _base field."
+ fi
+ $rm -f try.c try
+ ;;
+esac
+set d_stdiobase
+eval $setvar
+
: see if strcoll exists
set strcoll d_strcoll
eval $inlibc
case "$i_db" in
define)
: Check the return type needed for hash
+ echo " "
echo "Checking return type needed for hash for Berkeley DB ..." >&4
$cat >try.c <<'EOCP'
#include <sys/types.h>
#include <db.h>
-u_int32_t
-hash_cb (ptr, size)
-const void * ptr ;
-size_t size ;
+u_int32_t hash_cb (ptr, size)
+void *ptr;
+size_t size;
{
}
-HASHINFO info ;
+HASHINFO info;
main()
{
- info.hash = hash_cb ;
+ info.hash = hash_cb;
}
EOCP
if $cc $ccflags -c try.c >try.out 2>&1 ; then
case "$i_db" in
define)
: Check the return type needed for prefix
+ echo " "
echo "Checking return type needed for prefix for Berkeley DB ..." >&4
cat >try.c <<'EOCP'
#include <sys/types.h>
#include <db.h>
-size_t
-prefix_cb (key1, key2)
-const DBT * key1 ;
-const DBT * key2 ;
+size_t prefix_cb (key1, key2)
+DBT *key1;
+DBT *key2;
{
}
-BTREEINFO info ;
+BTREEINFO info;
main()
{
- info.prefix = prefix_cb ;
+ info.prefix = prefix_cb;
}
EOCP
if $cc $ccflags -c try.c >try.out 2>&1 ; then
lseektype="$ans"
: determine where manual pages go
-set mansrc mansrc none
+set man1dir man1dir none
eval $prefixit
$cat <<EOM
case "$nroff" in
nroff)
echo "However, you don't have nroff, so they're probably useless to you."
- case "$mansrc" in
- '') mansrc="none";;
+ case "$man1dir" in
+ '') man1dir="none";;
esac;;
esac
echo "If you don't want the manual sources installed, answer 'none'."
-case "$mansrc" in
+case "$man1dir" in
'')
lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
lookpath="$lookpath $prefixexp/man/l_man/man1"
lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
lookpath="$lookpath /usr/man/man.L"
- mansrc=`./loc . $prefixexp/man/man1 $lookpath`
- if $test -d "$mansrc"; then
- dflt="$mansrc"
+ man1dir=`./loc . $prefixexp/man/man1 $lookpath`
+ if $test -d "$man1dir"; then
+ dflt="$man1dir"
else
dflt="$sysman"
fi
eval $prefixup
;;
' ') dflt=none;;
-*) dflt="$mansrc"
+*) dflt="$man1dir"
;;
esac
echo " "
fn=dn~
-rp='Where do the manual pages (source) go?'
+rp="Where do the main $spackage manual pages (source) go?"
. ./getfile
-if test "X$mansrcexp" != "X$ansexp"; then
- installmansrc=''
+if test "X$man1direxp" != "X$ansexp"; then
+ installman1dir=''
fi
-mansrc="$ans"
-mansrcexp="$ansexp"
-case "$mansrc" in
-'') mansrc=' '
- installmansrc='';;
+man1dir="$ans"
+man1direxp="$ansexp"
+case "$man1dir" in
+'') man1dir=' '
+ installman1dir='';;
esac
if $afs; then
$cat <<EOM
which they are presumably copied to the former directory by occult means).
EOM
- case "$installmansrc" in
- '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installmansrc";;
+ case "$installman1dir" in
+ '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installman1dir";;
esac
fn=de~
rp='Where will man pages be installed?'
. ./getfile
- installmansrc="$ans"
+ installman1dir="$ans"
else
- installmansrc="$mansrcexp"
+ installman1dir="$man1direxp"
fi
-case "$mansrc" in
-' ') manext='0';;
-*l) manext=l;;
-*n) manext=n;;
-*o) manext=l;;
-*p) manext=n;;
-*C) manext=C;;
-*L) manext=L;;
-*L1) manext=L1;;
-*) manext=1;;
+case "$man1dir" in
+' ') man1ext='0';;
+*l) man1ext=l;;
+*n) man1ext=n;;
+*o) man1ext=l;;
+*p) man1ext=n;;
+*C) man1ext=C;;
+*L) man1ext=L;;
+*L1) man1ext=L1;;
+*) man1ext=1;;
+esac
+
+: determine where library module manual pages go
+set man3dir man3dir none
+eval $prefixit
+$cat <<EOM
+
+$spackage has manual pages for many of the library modules.
+EOM
+
+case "$nroff" in
+nroff)
+ $cat <<'EOM'
+However, you don't have nroff, so they're probably useless to you.
+You can use the supplied perldoc script instead.
+EOM
+ case "$man3dir" in
+ '') man3dir="none";;
+ esac;;
+esac
+
+case "$d_flexfnam" in
+undef)
+ $cat <<'EOM'
+However, your system can't handle the long file names like File::Basename.3.
+You can use the supplied perldoc script instead.
+EOM
+ case "$man3dir" in
+ '') man3dir="none";;
+ esac;;
+esac
+
+echo "If you don't want the manual sources installed, answer 'none'."
+case "$man3dir" in
+'') dflt="$privlib/man/man3" ;;
+' ') dflt=none;;
+*) dflt="$man3dir" ;;
+esac
+echo " "
+
+fn=dn~
+rp="Where do the $spackage library man pages (source) go?"
+. ./getfile
+if test "X$man3direxp" != "X$ansexp"; then
+ installman3dir=''
+fi
+
+man3dir="$ans"
+man3direxp="$ansexp"
+case "$man3dir" in
+'') man3dir=' '
+ installman3dir='';;
+esac
+if $afs; then
+ $cat <<EOM
+
+Since you are running AFS, I need to distinguish the directory in which
+manual pages reside from the directory in which they are installed (and from
+which they are presumably copied to the former directory by occult means).
+
+EOM
+ case "$installman3dir" in
+ '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installman3dir";;
+ esac
+ fn=de~
+ rp='Where will man pages be installed?'
+ . ./getfile
+ installman3dir="$ans"
+else
+ installman3dir="$man3direxp"
+fi
+
+case "$man3dir" in
+' ') man3ext='0';;
+*l) man3ext=l;;
+*n) man3ext=n;;
+*o) man3ext=l;;
+*p) man3ext=n;;
+*C) man3ext=C;;
+*L) man3ext=L;;
+*L3) man3ext=L3;;
+*) man3ext=3;;
esac
: see what type is used for mode_t
case "$sig_name" in
'')
echo "Generating a list of signal names..." >&4
- xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`" "`./findhdr linux/signal.h`
+ xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`
+ xxx="$xxx "`./findhdr linux/signal.h`
set X `cat $xxx 2>&1 | $awk '
$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
sig[$3] = substr($2,4,20)
;;
esac
+: Remove build directory name from cppstdin so it can be used from
+: either the present location or the final installed location.
+echo " "
+: Get out of the UU directory to get correct path name.
+cd ..
+case "$cppstdin" in
+`pwd`/cppstdin)
+ echo "Stripping down cppstdin path name"
+ cppstdin=cppstdin
+ ;;
+esac
+cd UU
+
: end of configuration questions
echo " "
echo "End of configuration questions."
d_isascii='$d_isascii'
d_killpg='$d_killpg'
d_link='$d_link'
-d_linuxstd='$d_linuxstd'
d_locconv='$d_locconv'
d_lockf='$d_lockf'
d_lstat='$d_lstat'
d_shmdt='$d_shmdt'
d_shmget='$d_shmget'
d_shrplib='$d_shrplib'
+d_sitelib='$d_sitelib'
d_socket='$d_socket'
d_sockpair='$d_sockpair'
d_statblks='$d_statblks'
+d_stdiobase='$d_stdiobase'
d_stdstdio='$d_stdstdio'
d_strchr='$d_strchr'
d_strcoll='$d_strcoll'
inews='$inews'
installarchlib='$installarchlib'
installbin='$installbin'
-installmansrc='$installmansrc'
+installman1dir='$installman1dir'
+installman3dir='$installman3dir'
installprivlib='$installprivlib'
installscript='$installscript'
+installsitelib='$installsitelib'
intsize='$intsize'
known_extensions='$known_extensions'
ksh='$ksh'
mallocobj='$mallocobj'
mallocsrc='$mallocsrc'
malloctype='$malloctype'
-manext='$manext'
-mansrc='$mansrc'
-mansrcexp='$mansrcexp'
+man1dir='$man1dir'
+man1direxp='$man1direxp'
+man1ext='$man1ext'
+man3dir='$man3dir'
+man3direxp='$man3direxp'
+man3ext='$man3ext'
medium='$medium'
mips='$mips'
mips_type='$mips_type'
shsharp='$shsharp'
sig_name='$sig_name'
signal_t='$signal_t'
+sitelib='$sitelib'
+sitelibexp='$sitelibexp'
sizetype='$sizetype'
sleep='$sleep'
smail='$smail'
startsh='$startsh'
static_ext='$static_ext'
stdchar='$stdchar'
+stdio_base='$stdio_base'
+stdio_bufsiz='$stdio_bufsiz'
+stdio_cnt='$stdio_cnt'
+stdio_ptr='$stdio_ptr'
strings='$strings'
submit='$submit'
sysman='$sysman'
Artistic The "Artistic License"
-Changes Differences between Perl 4 and Perl 5
+Changes Differences from previous versions.
+Changes.Conf Recent changes in the Configure & build process
Configure Portability tool
Copying The GNU General Public License
Doc/perl5-notes Samples of new functionality
README.vms Notes about VMS
Todo The Wishlist
XSUB.h Include file for extension subroutines
-autosplit Splits up autoloader functions
av.c Array value code
av.h Array value header
c2ph.SH program to translate dbx stabs to perl
c2ph.doc documentation for c2ph
cflags.SH A script that emits C compilation flags per file
-config.H Sample config.h
+config_H Sample config.h
config_h.SH Produces config.h
configpm Produces lib/Config.pm
+configure Crude emulation of GNU configure
cop.h Control operator header
cv.h Code value header
deb.c Debugging routines
-doSH Script to run all the *.SH files
doio.c I/O operations
doop.c Support code for various operations
dosish.h Some defines for MS/DOSish machines
ext/DB_File/DB_File_BS Berkeley DB extension mkbootstrap fodder
ext/DB_File/Makefile.PL Berkeley DB extension makefile writer
ext/DB_File/typemap Berkeley DB extension interface types
-ext/DynaLoader/DynaLoader.doc Dynamic Loader specification
ext/DynaLoader/DynaLoader.pm Dynamic Loader perl module
ext/DynaLoader/Makefile.PL Dynamic Loader makefile writer
ext/DynaLoader/README Dynamic Loader notes and intro
hints/dgux.sh Hints for named architecture
hints/dnix.sh Hints for named architecture
hints/dynix.sh Hints for named architecture
+hints/epix.sh Hints for named architecture
hints/esix4.sh Hints for named architecture
hints/fps.sh Hints for named architecture
hints/freebsd.sh Hints for named architecture
hints/uts.sh Hints for named architecture
hv.c Hash value code
hv.h Hash value header
+installman Perl script to install man pages for pods.
installperl Perl script to do "make install" dirty work
interp.sym Interpreter specific symbols to hide in a struct
ioctl.pl Sample ioctl.pl
lib/Net/Ping.pm Ping methods
lib/Search/Dict.pm A module to do binary search on dictionaries
lib/Shell.pm A module to make AUTOLOADEed system() calls
+lib/SubstrHash.pm Compact hash for known key, value and table size
lib/Sys/Hostname.pm Hostname methods
lib/Sys/Syslog.pm Perl module supporting syslogging
lib/Term/Cap.pm Perl module supporting termcap usage
lib/Text/Soundex.pm Perl module to implement Soundex
lib/Text/Tabs.pm Do expand and unexpand
lib/TieHash.pm Base class for tied hashes
-lib/SubstrHash.pm Compact hash for known key, value and table size
lib/Time/Local.pm Reverse translation of localtime, gmtime
lib/abbrev.pl An abbreviation table builder
lib/assert.pl assertion and panic with stack trace
perl.c main()
perl.h Global declarations
perl_exp.SH Creates list of exported symbols for AIX.
+perldoc.SH A simple tool to find & display perl's documentation
perlsh A poor man's perl shell
perly.c A byacc'ed perly.y
perly.c.diff Fixup perly.c to allow recursion
perly.y Yacc grammar for perl
pl2pm A pl to pm translator
pod/Makefile Make pods into something else
-pod/modpods/Abbrev.pod Doc for Abbrev.pm
-pod/modpods/AnyDBMFile.pod Doc for AnyDBMFile.pm
-pod/modpods/AutoLoader.pod Doc for AutoLoader.pm
-pod/modpods/AutoSplit.pod Doc for AutoSplit.pm
-pod/modpods/Basename.pod Doc for Basename.pm
-pod/modpods/Benchmark.pod Doc for Benchmark.pm
-pod/modpods/Carp.pod Doc for Carp.pm
-pod/modpods/CheckTree.pod Doc for CheckTree.pm
-pod/modpods/Collate.pod Doc for Collate.pm
-pod/modpods/Config.pod Doc for Config.pm
-pod/modpods/Cwd.pod Doc for Cwd.pm
-pod/modpods/DB_File.pod Doc for File.pm
-pod/modpods/Dynaloader.pod Doc for Dynaloader.pm
-pod/modpods/English.pod Doc for English.pm
-pod/modpods/Env.pod Doc for Env.pm
-pod/modpods/Exporter.pod Doc for Exporter.pm
-pod/modpods/Fcntl.pod Doc for Fcntl.pm
-pod/modpods/FileHandle.pod Doc for FileHandle.pm
-pod/modpods/Find.pod Doc for Find.pm
-pod/modpods/Finddepth.pod Doc for Finddepth.pm
-pod/modpods/GetOptions.pod Doc for GetOptions.pm
-pod/modpods/Getopt.pod Doc for Getopt.pm
-pod/modpods/MakeMaker.pod Doc for MakeMaker.pm
-pod/modpods/Open2.pod Doc for Open2.pm
-pod/modpods/Open3.pod Doc for Open3.pm
-pod/modpods/POSIX.pod Doc for POSIX.pm
-pod/modpods/Ping.pod Doc for Ping.pm
-pod/modpods/Socket.pod Doc for Socket.pm
-pod/modpods/integer.pod Doc for integer.pm
-pod/modpods/less.pod Doc for less.pm
-pod/modpods/sigtrap.pod Doc for sigtrap.pm
-pod/modpods/strict.pod Doc for strict.pm
-pod/modpods/subs.pod Doc for subs.pm
pod/perl.pod Top level perl man page
pod/perlapi.pod XS api info
pod/perlbook.pod Book info
t/cmd/switch.t See if switch optimizations work
t/cmd/while.t See if while loops work
t/comp/cmdopt.t See if command optimization works
+t/comp/cpp.aux main file for cpp.t
t/comp/cpp.t See if C preprocessor works
t/comp/decl.t See if declarations work
t/comp/multiline.t See if multiline strings work
x2p/util.c Utility routines
x2p/util.h Public declarations for the above
x2p/walk.c Parse tree walker
-xf A script to translate Perl 4 symbols to Perl 5
BYACC = $byacc
CC = $cc
LD = $ld
-bin = $installbin
-scriptdir = $scriptdir
-privlib = $installprivlib
-mansrc = $mansrc
-manext = $manext
+
LDFLAGS = $ldflags
CLDFLAGS = $ldflags
RMS = rm -f
ranlib = $ranlib
+# The following are mentioned only to make metaconfig include the
+# appropriate questions in Configure. If you want to change these,
+# edit config.sh instead, or specify --man1dir=/wherever on
+# installman commandline.
+bin = $installbin
+scriptdir = $scriptdir
+privlib = $installprivlib
+man1dir = $man1dir
+man1ext = $man1ext
+man3dir = $man3dir
+man3ext = $man3ext
+
# The following are used to build and install shared libraries for
# dynamic loading.
LDDLFLAGS = $lddlflags
private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
-scripts =
-
-manpages = perl.man
-
-util =
+sh = Makefile.SH c2ph.SH cflags.SH config_h.SH h2ph.SH h2xs.SH makeaperl.SH \
+ makedepend.SH makedir.SH perl_exp.SH perldoc.SH writemain.SH
-sh = Makefile.SH cflags.SH makedepend.SH makedir.SH writemain.SH
+addedbyconf = UU Makefile c2ph cflags config.h h2ph h2xs makeaperl \
+ makedepend makedir perl_exp perldoc writemain
h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
lintflags = -hbvxac
-addedbyconf = UU
-
# grrr
SHELL = /bin/sh
all: makefile miniperl $(private) $(public) $(dynamic_ext)
@echo " "; echo " Making x2p stuff"; cd x2p; $(MAKE) all
- @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
+
+# This is now done by installman only if you actually want the man pages.
+# @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
# Phony target to force checking subdirectories.
FORCE:
-!NO!SUBS!
-
-: Now on to the rest of the Makefile.
-$spitshell >>Makefile <<'!NO!SUBS!'
# The $& notation tells Sequent machines that it can do a parallel make,
# and is harmless otherwise.
$(CCCMD) -DIAMSUID sperl.c
$(RMS) sperl.c
+# The following three header files are generated automatically
+# The correct versions should be already supplied with the perl kit,
+# in case you don't have perl or 'sh' available.
+# The - is to ignore error return codes in case you have the source
+# installed read-only or you don't have perl yet.
+keywords.h: keywords.pl
+ @echo "Don't worry if this fails."
+ - perl keywords.pl
+
opcode.h: opcode.pl
+ @echo "Don't worry if this fails."
- perl opcode.pl
embed.h: embed_h.sh global.sym interp.sym
- sh embed_h.sh
+ @echo "Don't worry if this fails."
+ - sh embed_h.sh
# We have to call our ./makedir because Ultrix 4.3 make can't handle the line
# test -d lib/auto || mkdir lib/auto
lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.PL lib/Config.pm
./miniperl minimod.PL > tmp && mv tmp $@
-install: all
+install: all install.perl install.man
+
+install.perl: all
./perl installperl
+install.man: all
+ ./perl installman
+
+# Not implemented yet.
+#install.html: all
+# ./perl installhtml
+
# I now supply perly.c with the kits, so the following section is
# used only if you force byacc to run by saying
# make run_byacc
done
rm -f *.orig */*.orig *~ */*~ core t/core t/c t/perl
rm -rf $(addedbyconf)
- rm -f Makefile cflags makedepend makedir writemain
- rm -f config.h makefile makefile.old
+ rm -f makefile makefile.old
rm -f $(private)
rm -rf lib/auto
rm -f lib/.exists
- rm -f h2ph h2ph.man c2ph pstruct h2xs makeaperl
+ rm -f h2ph.man pstruct
rm -rf .config
@echo "Note that make realclean does not delete config.sh"
- cd t && chmod +x TEST */*.t
- cd t && (rm -f perl; $(LNS) ../perl perl) && ./perl TEST </dev/tty
+minitest: miniperl
+ - cd t && chmod +x TEST */*.t
+ - cd t && (rm -f perl; $(LNS) ../miniperl perl) \
+ && ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t </dev/tty
+
clist: $(c)
echo $(c) | tr ' ' '\012' >.clist
run ok, the defaults will usually be right. It will then proceed to
make config.h, config.sh, and Makefile. You may have to explicitly
say sh Configure to ensure that Configure is run under sh.
- If you're a hotshot, run Configure -d to take all the defaults and
- then edit config.sh to patch up any flaws and run Configure -S.
+ If you're a hotshot, run Configure -d to take all the defaults,
+ edit config.sh to patch up any flaws, and then run Configure -S.
Configure supports a number of useful options. Run Configure -h
to get a listing. To compile with gcc, for example, you can run
- Configure -Dcc=gcc, or answer 'gcc' at the cc prompt. This is the
- preferred way to invoke an alternate compiler, since the hints
- files can then set appropriate defaults.
+ Configure -Dcc=gcc, or answer 'gcc' at the cc prompt.
+
+ If you wish to use gcc (or another alternative compiler))
+ you should use Configure -Dcc=gcc. That way, the the hints
+ files can set appropriate defaults.
If you change compilers or make other significant changes, you should
probably _not_ re-use your old config.sh. Simply remove it or
if your sh doesn't handle them, but all other # comments will be taken
care of.
- (If you don't have sh, you'll have to copy the sample file config.H to
+ (If you don't have sh, you'll have to copy the sample file config_H to
config.h and edit the config.h to reflect your system's peculiarities.)
2) Glance through config.h to make sure system dependencies are correct.
Makefile.SH, since a default rule only takes effect in the
absence of a specific rule.
- Many of the following hints are now done automatically by Configure.
- Some of the hints here were for Perl 4, and are probably obsolete.
- They're left here for the moment just to give you some ideas for
- what to try if you're having trouble.
+ If you used a hint file, try reading the comments in the hint file
+ for further tips and information.
+
+ If you can successfully build miniperl, but the process crashes
+ during the building of extensions, you should run
+ make minitest
+ to test your version of miniperl.
+
+ Some additional things that have been reported for either perl4 or
+ perl5:
- AIX/RT may need a -a switch and -DCRIPPLED_CC.
- Ultrix 3.[01] on MIPS needs to undefine WAITPID--the system call is busted.
- MIPS machines may need to undef d_volatile.
- MIPS machines may need to turn off -O on some files.
- Some MIPS machines may need to undefine CASTNEGFLOAT.
Genix may need to use libc rather than libc_s, or #undef VARARGS.
+
NCR Tower 32 (OS 2.01.01) may need -W2,-Sl,2000 and #undef MKDIR.
- A/UX may appear to work with -O -B/usr/lib/big/ optimizer flags.
- A/UX may need -lposix to find rewinddir.
- A/UX may need -ZP -DPOSIX, and -g if big cc is used.
+
UTS may need one or more of -DCRIPPLED_CC, -K or -g, and undef LSTAT.
+
If you get syntax errors on '(', try -DCRIPPLED_CC.
+
Machines with half-implemented dbm routines will need to #undef I_ODBM
+
SCO prior to 3.2.4 may be missing dbmclose(). An upgrade to 3.2.4
that includes libdbm.nfs (which includes dbmclose()) may be available.
+
If you get duplicates upon linking for malloc et al, say -DHIDEMYMALLOC.
+
If you get duplicate function definitions (a perl function has the
same name as another function on your system) try -DEMBED.
+
If you get varags problems with gcc, be sure that gcc is installed
correctly. When using gcc, you should probably have i_stdarg='define'
- and i_varags='undef' in config.sh.
+ and i_varags='undef' in config.sh. The problem is usually solved
+ by running fixincludes correctly.
+
If you wish to use dynamic loading on SunOS or Solaris, and you
have GNU as and GNU ld installed, you may need to add -B/bin/ to
your $ccflags and $ldflags so that the system's versions of as
and ld are used.
+ If you run into dynamic loading problems, check your setting of
+ the LD_LIBRARY_PATH environment variable. Perl should build
+ fine with LD_LIBRARY_PATH unset, though that may depend on details
+ of your local set-up.
+
5) make test
This will run the regression tests on the perl you just made.
6) make install
- This will put perl into a public directory (such as /usr/local/bin).
- It will also try to put the man pages in a reasonable place. It will not
- nroff the man page, however. You may need to be root to do this. If
- you are not root, you must own the directories in question and you should
- ignore any messages about chown not working.
+ This will put perl into a public directory (such as
+ /usr/local/bin). It will also try to put the man pages in a
+ reasonable place. It will not nroff the man page, however. You
+ may need to be root to run make install. If you are not root, you
+ must own the directories in question and you should ignore any
+ messages about chown not working.
- make install will also install the following:
+ make install will install the following:
perl,
perl5.nnn where nnn is the current release number. This
will be a link to perl.
s2p sed-to-perl translator
find2perl find-to-perl translator
h2xs Converts C .h header files to Perl extensions.
+ perldoc Tool to read perl's pod documentation.
pod2html, Converters from perl's pod documentation format
pod2latex, and to other useful formats.
pod2man
Configure, usually under /usr/local/lib/perl5/.
man pages in the location specified to Configure, usually
something like /usr/local/man/man1.
+ module in the location specified to Configure, usually
+ man pages under /usr/local/lib/perl5/man/man3.
+ pod/*.pod in $privlib/pod/.
Perl's *.h header files and the libperl.a library are also
installed under $archlib so that you may later build new
make install may also offer to install perl in a "standard" location.
Most of the documentation in the pod/ directory is also available
- in HTML format. Type
+ in HTML and LaTeX format. Type
cd pod; make html; cd ..
- to generate the html versions.
+ to generate the html versions, and
+ cd pod; make tex; cd ..
+ to generate the LaTeX versions.
7) Read the manual entries before running perl.
internals, you might want to subscribe to the perl5-porters mailing list. You
can do this by sending a message to perl5-porters-request@nicoh.com, containing
the single line
-subscribe perl5-porters Your Name Here
+subscribe perl5-porters
This is a moderately high-volume list at the moment (25-50 messages/day).
Finally, if you're interested in ongoing information about the VMS port, you
+++ /dev/null
-#!./miniperl
-BEGIN { unshift @INC, "lib" }
-use AutoSplit;
-autosplit_lib_modules(@ARGV);
-/* This file (config.H) is a sample config.h file. If you are unable
+/* This file (config_H) is a sample config.h file. If you are unable
to successfully run Configure, copy this file to config.h and
edit it to suit your system.
*/
* $Id: Config_h.U,v 3.0.1.3 1995/01/30 14:25:39 ram Exp $
*/
-/* Configuration time: Wed Apr 5 14:50:33 EDT 1995
+/* Configuration time: Tue May 30 13:05:37 EDT 1995
* Configured by: andy
* Target system: crystal crystal 3.2 2 i386
*/
* This symbol, if defined, indicates that the chsize routine is available
* to truncate files. You might need a -lx to get this routine.
*/
-#define HAS_CHSIZE /**/
+/*#define HAS_CHSIZE /**/
/* VOID_CLOSEDIR:
* This symbol, if defined, indicates that the closedir() routine
* a macro using sprintf("%g") is used. Arguments for the Gconvert
* macro are: value, number of digits, whether trailing zeros should
* be retained, and the output buffer.
+ * Possible values are:
+ * d_Gconvert='gconvert((x),(n),(t),(b))'
+ * d_Gconvert='gcvt((x),(n),(b))'
+ * d_Gconvert='sprintf((b),"%.*g",(n),(x))'
+ * The last two assume trailing zeros should not be kept.
*/
#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
*/
#define HAS_LINK /**/
-/* USE_LINUX_STDIO:
- * This symbol is defined if this system has a FILE structure declaring
- * _IO_read_base, _IO_read_ptr, and _IO_read_end in stdio.h.
- */
-/*#define USE_LINUX_STDIO /**/
-
/* HAS_LOCALECONV:
* This symbol, if defined, indicates that the localeconv routine is
* available for numeric and monetary formatting conventions.
*/
/*#define USE_STAT_BLOCKS /**/
-/* USE_STD_STDIO:
- * This symbol is defined if this system has a FILE structure declaring
- * _ptr and _cnt in stdio.h.
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
+ */
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
+ */
+#define USE_STDIO_PTR /**/
+#define USE_STDIO_BASE /**/
+
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) ((fp)->_ptr)
+#define FILE_cnt(fp) ((fp)->_cnt)
+#endif
+
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
+ */
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
*/
-#define USE_STD_STDIO /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) ((fp)->_base)
+#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
+#endif
/* HAS_STRCHR:
* This symbol is defined to indicate that the strchr()/strrchr()
/*#define I_MEMORY /**/
/* I_NDBM:
- * This symbol, if defined, indicates that ndbm.h exists and should
+ * This symbol, if defined, indicates that <ndbm.h> exists and should
* be included.
*/
#define I_NDBM /**/
#define M_VOID /* Xenix strikes again */
#endif
-/* EUNICE:
- * This symbol, if defined, indicates that the program is being compiled
- * under the EUNICE package under VMS. The program will need to handle
- * things like files that don't go away the first time you unlink them,
- * due to version numbering. It will also need to compensate for lack
- * of a respectable link() command.
- */
/* VMS:
* This symbol, if defined, indicates that the program is running under
* VMS. It is currently only set in conjunction with the EUNICE symbol.
*/
-/*#define EUNICE /**/
/*#define VMS /**/
/* LOC_SED:
*/
#define MYMALLOC /**/
+/* SITELIB_EXP:
+ * This symbol contains the ~name expanded version of SITELIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+/*#define SITELIB_EXP "" /**/
+
#endif
* a macro using sprintf("%g") is used. Arguments for the Gconvert
* macro are: value, number of digits, whether trailing zeros should
* be retained, and the output buffer.
+ * Possible values are:
+ * d_Gconvert='gconvert((x),(n),(t),(b))'
+ * d_Gconvert='gcvt((x),(n),(b))'
+ * d_Gconvert='sprintf((b),"%.*g",(n),(x))'
+ * The last two assume trailing zeros should not be kept.
*/
#define Gconvert(x,n,t,b) $d_Gconvert
*/
#$d_link HAS_LINK /**/
-/* USE_LINUX_STDIO:
- * This symbol is defined if this system has a FILE structure declaring
- * _IO_read_base, _IO_read_ptr, and _IO_read_end in stdio.h.
- */
-#$d_linuxstd USE_LINUX_STDIO /**/
-
/* HAS_LOCALECONV:
* This symbol, if defined, indicates that the localeconv routine is
* available for numeric and monetary formatting conventions.
*/
#$d_statblks USE_STAT_BLOCKS /**/
-/* USE_STD_STDIO:
- * This symbol is defined if this system has a FILE structure declaring
- * _ptr and _cnt in stdio.h.
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
+ */
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
+ */
+#$d_stdstdio USE_STDIO_PTR /**/
+#$d_stdiobase USE_STDIO_BASE /**/
+
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) $stdio_ptr
+#define FILE_cnt(fp) $stdio_cnt
+#endif
+
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
+ */
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
*/
-#$d_stdstdio USE_STD_STDIO /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) $stdio_base
+#define FILE_bufsiz(fp) $stdio_bufsiz
+#endif
/* HAS_STRCHR:
* This symbol is defined to indicate that the strchr()/strrchr()
#$i_memory I_MEMORY /**/
/* I_NDBM:
- * This symbol, if defined, indicates that ndbm.h exists and should
+ * This symbol, if defined, indicates that <ndbm.h> exists and should
* be included.
*/
#$i_ndbm I_NDBM /**/
#define M_VOID /* Xenix strikes again */
#endif
-/* EUNICE:
- * This symbol, if defined, indicates that the program is being compiled
- * under the EUNICE package under VMS. The program will need to handle
- * things like files that don't go away the first time you unlink them,
- * due to version numbering. It will also need to compensate for lack
- * of a respectable link() command.
- */
/* VMS:
* This symbol, if defined, indicates that the program is running under
* VMS. It is currently only set in conjunction with the EUNICE symbol.
*/
-#$d_eunice EUNICE /**/
#$d_eunice VMS /**/
/* LOC_SED:
*/
#$d_mymalloc MYMALLOC /**/
+/* SITELIB_EXP:
+ * This symbol contains the ~name expanded version of SITELIB, to be used
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#$d_sitelib SITELIB_EXP "$sitelibexp" /**/
+
#endif
!GROK!THIS!
ENDOFBEG
+print CONFIG <<'EndOfPod';
+=head1 NAME
+
+Config - access Perl configuration option
+
+=head1 SYNOPSIS
+
+ use Config;
+ if ($Config{'cc'} =~ /gcc/) {
+ print "built by gcc\n";
+ }
+
+=head1 DESCRIPTION
+
+The Config module contains everything that was available to the
+C<Configure> program at Perl build time. Shell variables from
+F<config.sh> are stored in the readonly-variable C<%Config>, indexed by
+their names.
+
+=head1 EXAMPLE
+
+Here's a more sophisticated example of using %Config:
+
+ use Config;
+
+ defined $Config{sig_name} || die "No sigs?";
+ foreach $name (split(' ', $Config{sig_name})) {
+ $signo{$name} = $i;
+ $signame[$i] = $name;
+ $i++;
+ }
+
+ print "signal #17 = $signame[17]\n";
+ if ($signo{ALRM}) {
+ print "SIGALRM is $signo{ALRM}\n";
+ }
+
+=head1 NOTE
+
+This module contains a good example of how to make a variable
+readonly to those outside of it.
+
+=cut
+
+EndOfPod
+
@fast{@fast} = @fast;
@extensions{@extensions} = @extensions;
@non_v=();
--- /dev/null
+#! /bin/sh
+# GNU configure-like front end to metaconfig's Configure.
+#
+# Written by Andy Dougherty (doughera@lafcol.lafayette.edu)
+# and matthew green (mrg@mame.mu.oz.au)
+#
+# public domain.
+
+opts=''
+for f in $*
+do
+ case $f in
+ --help)
+ echo This is GNU configure-like front end for a MetaConfig Configure.
+ echo It understands the follow GNU configure options:
+ echo " --prefix=PREFIX"
+ echo " --help"
+ echo ""
+ echo And these environment variables:
+ echo " CFLAGS"
+ echo " CC"
+ echo " DEFS"
+ echo 0
+ ;;
+ --prefix=*)
+ shift
+ arg=`echo $f | sed 's/--prefix=/-Dprefix=/'`
+ opts="$opts $arg"
+ ;;
+ --*)
+ opt=`echo $f | sed 's/=.*//'`
+ echo This GNU configure front end does not understand $opt
+ exit 1
+ ;;
+ *)
+ shift
+ opts="$opts $f"
+ ;;
+ esac
+done
+
+case "$CC" in
+ '') ;;
+ *) opts="$opts -Dcc='$CC'" ;;
+esac
+
+# join DEFS and CFLAGS together.
+
+ccflags=''
+if test "x$DEFS" != x
+then
+ ccflags=$DEFS
+fi
+if test "x$CFLAGS" != x
+then
+ ccflags="$ccflags $CFLAGS"
+fi
+
+if test "x$ccflags" != x
+then
+ opts="$opts -Dccflags='$ccflags'"
+fi
+
+echo ./Configure "$opts" -des
+./Configure "$opts" -des
+++ /dev/null
-: doSH is obsolete. Just use Configure -S
-:
-if test -f Configure ; then TOP=.;
-elif test -f ../Configure ; then TOP=..;
-elif test -f ../../Configure ; then TOP=../..;
-elif test -f ../../../Configure ; then TOP=../../..;
-elif test -f ../../../../Configure ; then TOP=../../../..;
-else
- echo "Can't find Configure" ; exit 1
-fi
-
-sh $TOP/Configure -S
while (IoIFP(io)) {
-#ifdef USE_STD_STDIO /* (the code works without this) */
- if (IoIFP(io)->_cnt > 0) /* cheat a little, since */
+#ifdef USE_STDIO_PTR /* (the code works without this) */
+ if (FILE_cnt(IoIFP(io)) > 0) /* cheat a little, since */
return FALSE; /* this is the most usual case */
#endif
(void)ungetc(ch, IoIFP(io));
return FALSE;
}
-#ifdef USE_STD_STDIO
- if (IoIFP(io)->_cnt < -1)
- IoIFP(io)->_cnt = -1;
+#ifdef USE_STDIO_PTR
+ if (FILE_cnt(IoIFP(io)) < -1)
+ FILE_cnt(IoIFP(io)) = -1;
#endif
if (op->op_flags & OPf_SPECIAL) { /* not necessarily a real EOF yet? */
if (!nextargv(argvgv)) /* get another fp handy */
#define cop_seqmax Perl_cop_seqmax
#define cos_amg Perl_cos_amg
#define cryptseen Perl_cryptseen
-#define cryptswitch_add Perl_cryptswitch_add
-#define cryptswitch_fp Perl_cryptswitch_fp
#define cshlen Perl_cshlen
#define cshname Perl_cshname
#define curcop Perl_curcop
#define expect Perl_expect
#define expectterm Perl_expectterm
#define fallback_amg Perl_fallback_amg
+#define filter_add Perl_filter_add
+#define filter_del Perl_filter_del
+#define filter_read Perl_filter_read
#define fold Perl_fold
#define freq Perl_freq
#define ge_amg Perl_ge_amg
#define retstack_ix Perl_retstack_ix
#define retstack_max Perl_retstack_max
#define rsfp Perl_rsfp
+#define rsfp_filters Perl_rsfp_filters
#define rshift_amg Perl_rshift_amg
#define rshift_ass_amg Perl_rshift_ass_amg
#define savestack Perl_savestack
cop_seqmax
cos_amg
cryptseen
-cryptswitch_add
-cryptswitch_fp
cshlen
cshname
curcop
expect
expectterm
fallback_amg
+filter_add
+filter_del
+filter_read
fold
freq
ge_amg
retstack_ix
retstack_max
rsfp
+rsfp_filters
rshift_amg
rshift_ass_amg
savestack
if (GvCVGEN(topgv) >= sub_generation)
return topgv; /* valid cached inheritance */
if (!GvCVGEN(topgv)) { /* not an inheritance cache */
- if (CvROOT(cv) || CvXSUB(cv))
- return topgv; /* real definition */
- /* a simple undef -- save the slot for possible re-use */
+ return topgv;
}
else {
/* stale cached entry, just junk it */
These files are used by Configure to set things which Configure either
-can't or doesn't guess properly. Most of these hints files are from
+can't or doesn't guess properly. Many of these hints files are from
perl4. They may or may not work with perl5, but they are probably a
good starting point.
of perl5 and are probably reasonably close to being correct:
aix.sh
+aux.sh
bsd386.sh
dec_osf.sh
dgux.sh
hpux_9.sh
irix_4.sh
irix_5.sh
+irix_6.sh
isc.sh
linux.sh
netbsd.sh
3b1.sh
altos486.sh
apollo.sh
-aux.sh
dnix.sh
dynix.sh
fps.sh
-optimize='-O'
-ccflags="$ccflags -B/usr/lib/big/ -DPARAM_NEEDS_TYPES"
-POSIX_cflags='ccflags="$ccflags -ZP -Du_long=U32"'
+# hints/aux.sh
+#
+# Improved by Jake Hamby <jehamby@lightside.com> to support both Apple CC
+# and GNU CC. Tested on A/UX 3.1.1 with GCC 2.6.3.
+# Last modified
+# Fri May 5 10:59:43 EDT 1995
+
+case "$cc" in
+gcc) optimize='-O2'
+ ccflags="$ccflags -D_POSIX_SOURCE"
+ echo "Setting hints for GNU CC."
+ ;;
+*) optimize='-O'
+ ccflags="$ccflags -B/usr/lib/big/ -DPARAM_NEEDS_TYPES -D_POSIX_SOURCE"
+ POSIX_cflags='ccflags="$ccflags -ZP -Du_long=U32"'
+ echo "Setting hints for Apple's CC. If you plan to use"
+ echo "GNU CC, please rerun this Configure script as:"
+ echo "./Configure -Dcc=gcc"
+ ;;
+esac
ccdlflags='-Zelf -Zlink=dynamic -Wl,-Bexport -u sigaction'
lddlflags='-Zlink=so'
-# Configure imagines that stdio.h is "standard", but it really isn't.
-# Things like the -T and -B file test operators (on file handles) fail when
-# it tries to treat it as "standard"
-#
-d_stdstdio='undef'
-
# Configure imagines that it sees a pw_quota field, but it is really in a
# different structure than the one it thinks it is looking at. WARNING:
# Setting this here in the hints file doesn't help. You need to fix this by
--- /dev/null
+# epix.sh
+# Hint file for EP/IX on CDC RISC boxes.
+#
+# From: Stanley Donald Capelik <sd9sdc@hp100.den.mmc.com>
+# Modified by Andy Dougherty <doughera@lafcol.lafayette.edu>
+# Last modified: Mon May 8 15:29:18 EDT 1995
+#
+# This hint file appears to be based on the svr4 hints for perl5.000,
+# with some CDC-specific additions. I've tried to updated it to
+# match the 5.001 svr4 hints, which allow for dynamic loading,
+# but I have no way of testing the resulting file.
+#
+# There were also some contradictions that I've tried to straighten
+# out, but I'm not sure I got them all right.
+#
+# Edit config.sh to change shmattype from 'char *' to 'void *'"
+
+# Use Configure -Dcc=gcc to use gcc.
+case "$cc" in
+'') cc='/bin/cc3.11'
+ test -f $cc || cc='/usr/ccs/bin/cc'
+ ;;
+esac
+
+usrinc='/svr4/usr/include'
+
+# Various things that Configure apparently doesn't get right.
+strings='/svr4/usr/include/string.h'
+timeincl='/svr4/usr/include/sys/time.h '
+libc='/svr4/usr/lib/libc.a'
+libpth='/svr4/usr/lib /svr4/usr/lib/cmplrs/cc /usr/ccs/lib /svr4/lib /svr4/usr/ucblib'
+osname='epix2'
+archname='epix2'
+d_suidsafe='define' # "./Configure -d" can't figure this out easilly
+d_flock='undef'
+
+# Old version had this, but I'm not sure why since the old version
+# also mucked around with libswanted. This is also definitely wrong
+# if the user is trying to use DB_File or GDBM_File.
+# libs='-lsocket -lnsl -ldbm -ldl -lc -lcrypt -lm -lucb'
+
+# We include support for using libraries in /usr/ucblib, but the setting
+# of libswanted excludes some libraries found there. You may want to
+# prevent "ucb" from being removed from libswanted and see if perl will
+# build on your system.
+ldflags='-non_shared -systype svr4 -L/svr4/usr/lib -L/svr4/usr/lib/cmplrs/cc -L/usr/ccs/lib -L/svr4/usr/ucblib'
+ccflags='-systype svr4 -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude'
+cppflags='-D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude'
+
+# Don't use problematic libraries:
+
+libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'`
+# libmalloc.a - Probably using Perl's malloc() anyway.
+# libucb.a - Remove it if you have problems ld'ing. We include it because
+# it is needed for ODBM_File and NDBM_File extensions.
+if [ -r /usr/ucblib/libucb.a ]; then # If using BSD-compat. library:
+ # Use the "native" counterparts, not the BSD emulation stuff:
+ d_bcmp='undef'; d_bcopy='undef'; d_bzero='undef'; d_safebcpy='undef'
+ d_index='undef'; d_killpg='undef'; d_getprior='undef'; d_setprior='undef'
+ d_setlinebuf='undef'; d_setregid='undef'; d_setreuid='undef'
+fi
+
+lddlflags="-G $ldflags" # Probably needed for dynamic loading
+
+cat <<'EOM' >&4
+
+If you wish to use dynamic linking, you must use
+ LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
+or
+ setenv LD_LIBRARY_PATH `pwd`
+before running make.
+
+EOM
# Ollivier Robert <Ollivier.Robert@keltia.frmug.fr.net>
# Date: Sat, 8 Apr 1995 20:53:41 +0200 (MET DST)
#
+# Additional 2.0.5 and 2.1 defined from
+# Ollivier Robert <Ollivier.Robert@keltia.frmug.fr.net>
+# Date: Fri, 12 May 1995 14:30:38 +0200 (MET DST)
+#
# FreeBSD has the dynamic loading dl*() functions in /usr/lib/crt0.o,
# so Configure doesn't find them (unless you abandon the nm scan).
#
# -DPIC is not used by perl proper) but the full define is included to
# be consistent with the FreeBSD general shared libs building process.
#
-# setreuid and friends are inherently broken in all versions of FreeBSD.
+# setreuid and friends are inherently broken in all versions of FreeBSD
+# before 2.1-current (before approx date 4/15/95). It is fixed in 2.0.5
+# and what-will-be-2.1
#
case "$osvers" in
d_setrgid='undef'
d_setruid='undef'
;;
-*)
+2.0-RELEASE*)
d_dlopen="$define"
cccdlflags='-DPIC -fpic'
lddlflags='-Bshareable $lddlflags'
d_setrgid='undef'
d_setruid='undef'
;;
+#
+# Trying to cover 2.0.5, 2.1-current and future 2.1
+# It does not covert all 2.1-current versions as the output of uname
+# changed a few times.
+#
+2.0.5*|2.0-BUILD|2.1*)
+ d_dlopen="$define"
+ cccdlflags='-DPIC -fpic'
+ lddlflags='-Bshareable $lddlflags'
+ # Are these defines necessary? Doesn't Configure find them
+ # correctly?
+ d_setregid='define'
+ d_setreuid='define'
+ d_setrgid='define'
+ d_setruid='define'
esac
# Avoid telldir prototype conflict in pp_sys.c (FreeBSD uses const DIR *)
# Configure should test for this. Volunteers?
+#irix_4.sh
+# Last modified Fri May 5 14:06:37 EDT 1995
optimize='-O1'
-usemymalloc='y'
+
+# Does Configure really get these wrong? Why?
d_voidsig=define
-usevfork=false
d_charsprf=undef
-ccflags="-ansiposix -signed"
-#
+
+case "$cc" in
+*gcc) ccflags="$ccflags -D_BSD_TYPES" ;;
+*) ccflags="$ccflags -ansiposix -signed" ;;
+esac
+
# This hint due thanks Hershel Walters <walters@smd4d.wes.army.mil>
# Date: Tue, 31 Jan 1995 16:32:53 -0600 (CST)
# Subject: IRIX4.0.4(.5? 5.0?) problems
# irix_5.sh
+# Last modified Fri May 5 11:01:23 EDT 1995
ld=ld
i_time='define'
-ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -Olimit 3000"
+
+case "$cc" in
+*gcc) ccflags="$ccflags -D_BSD_TYPES" ;;
+*) ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -Olimit 3000" ;;
+esac
+
lddlflags="-shared"
+# For some reason we don't want -lsocket -lnsl or -ldl. Can anyone
+# contribute an explanation?
set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'`
shift
libswanted="$*"
cc="cc -32"
ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -Olimit 3000"
lddlflags="-32 -shared"
+
+# We don't want these libraries. Anyone know why?
set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'`
shift
libswanted="$*"
#
# Consolidated by Andy Dougherty <doughera@lafcol.lafayette.edu>
#
-# Last updated Thu Apr 6 12:22:03 EDT 1995
+# Last updated Tue May 30 14:25:02 EDT 1995
#
# If you wish to use something other than 'gcc' for your compiler,
# you should specify it on the Configure command line. To use
-# gcc-elf, for exmample, type
+# gcc-elf, for exmample, type
# ./Configure -Dcc=gcc-elf
# perl goes into the /usr tree. See the Filesystem Standard
# available via anonymous FTP at tsx-11.mit.edu in
# /pub/linux/docs/linux-standards/fsstnd.
-# This used to be
-# bin='/usr/bin'
-# but it doesn't seem sensible to put the binary in /usr and all the
-# rest of the support stuff (lib, man pages) into /usr/local.
-# However, allow a command line override, e.g. Configure -Dprefix=/foo/bar
+# Allow a command line override, e.g. Configure -Dprefix=/foo/bar
case "$prefix" in
'') prefix='/usr' ;;
esac
# Perl expects BSD style signal handling.
-# gcc defines _G_HAVE_BOOL to 1, but doesn't actually supply bool.
+# gcc-2.6.3 defines _G_HAVE_BOOL to 1, but doesn't actually supply bool.
ccflags="-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL $ccflags"
# The following functions are gcc built-ins, but the Configure tests
-# may fail because it doesn't supply a proper prototype.
+# may fail because they don't supply proper prototypes.
+# This should be fixed as of 5.001f. I'd appreciate reports.
d_memcmp=define
d_memcpy=define
# function in <sys/stat.h>.
d_lstat=define
+# Explanation?
d_dosuid='define'
+# I think Configure gets this right now, but I'd appreciate reports.
malloctype='void *'
+
+# Explanation?
usemymalloc='n'
case "$optimize" in
You appear to have ELF support. I'll try to use it for dynamic loading.
EOM
- # Configure now handles these automatically.
else
- echo "You don't have an ELF gcc, using dld if available."
- # We might possibly have a version of DLD around.
+ cat <<'EOM'
+
+You don't have an ELF gcc. I will use dld if possible. If you are
+using a version of DLD earlier than 3.2.6, or don't have it at all, you
+should probably upgrade. If you are forced to use 3.2.4, you should
+uncomment a couple of lines in hints/linux.sh and rerun Configure to
+disallow shared libraries.
+
+EOM
lddlflags="-r $lddlflags"
# These empty values are so that Configure doesn't put in the
# Linux ELF values.
fi
rm -rf try.c a.out
-cat <<'EOM'
+case "$BASH_VERSION" in
+1.14.3*)
+ cat <<'EOM'
+
+If you get failure of op/exec test #5 during the test phase, you probably
+have a buggy version of bash. Upgrading to a recent version (1.14.4 or
+later) should fix the problem.
-You should take a look at hints/linux.sh. There are a some lines you
-may wish to change.
EOM
+;;
+esac
+
+# In addition, on some systems there is a problem with perl and NDBM, which
+# causes AnyDBM and NDBM_File to lock up. This is evidenced in the tests as
+# AnyDBM just freezing. Currently we disable NDBM for all linux systems.
+# If someone can suggest a more robust test, that would be appreciated.
+d_dbm_open=undef
-# And -- reported by one user:
-# We need to get -lc away from the link lines.
-# If we leave it there we get SEGV from miniperl during the build.
-# This may have to do with bugs in the pre-release version of libc for ELF.
-# Uncomment the next two lines to remove -lc from the link line.
-# set `echo " $libswanted " | sed -e 's@ c @ @'`
-# libswanted="$*"
ccdlflags='-Zlink=dynamic -Wl,-Bexport'
lddlflags='-Zlink=so'
-# Configure imagines that stdio.h is "standard", but it really isn't.
-# Things like the -T and -B file test operators (on file handles) fail when
-# it tries to treat it as "standard"
-#
-d_stdstdio='undef'
-
# Configure sometime finds what it believes to be ndbm header files on the
# system and imagines that we have the NDBM library, but we really don't.
# There is something there that once resembled ndbm, but it is purely
--- /dev/null
+#!./perl
+BEGIN { @INC = ('lib') }
+use Config;
+use Getopt::Long;
+use File::Find;
+require Cwd;
+
+umask 022;
+
+$ver = $];
+$release = substr($ver,0,3); # Not used presently.
+$patchlevel = substr($ver,3,2);
+die "Patchlevel of perl ($patchlevel)",
+ "and patchlevel of config.sh ($Config{'PATCHLEVEL'}) don't match\n"
+ if $patchlevel != $Config{'PATCHLEVEL'};
+
+$usage =
+"Usage: installman --man1dir=/usr/wherever --man1ext=1
+ --man3dir=/usr/wherever --man3ext=3
+ --notify --help
+ Defaults are:
+ man1dir = $Config{'installman1dir'};
+ man1ext = $Config{'man1ext'};
+ man3dir = $Config{'installman3dir'};
+ man3ext = $Config{'man3ext'};
+ --notify (or -n) just lists commands that would be executed.\n";
+
+GetOptions( qw( man1dir=s man1ext=s man3dir=s man3ext=s notify help))
+ || die $usage;
+
+# These are written funny to avoid -w typo warnings.
+$man1dir = defined($opt_man1dir) ? $opt_man1dir : $Config{'installman1dir'};
+$man1ext = defined($opt_man1ext) ? $opt_man1ext : $Config{'man1ext'};
+$man3dir = defined($opt_man3dir) ? $opt_man3dir : $Config{'installman3dir'};
+$man3ext = defined($opt_man3ext) ? $opt_man3ext : $Config{'man3ext'};
+
+$notify = defined($opt_notify) ? $opt_notify : 0;
+
+#Sanity checks
+
+-x "./perl" || warn "./perl not found! Have you run make?\n";
+-d $Config{'installprivlib'}
+ || warn "Perl library directory $Config{'installprivlib'} not found.
+ Have you run make install?. (Installing anyway.)\n";
+-x 't/TEST' || warn "WARNING: You've never run 'make test'!!!",
+ " (Installing anyway.)\n";
+
+# Install the main pod pages.
+runpod2man('pod', $man1dir, $man1ext);
+
+# Install the pods for library modules.
+runpod2man('lib', $man3dir, $man3ext);
+
+sub runpod2man {
+ my($poddir, $mandir, $manext) = @_;
+ my($builddir) = Cwd::getcwd();
+
+ if ($mandir eq ' ' or $mandir eq '') {
+ print STDERR "Skipping installation of $poddir man pages.\n";
+ return;
+ }
+
+ chdir $poddir || die "Unable to cd to $poddir directory!\n$!\n";
+
+ # We insist on using the current version of pod2man in case there
+ # are enhancements or changes from previous installed versions.
+ $pod2man = "../pod/pod2man";
+ -x $pod2man || die "Executable $pod2man not found.\n";
+
+ &makedir($mandir);
+ # Make a list of all the .pm and .pod files in the directory. We will
+ # always run pod2man from the lib directory and feed it the full pathname
+ # of the pod. This might be useful for pod2man someday.
+ @modpods = ();
+ find(\&lsmodpods, '.');
+ foreach $mod (@modpods) {
+ $manpage = $mod;
+ # Convert name from File/Basename.pm to File::Basename.3 format,
+ # if necessary.
+ $manpage =~ s#\.p(m|od)$##;
+ $manpage =~ s#/#::#g;
+ $manpage = "${mandir}/${manpage}.${manext}";
+ # Print $release $patchlevel stuff? or should pod2man do that?
+ &cmd("$pod2man $mod > $manpage");
+ }
+ chdir "$builddir" || die "Unable to cd back to $builddir directory!\n$!\n";
+}
+
+sub lsmodpods {
+ my $dir = $File::Find::dir;
+ my $name = $File::Find::name;
+ if (-f $_) {
+ $name =~ s#^\./##;
+ push(@modpods, $name) if ($name =~ /\.p(m|od)$/);
+ }
+}
+
+print STDERR " Installation complete\n";
+
+exit 0;
+
+
+###############################################################################
+# Utility subroutines from installperl
+
+sub cmd {
+ local($cmd) = @_;
+ print STDERR " $cmd\n";
+ unless ($notify) {
+ system $cmd;
+ warn "Command failed!!!\n" if $?;
+ }
+}
+
+sub link {
+ local($from,$to) = @_;
+
+ print STDERR " ln $from $to\n";
+ link($from,$to) || warn "Couldn't link $from to $to: $!\n" unless $notify;
+}
+
+sub chmod {
+ local($mode,$name) = @_;
+
+ printf STDERR " chmod %o %s\n", $mode, $name;
+ chmod($mode,$name) || warn sprintf("Couldn't chmod %o %s: $!\n",$mode,$name)
+ unless $notify;
+}
+
+sub makedir {
+ local($dir) = @_;
+ unless (-d $dir) {
+ local($shortdir) = $dir;
+
+ $shortdir =~ s#(.*)/.*#$1#;
+ &makedir($shortdir);
+
+ print STDERR " mkdir $dir\n";
+ mkdir($dir, 0777) || warn "Couldn't create $dir: $!\n" unless $notify;
+ }
+}
+
+sub samepath {
+ local($p1, $p2) = @_;
+ local($dev1, $ino1, $dev2, $ino2);
+
+ if ($p1 ne $p2) {
+ ($dev1, $ino1) = stat($p1);
+ ($dev2, $ino2) = stat($p2);
+ ($dev1 == $dev2 && $ino1 == $ino2);
+ }
+ else {
+ 1;
+ }
+}
umask 022;
@scripts = ('cppstdin', 'c2ph', 'h2xs', 'pstruct', 'x2p/s2p', 'x2p/find2perl',
- 'pod/pod2man', 'pod/pod2html', 'pod/pod2latex' );
-@manpages = (<pod/*.man>, 'x2p/a2p.man', 'x2p/s2p.man');
+ 'perldoc', 'pod/pod2man', 'pod/pod2html', 'pod/pod2latex' );
+
+# pod documentation now handled by separate installman script.
+# These two are archaic leftovers.
+@manpages = ('x2p/a2p.man', 'x2p/s2p.man');
+
+@pods = (<pod/*.pod>);
# Read in the config file.
}
}
-# Install man pages.
+# Install pod pages. Where? I guess in $installprivlib/pod.
+&makedir("${installprivlib}/pod");
+foreach $file (@pods) {
+ # $file is a name like pod/perl.pod
+ cp_if_diff($file, "${installprivlib}/${file}");
+}
+
+# Install old man pages.
-if ($installmansrc ne '') {
- &makedir($installmansrc);
+if ($installman1dir ne '') {
+ &makedir($installman1dir);
- if (! &samepath($installmansrc, '.')) {
+ if (! &samepath($installman1dir, '.')) {
for (@manpages) {
- ($new = $_) =~ s/man$/$manext/;
+ ($new = $_) =~ s/man$/$man1ext/;
$new =~ s#.*/##;
- print STDERR " Installing $installmansrc/$new\n";
+ print STDERR " Installing $installman1dir/$new\n";
next if $nonono;
open(MI,$_) || warn "Can't open $_: $!\n";
- open(MO,">$installmansrc/$new") || warn "Can't install $installmansrc/$new: $!\n";
+ open(MO,">$installman1dir/$new") ||
+ warn "Can't install $installman1dir/$new: $!\n";
print MO ".ds RP Release $release Patchlevel $patchlevel\n";
while (<MI>) {
print MO;
makedir("$installarchlib/CORE");
foreach $file (<*.h libperl*.*>) {
cp_if_diff($file,"$installarchlib/CORE/$file");
- if ($file =~ /\.a$/ && $osname =~ /^(next|sunos)$/) {
- # on NeXTs and Suns we have to rerun ranlib after copying libraries
- # (maybe on all platforms which have ranlib ?)
- &cmd("$ranlib $installarchlib/CORE/$file");
- }
}
# AIX needs perl.exp installed as well.
cp_if_diff("perl.exp" ,"$installarchlib/CORE/perl.exp") if ($osname eq 'aix');
if ($?) {
&unlink("$installlib/$name");
&makedir("$installlib/$dir");
- &cmd("cp $_ $installlib/$dir");
- if (/\.a$/ && $osname eq 'next') {
- #on NeXTs we have to rerun ranlib after copying libraries
- &cmd("$ranlib $installlib/$dir/$_");
- }
+ cp_if_diff("$_", "$installlib/$dir/$_");
# HP-UX (at least) needs to maintain execute permissions
# on dynamically-loaded libraries.
if ($name =~ /\.(so|$dlext)$/o) {
}
}
+# Copy $from to $to, only if $from is different than $to.
+# Also preserve modification times for .a libraries.
+# On some systems, if you do
+# ranlib libperl.a
+# cp libperl.a /usr/local/lib/perl5/archlib/CORE/libperl.a
+# and then try to link against the installed libperl.a, you might
+# get an error message to the effect that the symbol table is older
+# than the library.
sub cp_if_diff {
my($from,$to)=@_;
-f $from || die "$0: $from not found";
system "cmp", "-s", $from, $to;
if ($?) {
+ my ($atime, $mtime);
unlink($to); # In case we don't have write permissions.
cmd("cp $from $to");
+ # Restore timestamps if it's a .a library.
+ if ($to =~ /\.a$/) {
+ ($atime, $mtime) = (stat $from)[8,9];
+ utime $atime, $mtime, $to;
+ }
}
}
;;
esac
-PATH="$PATH:."
+# We need .. when we are in the x2p directory if we are using the
+# cppstdin wrapper script.
+PATH="$PATH:.:.."
export PATH
$cat /dev/null >.deptmp
0x0001111d, /* shmget */
0x0001111d, /* shmctl */
0x0011111d, /* shmread */
- 0x0011111c, /* shmwrite */
+ 0x0011111d, /* shmwrite */
0x0000111d, /* msgget */
0x0001111d, /* msgctl */
0x0001111d, /* msgsnd */
shmget shmget ck_fun imst S S S
shmctl shmctl ck_fun imst S S S
shmread shmread ck_fun imst S S S S
-shmwrite shmwrite ck_fun ist S S S S
+shmwrite shmwrite ck_fun imst S S S S
# Message passing.
return s;
case 'v':
printf("\nThis is perl, version %s\n\n",patchlevel);
- fputs("\tUnofficial patchlevel 1e.\n",stdout);
+ fputs("\tUnofficial patchlevel 1i.\n",stdout);
fputs("\nCopyright 1987-1994, Larry Wall\n",stdout);
#ifdef MSDOS
fputs("MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n",
incpush(getenv("PERLLIB"));
}
+#ifdef SITELIB_EXP
+ incpush(SITELIB_EXP);
+#endif
#ifdef ARCHLIB_EXP
incpush(ARCHLIB_EXP);
#endif
# undef HAS_MEMCMP
#endif
+#ifdef I_MEMORY
+# include <memory.h>
+#endif
+
#ifdef HAS_MEMCPY
# if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
# ifndef memcpy
typedef struct mgvtbl MGVTBL;
typedef union any ANY;
-typedef int (*cryptswitch_t) _((void));
-
#include "handy.h"
+typedef I32 (*filter_t) _((int, SV *, int));
+#define FILTER_READ(idx, sv, len) filter_read(idx, sv, len)
+#define FILTER_DATA(idx) (AvARRAY(rsfp_filters)[idx])
+#define FILTER_ISREADER(idx) (idx >= AvFILL(rsfp_filters))
+
#ifdef DOSISH
# include "dosish.h"
#else
char *getlogin _((void));
#endif
-#ifdef EUNICE
+#ifdef UNLINK_ALL_VERSIONS /* Currently only makes sense for VMS */
#define UNLINK unlnk
I32 unlnk _((char*));
#else
EXT char * bufend;
EXT expectation expect INIT(XSTATE); /* how to interpret ambiguous tokens */
EXT char * autoboot_preamble INIT(Nullch);
-EXT cryptswitch_t cryptswitch_fp;
+EXT AV * rsfp_filters;
EXT I32 multi_start; /* 1st line of multi-line string */
EXT I32 multi_end; /* last line of multi-line string */
--- /dev/null
+case $CONFIG in
+'')
+ if test -f config.sh; then TOP=.;
+ elif test -f ../config.sh; then TOP=..;
+ elif test -f ../../config.sh; then TOP=../..;
+ elif test -f ../../../config.sh; then TOP=../../..;
+ elif test -f ../../../../config.sh; then TOP=../../../..;
+ else
+ echo "Can't find config.sh."; exit 1
+ fi
+ . $TOP/config.sh
+ ;;
+esac
+: This forces SH files to create target in same directory as SH file.
+: This is so that make depend always knows where to find SH derivatives.
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+echo "Extracting perldoc (with variable substitutions)"
+$spitshell >perldoc <<!GROK!THIS!
+#!$bin/perl
+!GROK!THIS!
+
+$spitshell >>perldoc <<'!NO!SUBS!'
+
+#
+# Perldoc revision #1 -- look up a piece of documentation in .pod format that
+# is embedded in the perl installation tree.
+#
+# This is not to be confused with Tom Christianson's perlman, which is a
+# man replacement, written in perl. This perldoc is strictly for reading
+# the perl manuals, though it too is written in perl.
+#
+# Version 1.01: Tue May 30 14:47:34 EDT 1995
+# Andy Dougherty <doughera@lafcol.lafayette.edu>
+# -added pod documentation.
+# -added PATH searching.
+# -added searching pod/ subdirectory (mainly to pick up perlfunc.pod
+# and friends.
+
+=head1 NAME
+
+perldoc - Look up Perl documentation in pod format.
+
+=head1 SYNOPSIS
+
+B<perldoc> [B<-h>] PageName|ModuleName
+
+=head1 DESCRIPTION
+
+I<perldoc> looks up a piece of documentation in .pod format that is
+embedded in the perl installation tree or in a perl script, and displays
+it via pod2man | nroff -man | $PAGER. This is primarily used for the
+documentation for the perl library modules.
+
+Your system may also have man pages installed for those modules, in
+which case you can probably just use the man(1) command.
+
+=head1 OPTIONS
+
+=over 5
+
+=item B<-h> help
+
+Prints out a brief help message.
+
+=item B<PageName|ModuleName>
+
+The item you want to look up. Nested modules (such as C<File::Basename>)
+are specified either as C<File::Basename> or C<File/Basename>. You
+may also give a descriptive name of a page, such as C<perlfunc>.
+
+=back
+
+=head1 ENVIRONMENT
+
+Any switches in the C<PERLDOC> environment variable will be used before the
+command line arguments. C<perldoc> also searches directories
+specified by the C<PERL5LIB> (or C<PERLLIB> if C<PERL5LIB> is not
+defined) and C<PATH> environment variables.
+(The latter is so that embedded pods for executables, such as
+C<perldoc> itself, are available.)
+
+=head1 AUTHOR
+
+Kenneth Albanowski <kjahds@kjahds.com>
+
+Minor updates by Andy Dougherty <doughera@lafcol.lafayette.edu>
+
+=head1 SEE ALSO
+
+=head1 DIAGNOSTICS
+
+=cut
+
+if(@ARGV<1) {
+ die <<EOF;
+Usage: $0 [-h] PageName|ModuleName
+
+We suggest you use C<perldoc perldoc> to get aquainted
+with the system.
+EOF
+}
+
+use Getopt::Std;
+
+sub usage{
+ warn "@_\n" if @_;
+ die <<EOF;
+perlman [-h] PageName|ModuleName...
+ -h Display this help message.
+PageName|ModuleName...
+ is the name of a piece of documentation that you want to look at. You
+ may either give a descriptive name of the page (as in the case of
+ `perlfunc') or the name of a module, either like `Term::Info',
+ `Term/Info'.
+
+Any switches in the PERLDOC environment variable will be used before the
+command line arguments.
+
+EOF
+}
+
+use Text::ParseWords;
+
+unshift(@ARGV,shellwords($ENV{"PERLDOC"}));
+
+getopts("h") || usage;
+
+usage if $opt_h;
+
+$index = $opt_i;
+@pages = @ARGV;
+
+sub containspod {
+ my($file) = @_;
+ local($_);
+ open(TEST,"<$file");
+ while(<TEST>) {
+ if(/^=head/) {
+ close(TEST);
+ return 1;
+ }
+ }
+ close(TEST);
+ return 0;
+}
+
+sub searchfor {
+ my($s,@dirs) = @_;
+ $s =~ s!::!/!g;
+ printf STDERR "looking for $s in @dirs\n";
+
+ foreach $dir (@dirs) {
+ if( -f "$dir/$s.pod") { return "$dir/$s.pod" }
+ elsif( -f "$dir/$s.pm" and containspod("$dir/$s.pm"))
+ { return "$dir/$s.pm" }
+ elsif( -f "$dir/$s" and containspod("$dir/$s"))
+ { return "$dir/$s" }
+ elsif( -f "$dir/pod/$s.pod") { return "$dir/pod/$s.pod" }
+ elsif( -f "$dir/pod/$s" and containspod("$dir/pod/$s"))
+ { return "$dir/pod/$s" }
+ }
+ return ();
+}
+
+
+$ENV{PAGER} ||= "more";
+
+foreach (@pages) {
+ print STDERR "Searching for $_\n";
+ # We must look both in @INC for library modules and in PATH
+ # for executables, like h2xs or perldoc itself.
+ @searchdirs = @INC;
+ push(@searchdirs, split(':', $ENV{'PATH'}) );
+ @files= searchfor($_,@searchdirs);
+ if( @files ) {
+ print STDERR "Found as @files\n";
+ } else {
+ print STDERR "No documentation found for $_\n";
+ }
+ push(@found,@files);
+}
+
+$cmd=$filter="";
+
+if( ! -t STDOUT ) { $opt_f = 1 }
+
+$cmd = "pod2man - | nroff -man";
+if( ! $opt_f ) { $filter = "|$ENV{PAGER}" };
+
+open(OUT,"|$cmd$filter");
+foreach (@found) {
+ open(IN,"<$_");
+ print OUT while <IN>;
+ close(IN);
+}
+close(OUT);
+!NO!SUBS!
+chmod 755 perldoc
+$eunicefix perldoc
(If you're intending to read these straight through for the first time,
the suggested order will tend to reduce the number of forward references.)
+Additional documentation for perl modules is available in
+the F</usr/local/lib/perl5/man/man3> directory. You can view this
+with a man(1) program by including the following in the
+appropriate start-up files. (You may have to adjust the path to
+match $Config{'man3dir'}.)
+
+ .profile (for sh, bash or ksh users):
+ MANPATH=$MANPATH:/usr/local/lib/perl5/man
+ export MANPATH
+
+ .login (for csh or tcsh users):
+ setenv MANPATH $MANPATH:/usr/local/lib/perl5/man
+
+If that doesn't work for some reason, you can still use the
+supplied perldoc script to view module information.
+
If something strange has gone wrong with your program and you're not
sure where you should look for help, try the B<-w> switch first. It
will often point out exactly where the trouble is.
The three principle virtues of a programmer are Laziness,
Impatience, and Hubris. See the Camel Book for why.
+
if (stack == sortstack) {
if (cxstack_ix == sortcxix || dopoptosub(cxstack_ix) < sortcxix) {
+ if (cxstack_ix > sortcxix)
+ dounwind(sortcxix);
AvARRAY(stack)[1] = *SP;
stack_sp = stack_base + 1;
return 0;
sv_setpvn(tmpcmd, cshname, cshlen);
sv_catpv(tmpcmd, " -cf 'set nonomatch; glob ");
sv_catsv(tmpcmd, tmpglob);
- sv_catpv(tmpcmd, "'|");
+ sv_catpv(tmpcmd, "' 2>/dev/null |");
#else
sv_setpv(tmpcmd, "echo ");
sv_catsv(tmpcmd, tmpglob);
sv = *(stack_base + TOPMARK + 1);
gv = 0;
+ if (SvGMAGICAL(sv))
+ mg_get(sv);
if (SvROK(sv))
- ob = SvRV(sv);
+ ob = (SV*)SvRV(sv);
else {
GV* iogv;
char* packname = 0;
#include "EXTERN.h"
#include "perl.h"
-/* Omit this -- it causes too much grief on mixed systems.
-#ifdef I_UNISTD
-#include <unistd.h>
-#endif
+/* XXX Omit this -- it causes too much grief on mixed systems.
+ Next time, I should force broken systems to unset i_unistd in
+ hint files.
*/
+#if 0
+# ifdef I_UNISTD
+# include <unistd.h>
+# endif
+#endif
/* Put this after #includes because fork and vfork prototypes may
conflict.
int argtype;
GV *gv;
FILE *fp;
-#ifdef HAS_FLOCK
+
+#if !defined(HAS_FLOCK) && defined(HAS_LOCKF)
+# define flock lockf_emulate_flock
+#endif
+
+#if defined(HAS_FLOCK) || defined(flock)
argtype = POPi;
if (MAXARG <= 0)
gv = last_in_gv;
PUSHi(value);
RETURN;
#else
-# ifdef HAS_LOCKF
- DIE(no_func, "flock()"); /* XXX emulate flock() with lockf()? */
-# else
DIE(no_func, "flock()");
-# endif
#endif
}
RETPUSHNO;
}
-#if defined(USE_STD_STDIO) || defined(atarist) /* this will work with atariST */
-# define FBASE(f) ((f)->_base)
-# define FSIZE(f) ((f)->_cnt + ((f)->_ptr - (f)->_base))
-# define FPTR(f) ((f)->_ptr)
-# define FCOUNT(f) ((f)->_cnt)
-#else
-# if defined(USE_LINUX_STDIO)
-# define FBASE(f) ((f)->_IO_read_base)
-# define FSIZE(f) ((f)->_IO_read_end - FBASE(f))
-# define FPTR(f) ((f)->_IO_read_ptr)
-# define FCOUNT(f) ((f)->_IO_read_end - FPTR(f))
-# endif
+#if defined(atarist) /* this will work with atariST. Configure will
+ make guesses for other systems. */
+# define FILE_base(f) ((f)->_base)
+# define FILE_ptr(f) ((f)->_ptr)
+# define FILE_cnt(f) ((f)->_cnt)
+# define FILE_bufsiz(f) ((f)->_cnt + ((f)->_ptr - (f)->_base))
#endif
PP(pp_fttext)
io = GvIO(statgv);
}
if (io && IoIFP(io)) {
-#ifdef FBASE
+#ifdef FILE_base
Fstat(fileno(IoIFP(io)), &statcache);
if (S_ISDIR(statcache.st_mode)) /* handle NFS glitch */
if (op->op_type == OP_FTTEXT)
RETPUSHNO;
else
RETPUSHYES;
- if (FCOUNT(IoIFP(io)) <= 0) {
+ if (FILE_cnt(IoIFP(io)) <= 0) {
i = getc(IoIFP(io));
if (i != EOF)
(void)ungetc(i, IoIFP(io));
}
- if (FCOUNT(IoIFP(io)) <= 0) /* null file is anything */
+ if (FILE_cnt(IoIFP(io)) <= 0) /* null file is anything */
RETPUSHYES;
- len = FSIZE(IoIFP(io));
- s = FBASE(IoIFP(io));
+ len = FILE_bufsiz(IoIFP(io));
+ s = FILE_base(IoIFP(io));
#else
DIE("-T and -B not implemented on filehandles");
#endif
char *filename;
{
char mybuf[8192];
- char *s,
+ char *s,
*save_filename = filename;
int anum = 1;
FILE *myfp;
#endif
}
+#if !defined(HAS_FLOCK) && defined(HAS_LOCKF)
+
+/* XXX Emulate flock() with lockf(). This is just to increase
+ portability of scripts. The calls are not completely
+ interchangeable. What's really needed is a good file
+ locking module.
+*/
+
+/* We might need <unistd.h> because it sometimes defines the lockf()
+ constants. Unfortunately, <unistd.h> causes troubles on some mixed
+ (BSD/POSIX) systems, such as SunOS 4.1.3. We could just try including
+ <unistd.h> here in this part of the file, but that might
+ conflict with various other #defines and includes above, such as
+ #define vfork fork above.
+
+ Further, the lockf() constants aren't POSIX, so they might not be
+ visible if we're compiling with _POSIX_SOURCE defined. Thus, we'll
+ just stick in the SVID values and be done with it. Sigh.
+*/
+
+# ifndef F_ULOCK
+# define F_ULOCK 0 /* Unlock a previously locked region */
+# endif
+# ifndef F_LOCK
+# define F_LOCK 1 /* Lock a region for exclusive use */
+# endif
+# ifndef F_TLOCK
+# define F_TLOCK 2 /* Test and lock a region for exclusive use */
+# endif
+# ifndef F_TEST
+# define F_TEST 3 /* Test a region for other processes locks */
+# endif
+
+/* These are the flock() constants. Since this sytems doesn't have
+ flock(), the values of the constants are probably not available.
+*/
+# ifndef LOCK_SH
+# define LOCK_SH 1
+# endif
+# ifndef LOCK_EX
+# define LOCK_EX 2
+# endif
+# ifndef LOCK_NB
+# define LOCK_NB 4
+# endif
+# ifndef LOCK_UN
+# define LOCK_UN 8
+# endif
+
+int
+lockf_emulate_flock (fd, operation)
+int fd;
+int operation;
+{
+ int i;
+ switch (operation) {
+
+ /* LOCK_SH - get a shared lock */
+ case LOCK_SH:
+ /* LOCK_EX - get an exclusive lock */
+ case LOCK_EX:
+ i = lockf (fd, F_LOCK, 0);
+ break;
+
+ /* LOCK_SH|LOCK_NB - get a non-blocking shared lock */
+ case LOCK_SH|LOCK_NB:
+ /* LOCK_EX|LOCK_NB - get a non-blocking exclusive lock */
+ case LOCK_EX|LOCK_NB:
+ i = lockf (fd, F_TLOCK, 0);
+ if (i == -1)
+ if ((errno == EAGAIN) || (errno == EACCES))
+ errno = EWOULDBLOCK;
+ break;
+
+ /* LOCK_UN - unlock */
+ case LOCK_UN:
+ i = lockf (fd, F_ULOCK, 0);
+ break;
+
+ /* Default - can't decipher operation */
+ default:
+ i = -1;
+ errno = EINVAL;
+ break;
+ }
+ return (i);
+}
+#endif
#ifdef DEBUGGING
void cx_dump _((CONTEXT* cs));
#endif
-void cryptswitch_add _((cryptswitch_t funcp));
+SV * filter_add _((filter_t funcp, SV *datasv));
+void filter_del _((filter_t funcp));
+I32 filter_read _((int idx, SV *buffer, int maxlen));
I32 cxinc _((void));
void deb _((char* pat,...)) __attribute__((format(printf,1,2)));
void deb_growlevel _((void));
void taint_env _((void));
void taint_not _((char *s));
void taint_proper _((char* f, char* s));
+#ifdef UNLINK_ALL_VERSIONS
I32 unlnk _((char* f));
+#endif
void utilize _((int aver, OP* id, OP* arg));
I32 wait4pid _((int pid, int* statusp, int flags));
void warn _((char* pat,...)) __attribute__((format(printf,1,2)));
not_a_number(sv);
return (IV)atol(SvPVX(sv));
}
- return 0;
+ if (!SvROK(sv)) {
+ return 0;
+ }
}
if (SvTHINKFIRST(sv)) {
if (SvROK(sv)) {
}
if (SvIOKp(sv))
return (double)SvIVX(sv);
- return 0;
+ if (!SvROK(sv)) {
+ return 0;
+ }
}
if (SvTHINKFIRST(sv)) {
if (SvROK(sv)) {
Gconvert(SvNVX(sv), DBL_DIG, 0, tokenbuf);
goto tokensave;
}
- *lp = 0;
- return "";
+ if (!SvROK(sv)) {
+ *lp = 0;
+ return "";
+ }
}
if (SvTHINKFIRST(sv)) {
if (SvROK(sv)) {
I32 append;
{
register char *bp; /* we're going to steal some values */
-#ifdef USE_STD_STDIO
+#ifdef USE_STDIO_PTR
register I32 cnt; /* from the stdio struct and put EVERYTHING */
register STDCHAR *ptr; /* in the innermost loop into registers */
STRLEN bpx;
}
} while (i != EOF);
}
-#ifdef USE_STD_STDIO /* Here is some breathtakingly efficient cheating */
- cnt = fp->_cnt; /* get count into register */
+#ifdef USE_STDIO_PTR /* Here is some breathtakingly efficient cheating */
+ cnt = FILE_cnt(fp); /* get count into register */
(void)SvPOK_only(sv); /* validate pointer */
if (SvLEN(sv) - append <= cnt + 1) { /* make sure we have the room */
if (cnt > 80 && SvLEN(sv) > append) {
else
shortbuffered = 0;
bp = SvPVX(sv) + append; /* move these two too to registers */
- ptr = fp->_ptr;
+ ptr = FILE_ptr(fp);
for (;;) {
screamer:
if (cnt > 0) {
continue;
}
- fp->_cnt = cnt; /* deregisterize cnt and ptr */
- fp->_ptr = ptr;
+ FILE_cnt(fp) = cnt; /* deregisterize cnt and ptr */
+ FILE_ptr(fp) = ptr;
i = _filbuf(fp); /* get more characters */
- cnt = fp->_cnt;
- ptr = fp->_ptr; /* reregisterize cnt and ptr */
+ cnt = FILE_cnt(fp);
+ ptr = FILE_ptr(fp); /* reregisterize cnt and ptr */
if (i == EOF) /* all done for ever? */
goto thats_really_all_folks;
thats_really_all_folks:
if (shortbuffered)
cnt += shortbuffered;
- fp->_cnt = cnt; /* put these back or we're in trouble */
- fp->_ptr = ptr;
+ FILE_cnt(fp) = cnt; /* put these back or we're in trouble */
+ FILE_ptr(fp) = ptr;
*bp = '\0';
SvCUR_set(sv, bp - SvPVX(sv)); /* set length */
-#else /* !USE_STD_STDIO */ /* The big, slow, and stupid way */
+#else /* !USE_STDIO_PTR */ /* The big, slow, and stupid way */
{
char buf[8192];
}
}
-#endif /* USE_STD_STDIO */
+#endif /* USE_STDIO_PTR */
if (rspara) {
while (i != EOF) {
--- /dev/null
+#!./perl -P
+
+# $RCSfile: cpp.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:18 $
+
+print "1..3\n";
+
+#this is a comment
+#define MESS "ok 1\n"
+print MESS;
+
+#If you capitalize, it's a comment.
+#ifdef MESS
+ print "ok 2\n";
+#else
+ print "not ok 2\n";
+#endif
+
+open(TRY,">Comp.cpp.tmp") || die "Can't open temp perl file.";
+
+($prog = <<'END') =~ s/X//g;
+X$ok = "not ok 3\n";
+X#include "Comp.cpp.inc"
+X#ifdef OK
+X$ok = OK;
+X#endif
+Xprint $ok;
+END
+print TRY $prog;
+close TRY;
+
+open(TRY,">Comp.cpp.inc") || (die "Can't open temp include file.");
+print TRY '#define OK "ok 3\n"' . "\n";
+close TRY;
+
+$pwd=`pwd`;
+$pwd =~ s/\n//;
+$x = `./perl -P Comp.cpp.tmp`;
+print $x;
+unlink "Comp.cpp.tmp", "Comp.cpp.inc";
-#!./perl -P
+#!./perl
# $RCSfile: cpp.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:18 $
-open(CONFIG,"../config.sh") || die;
-while (<CONFIG>) {
- if (/^cppstdin/) {
- if (/^cppstdin='(.*cppstdin)'/ && ! -e $1) {
- print "1..0\n";
- exit; # Cannot test till after install, alas.
- }
- last;
- }
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
}
-close CONFIG;
-print "1..3\n";
-
-#this is a comment
-#define MESS "ok 1\n"
-print MESS;
-
-#If you capitalize, it's a comment.
-#ifdef MESS
- print "ok 2\n";
-#else
- print "not ok 2\n";
-#endif
-
-open(TRY,">Comp.cpp.tmp") || die "Can't open temp perl file.";
-
-($prog = <<'END') =~ s/X//g;
-X$ok = "not ok 3\n";
-X#include "Comp.cpp.inc"
-X#ifdef OK
-X$ok = OK;
-X#endif
-Xprint $ok;
-END
-print TRY $prog;
-close TRY;
-
-open(TRY,">Comp.cpp.inc") || (die "Can't open temp include file.");
-print TRY '#define OK "ok 3\n"' . "\n";
-close TRY;
+use Config;
+if ( ($Config{'cppstdin'} =~ /\bcppstdin\b/) and
+ ( ! -x $Config{'scriptdir'} . "/cppstdin") ) {
+ print "1..0\n";
+ exit; # Cannot test till after install, alas.
+}
-$pwd=`pwd`;
-$pwd =~ s/\n//;
-$x = `./perl -P Comp.cpp.tmp`;
-print $x;
-unlink "Comp.cpp.tmp", "Comp.cpp.inc";
+system "./perl -P comp/cpp.aux"
"foo";
}
########
--P
-use POSIX;
-########
$array[128]=1
########
$x=0x0eabcd; print $x->ref;
#ifdef CRIPPLED_CC
static int uni _((I32 f, char *s));
#endif
+static char * filter_gets _((SV *sv, FILE *fp));
/* The following are arranged oddly so that the guard on the switch statement
* can get by with a single comparison (if the compiler is smart enough).
}
if (s < bufend || !rsfp || lex_state != LEX_NORMAL)
return s;
- if ((s = sv_gets(linestr, rsfp, 0)) == Nullch) {
+ if ((s = filter_gets(linestr, rsfp)) == Nullch) {
if (minus_n || minus_p) {
sv_setpv(linestr,minus_p ? ";}continue{print" : "");
sv_catpv(linestr,";}");
}
-/* Encrypted script support: cryptswitch_add() may be called to */
-/* define a function which may manipulate the input stream */
-/* (via popen() etc) to decode the input if required. */
-/* At the moment we only allow one cryptswitch function. */
+/* Encoded script support. filter_add() effectively inserts a
+ * 'pre-processing' function into the current source input stream.
+ * Note that the filter function only applies to the current source file
+ * (e.g., it will not affect files 'require'd or 'use'd by this one).
+ *
+ * The datasv parameter (which may be NULL) can be used to pass
+ * private data to this instance of the filter. The filter function
+ * can recover the SV using the FILTER_DATA macro and use it to
+ * store private buffers and state information.
+ *
+ * The supplied datasv parameter is upgraded to a PVIO type
+ * and the IoDIRP field is used to store the function pointer.
+ * Note that IoTOP_NAME, IoFMT_NAME, IoBOTTOM_NAME, if set for
+ * private use must be set using malloc'd pointers.
+ */
+static int filter_debug = 0;
+
+SV *
+filter_add(funcp, datasv)
+ filter_t funcp;
+ SV *datasv;
+{
+ if (!funcp){ /* temporary handy debugging hack to be deleted */
+ filter_debug = atoi((char*)datasv);
+ return NULL;
+ }
+ if (!rsfp_filters)
+ rsfp_filters = newAV();
+ if (!datasv)
+ datasv = newSV(0);
+ if (!SvUPGRADE(datasv, SVt_PVIO))
+ die("Can't upgrade filter_add data to SVt_PVIO");
+ IoDIRP(datasv) = (DIR*)funcp; /* stash funcp into spare field */
+ if (filter_debug)
+ warn("filter_add func %lx (%s)", funcp, SvPV(datasv,na));
+ av_push(rsfp_filters, datasv);
+ return(datasv);
+}
+
+
+/* Delete most recently added instance of this filter function. */
void
-cryptswitch_add(funcp)
- cryptswitch_t funcp;
+filter_del(funcp)
+ filter_t funcp;
+{
+ if (filter_debug)
+ warn("filter_del func %lx", funcp);
+ if (!rsfp_filters || AvFILL(rsfp_filters)<0)
+ return;
+ /* if filter is on top of stack (usual case) just pop it off */
+ if (IoDIRP(FILTER_DATA(AvFILL(rsfp_filters))) == (void*)funcp){
+ sv_free(av_pop(rsfp_filters));
+ return;
+ }
+ /* we need to search for the correct entry and clear it */
+ die("filter_del can only delete in reverse order (currently)");
+}
+
+
+/* Invoke the n'th filter function for the current rsfp. */
+I32
+filter_read(idx, buf_sv, maxlen)
+ int idx;
+ SV *buf_sv;
+ int maxlen; /* 0 = read one text line */
{
- cryptswitch_fp = funcp;
+ filter_t funcp;
+ SV *datasv = NULL;
+ if (!rsfp_filters)
+ return -1;
+ if (idx > AvFILL(rsfp_filters)){ /* Any more filters? */
+ /* Provide a default input filter to make life easy. */
+ /* Note that we append to the line. This is handy. */
+ /* We ignore maxlen here */
+ if (filter_debug)
+ warn("filter_read %d: from rsfp\n", idx);
+ if (maxlen) {
+ /* Want a block */
+ int len ;
+ int old_len = SvCUR(buf_sv) ;
+
+ /* ensure buf_sv is large enough */
+ SvGROW(buf_sv, old_len + maxlen) ;
+ if ((len = fread(SvPVX(buf_sv) + old_len, 1, maxlen, rsfp)) <= 0)
+ return len ;
+ SvCUR_set(buf_sv, old_len + len) ;
+ } else {
+ /* Want a line */
+ if (sv_gets(buf_sv, rsfp, (SvCUR(buf_sv)>0) ? 1 : 0) == NULL)
+ return -1; /* end of file */
+ }
+ return SvCUR(buf_sv);
+ }
+ /* Skip this filter slot if filter has been deleted */
+ if ( (datasv = FILTER_DATA(idx)) == &sv_undef){
+ if (filter_debug)
+ warn("filter_read %d: skipped (filter deleted)\n", idx);
+ return FILTER_READ(idx+1, buf_sv, maxlen); /* recurse */
+ }
+ /* Get function pointer hidden within datasv */
+ funcp = (filter_t)IoDIRP(datasv);
+ if (filter_debug)
+ warn("filter_read %d: via function %lx (%s)\n",
+ idx, funcp, SvPV(datasv,na));
+ /* Call function. The function is expected to */
+ /* call "FILTER_READ(idx+1, buf_sv)" first. */
+ /* Return: <0:error/eof, >=0:not eof (see yylex()) */
+ return (*funcp)(idx, buf_sv, maxlen);
+}
+
+static char *
+filter_gets(sv,fp)
+register SV *sv;
+register FILE *fp;
+{
+ if (rsfp_filters) {
+
+ SvCUR_set(sv, 0); /* start with empty line */
+ if (FILTER_READ(0, sv, 0) > 0)
+ return ( SvPVX(sv) ) ;
+ else
+ return Nullch ;
+ }
+ else
+ return (sv_gets(sv, fp, 0)) ;
+
}
}
goto retry;
}
- /* Give cryptswitch a chance. Note that cryptswitch_fp may */
- /* be either be called once if it redirects rsfp and unregisters */
- /* itself, or it may be called on every line if it loads linestr. */
- if (cryptswitch_fp && (*cryptswitch_fp)()) {
- oldoldbufptr = oldbufptr = s = SvPVX(linestr);
- bufend = SvPVX(linestr) + SvCUR(linestr);
- goto retry;
- }
do {
- if ((s = sv_gets(linestr, rsfp, 0)) == Nullch) {
+ if ((s = filter_gets(linestr, rsfp)) == Nullch) {
fake_eof:
if (rsfp) {
if (preprocess && !in_eval)
OPERATOR(tmp);
case ')':
tmp = *s++;
+ s = skipspace(s);
+ if (*s == '{')
+ PREBLOCK(tmp);
TERM(tmp);
case ']':
s++;
sv_setpvn(tmpstr,"",0); /* avoid "uninitialized" warning */
while (s >= bufend) { /* multiple line string? */
if (!rsfp ||
- !(oldoldbufptr = oldbufptr = s = sv_gets(linestr, rsfp, 0))) {
+ !(oldoldbufptr = oldbufptr = s = filter_gets(linestr, rsfp))) {
curcop->cop_line = multi_start;
missingterm(tokenbuf);
}
if (s < bufend) break; /* string ends on this line? */
if (!rsfp ||
- !(oldoldbufptr = oldbufptr = s = sv_gets(linestr, rsfp, 0))) {
+ !(oldoldbufptr = oldbufptr = s = filter_gets(linestr, rsfp))) {
curcop->cop_line = multi_start;
return Nullch;
}
}
s = eol;
if (rsfp) {
- s = sv_gets(linestr, rsfp, 0);
+ s = filter_gets(linestr, rsfp);
oldoldbufptr = oldbufptr = bufptr = SvPVX(linestr);
bufend = bufptr + SvCUR(linestr);
if (!s) {
#define HAS_KILL
#define HAS_WAIT
+
+/* UNLINK_ALL_VERSIONS:
+ * This symbol, if defined, indicates that the program should arrange
+ * to remove all versions of a file if unlink() is called. This is
+ * probably only relevant for VMS.
+ */
+/* #define UNLINK_ALL_VERSIONS /**/
+
+/* VMS:
+ * This symbol, if defined, indicates that the program is running under
+ * VMS. It is currently automatically set by cpps running under VMS,
+ * and is included here for completeness only.
+ */
+/* #define VMS /**/
#if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX)
# include <signal.h>
}
#endif /* !VMS */
-#ifdef EUNICE
+#ifdef UNLINK_ALL_VERSIONS
I32
unlnk(f) /* unlink all versions of a file */
char *f;
* config.h for VMS
*/
-/* Configuration time: 12-Oct-1994 17:00
+/* Configuration time: 18-Apr-1995 17:00
* Configured by: Charles Bailey bailey@genetics.upenn.edu
* Target system: VMS
*/
* but not always right so it should be emitted by the program only
* when HAS_SHMAT_PROTOTYPE is not defined to avoid conflicting defs.
*/
-#undef Shmat_t char * /**/ /* config-skip */
+#undef Shmat_t /**/ /* config-skip */
#undef HAS_SHMAT_PROTOTYPE /**/
/* USE_STAT_BLOCKS:
*/
#undef USE_STAT_BLOCKS /**/
-/* USE_STD_STDIO:
- * This symbol is defined if this system has a FILE structure declaring
- * _ptr and _cnt in stdio.h.
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
+ */
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
+ */
+#undef USE_STDIO_PTR /**/
+#undef USE_STDIO_BASE /**/
+
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+#ifdef USE_STDIO_PTR
+#endif
+
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
+ */
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
*/
-#undef USE_STD_STDIO /**/
+#ifdef USE_STDIO_BASE
+#endif
/* USE_STRUCT_COPY:
* This symbol, if defined, indicates that this C compiler knows how
#define M_VOID /* Xenix strikes again */ /* config-skip */
#endif
-
-/* EUNICE:
- * This symbol, if defined, indicates that the program is being compiled
- * under the EUNICE package under VMS. The program will need to handle
- * things like files that don't go away the first time you unlink them,
- * due to version numbering. It will also need to compensate for lack
- * of a respectable link() command.
+/* UNLINK_ALL_VERSIONS:
+ * This symbol, if defined, indicates that the program should arrange
+ * to remove all versions of a file if unlink() is called.
*/
+#undef UNLINK_ALL_VERSIONS /**/
+
/* VMS:
* This symbol, if defined, indicates that the program is running under
- * VMS. It is currently only set in conjunction with the EUNICE symbol.
- */
-#define EUNICE /**/
-/* This symbol is automagically defined by all VMS C compilers I've seen.
+ * VMS. It's symbol automagically defined by all VMS C compilers I've seen.
* Just in case, however . . . */
#ifndef VMS
#define VMS /**/
# FULLEXT = Pathname for extension directory (eg DBD/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
# ROOTEXT = Directory part of FULLEXT with leading slash (e.g /DBD)
-FULLEXT = ",vmsify($att{FULLEXT}),"
+FULLEXT = ",vmspath($att{FULLEXT}),"
BASEEXT = $att{BASEEXT}
ROOTEXT = ",($att{ROOTEXT} eq '') ? '[]' : vmspath($att{ROOTEXT}),"
/* Use type for FILE * from Perl's XSUB typemap. This is a bit
* of a hack, since all Perl filehandles using this type will permit
- * both read & write operations, but it saves to write the PPCODE
+ * both read & write operations, but it saves having to write the PPCODE
* directly for updating the Perl filehandles.
*/
typedef FILE * InOutStream;
if (*(name+1) == '>') *mode = 'a', name += 2;
else *mode = 'w', name++;
}
+ else if (*name == '<') name++;
myargc = items - 1;
for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+1),na);
/* This hack brought to you by C's opaque arglist management */
setpwent, shift, sin, sleep, sort, splice, split,
sprintf, sqrt, srand, stat, study, substr, sysread,
system*, syswrite, tell, telldir, tie, time, times*,
- tr///, uc, ucfirst, umask, undef, unlink, unpack,
+ tr///, uc, ucfirst, umask, undef, unlink*, unpack,
untie, unshift, use, utime*, values, vec, wait,
waitpid*, wantarray, warn, write, y///
accumulate the times of suprocesses spawned via pipes, L<system>,
or backticks.
+=item unlink LIST
+
+C<unlink> will delete the highest version of a file only; in
+order to delete all versions, you need to say
+ 1 while (unlink LIST);
+You may need to make this change to scripts written for a
+Unix system which expect that after a call to C<unlink>,
+no files with the names passed to C<unlink> will exist.
+(Note: This can be changed at compile time by including
+C<#define UNLINK_ALL_VERSIONS> in config.h.
+
+C<unlink> will delete a file if at all possible, even if it
+requires changing file protection (though it won't try to
+change the protection of the parent directory). You can tell
+whether you've got explicit delete access to a file by using the
+C<VMS::Filespec::candelete> operator. For instance, in order
+to delete only files to which you have delete access, you could
+say something like
+ sub safe_unlink {
+ my($file,$num);
+ foreach $file (@_) {
+ next unless VMS::Filespec::candelete($file);
+ $num += unlink $file;
+ }
+ $num;
+ }
+Finally, if C<unlink> has to change the file protection to
+delete the file, and you interrupt it in midstream, the file
+may be left intact, but with a changed ACL allowing you delete
+access.
+
=item utime LIST
Since ODS-2, the VMS file structure for disk files, does not keep
if (path == NULL) return NULL;
if (buf) rslt = buf;
- else if (ts) New(7016,rslt,strlen(path)+1,char);
+ else if (ts) New(7016,rslt,strlen(path)+3,char);
else rslt = __tovmsspec_retbuf;
if (strpbrk(path,"]:>") ||
(dirend = strrchr(path,'/')) == NULL) {
CC = $cc
BYACC = $byacc
-mansrc = $mansrc
-manext = $manext
LDFLAGS = $ldflags
SMALL = $small
LARGE = $large $split
sh = Makefile.SH cflags.SH find2perl.SH s2p.SH
+addedbyconf = Makefile cflags find2perl s2p
+
h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h
c = hash.c $(mallocsrc) str.c util.c walk.c
realclean: clean
rm -f *.orig core $(addedbyconf) all malloc.c
- rm -f Makefile cflags find2perl s2p makefile makefile.old
+ rm -f makefile makefile.old
# The following lint has practically everything turned on. Unfortunately,
# you have to wade through a lot of mumbo jumbo that can't be suppressed.
register STR *str;
register FILE *fp;
{
-#ifdef USE_STD_STDIO /* Here is some breathtakingly efficient cheating */
+#ifdef USE_STDIO_PTR /* Here is some breathtakingly efficient cheating */
register char *bp; /* we're going to steal some values */
register int cnt; /* from the stdio struct and put EVERYTHING */
int i;
int bpx;
- cnt = fp->_cnt; /* get count into register */
+ cnt = FILE_cnt(fp); /* get count into register */
str->str_nok = 0; /* invalidate number */
str->str_pok = 1; /* validate pointer */
if (str->str_len <= cnt) /* make sure we have the room */
GROWSTR(&(str->str_ptr), &(str->str_len), cnt+1);
bp = str->str_ptr; /* move these two too to registers */
- ptr = fp->_ptr;
+ ptr = FILE_ptr(fp);
for (;;) {
while (--cnt >= 0) {
if ((*bp++ = *ptr++) == newline)
}
}
- fp->_cnt = cnt; /* deregisterize cnt and ptr */
- fp->_ptr = ptr;
+ FILE_cnt(fp) = cnt; /* deregisterize cnt and ptr */
+ FILE_ptr(fp) = ptr;
i = _filbuf(fp); /* get more characters */
- cnt = fp->_cnt;
- ptr = fp->_ptr; /* reregisterize cnt and ptr */
+ cnt = FILE_cnt(fp);
+ ptr = FILE_ptr(fp); /* reregisterize cnt and ptr */
bpx = bp - str->str_ptr; /* prepare for possible relocation */
GROWSTR(&(str->str_ptr), &(str->str_len), str->str_cur + cnt + 1);
}
thats_all_folks:
- fp->_cnt = cnt; /* put these back or we're in trouble */
- fp->_ptr = ptr;
+ FILE_cnt(fp) = cnt; /* put these back or we're in trouble */
+ FILE_ptr(fp) = ptr;
*bp = '\0';
str->str_cur = bp - str->str_ptr; /* set length */
-#else /* !USE_STD_STDIO */ /* The big, slow, and stupid way */
+#else /* !USE_STDIO_PTR */ /* The big, slow, and stupid way */
static char buf[4192];
else
str_set(str, No);
-#endif /* USE_STD_STDIO */
+#endif /* USE_STDIO_PTR */
return str->str_cur ? str->str_ptr : Nullch;
}
+++ /dev/null
-#!/usr/bin/perl -i.bak
-
-while (<>) {
- study;
- s/\bSTR\b/SV/g && study;
- s/\bARRAY\b/AV/g && study;
- s/\bARG\b/OP/g && study;
- s/\bHASH\b/HV/g && study;
- s/\bHENT\b/HE/g && study;
- s/\bCMD\b/COP/g && study;
- s/\bSPAT\b/PM/g && study;
- s/\bSTIO\b/IO/g && study;
- s/\bSTAB\b/GV/g && study;
- s/\bSTBP\b/GP/g && study;
- s/\bSUBR\b/CV/g && study;
-
- s/\bNullstr\b/Nullsv/g && study;
- s/\bNullarg\b/Nullop/g && study;
- s/\bNullcmd\b/Nullcop/g && study;
- s/\bNullstab\b/Nullgv/g && study;
-
- s/\bstruct stab\b/struct gv/g && study;
- s/\bstruct stabptrs\b/struct gp/g && study;
- s/\bstruct stio\b/struct io/g && study;
- s/\bstruct string\b/struct sv/g && study;
- s/\bstruct scanpat\b/struct pm/g && study;
- s/\bstruct formcmd\b/struct ff/g && study;
- s/\bstruct hentry\b/struct he/g && study;
- s/\bstruct atbl\b/struct av/g && study;
- s/\bstruct htbl\b/struct hv/g && study;
- s/\bstruct cmd\b/struct cop/g && study;
-
- s/\bcmdname\b/cop_name/g && study;
- s/\bopname\b/op_name/g && study;
-
- s/\bstab_stab\b/GvGV/g && study;
- s/\bstab_estab\b/GvEGV/g && study;
- s/\bstab_stash\b/GvSTASH/g && study;
- s/\bstab_estash\b/GvESTASH/g && study;
- s/\bstab_name\b/GvNAME/g && study;
- s/\bstab_ename\b/GvENAME/g && study;
- s/\bstab_hash\b/GvHVn/g && study;
- s/\bstab_xhash\b/GvHV/g && study;
- s/\bstab_array\b/GvAVn/g && study;
- s/\bstab_xarray\b/GvAV/g && study;
- s/\bstab_sub\b/GvCV/g && study;
- s/\bstab_form\b/GvFORM/g && study;
- s/\bstab_magic\b/GvMAGIC/g && study;
- s/\bstab_val\b/GvSV/g && study;
- s/\bstab_xio\b/GvIO/g && study;
- s/\bstab_io\b/GvIOn/g && study;
- s/\bstab_lastexpr\b/GvLASTEXPR/g && study;
- s/\bstab_line\b/GvLINE/g && study;
- s/\bstab_flags\b/GvFLAGS/g && study;
-
- s/\bstbp_val\b/gp_sv/g && study;
- s/\bstbp_array\b/gp_av/g && study;
- s/\bstbp_hash\b/gp_hv/g && study;
- s/\bstbp_stab\b/gp_egv/g && study;
-
- s/\bstr_array\b/sv_av/g && study;
- s/\bstr_hash\b/sv_hv/g && study;
- s/\bstr_cmd\b/sv_cop/g && study;
- s/\bstr_args\b/sv_op/g && study;
- s/\bstr_nval\b/sv_nv/g && study;
- s/\bstr_pval\b/sv_pv/g && study;
-
- s/\bSTABSET\b/SvSETMAGIC/g && study;
- s/\bstabset\b/sv_setmagic/g && study;
- s/\bSTR_SSET\b/sv_setsv/g && study;
- s/\bSTR_GROW\b/SvGROW/g && study;
-
- s/\bstr_true\b/SvTRUE/g && study;
- s/\bstr_peek\b/SvPEEK/g && study;
- s/\bstr_get\b/SvPV/g && study;
- s/\bstr_gnum\b/SvNV/g && study;
-
- s/\bstab\b/gv/g && study;
- s/\bstr\b/sv/g && study;
- s/\bStr\b/Sv/g && study;
-
- s/\baadd\b/gv_AVn/g && study;
-
- s/\baclear\b/av_clear/g && study;
- s/\bafake\b/av_fake/g && study;
- s/\bafetch\b/av_fetch/g && study;
- s/\bafill\b/av_fill/g && study;
- s/\bafree\b/av_free/g && study;
- s/\balen\b/av_len/g && study;
- s/\banew\b/newAV/g && study;
- s/\bapop\b/av_pop/g && study;
- s/\bapush\b/av_push/g && study;
- s/\barg_free\b/op_free/g && study;
- s/\bashift\b/av_shift/g && study;
- s/\bastore\b/av_store/g && study;
- s/\baunshift\b/av_unshift/g && study;
- s/\bcastulong\b/cast_ulong/g && study;
- s/\bcmd_free\b/op_free/g && study;
- s/\bcurcmd\b/curcop/g && study;
- s/\bdump_arg\b/dump_op/g && study;
- s/\bdump_cmd\b/dump_op/g && study;
- s/\bdump_spat\b/dump_pm/g && study;
- s/\bdump_stab\b/dump_gv/g && study;
- s/\bdumpfds\b/dump_fds/g && study;
- s/\bfbmcompile\b/fbm_compile/g && study;
- s/\bfbminstr\b/fbm_instr/g && study;
- s/\bfstab\b/newGVfile/g && study;
- s/\bgenstab\b/newGVgen/g && study;
- s/\bgrow_dlevel\b/deb_growlevel/g && study;
- s/\bhadd\b/gv_HVn/g && study;
- s/\bhclear\b/hv_clear/g && study;
- s/\bhdelete\b/hv_delete/g && study;
- s/\bhentdelayfree\b/he_delayfree/g && study;
- s/\bhentfree\b/he_free/g && study;
- s/\bhfetch\b/hv_fetch/g && study;
- s/\bhfree\b/hv_free/g && study;
- s/\bhiterinit\b/hv_iterinit/g && study;
- s/\bhiterkey\b/hv_iterkey/g && study;
- s/\bhiternext\b/hv_iternext/g && study;
- s/\bhiterval\b/hv_iterval/g && study;
- s/\bhnew\b/newHV/g && study;
- s/\bhstore\b/hv_store/g && study;
- s/\blistish\b/forcelist/g && study;
- s/\bmaybelistish\b/maybeforcelist/g && study;
- s/\bmylstat\b/my_lstat/g && study;
- s/\bmypclose\b/my_pclose/g && study;
- s/\bmypfiopen\b/my_pfiopen/g && study;
- s/\bmypopen\b/my_popen/g && study;
- s/\bmystat\b/my_stat/g && study;
- s/\bop_new\b/newOP/g && study;
- s/\bperl_alloc\b/perl_alloc/g && study;
- s/\bperl_callback\b/perl_callpv/g && study;
- s/\bperl_callv\b/perl_callargv/g && study;
- s/\bperl_construct\b/perl_construct/g && study;
- s/\bperl_destruct\b/perl_destruct/g && study;
- s/\bperl_free\b/perl_free/g && study;
- s/\bperl_parse\b/perl_parse/g && study;
- s/\bperl_run\b/perl_run/g && study;
- s/\bregcomp\b/regcomp/g && study;
- s/\bregdump\b/regdump/g && study;
- s/\bregexec\b/regexec/g && study;
- s/\bregfree\b/regfree/g && study;
- s/\bregnext\b/regnext/g && study;
- s/\bregprop\b/regprop/g && study;
- s/\brepeatcpy\b/repeatcpy/g && study;
- s/\brestorelist\b/leave_scope/g && study;
- s/\bsaveaptr\b/save_aptr/g && study;
- s/\bsaveary\b/save_ary/g && study;
- s/\bsavehash\b/save_hash/g && study;
- s/\bsavehptr\b/save_hptr/g && study;
- s/\bsaveint\b/save_int/g && study;
- s/\bsaveitem\b/save_item/g && study;
- s/\bsavelines\b/save_lines/g && study;
- s/\bsavelist\b/save_list/g && study;
- s/\bsavelong\b/save_long/g && study;
- s/\bsavenostab\b/save_nostab/g && study;
- s/\bsavesptr\b/save_sptr/g && study;
- s/\bscanconst\b/scan_const/g && study;
- s/\bscanhex\b/scan_hex/g && study;
- s/\bscanident\b/scan_ident/g && study;
- s/\bscanoct\b/scan_oct/g && study;
- s/\bscanpat\b/scan_pat/g && study;
- s/\bscanstr\b/scan_str/g && study;
- s/\bscansubst\b/scan_subst/g && study;
- s/\bscantrans\b/scan_trans/g && study;
- s/\bstab_check\b/gv_check/g && study;
- s/\bstab_clear\b/gv_clear/g && study;
- s/\bstab_efullname\b/gv_efullname/g && study;
- s/\bstab_fullname\b/gv_fullname/g && study;
- s/\bstab_len\b/gv_len/g && study;
- s/\bstab_str\b/gv_str/g && study;
- s/\bstabent\b/gv_fetchpv/g && study;
- s/\bstio_new\b/newIO/g && study;
- s/\bstr_2mortal\b/sv_2mortal/g && study;
- s/\bstr_2num\b/sv_2num/g && study;
- s/\bstr_2ptr\b/sv_2ptr/g && study;
- s/\bstr_cat\b/sv_catpv/g && study;
- s/\bstr_chop\b/sv_chop/g && study;
- s/\bstr_cmp\b/sv_cmp/g && study;
- s/\bstr_dec\b/sv_dec/g && study;
- s/\bstr_eq\b/sv_eq/g && study;
- s/\bstr_free\b/sv_free/g && study;
- s/\bstr_gets\b/sv_gets/g && study;
- s/\bstr_grow\b/sv_grow/g && study;
- s/\bstr_inc\b/sv_inc/g && study;
- s/\bstr_insert\b/sv_insert/g && study;
- s/\bstr_len\b/sv_len/g && study;
- s/\bstr_magic\b/sv_magic/g && study;
- s/\bstr_make\b/newSVpv/g && study;
- s/\bstr_mortal\b/sv_mortalcopy/g && study;
- s/\bstr_ncat\b/sv_catpvn/g && study;
- s/\bstr_new\b/newSV/g && study;
- s/\bstr_nmake\b/newSVnv/g && study;
- s/\bstr_nset\b/sv_setpvn/g && study;
- s/\bstr_numset\b/sv_setnv/g && study;
- s/\bstr_replace\b/sv_replace/g && study;
- s/\bstr_reset\b/sv_reset/g && study;
- s/\bstr_scat\b/sv_catsv/g && study;
- s/\bstr_set\b/sv_setpv/g && study;
- s/\bstr_smake\b/newSVsv/g && study;
- s/\bstr_sset\b/sv_setsv/g && study;
- s/\btaintenv\b/taint_env/g && study;
- s/\btaintproper\b/taint_proper/g && study;
- s/\barg\b/op/g && study;
- s/\barg_ptr\.//g && study;
- s/\barg_/op_/g && study;
-
- s/\bSTR_/SV_/g && study;
- s/\bSP_/SVp_/g && study;
- s/\bSS_/SVs_/g && study;
- s/\bSTAB_/GV_/g && study;
- s/\bSF_/GVf_/g && study;
- s/\bSPAT_/PMf_/g && study;
- #s/\bF_/FFt_/g && study;
- s/\bFC_/FFf_/g && study;
- s/\bO_/OP_/g && study;
- s/\bC_/COP_/g && study;
- s/\bCF_/COPf_/g && study;
- s/\bCFT_/COPo_/g && study;
- s/\bARF_/AVf_/g && study;
- s/\bIOF_/IOf_/g && study;
- s/\bStr_new\b/NEWSV/g && study;
-
- s/\bstbp_/gp_/g && study;
- s/\bstab_/gv_/g && study;
- s/\bspat_/pm_/g && study;
- s/\bstio/io/g && study;
- s/\bf_/ff_/g && study;
- s/\bStr_/Sv_/g && study;
- s/\bstr_/sv_/g && study;
- s/\btbl_/hv_/g && study;
- s/\bary_/av_/g && study;
- s/acmd\.ac_/acop_/g && study;
- s/ccmd\.cc_/ccop_/g && study;
- s/scmd\.sc_/scop_/g && study;
- s/\bac_/acop_/g;
- s/\bcc_/ccop_/g;
- s/\bsc_/scop_/g;
- s/\bc_/cop_/g;
- s/spat/pm/g;
- s/stab/gv/g;
-
- print;
-}