summaryrefslogtreecommitdiff
path: root/usr.bin/vi/build
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-11-26 22:49:10 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-11-26 22:49:10 +0000
commitae8a234af8879e97f27622bf3af2202b850b82c3 (patch)
treeae8b4c98914ed60402c7db26b33a4899bfc5c4e4 /usr.bin/vi/build
parent3eb6c5a66b1af6fba5c9f450d1e602f3ea85256b (diff)
o Update README files etc. from nvi-1.79 so they have the correct info
o make port.h empty since we there is nothing we lack o include <sys/param.h>, not <sys/types.h> in files that use MIN/MAX macros o add perl api support since we have libperl (off by default)
Diffstat (limited to 'usr.bin/vi/build')
-rw-r--r--usr.bin/vi/build/Makefile39
-rw-r--r--usr.bin/vi/build/README57
-rw-r--r--usr.bin/vi/build/port.h185
3 files changed, 59 insertions, 222 deletions
diff --git a/usr.bin/vi/build/Makefile b/usr.bin/vi/build/Makefile
index d129ce4fc4d..6678bb9c259 100644
--- a/usr.bin/vi/build/Makefile
+++ b/usr.bin/vi/build/Makefile
@@ -1,14 +1,20 @@
-# $OpenBSD: Makefile,v 1.12 1999/05/29 03:50:24 aaron Exp $
+# $OpenBSD: Makefile,v 1.13 1999/11/26 22:49:08 millert Exp $
# @(#)Makefile.in 8.75 (Berkeley) 10/23/96
+PROG= vi
+
+# Uncomment to build with an embedded perl interpreter
+#PERLINTERP= yes
+
+# Modern curses (ncurses)
CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include
LDADD+=-lcurses
DPADD+= ${LIBCURSES}
+# Old BSD curses
#CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include -D_USE_OLD_CURSES_
#LDADD+= -locurses
#DPADD+= ${LIBOLDCURSES}
-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 \
@@ -29,18 +35,39 @@ SRCS= cl_bsd.c cl_funcs.c cl_main.c cl_read.c cl_screen.c cl_term.c \
v_zexit.c vi.c vs_line.c vs_msg.c vs_refresh.c vs_relative.c \
vs_smap.c vs_split.c
+.ifdef PERLINTERP
+SRCS+= api.c perl.c perlsfio.c
+PERLARCH!=perl -MConfig -e 'print $$Config{archlibexp}'
+CFLAGS+=-DHAVE_PERL_5_003_01 -DHAVE_PERL_INTERP -I${PERLARCH}/CORE
+LDADD+= -lperl ${PERLARCH}/auto/DynaLoader/DynaLoader.a
+DPADD+= ${LIBPERL}
+.endif
+
LINKS= ${BINDIR}/vi ${BINDIR}/ex
LINKS+= ${BINDIR}/vi ${BINDIR}/view
MLINKS= vi.1 ex.1
MLINKS+= vi.1 view.1
-.PATH: ${.CURDIR}/../vi ${.CURDIR}/../ex ${.CURDIR}/../cl ${.CURDIR}/../common ${.CURDIR}/../docs/USD.doc/vi.man
+CLEANFILES+= VI.pm perl.c
+
+.PATH: ${.CURDIR}/../vi ${.CURDIR}/../ex ${.CURDIR}/../cl ${.CURDIR}/../common ${.CURDIR}/../perl_api ${.CURDIR}/../docs/USD.doc/vi.man
+
+perl.c: ${.CURDIR}/../perl_api/perl.xs ${.CURDIR}/../perl_api/typemap
+ echo "#define _PATH_PERLSCRIPTS \"${SHAREDIR}/vi/perl\"" > ${.TARGET}
+ perl /usr/libdata/perl5/ExtUtils/xsubpp -typemap \
+ /usr/libdata/perl5/ExtUtils/typemap ${.CURDIR}/../perl_api/perl.xs >> ${.TARGET}
+ (perl -ne 'print "sub $$1 {\$$curscr->$$1(\@_)}\n" \
+ if /newXS\("VI::([^":]*)"/;' ${.TARGET} ; echo "1;") > VI.pm
.include <bsd.prog.mk>
.include "../../Makefile.inc"
CATALOGS= dutch english french german ru_SU.KOI8-R spanish swedish
afterinstall:
- install -d ${DESTDIR}/usr/share/vi/catalog
- (cd ${.CURDIR}/../catalog && install -m ${NONBINMODE} -c ${CATALOGS} ${DESTDIR}/usr/share/vi/catalog )
- install -m ${BINMODE} -o ${BINOWN} -g ${BINGRP} -c ${.CURDIR}/recover ${DESTDIR}/usr/libexec/vi.recover
+ ${INSTALL} -d ${DESTDIR}${SHAREDIR}/vi/catalog
+ (cd ${.CURDIR}/../catalog && ${INSTALL} -m ${NONBINMODE} -c ${CATALOGS} ${DESTDIR}/usr/share/vi/catalog )
+ ${INSTALL} -m ${BINMODE} -o ${BINOWN} -g ${BINGRP} -c ${.CURDIR}/recover ${DESTDIR}/usr/libexec/vi.recover
+.ifdef PERLINTERP
+ ${INSTALL} -d ${DESTDIR}${SHAREDIR}/vi/perl
+ (cd ${.CURDIR}/../perl_scripts; for i in *.pl; do ${INSTALL} -m ${NONBINMODE} -c $$i ${DESTDIR}/usr/share/vi/perl; done)
+.endif
diff --git a/usr.bin/vi/build/README b/usr.bin/vi/build/README
index 2d0447faea2..efbce2b9dfb 100644
--- a/usr.bin/vi/build/README
+++ b/usr.bin/vi/build/README
@@ -1,4 +1,4 @@
-# @(#)README 8.24 (Berkeley) 6/20/96
+# @(#)README 8.26 (Berkeley) 10/19/96
Nvi uses the GNU autoconf program for configuration and compilation. You
should enter:
@@ -271,47 +271,41 @@ 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/
+Variables: Default value:
+prefix /usr/local
+exec_prefix $(prefix)
+bindir $(prefix)/bin
+datadir $(prefix)/share
+mandir $(prefix)/man
-Tcl scripts $(prefix)/$(datadir)/vi/tcl/
- /usr/local/share/vi/tcl/
+File(s): Default location
+----------------------------------------
+vi $(bindir)/vi
+vi.1 $(mandir)/man1/vi.1
+vi.0 $(mandir)/cat1/vi.0
+Perl scripts $(datadir)/vi/perl/
+Tcl scripts $(datadir)/vi/tcl/
+Message Catalogs $(datadir)/vi/catalog/
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.
+ Similarly, there are two hard links to the unformatted vi manual
+ page, named ex.1 and view.1, and two hard links to the formatted
+ 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:
+ binaries to a different place, change the value of "bindir".
+ Similarly, to put the datafiles (the message catalogs, Perl and
+ Tcl scripts) or the man pages in a different place, change the
+ value of "datadir" or "mandir". These values can be changed as
+ part of configuration:
configure --exec_prefix=/usr/contrib --prefix=/usr/share
@@ -323,9 +317,6 @@ Notes:
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/usr.bin/vi/build/port.h b/usr.bin/vi/build/port.h
index b363a26bd89..8ec6b531af2 100644
--- a/usr.bin/vi/build/port.h
+++ b/usr.bin/vi/build/port.h
@@ -1,186 +1,5 @@
-/* $OpenBSD: port.h,v 1.3 1997/07/27 22:27:54 downsj Exp $ */
-/* @(#)port.h.in 8.13 (Berkeley) 6/12/96 */
+/* $OpenBSD: port.h,v 1.4 1999/11/26 22:49:08 millert Exp $ */
/*
- * Declare the basic types, if they aren't already declared. Named and
- * some system's db.h files protect them with __BIT_TYPES_DEFINED__.
+ * Nothing needed here for OpenBSD.
*/
-#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