summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafcol.lafayette.edu>1995-01-18 02:44:39 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-01-18 02:44:39 +0000
commit5f51ce503c8828daeb43446f6dff8a13c393fe19 (patch)
tree67c06cad89982baeaefd8e81f4d1dd03b2d7a87b
parent9c8d0b29b7bd1493cc1d95591b17902820e5579c (diff)
downloadperl-5f51ce503c8828daeb43446f6dff8a13c393fe19.tar.gz
perl5.000 patch.0f: [enable metaconfig (PL48) users to regenerate Configure]
This patch enables metaconfig (PL48) users to regenerate Configure. A few of the units are considerably enhanced from those distributed with perl5.000. (This patch assumes that you do *not* have the units from perl5beta3i installed. Sorry if that's an inconvenience.) In particular, *dbm testing also checks for an appropriate library function, not just the right header files. The dynamic loading unit U/dlsrc.U has also been updated to support SVR4 dynamic loading. The U/i_db.U unit now checks for the types for the various structure members that have been causing problems. Note that at a minimum, you need to be sure you have the cext='.xs' line from this .package file in your own. That tells metaconfig that it should look in .xs files (as well as the usual .[chy] files) for C symbols.
-rw-r--r--U/Extensions.U172
-rw-r--r--U/Extract.U74
-rw-r--r--U/Guess.U159
-rw-r--r--U/Loc_sed.U14
-rw-r--r--U/Myinit.U42
-rw-r--r--U/README9
-rw-r--r--U/ccflags.U288
-rw-r--r--U/d_dlsymun.U102
-rw-r--r--U/dlext.U48
-rw-r--r--U/dlsrc.U259
-rw-r--r--U/i_db.U132
-rw-r--r--U/i_dbm.U52
-rw-r--r--U/i_gdbm.U51
-rw-r--r--U/i_ndbm.U51
-rw-r--r--U/mallocsrc.U126
15 files changed, 1579 insertions, 0 deletions
diff --git a/U/Extensions.U b/U/Extensions.U
new file mode 100644
index 0000000000..bcaffc0c52
--- /dev/null
+++ b/U/Extensions.U
@@ -0,0 +1,172 @@
+?RCS: $Id: Extensions.U,v$
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: Extensions.U,v $
+?RCS:
+?MAKE:known_extensions extensions dynamic_ext static_ext useposix : \
+ Myread usedl d_socket i_db i_dbm i_ndbm i_gdbm package test cat
+?MAKE: -pick add $@ %<
+?S:known_extensions:
+?S: This variable holds a list of all extensions included in
+?S: the package.
+?S:.
+?S:dynamic_ext:
+?S: This variable holds a list of extension files we want to
+?S: link dynamically into the package. It is used by Makefile.
+?S:.
+?S:static_ext:
+?S: This variable holds a list of extension files we want to
+?S: link statically into the package. It is used by Makefile.
+?S:.
+?S:extensions:
+?S: This variable holds a list of all extension files
+?S: linked into the package. It is propagated to Config.pm
+?S: and is typically used to test whether a particular extesion
+?S: is available.
+?S:.
+?S:useposix:
+?S: This variable holds either 'true' or 'false' to indicate
+?S: whether the POSIX extension should be used. The sole
+?S: use for this currently is to allow an easy mechanism
+?S: for hints files to indicate that POSIX will not compile
+?S: on a particular system.
+?S:.
+?T:xxx avail_ext
+?INIT:: set useposix=false in your hint file to disable the POSIX extension.
+?INIT:useposix=true
+echo " "
+echo "Looking for extensions..." >&4
+cd ../ext
+?X: If we're using the old config.sh, known_extensions may contain
+?X: old or inaccurate (or duplicate) values.
+known_extensions=''
+for xxx in * ; do
+ if $test -f $xxx/$xxx.xs; then
+ known_extensions="$known_extensions $xxx"
+ fi
+done
+set X $known_extensions
+shift
+known_extensions="$*"
+cd ../UU
+
+: Now see which are supported on this system.
+avail_ext=''
+for xxx in $known_extensions ; do
+ case "$xxx" in
+ DB_File) case "$i_db" in
+ $define) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
+ GDBM_File) case "$i_gdbm" in
+ $define) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
+ NDBM_File) case "$i_ndbm" in
+ $define) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
+ ODBM_File) case "$i_dbm" in
+ $define) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
+ POSIX) case "$useposix" in
+ true|define|y) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
+ Socket) case "$d_socket" in
+ $define) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
+ *) avail_ext="$avail_ext $xxx"
+ ;;
+ esac
+done
+
+set X $avail_ext
+shift
+avail_ext="$*"
+
+case $usedl in
+$define)
+ $cat <<EOM
+A number of extensions are supplied with $package. You may choose to
+compile these extensions for dynamic loading (the default), compile
+them into the $package executable (static loading), or not include
+them at all. Answer "none" to include no extensions.
+
+EOM
+ case "$dynamic_ext" in
+ ''|' ') dflt="$avail_ext" ;;
+ *) dflt="$dynamic_ext" ;;
+ esac
+ case "$dflt" in
+ '') dflt=none;;
+ esac
+ rp="What extensions do you wish to load dynamically?"
+ . ./myread
+ case "$ans" in
+ none) dynamic_ext='' ;;
+ *) dynamic_ext="$ans" ;;
+ esac
+
+ case "$static_ext" in
+ ''|' ')
+ : Exclude those already listed in dynamic linking
+ dflt=''
+ for xxx in $avail_ext; do
+ case " $dynamic_ext " in
+ *" $xxx "*) ;;
+ *) dflt="$dflt $xxx" ;;
+ esac
+ done
+ set X $dflt
+ shift
+ dflt="$*"
+ ;;
+ *) dflt="$static_ext"
+ ;;
+ esac
+
+ case "$dflt" in
+ '') dflt=none;;
+ esac
+ rp="What extensions do you wish to load statically?"
+ . ./myread
+ case "$ans" in
+ none) static_ext='' ;;
+ *) static_ext="$ans" ;;
+ esac
+ ;;
+*)
+ $cat <<EOM
+A number of extensions are supplied with $package. Answer "none"
+to include no extensions.
+
+EOM
+ case "$static_ext" in
+ ''|' ') dflt="$avail_ext" ;;
+ *) dflt="$static_ext" ;;
+ esac
+
+ case "$dflt" in
+ '') dflt=none;;
+ esac
+ rp="What extensions do you wish to include?"
+ . ./myread
+ case "$ans" in
+ none) static_ext='' ;;
+ *) static_ext="$ans" ;;
+ esac
+ ;;
+esac
+
+set X $dynamic_ext $static_ext
+shift
+extensions="$*"
+
diff --git a/U/Extract.U b/U/Extract.U
new file mode 100644
index 0000000000..606aaa3e68
--- /dev/null
+++ b/U/Extract.U
@@ -0,0 +1,74 @@
+?RCS: $Id: Extract.U,v 3.0.1.1 1994/10/29 15:51:46 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: This private version for perl5 will also extract files from
+?RCS: extension MANIFEST. (ext/Blah/MANIFEST).
+?RCS:
+?RCS: $Log: Extract.U,v $
+?RCS: Revision 3.0.1.1 1994/10/29 15:51:46 ram
+?RCS: patch36: added ?F: line for metalint file checking
+?RCS:
+?RCS: Revision 3.0 1993/08/18 12:04:52 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?X:
+?X: This unit produces a shell script which can be doted in order to extract
+?X: .SH files with variable substitutions.
+?X:
+?MAKE:Extract: Nothing
+?MAKE: -pick add $@ %<
+?F:./extract !config_h.SH
+?T:CONFIG dir file shlist xxx
+: script used to extract .SH files with variable substitutions
+cat >extract <<'EOS'
+CONFIG=true
+echo "Doing variable substitutions on .SH files..."
+if test -f MANIFEST; then
+ shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
+ : Pick up possible extension manifests.
+ for dir in ext/* ; do
+ if test -f $dir/MANIFEST; then
+ xxx=`awk '{print $1}' < $dir/MANIFEST |
+ sed -n "/\.SH$/ s@^@$dir/@p"`
+ shlist="$shlist $xxx"
+ fi
+ done
+ set x $shlist
+else
+ echo "(Looking for .SH files under the current directory.)"
+ set x `find . -name "*.SH" -print`
+fi
+shift
+case $# in
+0) set x *.SH; shift;;
+esac
+if test ! -f $1; then
+ shift
+fi
+for file in $*; do
+ case "$file" in
+ */*)
+ dir=`expr X$file : 'X\(.*\)/'`
+ file=`expr X$file : 'X.*/\(.*\)'`
+ (cd $dir && . ./$file)
+ ;;
+ *)
+ . ./$file
+ ;;
+ esac
+done
+if test -f config_h.SH; then
+ if test ! -f config.h; then
+ : oops, they left it out of MANIFEST, probably, so do it anyway.
+ . ./config_h.SH
+ fi
+fi
+EOS
+
diff --git a/U/Guess.U b/U/Guess.U
new file mode 100644
index 0000000000..cb6354ae3d
--- /dev/null
+++ b/U/Guess.U
@@ -0,0 +1,159 @@
+?RCS: $Id: Guess.U,v 3.0.1.4 1994/10/29 15:53:55 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: Guess.U,v $
+?RCS: Revision 3.0.1.4 1994/10/29 15:53:55 ram
+?RCS: patch36: added ?F: line for metalint file checking
+?RCS: patch36: call ./xenix explicitely instead of relying on PATH
+?RCS:
+?RCS: Revision 3.0.1.3 1993/12/15 08:14:35 ram
+?RCS: patch15: variable d_bsd was not always set properly
+?RCS:
+?RCS: Revision 3.0.1.2 1993/08/30 08:57:14 ram
+?RCS: patch8: fixed comment which wrongly attributed the usrinc symbol
+?RCS: patch8: no more ugly messages when no /usr/include/ctype.h
+?RCS:
+?RCS: Revision 3.0.1.1 1993/08/27 14:37:37 ram
+?RCS: patch7: added support for OSF/1 machines
+?RCS:
+?RCS: Revision 3.0 1993/08/18 12:04:57 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?X:
+?X: This unit hazards some guesses as to what the general nature of the system
+?X: is. The information it collects here is used primarily to establish default
+?X: answers to other questions.
+?X:
+?MAKE:Guess d_eunice d_xenix d_bsd: cat test echo n c contains rm Loc eunicefix
+?MAKE: -pick add $@ %<
+?S:d_eunice:
+?S: This variable conditionally defines the symbols EUNICE and VAX, which
+?S: alerts the C program that it must deal with ideosyncracies of VMS.
+?S:.
+?S:d_xenix:
+?S: This variable conditionally defines the symbol XENIX, which alerts
+?S: the C program that it runs under Xenix.
+?S:.
+?S:d_bsd:
+?S: This symbol conditionally defines the symbol BSD when running on a
+?S: BSD system.
+?S:.
+?C:EUNICE:
+?C: This symbol, if defined, indicates that the program is being compiled
+?C: under the EUNICE package under VMS. The program will need to handle
+?C: things like files that don't go away the first time you unlink them,
+?C: due to version numbering. It will also need to compensate for lack
+?C: of a respectable link() command.
+?C:.
+?C:VMS:
+?C: This symbol, if defined, indicates that the program is running under
+?C: VMS. It is currently only set in conjunction with the EUNICE symbol.
+?C:.
+?C:XENIX:
+?C: This symbol, if defined, indicates thet the program is running under
+?C: Xenix (at least 3.0 ?).
+?C:.
+?X:We don't use BSD in the perl source. It's too vague, and already
+?X:defined in some header files anyway (e.g. NetBSD).
+?X:?C:BSD:
+?X:?C: This symbol, if defined, indicates that the program is running under
+?X:?C: a BSD system.
+?X:?C:.
+?H:#$d_eunice EUNICE /**/
+?H:#$d_eunice VMS /**/
+?H:#$d_xenix XENIX /**/
+?X:?H:#$d_bsd BSD /**/
+?H:.
+?F:./bsd ./usg ./v7 ./osf1 ./eunice ./xenix ./venix
+?T:xxx
+: make some quick guesses about what we are up against
+echo " "
+$echo $n "Hmm... $c"
+echo exit 1 >bsd
+echo exit 1 >usg
+echo exit 1 >v7
+echo exit 1 >osf1
+echo exit 1 >eunice
+echo exit 1 >xenix
+echo exit 1 >venix
+d_bsd="$undef"
+?X:
+?X: Do not use 'usrinc', or we get a circular dependency. because
+?X: usrinc is defined in usrinc.U, which relies on us...
+?X:
+$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
+if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
+then
+ echo "Looks kind of like an OSF/1 system, but we'll see..."
+ echo exit 0 >osf1
+elif test `echo abc | tr a-z A-Z` = Abc ; then
+ xxx=`./loc addbib blurfl $pth`
+ if $test -f $xxx; then
+ echo "Looks kind of like a USG system with BSD features, but we'll see..."
+ echo exit 0 >bsd
+ echo exit 0 >usg
+ else
+ if $contains SIGTSTP foo >/dev/null 2>&1 ; then
+ echo "Looks kind of like an extended USG system, but we'll see..."
+ else
+ echo "Looks kind of like a USG system, but we'll see..."
+ fi
+ echo exit 0 >usg
+ fi
+elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
+ echo "Looks kind of like a BSD system, but we'll see..."
+ d_bsd="$define"
+ echo exit 0 >bsd
+else
+ echo "Looks kind of like a Version 7 system, but we'll see..."
+ echo exit 0 >v7
+fi
+case "$eunicefix" in
+*unixtovms*)
+ $cat <<'EOI'
+There is, however, a strange, musty smell in the air that reminds me of
+something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
+EOI
+ echo exit 0 >eunice
+ d_eunice="$define"
+: it so happens the Eunice I know will not run shell scripts in Unix format
+ ;;
+*)
+ echo " "
+ echo "Congratulations. You aren't running Eunice."
+ d_eunice="$undef"
+ ;;
+esac
+if test -f /xenix; then
+ echo "Actually, this looks more like a XENIX system..."
+ echo exit 0 >xenix
+ d_xenix="$define"
+else
+ echo " "
+ echo "It's not Xenix..."
+ d_xenix="$undef"
+fi
+chmod +x xenix
+$eunicefix xenix
+if test -f /venix; then
+ echo "Actually, this looks more like a VENIX system..."
+ echo exit 0 >venix
+else
+ echo " "
+ if ./xenix; then
+ : null
+ else
+ echo "Nor is it Venix..."
+ fi
+fi
+chmod +x bsd usg v7 osf1 eunice xenix venix
+$eunicefix bsd usg v7 osf1 eunice xenix venix
+$rm -f foo
+
diff --git a/U/Loc_sed.U b/U/Loc_sed.U
new file mode 100644
index 0000000000..96341408db
--- /dev/null
+++ b/U/Loc_sed.U
@@ -0,0 +1,14 @@
+?RCS: $Id: Loc_sed.U,v $
+?RCS:
+?X: This is used in perl.c.
+?MAKE:Loc_sed: sed
+?MAKE: -pick add $@ %<
+?X: Fool metalint:
+?LINT:use sed
+?LINT:extern sed
+?C:LOC_SED:
+?C: This symbol holds the complete pathname to the sed program.
+?C:.
+?H:#define LOC_SED "$sed" /**/
+?H:.
+
diff --git a/U/Myinit.U b/U/Myinit.U
new file mode 100644
index 0000000000..885f07afaf
--- /dev/null
+++ b/U/Myinit.U
@@ -0,0 +1,42 @@
+?RCS: $Id: Myinit.U,v 3.0 1993/08/18 12:05:07 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: Myinit.U,v $
+?RCS: Revision 3.0 1993/08/18 12:05:07 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?X:
+?X: If you want to initialize any default values, copy this unit to your
+?X: personal U directory and add the assignments to the end. This file
+?X: is included after variables are initialized but before any old
+?X: config.sh file is read in.
+?X:
+?MAKE:Myinit libswanted : Init
+?MAKE: -pick add $@ %<
+?S:libswanted:
+?S: This variable holds a list of all the libraries we want to
+?S: search. The order is chosen to pick up the c library
+?S: ahead of ucb or bsd libraries for SVR4.
+?S:.
+?LINT:extern usevfork glibpth
+?LINT:change usevfork glibpth
+: List of libraries we want.
+?X: Put crypt here, even though I should really fix d_crypt.U to look
+?X: for it correctly, including possible shared library versions.
+libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
+libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
+libswanted="$libswanted ucb bsd BSD PW x"
+: We want to search /usr/shlib before most other libraries.
+: This is only used by ext/util/extliblist
+glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
+glibpth="/usr/shlib $glibpth"
+: Do not use vfork unless overridden by a hint file.
+usevfork=false
+
diff --git a/U/README b/U/README
new file mode 100644
index 0000000000..579c0ade1c
--- /dev/null
+++ b/U/README
@@ -0,0 +1,9 @@
+?X: These units are based on the ones supplied with dist-3.0.
+?X: They have been changed or enhanced to work with perl.
+?X: I would appreciate hearing about any changes, corrections,
+?X: or enhancements.
+?X: Andy Dougherty doughera@lafcol.lafayette.edu
+?X: Dept. of Physics
+?X: Lafayette College
+?X: Easton, PA 18042-1782
+?X: Wed Nov 9 15:34:15 EST 1994
diff --git a/U/ccflags.U b/U/ccflags.U
new file mode 100644
index 0000000000..c935281c3d
--- /dev/null
+++ b/U/ccflags.U
@@ -0,0 +1,288 @@
+?RCS: $Id: ccflags.U,v 3.0.1.6 1994/10/29 16:07:02 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: This is the same as dist's ccflags unit except that perl uses
+?RCS: -DDEBUGGING rather than -DDEBUG, and I also suggest a few other
+?RCS: flags the user might set, such as -DCRIPPLED_CC and -D_POSIX_SOURCE.
+?RCS:
+?RCS: $Log: ccflags.U,v $
+?RCS: Revision 3.0.1.6 1994/10/29 16:07:02 ram
+?RCS: patch36: gcc versionning no longer relies on the C compiler's name
+?RCS: patch36: simplified check for gcc version checking (ADO)
+?RCS:
+?RCS: Revision 3.0.1.5 1994/08/29 16:06:35 ram
+?RCS: patch32: propagate -posix flag from ccflags to ldflags
+?RCS:
+?RCS: Revision 3.0.1.4 1994/05/06 14:28:45 ram
+?RCS: patch23: -fpcc-struct-return only needed in gcc 1.x (ADO)
+?RCS: patch23: cppflags now computed on an option-by-option basis
+?RCS: patch23: magically added cc flags now only done the first time
+?RCS:
+?RCS: Revision 3.0.1.3 1993/09/13 15:58:29 ram
+?RCS: patch10: explicitely mention -DDEBUG just in case they need it (WAD)
+?RCS: patch10: removed all the "tans" variable usage (WAD)
+?RCS:
+?RCS: Revision 3.0.1.2 1993/08/27 14:39:38 ram
+?RCS: patch7: added support for OSF/1 machines
+?RCS:
+?RCS: Revision 3.0.1.1 1993/08/25 14:00:24 ram
+?RCS: patch6: added defaults for cppflags, ccflags and ldflags
+?RCS:
+?RCS: Revision 3.0 1993/08/18 12:05:31 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?MAKE:ccflags ldflags lkflags cppflags optimize: test cat Myread Guess \
+ Oldconfig +gccversion mips_type +usrinc package contains rm \
+ cppstdin cppminus cpprun cpplast
+?MAKE: -pick add $@ %<
+?S:ccflags:
+?S: This variable contains any additional C compiler flags desired by
+?S: the user. It is up to the Makefile to use this.
+?S:.
+?S:cppflags:
+?S: This variable holds the flags that will be passed to the C pre-
+?S: processor. It is up to the Makefile to use it.
+?S:.
+?S:optimize:
+?S: This variable contains any optimizer/debugger flag that should be used.
+?S: It is up to the Makefile to use it.
+?S:.
+?S:ldflags:
+?S: This variable contains any additional C loader flags desired by
+?S: the user. It is up to the Makefile to use this.
+?S:.
+?S:lkflags:
+?S: This variable contains any additional C partial linker flags desired by
+?S: the user. It is up to the Makefile to use this.
+?S:.
+?T:inctest thisincl xxx flag inclwanted ftry previous
+?D:cppflags=''
+?D:ccflags=''
+?D:ldflags=''
+?INIT:: no include file wanted by default
+?INIT:inclwanted=''
+?INIT:
+: determine optimize, if desired, or use for debug flag also
+case "$optimize" in
+' ') dflt='none';;
+'') dflt='-O';;
+*) dflt="$optimize";;
+esac
+$cat <<EOH
+
+Some C compilers have problems with their optimizers, by default, $package
+compiles with the -O flag to use the optimizer. Alternately, you might want
+to use the symbolic debugger, which uses the -g flag (on traditional Unix
+systems). Either flag can be specified here. To use neither flag, specify
+the word "none".
+
+EOH
+rp="What optimizer/debugger flag should be used?"
+. ./myread
+optimize="$ans"
+case "$optimize" in
+'none') optimize=" ";;
+esac
+
+dflt=''
+case "$ccflags" in
+'')
+ case "$gccversion" in
+ 1*) dflt='-fpcc-struct-return' ;;
+ esac
+ case "$optimize" in
+ *-g*) dflt="$dflt -DDEBUGGING";;
+ esac
+?X: check for POSIXized ISC
+ case "$gccversion" in
+ 2*) if test -d /etc/conf/kconfig.d &&
+ $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
+ then
+ dflt="$dflt -posix"
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+?X: In USG mode, a MIPS system may need some BSD includes
+case "$mips_type" in
+*BSD*) ;;
+'') ;;
+*) inclwanted="$inclwanted $usrinc/bsd";;
+esac
+for thisincl in $inclwanted; do
+ if $test -d $thisincl; then
+ if $test x$thisincl != x$usrinc; then
+ case "$dflt" in
+ *$thisincl*);;
+ *) dflt="$dflt -I$thisincl";;
+ esac
+ fi
+ fi
+done
+
+?X: Include test function (header, symbol)
+inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
+ xxx=true;
+elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
+ xxx=true;
+else
+ xxx=false;
+fi;
+if $xxx; then
+ case "$dflt" in
+ *$2*);;
+ *) dflt="$dflt -D$2";;
+ esac;
+fi'
+
+?X:
+?X: SCO unix uses NO_PROTOTYPE instead of _NO_PROTO
+?X: OSF/1 uses __LANGUAGE_C__ instead of LANGUAGE_C
+?X:
+if ./osf1; then
+ set signal.h __LANGUAGE_C__; eval $inctest
+else
+ set signal.h LANGUAGE_C; eval $inctest
+fi
+set signal.h NO_PROTOTYPE; eval $inctest
+set signal.h _NO_PROTO; eval $inctest
+
+case "$dflt" in
+'') dflt=none;;
+esac
+case "$ccflags" in
+'') ;;
+*) dflt="$ccflags";;
+esac
+$cat <<EOH
+
+Your C compiler may want other flags. For this question you should include
+-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
+but you should NOT include libraries or ld flags like -lwhatever. If you
+want $package to honor its debug switch, you should include -DDEBUGGING here.
+Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
+-DHIDEMYMALLOC or -DCRIPPLED_CC.
+
+To use no flags, specify the word "none".
+
+EOH
+?X: strip leading space
+set X $dflt
+shift
+dflt=${1+"$@"}
+rp="Any additional cc flags?"
+. ./myread
+case "$ans" in
+none) ccflags='';;
+*) ccflags="$ans";;
+esac
+
+: the following weeds options from ccflags that are of no interest to cpp
+cppflags="$ccflags"
+case "$gccversion" in
+1*) cppflags="$cppflags -D__GNUC__"
+esac
+case "$mips_type" in
+'');;
+*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
+esac
+case "$cppflags" in
+'');;
+*)
+ echo " "
+ echo "Let me guess what the preprocessor flags are..." >&4
+ set X $cppflags
+ shift
+ cppflags=''
+ $cat >cpp.c <<'EOM'
+#define BLURFL foo
+
+BLURFL xx LFRULB
+EOM
+?X:
+?X: For each cc flag, try it out with both cppstdin and cpprun, since the
+?X: first is almost surely a cc wrapper. We have to try both in case
+?X: of cc flags like '-Olimit 2900' that are actually two words...
+?X:
+ previous=''
+ for flag in $*
+ do
+ case "$flag" in
+ -*) ftry="$flag";;
+ *) ftry="$previous $flag";;
+ esac
+ if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
+ >cpp1.out 2>/dev/null && \
+ $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
+ >cpp2.out 2>/dev/null && \
+ $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
+ $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
+ then
+ cppflags="$cppflags $ftry"
+ previous=''
+ else
+ previous="$flag"
+ fi
+ done
+ set X $cppflags
+ shift
+ cppflags=${1+"$@"}
+ case "$cppflags" in
+ *-*) echo "They appear to be: $cppflags";;
+ esac
+ $rm -f cpp.c cpp?.out
+ ;;
+esac
+
+: flags used in final linking phase
+case "$ldflags" in
+'') if ./venix; then
+ dflt='-i -z'
+ else
+ dflt=''
+ fi
+ case "$ccflags" in
+ *-posix*) dflt="$dflt -posix" ;;
+ esac
+ case "$dflt" in
+ '') dflt='none' ;;
+ esac
+ ;;
+*) dflt="$ldflags";;
+esac
+echo " "
+rp="Any additional ld flags (NOT including libraries)?"
+. ./myread
+case "$ans" in
+none) ldflags='';;
+*) ldflags="$ans";;
+esac
+rmlist="$rmlist pdp11"
+
+@if lkflags
+: partial linking may need other flags
+case "$lkflags" in
+'') case "$ldflags" in
+ '') dflt='none';;
+ *) dflt="$ldflags";;
+ esac;;
+*) dflt="$lkflags";;
+esac
+echo " "
+rp="Partial linking flags to be used (NOT including -r)?"
+. ./myread
+case "$ans" in
+none) lkflags='';;
+*) lkflags="$ans";;
+esac
+
+@end
diff --git a/U/d_dlsymun.U b/U/d_dlsymun.U
new file mode 100644
index 0000000000..7831c4ac48
--- /dev/null
+++ b/U/d_dlsymun.U
@@ -0,0 +1,102 @@
+?RCS: $Id: d_dlsymun.U,v $
+?RCS:
+?RCS: $Log: d_dlsymun.U,v $
+?RCS:
+?MAKE:d_dlsymun: cat cc ccflags ldflags rm Setvar dlsrc i_dlfcn \
+ cccdlflags ccdlflags lddlflags libs dlext
+?MAKE: -pick add $@ %<
+?X: This is specific to perl5.
+?S:d_dlsymun:
+?S: This variable conditionally defines DLSYM_NEEDS_UNDERSCORE, which
+?S: indicates that we need to prepend an underscore to the symbol
+?S: name before calling dlsym().
+?S:.
+?C:DLSYM_NEEDS_UNDERSCORE:
+?C: This symbol, if defined, indicates that we need to prepend an
+?C: underscore to the symbol name before calling dlsym(). This only
+?C: makes sense if you *have* dlsym, which we will presume is the
+?C: case if you're using dl_dlopen.xs.
+?C:.
+?H:#$d_dlsymun DLSYM_NEEDS_UNDERSCORE /* */
+?H:.
+?F: !fred
+?LINT:set d_dlsymun
+?T: xxx
+: Check if dlsym need a leading underscore
+echo " "
+val="$undef"
+
+case "$dlsrc" in
+dl_dlopen.xs)
+ echo "Checking whether your dlsym() needs a leading underscore ..." >&4
+ $cat >dyna.c <<'EOM'
+fred () { }
+EOM
+
+$cat >fred.c<<EOM
+
+#include <stdio.h>
+#$i_dlfcn I_DLFCN
+#ifdef I_DLFCN
+#include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
+#else
+#include <sys/types.h>
+#include <nlist.h>
+#include <link.h>
+#endif
+
+extern int fred() ;
+
+main()
+{
+ void * handle ;
+ void * symbol ;
+#ifndef RTLD_LAZY
+ int mode = 1 ;
+#else
+ int mode = RTLD_LAZY ;
+#endif
+ handle = dlopen("./dyna.$dlext", mode) ;
+ if (handle == NULL) {
+ printf ("1\n") ;
+ exit(0);
+ }
+ symbol = dlsym(handle, "fred") ;
+ if (symbol == NULL) {
+ /* try putting a leading underscore */
+ symbol = dlsym(handle, "_fred") ;
+ if (symbol == NULL) {
+ printf ("2\n") ;
+ exit(0);
+ }
+ printf ("3\n") ;
+ }
+ else
+ printf ("4\n") ;
+ exit(0);
+}
+EOM
+ if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
+ ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
+ $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
+ xxx=`./fred`
+ case $xxx in
+ 1) echo "Test program failed using dlopen." >&4
+ echo "Perhaps you should not use dynamic loading." >&4;;
+ 2) echo "Test program failed using dlsym." >&4
+ echo "Perhaps you should not use dynamic loading." >&4;;
+ 3) echo "dlsym needs a leading underscore" >&4
+ val="$define" ;;
+ 4) echo "dlsym doesn't need a leading underscore." >&4;;
+ esac
+ else
+ echo "I can't compile and run the test program." >&4
+ fi
+ ;;
+esac
+
+$rm -f fred fred.? dyna.$dlext dyna.?
+
+set d_dlsymun
+eval $setvar
+
diff --git a/U/dlext.U b/U/dlext.U
new file mode 100644
index 0000000000..8483197a3b
--- /dev/null
+++ b/U/dlext.U
@@ -0,0 +1,48 @@
+?RCS: $Id: dlsrc.U,v$
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: dlsrc.U,v $
+?RCS:
+?X: hpux support thanks to Jeff Okamoto <okamoto@hpcc101.corp.hp.com>
+?X:
+?X: To create a shared library, you must compile ALL source files in the
+?X: library with +z (or possibly +Z if the library is whopping huge),
+?X: then link the library with -b. Example:
+?X: cc -c +z module_a.c
+?X: cc -c +z module_b.c
+?X: ld -b module_a.o module_b.o -o module.sl
+?X:
+?MAKE:dlext: \
+ Getfile Myread cat usedl so
+?MAKE: -pick add $@ %<
+?S:dlext:
+?S: This variable contains the extension that is to be used for the
+?S: dynamically loaded modules that perl generaties.
+?S:.
+case "$usedl" in
+$define|y|true)
+ $cat << EOM
+
+On a few systems, the dynamically loaded modules that perl generates and uses
+will need a different extension then shared libs. The default will probably
+be appropriate.
+
+EOM
+ case "$dlext" in
+ '') dflt="$so" ;;
+ *) dflt="$dlext" ;;
+ esac
+ rp='What is the extension of dynamically loaded modules'
+ . ./myread
+ dlext="$ans"
+ ;;
+*)
+ dlext="none"
+ ;;
+esac
+
diff --git a/U/dlsrc.U b/U/dlsrc.U
new file mode 100644
index 0000000000..412e274abf
--- /dev/null
+++ b/U/dlsrc.U
@@ -0,0 +1,259 @@
+?RCS: $Id: dlsrc.U,v$
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: dlsrc.U,v $
+?RCS:
+?X: hpux support thanks to Jeff Okamoto <okamoto@hpcc101.corp.hp.com>
+?X:
+?X: To create a shared library, you must compile ALL source files in the
+?X: library with +z (or possibly +Z if the library is whopping huge),
+?X: then link the library with -b. Example:
+?X: cc -c +z module_a.c
+?X: cc -c +z module_b.c
+?X: ld -b module_a.o module_b.o -o module.sl
+?X:
+?MAKE:usedl dlsrc cccdlflags lddlflags ccdlflags d_shrplib shrpdir: \
+ Getfile Myread test osname sed i_dld d_dlopen Findhdr Setvar \
+ cc ldflags cat archlib
+?MAKE: -pick add $@ %<
+?S:usedl:
+?S: This variable indicates if the the system supports dynamic
+?S: loading of some sort. See also dlsrc and dlobj.
+?S:.
+?S:dlsrc:
+?S: This variable contains the name of the dynamic loading file that
+?S: will be used with the package.
+?S:.
+?S:cccdlflags:
+?S: This variable contains any special flags that might need to be
+?S: passed with cc -c to compile modules to be used to create a shared
+?S: library that will be used for dynamic loading. For hpux, this
+?S: should be +z. It is up to the makefile to use it.
+?S:.
+?S:lddlflags:
+?S: This variable contains any special flags that might need to be
+?S: passed to ld to create a shared library suitable for dynamic
+?S: loading. It is up to the makefile to use it. For hpux, it
+?S: should be -b. For sunos 4.1, it is empty.
+?S:.
+?S:ccdlflags:
+?S: This variable contains any special flags that might need to be
+?S: passed to cc to link with a shared library for dynamic loading.
+?S: It is up to the makefile to use it. For sunos 4.1, it should
+?S: be empty.
+?S:.
+?S:d_shrplib:
+?S: This variable indicates whether libperl should be made as a
+?S: shared library. This must be true for dynamic loading to
+?S: work on (some) System V Release 4 systems.
+?S:.
+?S:shrpdir:
+?S: This variable contains the directory where the libperl shared
+?S: library will be installed. LD_RUN_PATH is set to this when
+?S: linking with libperl (unless it is /usr/lib, the default).
+?S:.
+?C:USE_DYNAMIC_LOADING ~ %<:
+?C: This symbol, if defined, indicates that dynamic loading of
+?C: some sort is available.
+?C:.
+?H:?%<:#$usedl USE_DYNAMIC_LOADING /**/
+?H:.
+?W:%<:dlopen
+?LINT: set d_shrplib shrpdir
+?T:dldir
+: determine which dynamic loading, if any, to compile in
+echo " "
+dldir="ext/DynaLoader"
+case "$usedl" in
+$define|y|true)
+ dflt='y'
+ usedl="$define"
+ ;;
+$undef|n|false)
+ dflt='n'
+ usedl="$undef"
+ ;;
+*)
+ dflt='n'
+ case "$d_dlopen" in
+ $define) dflt='y' ;;
+ esac
+ case "$i_dld" in
+ $define) dflt='y' ;;
+ esac
+ : Does a dl_xxx.xs file exist for this operating system
+ $test -f ../$dldir/dl_${osname}.xs && dflt='y'
+ ;;
+esac
+rp="Do you wish to use dynamic loading?"
+. ./myread
+usedl="$ans"
+case "$ans" in
+y*) usedl="$define"
+ case "$dlsrc" in
+ '')
+ if $test -f ../$dldir/dl_${osname}.xs ; then
+ dflt="$dldir/dl_${osname}.xs"
+ elif $test "$d_dlopen" = "$define" ; then
+ dflt="$dldir/dl_dlopen.xs"
+ elif $test "$i_dld" = "$define" ; then
+ dflt="$dldir/dl_dld.xs"
+ else
+ dflt=''
+ fi
+ ;;
+ *) dflt="$dldir/$dlsrc"
+ ;;
+ esac
+ echo "The following dynamic loading files are available:"
+ : Can not go over to $dldir because getfile has path hard-coded in.
+ cd ..; ls -C $dldir/dl*.xs; cd UU
+ rp="Source file to use for dynamic loading"
+ fn="fne~"
+ . ./getfile
+ usedl="$define"
+ : emulate basename
+ dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
+ $cat << EOM
+
+Some systems may require passing special flags to $cc -c to
+compile modules that will be used to create a shared library.
+To use no flags, say "none".
+
+EOM
+ case "$cccdlflags" in
+ ''|' ') case "$cc" in
+ *gcc*) dflt='-fpic' ;;
+ *) case "$osname" in
+ hpux) dflt='+z' ;;
+ next) dflt='none' ;;
+ solaris) dflt='-K pic' ;;
+ sunos) dflt='-pic' ;;
+ svr4*|esix*) dflt='-Kpic' ;;
+ *) dflt='none' ;;
+ esac ;;
+ esac ;;
+ *) dflt="$cccdlflags" ;;
+ esac
+ rp="Any special flags to pass to $cc -c to compile shared library modules?"
+ . ./myread
+ case "$ans" in
+ none) cccdlflags='' ;;
+ *) cccdlflags="$ans" ;;
+ esac
+
+ cat << 'EOM'
+
+Some systems may require passing special flags to ld to create a
+library that can be dynamically loaded. If your ld flags include
+-L/other/path options to locate libraries outside your loader's normal
+search path, you may need to specify those -L options here as well. To
+use no flags, say "none".
+
+EOM
+?X: I have received one report that NeXT requires -r here.
+?X: On SunOS 4.1.3, that makes the library no longer shared.
+?X: This stuff probably all belongs in hints files anyway.
+ case "$lddlflags" in
+ ''|' ') case "$osname" in
+ hpux) dflt='-b' ;;
+ next) dflt='none' ;;
+ solaris) dflt='-G' ;;
+ sunos) dflt='-assert nodefinitions' ;;
+ svr4*|esix*) dflt="-G $ldflags" ;;
+ *) dflt='none' ;;
+ esac
+ ;;
+ *) dflt="$lddlflags" ;;
+ esac
+ rp="Any special flags to pass to ld to create a dynamically loaded library?"
+ . ./myread
+ case "$ans" in
+ none) lddlflags='' ;;
+ *) lddlflags="$ans" ;;
+ esac
+
+ cat <<EOM
+
+Some systems may require passing special flags to $cc to indicate that
+the resulting executable will use dynamic linking. To use no flags,
+say "none".
+
+EOM
+ case "$ccdlflags" in
+ ''|' ') case "$osname" in
+ hpux) dflt='none' ;;
+ next) dflt='none' ;;
+ sunos) dflt='none' ;;
+ *) dflt='none' ;;
+ esac ;;
+ *) dflt="$ccdlflags" ;;
+ esac
+ rp="Any special flags to pass to $cc to use dynamic loading?"
+ . ./myread
+ case "$ans" in
+ none) ccdlflags='' ;;
+ *) ccdlflags="$ans" ;;
+ esac
+ ;;
+?X: End of usedl=y section
+*) usedl="$undef"
+ dlsrc='dl_none.xs'
+ lddlflags=''
+ ccdlflags=''
+ ;;
+esac
+
+?X: Currently libperl is only created as a shared library if
+?X: using dynamic loading on a SysVR4 system. Feel free to
+?X: add prompts here to allow the user to choose a shared
+?X: libperl in other cases.
+val="$undef"
+case "$osname" in
+esix*|svr4*)
+ case "$usedl" in
+ $define)
+ $cat <<EOM
+
+System V Release 4 systems can support dynamic loading
+only if libperl is created as a shared library.
+
+EOM
+ val="$define"
+ ;;
+ esac ;;
+esac
+set d_shrplib; eval $setvar
+case "$d_shrplib" in
+$define)
+ cat <<EOM >&4
+
+Be sure to add the perl source directory to the LD_LIBRARY_PATH
+environment variable before running make:
+ LD_LIBRARY_PATH=`cd ..;pwd`; export LD_LIBRARY_PATH
+or
+ setenv LD_LIBRARY_PATH `cd ..;pwd`
+
+EOM
+;;
+esac
+case "$d_shrplib" in
+$define)
+ case "$shrpdir" in
+ "") dflt="$archlib/CORE";;
+ *) dflt="$shrpdir";;
+ esac
+ rp="What directory should we install the shared libperl into?"
+ fn="d~"
+ . ./getfile
+ shrpdir="$ans"
+ ;;
+*) shrpdir='none'
+ ;;
+esac
+
diff --git a/U/i_db.U b/U/i_db.U
new file mode 100644
index 0000000000..aaa2389a72
--- /dev/null
+++ b/U/i_db.U
@@ -0,0 +1,132 @@
+?RCS: $Id: i_db.U,v 3.0.1.1 1994/08/29 16:21:50 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
+?RCS:
+?RCS: $Log: i_db.U,v $
+?RCS: Revision 3.0.1.1 1994/08/29 16:21:50 ram
+?RCS: patch32: created by ADO
+?RCS:
+?MAKE:i_db db_hashtype db_prefixtype: Inhdr +cc +ccflags rm contains
+?MAKE: -pick add $@ %<
+?S:i_db:
+?S: This variable conditionally defines the I_DB symbol, and indicates
+?S: whether a C program may include Berkeley's DB include file <db.h>.
+?S:.
+?S:db_hashtype:
+?S: This variable contains the type of the hash structure element
+?S: in the <db.h> header file. In older versions of DB, it was
+?S: int, while in newer ones it is u_int32_t.
+?S:.
+?S:db_prefixtype:
+?S: This variable contains the type of the prefix structure element
+?S: in the <db.h> header file. In older versions of DB, it was
+?S: int, while in newer ones it is size_t.
+?S:.
+?C:I_DB:
+?C: This symbol, if defined, indicates to the C program that it should
+?C: include Berkeley's DB include file <db.h>.
+?C:.
+?C:DB_Prefix_t:
+?C: This symbol contains the type of the prefix structure element
+?C: in the <db.h> header file. In older versions of DB, it was
+?C: int, while in newer ones it is u_int32_t.
+?C:.
+?C:DB_Hash_t:
+?C: This symbol contains the type of the prefix structure element
+?C: in the <db.h> header file. In older versions of DB, it was
+?C: int, while in newer ones it is size_t.
+?C:.
+?H:#$i_db I_DB /**/
+?H:#define DB_Hash_t "$db_hashtype" /**/
+?H:#define DB_Prefix_t "$db_prefixtype" /**/
+?H:.
+?F:!try.c !try.o
+?LINT:set i_db
+: see if this is a db.h system
+set db.h i_db
+eval $inhdr
+
+@if DB_Hash_t
+case "$i_db" in
+define)
+ : Check the return type needed for hash
+ 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 ;
+{
+}
+HASHINFO info ;
+main()
+{
+ info.hash = hash_cb ;
+}
+EOCP
+ if $cc $ccflags -c try.c >try.out 2>&1 ; then
+ if $contains warning try.out >>/dev/null 2>&1 ; then
+ db_hashtype='int'
+ else
+ db_hashtype='u_int32_t'
+ fi
+ else
+ echo "I can't seem to compile the test program." >&4
+ db_hashtype=int
+ fi
+ $rm -f try.[co]
+ echo "Your version of Berkeley DB uses $db_hashtype for hash."
+ ;;
+*) db_hashtype=int
+ ;;
+esac
+@end
+
+@if DB_Prefix_t
+case "$i_db" in
+define)
+ : Check the return type needed for prefix
+ 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 ;
+{
+}
+BTREEINFO info ;
+main()
+{
+ info.prefix = prefix_cb ;
+}
+EOCP
+ if $cc $ccflags -c try.c >try.out 2>&1 ; then
+ if $contains warning try.out >>/dev/null 2>&1 ; then
+ db_prefixtype='int'
+ else
+ db_prefixtype='size_t'
+ fi
+ else
+ echo "I can't seem to compile the test program." >&4
+ db_prefixtype='int'
+ fi
+ $rm -f try.[co]
+ echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
+ ;;
+*) db_prefixtype='int'
+ ;;
+esac
+@end
+
diff --git a/U/i_dbm.U b/U/i_dbm.U
new file mode 100644
index 0000000000..99bd346276
--- /dev/null
+++ b/U/i_dbm.U
@@ -0,0 +1,52 @@
+?RCS: $Id: i_dbm.U,v 3.0 1993/08/18 12:08:19 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: i_dbm.U,v $
+?RCS: Revision 3.0 1993/08/18 12:08:19 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?MAKE:i_dbm: Inhdr Inlibc Setvar
+?MAKE: -pick add $@ %<
+?S:i_dbm (d_odbm):
+?S: This variable conditionally defines the I_DBM symbol, which
+?S: indicates to the C program that dbm.h exists and should
+?S: be included.
+?S:.
+?C:I_DBM (HAS_ODBM ODBM):
+?C: This symbol, if defined, indicates that dbm.h exists and should
+?C: be included.
+?C:.
+?H:#$i_dbm I_DBM /**/
+?H:.
+?T: t_dbm d_dbmclose
+?LINT:set i_dbm
+: see if dbm.h is available
+?X: t_dbm is a tentative check. We might just have the header, not
+?X: the library. We look for dbmclose() rather than dbminit() because
+?X: some versions of SCO Unix have -ldbm, but are missing dbmclose().
+set dbm.h t_dbm
+eval $inhdr
+case "$t_dbm" in
+$define)
+ : see if dbmclose exists
+ set dbmclose d_dbmclose
+ eval $inlibc
+ case "$d_dbmclose" in
+ $undef)
+ t_dbm="$undef"
+ echo "We won't be including <dbm.h>"
+ ;;
+ esac
+ ;;
+esac
+val="$t_dbm"
+set i_dbm
+eval $setvar
+
diff --git a/U/i_gdbm.U b/U/i_gdbm.U
new file mode 100644
index 0000000000..d9ca1bc16d
--- /dev/null
+++ b/U/i_gdbm.U
@@ -0,0 +1,51 @@
+?RCS: $Id: i_gdbm.U,v 3.0 1993/08/18 12:08:19 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: i_gdbm.U,v $
+?RCS: Revision 3.0 1993/08/18 12:08:19 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?MAKE:i_gdbm: Inhdr Inlibc Setvar
+?MAKE: -pick add $@ %<
+?S:i_gdbm (d_gdbm):
+?S: This variable conditionally defines the I_GDBM symbol, which
+?S: indicates to the C program that gdbm.h exists and should
+?S: be included.
+?S:.
+?C:I_GDBM (HAS_GDBM):
+?C: This symbol, if defined, indicates that gdbm.h exists and should
+?C: be included.
+?C:.
+?H:#$i_gdbm I_GDBM /**/
+?H:.
+?T: t_gdbm d_gdbm_open
+?LINT:set i_gdbm
+: see if gdbm.h is available
+?X: t_gdbm is a tentative check. We might just have the header, not
+?X: the library.
+set gdbm.h t_gdbm
+eval $inhdr
+case "$t_gdbm" in
+$define)
+ : see if gdbm_open exists
+ set gdbm_open d_gdbm_open
+ eval $inlibc
+ case "$d_gdbm_open" in
+ $undef)
+ t_gdbm="$undef"
+ echo "We won't be including <gdbm.h>"
+ ;;
+ esac
+ ;;
+esac
+val="$t_gdbm"
+set i_gdbm
+eval $setvar
+
diff --git a/U/i_ndbm.U b/U/i_ndbm.U
new file mode 100644
index 0000000000..62bcb7c38b
--- /dev/null
+++ b/U/i_ndbm.U
@@ -0,0 +1,51 @@
+?RCS: $Id: i_ndbm.U,v 3.0 1993/08/18 12:08:19 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: i_ndbm.U,v $
+?RCS: Revision 3.0 1993/08/18 12:08:19 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?MAKE:i_ndbm: Inhdr Inlibc Setvar
+?MAKE: -pick add $@ %<
+?S:i_ndbm (d_ndbm):
+?S: This variable conditionally defines the I_NDBM symbol, which
+?S: indicates to the C program that ndbm.h exists and should
+?S: be included.
+?S:.
+?C:I_NDBM (HAS_NDBM NDBM):
+?C: This symbol, if defined, indicates that ndbm.h exists and should
+?C: be included.
+?C:.
+?H:#$i_ndbm I_NDBM /**/
+?H:.
+?T: t_ndbm d_dbm_open
+?LINT:set i_ndbm
+: see if ndbm.h is available
+?X: t_ndbm is a tentative check. We might just have the header, not
+?X: the library.
+set ndbm.h t_ndbm
+eval $inhdr
+case "$t_ndbm" in
+$define)
+ : see if dbm_open exists
+ set dbm_open d_dbm_open
+ eval $inlibc
+ case "$d_dbm_open" in
+ $undef)
+ t_ndbm="$undef"
+ echo "We won't be including <ndbm.h>"
+ ;;
+ esac
+ ;;
+esac
+val="$t_ndbm"
+set i_ndbm
+eval $setvar
+
diff --git a/U/mallocsrc.U b/U/mallocsrc.U
new file mode 100644
index 0000000000..83560e8134
--- /dev/null
+++ b/U/mallocsrc.U
@@ -0,0 +1,126 @@
+?RCS: $Id: mallocsrc.U,v 3.0.1.1 1994/05/06 15:10:46 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: mallocsrc.U,v $
+?RCS: Revision 3.0.1.1 1994/05/06 15:10:46 ram
+?RCS: patch23: added support for MYMALLOC, mainly for perl5 (ADO)
+?RCS:
+?RCS: Revision 3.0 1993/08/18 12:09:12 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?MAKE:mallocsrc mallocobj usemymalloc malloctype d_mymalloc: Myread \
+ Oldconfig package Guess Setvar rm cat +cc +ccflags Findhdr \
+ i_malloc sed libs
+?MAKE: -pick add $@ %<
+?S:usemymalloc:
+?S: This variable contains y if the malloc that comes with this package
+?S: is desired over the system's version of malloc. People often include
+?S: special versions of malloc for effiency, but such versions are often
+?S: less portable. See also mallocsrc and mallocobj.
+?S: If this is 'y', then -lmalloc is removed from $libs.
+?S:.
+?S:mallocsrc:
+?S: This variable contains the name of the malloc.c that comes with
+?S: the package, if that malloc.c is preferred over the system malloc.
+?S: Otherwise the value is null. This variable is intended for generating
+?S: Makefiles.
+?S:.
+?S:d_mymalloc:
+?S: This variable conditionally defines MYMALLOC in case other parts
+?S: of the source want to take special action if MYMALLOC is used.
+?S: This may include different sorts of profiling or error detection.
+?S:.
+?S:mallocobj:
+?S: This variable contains the name of the malloc.o that this package
+?S: generates, if that malloc.o is preferred over the system malloc.
+?S: Otherwise the value is null. This variable is intended for generating
+?S: Makefiles. See mallocsrc.
+?S:.
+?S:malloctype:
+?S: This variable contains the kind of ptr returned by malloc and realloc.
+?S:.
+?C:Malloc_t (MALLOCPTRTYPE):
+?C: This symbol is the type of pointer returned by malloc and realloc.
+?C:.
+?H:#define Malloc_t $malloctype /**/
+?H:.
+?C:MYMALLOC:
+?C: This symbol, if defined, indicates that we're using our own malloc.
+?C:.
+?H:#$d_mymalloc MYMALLOC /**/
+?H:.
+?LINT:change libs
+?X: Cannot test for mallocsrc; it is the unit's name and there is a bug in
+?X: the interpreter which defines all the names, even though they are not used.
+@if mallocobj
+: determine which malloc to compile in
+echo " "
+case "$usemymalloc" in
+''|y*|true) dflt='y' ;;
+n*|false) dflt='n' ;;
+*) dflt="$usemymalloc" ;;
+esac
+rp="Do you wish to attempt to use the malloc that comes with $package?"
+. ./myread
+usemymalloc="$ans"
+case "$ans" in
+y*|true)
+ usemymalloc='y'
+ mallocsrc='malloc.c'
+ mallocobj='malloc.o'
+ d_mymalloc="$define"
+?X: Maybe libs.U should be dependent on mallocsrc.U, but then
+?X: most packages that use dist probably don't supply their own
+?X: malloc, so this is probably an o.k. comprpomise
+ case "$libs" in
+ *-lmalloc*)
+ : Remove malloc from list of libraries to use
+ echo "Removing unneeded -lmalloc from library list" >&4
+ set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
+ shift
+ libs="$*"
+ echo "libs = $libs" >&4
+ ;;
+ esac
+ ;;
+*)
+ usemymalloc='n'
+ mallocsrc=''
+ mallocobj=''
+ d_mymalloc="$undef"
+ ;;
+esac
+
+@end
+@if MALLOCPTRTYPE || Malloc_t
+: compute the type returned by malloc
+echo " "
+case "$malloctype" in
+'')
+ $cat >malloc.c <<END
+#$i_malloc I_MALLOC
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef I_MALLOC
+#include <malloc.h>
+#endif
+void *malloc();
+END
+ if $cc $ccflags -c malloc.c >/dev/null 2>&1; then
+ malloctype='void *'
+ else
+ malloctype='char *'
+ fi
+ $rm -f malloc.[co]
+ ;;
+esac
+echo "Your system wants malloc to return '$malloctype', it would seem." >&4
+
+@end