summaryrefslogtreecommitdiff
path: root/usr.bin/vi/build
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/vi/build')
-rw-r--r--usr.bin/vi/build/Makefile38
-rw-r--r--usr.bin/vi/build/README371
-rw-r--r--usr.bin/vi/build/config.h138
-rw-r--r--usr.bin/vi/build/pathnames.h45
-rw-r--r--usr.bin/vi/build/port.h180
5 files changed, 772 insertions, 0 deletions
diff --git a/usr.bin/vi/build/Makefile b/usr.bin/vi/build/Makefile
new file mode 100644
index 00000000000..6a910754bb1
--- /dev/null
+++ b/usr.bin/vi/build/Makefile
@@ -0,0 +1,38 @@
+# $NetBSD: Makefile,v 1.2 1996/05/20 05:01:36 mrg Exp $
+#
+# from: @(#)Makefile.in 8.56 (Berkeley) 5/18/96
+
+CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include
+
+LDADD+= -lcurses -ltermcap
+PROG= vi
+SRCS= cl_bsd.c cl_funcs.c cl_main.c cl_read.c cl_screen.c cl_term.c \
+ cut.c delete.c ex.c ex_abbrev.c ex_append.c ex_args.c ex_argv.c \
+ ex_at.c ex_bang.c ex_cd.c ex_cmd.c ex_cscope.c ex_delete.c \
+ ex_display.c ex_edit.c ex_equal.c ex_file.c ex_filter.c \
+ ex_global.c ex_init.c ex_join.c ex_map.c ex_mark.c ex_mkexrc.c \
+ ex_move.c ex_open.c ex_perl.c ex_preserve.c ex_print.c ex_put.c \
+ ex_quit.c ex_read.c ex_screen.c ex_script.c ex_set.c ex_shell.c \
+ ex_shift.c ex_source.c ex_stop.c ex_subst.c ex_tag.c ex_tcl.c \
+ ex_txt.c ex_undo.c ex_usage.c ex_util.c ex_version.c ex_visual.c \
+ ex_write.c ex_yank.c ex_z.c exf.c getc.c key.c line.c log.c main.c \
+ mark.c msg.c options.c options_f.c put.c recover.c screen.c \
+ search.c seq.c util.c v_at.c v_ch.c v_cmd.c v_delete.c v_ex.c \
+ v_increment.c v_init.c v_itxt.c v_left.c v_mark.c v_match.c \
+ v_paragraph.c v_put.c v_redraw.c v_replace.c v_right.c v_screen.c \
+ v_scroll.c v_search.c v_section.c v_sentence.c v_status.c v_txt.c \
+ v_ulcase.c v_undo.c v_util.c v_word.c v_xchar.c v_yank.c v_z.c \
+ v_zexit.c vi.c vs_line.c vs_msg.c vs_refresh.c vs_relative.c \
+ vs_smap.c vs_split.c
+
+LINKS= ${BINDIR}/vi ${BINDIR}/ex ${BINDIR}/vi ${BINDIR}/view
+MLINKS= vi.1 ex.1 vi.1 view.1
+
+.PATH: ${.CURDIR}/../vi ${.CURDIR}/../svi ${.CURDIR}/../ex ${.CURDIR}/../sex ${.CURDIR}/../cl ${.CURDIR}/../common ${.CURDIR}/../docs/USD.doc/vi.man
+.include <bsd.prog.mk>
+.include "../../Makefile.inc"
+
+cat= dutch english german ru_SU.KOI8-R swedish
+datadir= /usr/share
+afterinstall:
+ (cd ${.CURDIR}/../catalog && install -m $(NONBINMODE) -c $(cat) $(datadir)/vi/catalog )
diff --git a/usr.bin/vi/build/README b/usr.bin/vi/build/README
new file mode 100644
index 00000000000..b6e59e0c82d
--- /dev/null
+++ b/usr.bin/vi/build/README
@@ -0,0 +1,371 @@
+# @(#)README 8.20 (Berkeley) 5/12/96
+
+Nvi uses the GNU autoconf program for configuration and compilation. You
+should enter:
+
+ configure
+ make
+
+and nvi will configure the system and build one or two binaries: nvi and
+tknvi. You can use any path to the configure script, e.g., to build for
+an x86 architecture, you might do:
+
+ mkdir build.x86
+ cd build.x86
+ ../build/configure
+ make
+
+If you're only building nvi for a single architecture, you can just use
+the path ./configure, and build it in this directory.
+
+There are options that you can specify to the configure command. See
+the next section for a description of these options.
+
+If you want to rebuild or reconfigure nvi, for example, because you change
+your mind as to the curses library that you want to use, enter:
+
+ make distclean
+
+and then reconfigure using "configure" and whatever options you choose.
+
+By default, nvi is installed as "vi", with hard links to "ex" and "view".
+To install them using different names, use the configure program options.
+For example, to install them as "nvi", "nex" and "nview", use:
+
+ configure --program-prefix=n
+
+See the section below on installation for details.
+
+If you have trouble with this procedure, send email to the addresses
+listed in ../README. In that email, please provide a complete script
+of the output for all of the above commands that you entered.
+
+=-=-=-=-=-=-=
+NVI'S OPTIONS TO THE CONFIGURE PROGRAM
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+There are many options that you can enter to the configuration program.
+To see a complete list of the options, enter "configure --help". Only
+a few of them are nvi specific. These options are as follows:
+
+ --disable-curses DON'T use the nvi-provided curses routines.
+ --disable-db DON'T use the nvi-provided DB routines.
+ --disable-re DON'T use the nvi-provided RE routines.
+ --enable-debug Build a debugging version.
+ --enable-perlinterp Include a Perl interpreter in vi.
+ --enable-tclinterp Include a Tk/Tcl interpreter in vi.
+ --enable-tknvi Build a Tk/Tcl front-end for vi.
+
+disable-curses:
+ By default, nvi loads its own implementation of the curses
+ routines (which are a stripped-down version of the 4.4BSD curses
+ library). If you have your own curses library implementation and
+ you want to use it instead, enter:
+
+ --disable-curses
+
+ as an argument to configure, and the curses routines will be taken
+ from whatever libraries you load. Note: System V based curses
+ implementations are usually broken. See the last section of this
+ README for further information about nvi and the curses library.
+
+disable-db:
+ By default, nvi loads its own versions of the Berkeley DB routines
+ (which are a stripped-down version of DB 1.85). If you have your
+ own version of the Berkeley DB routines and you want to use them
+ instead, enter:
+
+ --disable-db
+
+ as an argument to configure, and the DB routines will be taken
+ from whatever libraries you load. Make sure that the DB routines
+ you use are at least version 1.85 or later.
+
+disable-re:
+ By default, nvi loads its own versions of the POSIX 1003.2 Regular
+ Expression routines (which are Henry Spencer's implementation).
+ If your C library contains an implementation of the POSIX 1003.2
+ RE routines (note, this is NOT the same as the historic UNIX RE
+ routines), and you want to use them instead, enter:
+
+ --disable-re
+
+ as an argument to configure, and the RE routines will be taken
+ from whatever libraries you load. Please ensure that your RE
+ routines implement Henry Spencer's extensions for doing vi-style
+ "word" searches.
+
+enable-debug:
+ If you want to build nvi with no optimization (i.e. without -O
+ as a compiler flag), with -g as a compiler flag, and with DEBUG
+ defined during compilation, enter:
+
+ --enable-debug
+
+ as an argument to configure.
+
+enable-perlinterp:
+ If you have the Perl 5 libraries and you want to compile in the
+ Perl interpreter, enter:
+
+ --enable-perlinterp
+
+ as an argument to configure. (Note: this is NOT possible with
+ Perl 4, or even with Perl 5 versions earlier than 5.002.)
+
+enable-tclinterp:
+ If you have the Tk/Tcl libraries and you want to compile in the
+ Tcl/Tk interpreter, enter:
+
+ --enable-tclinterp
+
+ as an argument to configure. If your Tk/Tcl include files and
+ libraries aren't in the standard library and include locations,
+ see the next section of this README file for more information.
+
+enable-tknvi:
+ If you have the Tk/Tcl libraries and you want to build the Tcl/Tk
+ nvi front-end, enter:
+
+ --enable-tknvi
+
+ as an argument to configure. If your Tk/Tcl include files and
+ libraries aren't in the standard library and include locations,
+ see the next section of this README file for more information.
+
+=-=-=-=-=-=-=
+ADDING OR CHANGING COMPILE OR LOAD LINE FLAGS
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+If you want to specify additional load line flags, specify the ADDLDFLAGS
+environment variable before running configure. For example:
+
+ env ADDLDFLAGS="-Q" ./configure
+
+would specify the -Q flag in the load line when the nvi programs are
+loaded.
+
+If you don't want configure to use the default load line flags for the
+system, specify the LDFLAGS environment variable before running configure.
+For example:
+
+ env LDFLAGS="-32" ./configure
+
+will cause configure to set the load line flags to "-32", and not set
+them based on the current system.
+
+If you want to specify additional compile line flags, specify the
+ADDCPPFLAGS environment variable before running configure. For example:
+
+ env ADDCPPFLAGS="-I../foo" ./configure
+
+would cause the compiler to be passed the -I../foo flag when compiling
+test programs during configuration as well as when building nvi object
+files.
+
+If you don't want configure to use the default compile line flags for the
+system, specify the CPPFLAGS environment variable before running configure.
+For example:
+
+ env CPPFLAGS="-I.." ./configure
+
+will cause configure to use "-I.." as the compile line flags instead of
+the default values.
+
+=-=-=-=-=-=-=
+ADDING LIBRARIES AND INCLUDE FILES
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+If the Tk/Tcl or any other include files or libraries are in non-standard
+places on your system, you will need to specify the directory path where
+they can be found.
+
+If you want to specify additional library paths, set the ADDLIBS environment
+variable before running configure. For example:
+
+ env ADDLIBS="-L/a/b -L/e/f -ldb" ./configure
+
+would specify two additional directories to search for libraries, /a/b
+and /e/f, and one additional library to load, "db".
+
+If you want to specify additional include paths, specify the ADDCPPFLAGS
+environment variable before running configure. For example:
+
+ env ADDCPPFLAGS="-I/usr/local/include" LIBS="-ldb" ./configure
+
+would search /usr/local/include for include files, as well as load the db
+library as described above.
+
+As a final example, let's say that you've downloaded ncurses from the net
+and you've built it in a directory named ncurses which is at the same
+level in the filesystem hierarchy as nvi. You would enter something like:
+
+ env ADDCPPFLAGS="-I../../ncurses/include" \
+ ADDLIBS="-L../../ncurses/libraries" ./configure
+
+to cause nvi to look for the curses include files and the curses library
+in the ncurses environment.
+
+Notes:
+ Make sure that you prepend -L to any library directory names, and
+ that you prepend -I to any include file directory names! Also,
+ make sure that you quote the paths as shown above, i.e. with
+ single or double quotes around the values you're specifying for
+ ADDCPPFLAGS and ADDLIBS.
+
+ =-=-=-=-=-=
+ You should NOT need to add any libraries or include files to load
+ the Perl5 interpreter. The configure script will obtain that
+ information directly from the Perl5 program. This means that the
+ configure script must be able to find perl in its path. It looks
+ for "perl5" first, and then "perl". If you're building a Perl
+ interpreter and neither is found, it's a fatal error.
+
+ =-=-=-=-=-=
+ You do not need to specify additional libraries to load Tk/Tcl,
+ Perl or curses, as the nvi configuration script adds the
+ appropriate libraries to the load line whenever you specify
+ --enable-tknvi or other Perl or Tk/Tcl related option, or build
+ the Tk/Tcl or curses version of nvi. The library names that are
+ automatically loaded are as follows:
+
+ for Perl: -lperl
+ for Tk/Tcl: -ltk -ltcl -lm
+ for curses: -lcurses
+
+ In addition, the configure script loads:
+
+ ... the X libraries when loading the Tk/Tcl libraries,
+ if they exist.
+
+ ... the -ltermcap or -ltermlib libraries when loading
+ any curses library, if they exist.
+
+ =-=-=-=-=-=
+ The env command is available on most systems, and simply sets one
+ or more environment variables before running a command. If the
+ env command is not available to you, you can set the environment
+ variables in your shell before running configure. For example,
+ in sh or ksh, you could do:
+
+ ADDLIBS="-L/a/b -L/e/f -ldb" ./configure
+
+ and in csh or tcsh, you could do:
+
+ setenv ADDLIBS "-L/a/b -L/e/f -ldb"
+ ./configure
+
+ See your shell manual page for further information.
+
+=-=-=-=-=-=-=
+INSTALLING NVI
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+Nvi installs the following files into the following locations, with
+the following default values:
+
+File(s): Location
+ Default Location
+----------------------------------------
+vi $(exec_prefix)/$(bindir)/vi
+ /usr/local/bin/vi
+
+vi.0 $(prefix)/$(mandir)/cat1/vi.0
+ /usr/local/man/cat1/vi.0
+
+Message Catalogs $(prefix)/$(datadir)/vi/catalog/
+ /usr/local/share/vi/catalog/
+
+Perl5 scripts $(prefix)/$(datadir)/vi/perl/
+ /usr/local/share/vi/perl/
+
+Tcl scripts $(prefix)/$(datadir)/vi/tcl/
+ /usr/local/share/vi/tcl/
+
+Notes:
+ There are two hard links to the vi program, named ex and view.
+ Similarly, there are two hard links to the vi manual page, named
+ ex.0 and view.0. These links are created when the program and
+ man pages are installed.
+
+ If you want to install vi, ex, view and the man pages as nvi, nex,
+ nview, use the configure option --program-prefix=n. Other, more
+ complex transformations are possible -- use configure --help to
+ see more options.
+
+ The default value for both "exec_prefix" and "prefix" is the
+ directory /usr/local. The default values for "bindir", "datadir"
+ and "mandir" are bin, share and man, respectively.
+
+ To move the entire installation tree somewhere besides /usr/local,
+ change the value of both "exec_prefix" and "prefix". To move the
+ binaries to a different place in the "exec_prefix" directory tree,
+ change the value of "bindir". Similarly, to put the datafiles
+ (the message catalogs, Perl5 and Tcl scripts) or the man pages in
+ a different place in the "prefix" directory tree, change the value
+ of "datadir" or "mandir". These values can be changed as part of
+ configuration:
+
+ configure --exec_prefix=/usr/contrib --prefix=/usr/share
+
+ or when doing the install itself:
+
+ make exec_prefix=/usr/contrib prefix=/usr/contrib install
+
+ The datafile directory (e.g., /usr/local/share/vi by default) is
+ completely removed and then recreated as part of the installation
+ process.
+
+ The mandir directory must have another directory named "cat1"
+ beneath it for the man pages to successfully install.
+
+=-=-=-=-=-=-=
+NVI AND THE CURSES LIBRARY
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The major portability problem for nvi is selecting a curses library.
+Unfortunately, it is common to find broken versions of curses -- the
+original System V curses was broken, resulting in all vendors whose
+implementations are derived from System V having broken implementations
+in turn.
+
+For this reason, BY DEFAULT, nvi uses the stripped-down curses library
+that's included in its distribution. Of course, it would be preferable
+to use the vendor's curses library, or one of the newer implementations
+of curses, e.g., ncurses.
+
+To use the vendor's curses library, specify the:
+
+ --disable-curses
+
+argument to the configure command. If you use the vendor's or other
+curses library, and you see any of the following symptoms:
+
+ + Core dumps in curses routines.
+ + Missing routines when compiling.
+ + Repainting the wrong characters on the screen.
+ + Displaying inverse video in the wrong places.
+ + Failure to reset your terminal to the correct modes on exit.
+
+you have a broken curses implementation, and you should reconfigure nvi
+to use another curses library or the curses library provided with nvi.
+
+There are two alternative sources for curses libraries:
+
+#1: Compile the 4BSD curses library from any of the recent BSD
+ releases: FreeBSD, NetBSD or 4.4BSD-Lite release 2. These
+ libraries should be able to support nvi.
+
+#2: Retrieve and build the ncurses library. This library is not
+ recommended unreservedly, at least for now, for two reasons.
+ First, it can't be built on any system where the compiler
+ doesn't support function prototypes. Second, it currently has
+ a few bugs in its support for nvi. It mostly works, but it's
+ still not quite right.
+
+One final note. If you see the following symptoms:
+
+ + Line-by-line screen repainting instead of scrolling.
+
+it usually means that your termcap or terminfo information is insufficient
+for the terminal.
diff --git a/usr.bin/vi/build/config.h b/usr.bin/vi/build/config.h
new file mode 100644
index 00000000000..b4d53fa0278
--- /dev/null
+++ b/usr.bin/vi/build/config.h
@@ -0,0 +1,138 @@
+/* config.h. Generated automatically by configure. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define if you don't have vprintf but do have _doprnt. */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have a working `mmap' system call. */
+/* #define HAVE_MMAP 1 */
+
+/* Define if your struct stat has st_blksize. */
+#define HAVE_ST_BLKSIZE 1
+
+/* Define if you have <vfork.h>. */
+/* #undef HAVE_VFORK_H */
+
+/* Define if you have the vprintf function. */
+#define HAVE_VPRINTF 1
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef mode_t */
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+/* #undef off_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef pid_t */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if your <sys/time.h> declares struct tm. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define vfork as fork if vfork does not work. */
+/* #undef vfork */
+
+/* Define if your processor stores words with the most significant
+ byte first (like Motorola and SPARC, unlike Intel and VAX). */
+#define WORDS_BIGENDIAN 1
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef ssize_t */
+
+/* Define if you want a debugging version. */
+/* #undef DEBUG */
+
+/* Define if you have a System V-style (broken) gettimeofday. */
+/* #undef HAVE_BROKEN_GETTIMEOFDAY */
+
+/* Define if you have a Ultrix-style (broken) vdisable. */
+/* #undef HAVE_BROKEN_VDISABLE */
+
+/* Define if you have a BSD version of curses. */
+#define HAVE_BSD_CURSES 1
+
+/* Define if you have the curses(3) addnstr function. */
+#define HAVE_CURSES_ADDNSTR 1
+
+/* Define if you have the curses(3) beep function. */
+/* #undef HAVE_CURSES_BEEP */
+
+/* Define if you have the curses(3) flash function. */
+/* #undef HAVE_CURSES_FLASH */
+
+/* Define if you have the curses(3) idlok function. */
+#define HAVE_CURSES_IDLOK 1
+
+/* Define if you have the curses(3) keypad function. */
+/* #undef HAVE_CURSES_KEYPAD */
+
+/* Define if you have the curses(3) newterm function. */
+/* #undef HAVE_CURSES_NEWTERM */
+
+/* Define if you have the curses(3) setupterm function. */
+/* #undef HAVE_CURSES_SETUPTERM */
+
+/* Define if you have the curses(3) tigetstr/tigetnum functions. */
+/* #undef HAVE_CURSES_TIGETSTR */
+
+/* Define if you have the chsize(2) system call. */
+/* #undef HAVE_FTRUNCATE_CHSIZE */
+
+/* Define if you have the ftruncate(2) system call. */
+#define HAVE_FTRUNCATE_FTRUNCATE 1
+
+/* Define if you have fcntl(2) style locking. */
+/* #undef HAVE_LOCK_FCNTL */
+
+/* Define if you have flock(2) style locking. */
+#define HAVE_LOCK_FLOCK 1
+
+/* Define if you want to compile in the Perl interpreter. */
+/* #undef HAVE_PERL_INTERP */
+
+/* Define if your Perl is at least 5.002_01. */
+/* #undef HAVE_PERL_5_002_01 */
+
+/* Define if you have the Berkeley style revoke(2) system call. */
+#define HAVE_REVOKE 1
+
+/* Define if you have <sys/mman.h> */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define if you have <sys/select.h> */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define if you have the System V style pty calls. */
+/* #undef HAVE_SYS5_PTY */
+
+/* Define if you want to compile in the Tcl interpreter. */
+/* #undef HAVE_TCL_INTERP */
+
+/* Define if your sprintf returns a pointer, not a length. */
+/* #undef SPRINTF_RET_CHARPNT */
+
+/* Define if you have the getpagesize function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if you have the select function. */
+#define HAVE_SELECT 1
+
+/* Define if you have the setenv function. */
+#define HAVE_SETENV 1
+
+/* Define if you have the strsep function. */
+#define HAVE_STRSEP 1
+
+/* Define if you have the unsetenv function. */
+#define HAVE_UNSETENV 1
+
+/* Define if you have the valloc function. */
+#define HAVE_VALLOC 1
diff --git a/usr.bin/vi/build/pathnames.h b/usr.bin/vi/build/pathnames.h
new file mode 100644
index 00000000000..f2d5ec309bc
--- /dev/null
+++ b/usr.bin/vi/build/pathnames.h
@@ -0,0 +1,45 @@
+/* @(#)pathnames.h.in 8.3 (Berkeley) 4/22/96 */
+
+#ifndef _PATH_BSHELL
+#define _PATH_BSHELL "/bin/sh"
+#endif
+
+#ifndef _PATH_EXRC
+#define _PATH_EXRC ".exrc"
+#endif
+
+#ifndef _PATH_MSGCAT
+#define _PATH_MSGCAT "./"
+#endif
+
+#ifndef _PATH_NEXRC
+#define _PATH_NEXRC ".nexrc"
+#endif
+
+#ifndef _PATH_PRESERVE
+#define _PATH_PRESERVE "/var/tmp/vi.recover"
+#endif
+
+#ifndef _PATH_SYSV_PTY
+#define _PATH_SYSV_PTY "/dev/ptmx"
+#endif
+
+#ifndef _PATH_SENDMAIL
+#define _PATH_SENDMAIL "/usr/sbin/sendmail"
+#endif
+
+#ifndef _PATH_SYSEXRC
+#define _PATH_SYSEXRC "/etc/vi.exrc"
+#endif
+
+#ifndef _PATH_TAGS
+#define _PATH_TAGS "tags"
+#endif
+
+#ifndef _PATH_TMP
+#define _PATH_TMP "/tmp"
+#endif
+
+#ifndef _PATH_TTY
+#define _PATH_TTY "/dev/tty"
+#endif
diff --git a/usr.bin/vi/build/port.h b/usr.bin/vi/build/port.h
new file mode 100644
index 00000000000..ed7116f8543
--- /dev/null
+++ b/usr.bin/vi/build/port.h
@@ -0,0 +1,180 @@
+/* @(#)port.h.in 8.12 (Berkeley) 5/16/96 */
+
+/*
+ * Declare the basic types, if they aren't already declared. Named and
+ * some system's db.h files protect them with __BIT_TYPES_DEFINED__.
+ */
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+
+
+
+
+
+#endif
+
+/*
+ * XXX
+ * Handle function prototypes. This steps on name space that vi doesn't
+ * control, but all of the other solutions are worse.
+ */
+#undef __P
+#if defined(__STDC__) || defined(__cplusplus)
+#define __P(protos) protos /* ANSI C prototypes */
+#else
+#define __P(protos) () /* K&R C preprocessor */
+#endif
+
+/*
+ * XXX
+ * Some versions of System V changed the number of arguments to gettimeofday
+ * without changing the name.
+ */
+#ifdef HAVE_BROKEN_GETTIMEOFDAY
+#define gettimeofday(tv, tz) gettimeofday(tv)
+#endif
+
+/*
+ * XXX
+ * If we don't have mmap, we fake it with read and write, but we'll
+ * still need the header information.
+ */
+#ifndef HAVE_SYS_MMAN_H
+#define MAP_SHARED 1 /* share changes */
+#define MAP_PRIVATE 2 /* changes are private */
+#define PROT_READ 0x1 /* pages can be read */
+#define PROT_WRITE 0x2 /* pages can be written */
+#define PROT_EXEC 0x4 /* pages can be executed */
+#endif
+
+/*
+ * XXX
+ * POSIX 1003.1 names for file descriptors.
+ */
+#ifndef STDERR_FILENO
+#define STDIN_FILENO 0 /* ANSI C #defines */
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+#endif
+
+/*
+ * XXX
+ * POSIX 1003.1 names for seek settings.
+ */
+#ifndef SEEK_END
+#define SEEK_SET 0 /* POSIX 1003.1 seek values */
+#define SEEK_CUR 1
+#define SEEK_END 2
+#endif
+
+/*
+ * Hack _POSIX_VDISABLE to \377 since Ultrix doesn't honor _POSIX_VDISABLE
+ * (treats it as ^@). The symptom is that the ^@ keystroke immediately
+ * drops core.
+ */
+#ifdef HAVE_BROKEN_VDISABLE
+#undef _POSIX_VDISABLE
+#define _POSIX_VDISABLE ((unsigned char)'\377')
+#endif
+
+/*
+ * XXX
+ * POSIX 1003.1 tty disabling character.
+ */
+#ifndef _POSIX_VDISABLE
+#define _POSIX_VDISABLE 0 /* Some systems used 0. */
+#endif
+
+/*
+ * XXX
+ * 4.4BSD extension to only set the software termios bits.
+ */
+#ifndef TCSASOFT /* 4.4BSD extension. */
+#define TCSASOFT 0
+#endif
+
+/*
+ * XXX
+ * POSIX 1003.1 maximum path length.
+ */
+#ifndef MAXPATHLEN
+#ifdef PATH_MAX
+#define MAXPATHLEN PATH_MAX
+#else
+#define MAXPATHLEN 1024
+#endif
+#endif
+
+/*
+ * XXX
+ * MIN, MAX, historically in <sys/param.h>
+ */
+#ifndef MAX
+#define MAX(_a,_b) ((_a)<(_b)?(_b):(_a))
+#endif
+#ifndef MIN
+#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
+#endif
+
+/*
+ * XXX
+ * "DB" isn't always portable, and we want the private information.
+ */
+#define DB L__DB
+#undef pgno_t /* IRIX has its own version. */
+#define pgno_t L__db_pgno_t
+
+/*
+ * XXX
+ * 4.4BSD extension to provide lock values in the open(2) call.
+ */
+#ifndef O_EXLOCK
+#define O_EXLOCK 0
+#endif
+
+#ifndef O_SHLOCK
+#define O_SHLOCK 0
+#endif
+
+/*
+ * XXX
+ * POSIX 1003.1 bad file format errno.
+ */
+#ifndef EFTYPE
+#define EFTYPE EINVAL
+#endif
+
+/*
+ * XXX
+ * POSIX 1003.2 RE length limit.
+ */
+#ifndef _POSIX2_RE_DUP_MAX
+#define _POSIX2_RE_DUP_MAX 255
+#endif
+
+/*
+ * XXX
+ * 4.4BSD extension to determine if a program dropped core from the exit
+ * status.
+ */
+#ifndef WCOREDUMP
+#define WCOREDUMP(a) 0
+#endif
+
+/*
+ * XXX
+ * Endian-ness of the machine.
+ */
+#if !defined(LITTLE_ENDIAN)
+#define LITTLE_ENDIAN 1234
+#endif
+#if !defined(BIG_ENDIAN)
+#define BIG_ENDIAN 4321
+#endif
+#if !defined(BYTE_ORDER)
+#if WORDS_BIGENDIAN == 1
+#define BYTE_ORDER BIG_ENDIAN
+#else
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+#endif