-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
804 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,43 @@ | ||
# $OpenBSD: Makefile,v 1.33 2016/03/30 06:38:40 jmc Exp $ | ||
CC ?= cc | ||
CFLAGS ?= -O2 | ||
CFLAGS += -I. -D_GNU_SOURCE -std=gnu99 -Wall -pedantic -Wno-format-security -Wno-pointer-sign | ||
LDFLAGS ?= | ||
DESTDIR ?= / | ||
PREFIX ?= /usr | ||
BIN_DIR ?= $(PREFIX)/bin | ||
BIN_NAME ?= ksh | ||
MAN_DIR ?= $(PREFIX)/share/man | ||
DOC_DIR ?= $(PREFIX)/share/doc/loksh | ||
HAVE_LIBBSD ?= 0 | ||
|
||
PROG= ksh | ||
SRCS= alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c eval.c \ | ||
exec.c expr.c history.c io.c jobs.c lex.c mail.c main.c \ | ||
misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c var.c \ | ||
version.c vi.c | ||
OBJECTS = alloc.o c_ksh.o c_sh.o c_test.o c_ulimit.o edit.o emacs.o eval.o \ | ||
exec.o expr.o history.o io.o jobs.o lex.o mail.o main.o misc.o \ | ||
path.o shf.o syn.o table.o trap.o tree.o tty.o var.o version.o vi.o | ||
HEADERS = c_test.h charclass.h config.h edit.h expand.h ksh_limval.h lex.h \ | ||
proto.h sh.h shf.h table.h tree.h tty.h | ||
|
||
DEFS= -Wall | ||
CFLAGS+=${DEFS} -I. -I${.CURDIR} -I${.CURDIR}/../../lib/libc/gen | ||
MAN= ksh.1 sh.1 | ||
ifeq (1,$(HAVE_LIBBSD)) | ||
CFLAGS += $(shell pkg-config --cflags libbsd-overlay) | ||
LDFLAGS += $(shell pkg-config --libs libbsd-overlay) | ||
endif | ||
|
||
LINKS= ${BINDIR}/ksh ${BINDIR}/rksh | ||
LINKS+= ${BINDIR}/ksh ${BINDIR}/sh | ||
all: ksh | ||
|
||
.include <bsd.prog.mk> | ||
%.o: %.c $(HEADERS) | ||
$(CC) -c -o $@ $< $(CFLAGS) | ||
|
||
ksh: $(OBJECTS) | ||
$(CC) -o $@ $^ $(LDFLAGS) | ||
|
||
clean: | ||
rm -f $(BIN_NAME) *.o | ||
|
||
install: all | ||
install -v -D -m 755 ksh $(DESTDIR)/$(BIN_DIR)/$(BIN_NAME) | ||
install -v -D -m 644 ksh.1 $(DESTDIR)/$(MAN_DIR)/man1/$(BIN_NAME).1 | ||
install -v -m 644 sh.1 $(DESTDIR)/$(MAN_DIR)/man1/sh.1 | ||
install -v -D -m 644 README $(DESTDIR)/$(DOC_DIR)/README | ||
install -v -m 644 README.upstream $(DESTDIR)/$(DOC_DIR)/README.upstream | ||
install -v -m 644 CONTRIBUTORS $(DESTDIR)/$(DOC_DIR)/CONTRIBUTORS | ||
install -v -m 644 PROJECTS $(DESTDIR)/$(DOC_DIR)/PROJETCS | ||
install -v -m 644 LEGAL $(DESTDIR)/$(DOC_DIR)/LEGAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
$OpenBSD: README,v 1.15 2015/12/05 19:40:45 mmcc Exp $ | ||
_ _ _ | ||
| | ___ | | _____| |__ | ||
| |/ _ \| |/ / __| '_ \ | ||
| | (_) | <\__ \ | | | | ||
|_|\___/|_|\_\___/_| |_| | ||
|
||
Last updated Jul '99 for pdksh-5.2.14. | ||
Overview | ||
======== | ||
|
||
PD-ksh is a mostly complete AT&T ksh look-alike (see NOTES file for a list | ||
of things not supported). Work is mostly finished to make it fully | ||
compatible with both POSIX and AT&T ksh (when the two don't conflict). | ||
loksh is a Linux (https://www.kernel.org/) port of OpenBSD's | ||
(http://www.openbsd.org/) ksh targeting musl (http://www.musl-libc.org/). | ||
|
||
PDksh was being maintained by Michael Rendell ([email protected]), | ||
who took over from Simon J. Gerraty ([email protected]) at the later's | ||
suggestion. | ||
It is a small, interactive shell targeted at resource-constrained systems. | ||
|
||
Files of interest: | ||
CONTRIBUTORS short history of pdksh, people who contributed, etc. | ||
NOTES lists of known bugs in pdksh, at&t ksh, and posix. | ||
PROJECTS list of things that need to be done in pdksh. | ||
LEGAL A file detailing legal issues concerning pdksh. | ||
Legal Information | ||
================= | ||
|
||
loksh is licensed under the same license as the upstream code it is based on. | ||
|
||
BTW, THE MOST FREQUENTLY REPORTED BUG IS | ||
echo hi | read a; echo $a # Does not print hi | ||
I'm aware of this and there is no need to report it. | ||
The ASCII art logo at the top was made using FIGlet (http://www.figlet.org/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$OpenBSD: README,v 1.15 2015/12/05 19:40:45 mmcc Exp $ | ||
|
||
Last updated Jul '99 for pdksh-5.2.14. | ||
|
||
PD-ksh is a mostly complete AT&T ksh look-alike (see NOTES file for a list | ||
of things not supported). Work is mostly finished to make it fully | ||
compatible with both POSIX and AT&T ksh (when the two don't conflict). | ||
|
||
PDksh was being maintained by Michael Rendell ([email protected]), | ||
who took over from Simon J. Gerraty ([email protected]) at the later's | ||
suggestion. | ||
|
||
Files of interest: | ||
CONTRIBUTORS short history of pdksh, people who contributed, etc. | ||
NOTES lists of known bugs in pdksh, at&t ksh, and posix. | ||
PROJECTS list of things that need to be done in pdksh. | ||
LEGAL A file detailing legal issues concerning pdksh. | ||
|
||
|
||
BTW, THE MOST FREQUENTLY REPORTED BUG IS | ||
echo hi | read a; echo $a # Does not print hi | ||
I'm aware of this and there is no need to report it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Public domain, 2008, Todd C. Miller <[email protected]> | ||
* | ||
* $OpenBSD: charclass.h,v 1.1 2008/10/01 23:04:13 millert Exp $ | ||
*/ | ||
|
||
/* | ||
* POSIX character class support for fnmatch() and glob(). | ||
*/ | ||
static struct cclass { | ||
const char *name; | ||
int (*isctype)(int); | ||
} cclasses[] = { | ||
{ "alnum", isalnum }, | ||
{ "alpha", isalpha }, | ||
{ "blank", isblank }, | ||
{ "cntrl", iscntrl }, | ||
{ "digit", isdigit }, | ||
{ "graph", isgraph }, | ||
{ "lower", islower }, | ||
{ "print", isprint }, | ||
{ "punct", ispunct }, | ||
{ "space", isspace }, | ||
{ "upper", isupper }, | ||
{ "xdigit", isxdigit }, | ||
{ NULL, NULL } | ||
}; | ||
|
||
#define NCCLASSES (sizeof(cclasses) / sizeof(cclasses[0]) - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.