From ff1290cbb138dd09b0a3ca842f843b8321b4c3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Thu, 19 Oct 2017 14:07:56 +0200 Subject: Handwritten Makefile and config.h; no more GNU autohell --- .gitignore | 32 ++----- Makefile | 133 +++++++++++++++++++++++++++++ Makefile.am | 67 --------------- README | 4 - RELDATE | 1 - ReleaseTime | 6 -- acinclude.m4 | 174 -------------------------------------- bootstrap | 2 - config.def.h | 123 +++++++++++++++++++++++++++ configure.ac | 260 --------------------------------------------------------- configure.scan | 49 ----------- mkinstalldirs | 162 ----------------------------------- nonblock.c | 14 ---- random.pl | 15 ---- slow | 11 --- stamp-h | 1 - stamp-h.in | 1 - tmp | 2 - version.c.in | 1 - 19 files changed, 264 insertions(+), 794 deletions(-) create mode 100644 Makefile delete mode 100644 Makefile.am delete mode 100644 RELDATE delete mode 100755 ReleaseTime delete mode 100644 acinclude.m4 delete mode 100755 bootstrap create mode 100644 config.def.h delete mode 100644 configure.ac delete mode 100644 configure.scan delete mode 100755 mkinstalldirs delete mode 100644 nonblock.c delete mode 100644 random.pl delete mode 100644 slow delete mode 100644 stamp-h delete mode 100644 stamp-h.in delete mode 100644 tmp delete mode 100644 version.c.in diff --git a/.gitignore b/.gitignore index 8a544e0..d6811f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,13 @@ -*~ -.*.swp -aclocal.m4 -autom4te.cache/ -compile +*.d +*.o +.depend config.h -config.h.in -config.log -config.status -configure -depcomp -.deps/ -INSTALL -install-sh -Makefile -Makefile.in -missing +parse.[ch] +sigmsgs.[ch] +statval.h +rc +history mksignal mkstatval -*.o -parse.c -parse.h -rc -sigmsgs.c -sigmsgs.h -stamp-h1 -statval.h tripping ylwrap diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5cd5376 --- /dev/null +++ b/Makefile @@ -0,0 +1,133 @@ +PACKAGE = rc +VERSION = 1.7.4 +DESCRIPTION = $$(cd "$(srcdir)"; git describe --always) + +srcdir = . +VPATH = $(srcdir) + +PREFIX = /usr/local +MANPREFIX = $(PREFIX)/share/man + +CC = cc +DEF_CFLAGS = -Wall +DEF_CPPFLAGS = -I$(PREFIX)/include +DEF_LDFLAGS = -L$(PREFIX)/lib +YACC = byacc + +# line editing library: null/edit/editline/readline/vrl +EDIT = readline + +# if your kernel supports `#!' magic numbers +HASH_BANG = 1 + +# if system calls automatically restart after interruption by signal +HAVE_RESTARTABLE_SYSCALLS = 0 + +# include extra builtins in addon.c +RC_ADDON = 0 + +# include parse tree dumper +RC_DEVELOP = 0 + +ALL_CFLAGS = $(DEF_CFLAGS) $(CFLAGS) +REQ_CPPFLAGS = -I. -I"$(srcdir)" \ + -DPACKAGE=\"$(PACKAGE)\" -DVERSION=\"$(VERSION)\" \ + -DDESCRIPTION=\"$(DESCRIPTION)\" -DHASH_BANG=$(HASH_BANG) \ + -DHAVE_RESTARTABLE_SYSCALLS=$(HAVE_RESTARTABLE_SYSCALLS) \ + -DRC_ADDON=$(RC_ADDON) -DRC_DEVELOP=$(RC_DEVELOP) +ALL_CPPFLAGS = $(REQ_CPPFLAGS) $(DEF_CPPFLAGS) $(CPPFLAGS) +ALL_LDFLAGS = $(DEF_LDFLAGS) $(LDFLAGS) + +LIB_EDIT_null = +LIB_EDIT_edit = -ledit +LIB_EDIT_editline = -leditline +LIB_EDIT_readline = -lreadline +LIB_EDIT_vrl = -lvrl +LDLIBS = $(LIB_EDIT_$(EDIT)) + +OBJ_ADDON_0 = +OBJ_ADDON_1 = addon.o +OBJ_DEVELOP_0 = +OBJ_DEVELOP_1 = develop.o +OBJ_EXECVE_0 = execve.o +OBJ_EXECVE_1 = +OBJ_SYSTEM_0 = system.o +OBJ_SYSTEM_1 = system-bsd.o +OBJS = $(OBJ_ADDON_$(RC_ADDON)) $(OBJ_DEVELOP_$(RC_DEVELOP)) builtins.o \ + edit-$(EDIT).o except.o exec.o $(OBJ_EXECVE_$(HASH_BANG)) fn.o footobar.o \ + getopt.o glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \ + nalloc.o open.o parse.o print.o redir.o sigmsgs.o signal.o status.o \ + $(OBJ_SYSTEM_$(HAVE_RESTARTABLE_SYSCALLS)) tree.o utils.o var.o wait.o \ + walk.o which.o +HDRS = addon.h develop.h edit.h getgroups.h input.h jbwrap.h proto.h rc.h \ + rlimit.h stat.h wait.h +BINS = history mksignal mkstatval tripping + +all: rc + +.PHONY: all check clean distclean install trip +.SUFFIXES: +.SUFFIXES: .c .o .y +$(V).SILENT: + +rc: $(OBJS) + @echo "LINK $@" + $(CC) $(ALL_LDFLAGS) $(ALL_CFLAGS) -o $@ $(OBJS) $(LDLIBS) + +$(OBJS): Makefile $(HDRS) config.h + +.c.o: + @echo "CC $@" + $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $< + +config.h: + @echo "GEN $@" + cp "$(srcdir)/config.def.h" $@ + +lex.o parse.o: parse.c + +.y.c: + @echo "GEN $@" + $(YACC) -b $* -d $< + mv $*.tab.c $*.c + mv $*.tab.h $*.h + +builtins.o fn.o hash.o sigmsgs.o signal.o status.o: sigmsgs.c + +sigmsgs.c: mksignal + @echo "GEN $@" + ./mksignal + +status.o: statval.h + +statval.h: mkstatval + @echo "GEN $@" + ./mkstatval >$@ + +$(BINS): Makefile rc.h proto.h config.h + +.c: + @echo "CC $@" + $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $< + +check: trip + +trip: rc tripping + ./rc -p <"$(srcdir)/trip.rc" + +clean: + rm -f *.o $(BINS) rc + +distclean: clean + rm -f config.h parse.[ch] sigmsgs.[ch] statval.h + +install: all + @echo "INSTALL bin/rc" + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp rc $(DESTDIR)$(PREFIX)/bin/ + chmod 755 $(DESTDIR)$(PREFIX)/bin/rc + @echo "INSTALL rc.1" + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + cp rc.1 $(DESTDIR)$(MANPREFIX)/man1/ + chmod 644 $(DESTDIR)$(MANPREFIX)/man1/rc.1 + diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index fac6214..0000000 --- a/Makefile.am +++ /dev/null @@ -1,67 +0,0 @@ -## Process this file with automake to produce Makefile.in - -EDIT=@EDIT@ - -if AMC_HISTORY -man_MANS = rc.1 history.1 -HISTORY = history -else -man_MANS = rc.1 -endif - -if AMC_NO_HASHBANG -EXECVE = execve.o -endif - -if AMC_RESTART -SYSTEM = system-bsd.o -else -SYSTEM = system.o -endif - -if AMC_DEVELOP -DEVELOP = develop.o -endif - -bin_PROGRAMS = rc -noinst_PROGRAMS = mksignal mkstatval tripping $(HISTORY) - -rc_SOURCES = builtins.c except.c exec.c fn.c footobar.c getopt.c glob.c glom.c hash.c heredoc.c input.c lex.c list.c main.c match.c nalloc.c open.c parse.y print.c redir.c signal.c status.c tree.c utils.c var.c wait.c walk.c which.c - -EXTRA_rc_SOURCES = addon.c edit-edit.c edit-editline.c edit-null.c edit-readline.c edit-vrl.c execve.c system.c system-bsd.c - -rc_DEPENDENCIES = sigmsgs.o $(ADDON) $(DEVELOP) $(EDIT) $(EXECVE) $(SYSTEM) -rc_LDADD = sigmsgs.o $(ADDON) $(DEVELOP) $(EDIT) $(EXECVE) $(SYSTEM) - -noinst_HEADERS = edit.h getgroups.h input.h jbwrap.h parse.h proto.h rc.h rlimit.h stat.h wait.h - -BUILT_SOURCES = parse.h sigmsgs.c - -EXTRA_DIST = EXAMPLES addon.c addon.h history.1 rc.1 trip.rc - -AM_YFLAGS = -d - -sigmsgs.c sigmsgs.h: mksignal - ./mksignal - -# Newer automake's buildtime dependency tracking can't seem to figure -# this one out. -status.o: statval.h - -statval.h: mkstatval - ./mkstatval > statval.h - -DISTCLEANFILES = parse.c parse.h sigmsgs.c sigmsgs.h statval.h - -check: trip - -trip: rc tripping - ./rc -p < $(srcdir)/trip.rc - -install-exec-hook: -if AMC_HISTORY - $(INSTALL_PROGRAM) history $(bindir)/- ;\ - rm -f $(bindir)/--; $(LN) $(bindir)/- $(bindir)/-- ;\ - rm -f $(bindir)/-p; $(LN) $(bindir)/- $(bindir)/-p ;\ - rm -f $(bindir)/--p; $(LN) $(bindir)/- $(bindir)/--p -endif diff --git a/README b/README index 004d5e2..f577a00 100644 --- a/README +++ b/README @@ -18,9 +18,5 @@ See COPYING for copying information. All files are Copyright 1991, 1999, 2001-2003, 2014, 2015 Byron Rakitzis. -See INSTALL for build and installation information. - The current maintainer is Toby Goodwin[1]. Please contact him with any problems, questions, bug reports, or suggestions. - -[1] mailto:toby@paccrat.org diff --git a/RELDATE b/RELDATE deleted file mode 100644 index b16a0df..0000000 --- a/RELDATE +++ /dev/null @@ -1 +0,0 @@ -2014-09-01 diff --git a/ReleaseTime b/ReleaseTime deleted file mode 100755 index 7dc6210..0000000 --- a/ReleaseTime +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/sed 1d -ChangeLog -NEWS -README -configure.ac -rc.1 diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 19d0d50..0000000 --- a/acinclude.m4 +++ /dev/null @@ -1,174 +0,0 @@ -dnl This macro sets HAVE_POSIX_GETGROUPS if the -dnl getgroups() function accepts a zero first argument. -AC_DEFUN([RC_FUNC_GETGROUPS], [ - AC_CACHE_CHECK(for POSIX getgroups, rc_cv_func_posix_getgroups, AC_TRY_RUN([ -#include -#include -int main(void) { - return getgroups(0, (void *)0) == -1; -} - ], rc_cv_func_posix_getgroups=yes, rc_cv_func_posix_getgroups=no, rc_cv_func_posix_getgroups=yes)) - case "$rc_cv_func_posix_getgroups" in - yes) AC_DEFINE(HAVE_POSIX_GETGROUPS, 1, [Define to 1 if you have the `getgroups' function with POSIX semantics.]) ;; - esac -]) - - -dnl We can't use AC_CHECK_FUNCS for sigsetjmp(), since it's a macro in -dnl some places. -AC_DEFUN([RC_FUNC_SIGSETJMP], [ - AC_CACHE_CHECK(for sigsetjmp, rc_cv_sigsetjmp, - AC_TRY_LINK([ -#include - ], [ -sigjmp_buf e; -sigsetjmp(e, 1); - ], rc_cv_sigsetjmp=yes, rc_cv_sigsetjmp=no)) - case "$rc_cv_sigsetjmp" in - yes) AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have the `sigsetjmp' function or macro.]) ;; - esac -]) - -dnl Similarly, AC_CHECK_FUNCS doesn't find strerror() on NetBSD. -AC_DEFUN([RC_FUNC_STRERROR], [ - AC_CACHE_CHECK(for strerror, rc_cv_strerror, - AC_TRY_LINK([ -#include - ], [ -strerror(0); - ], rc_cv_strerror=yes, rc_cv_strerror=no)) - case "$rc_cv_strerror" in - yes) AC_DEFINE(HAVE_STRERROR, 1, [Define to 1 if you have the `strerror' function or macro.]) ;; - esac -]) - -dnl HPUX needs _KERNEL defined to pick up RLIMIT_foo defines. (Why?) -AC_DEFUN([RC_NEED_KERNEL], [ - AC_CACHE_CHECK(if _KERNEL is required for RLIMIT defines, rc_cv_kernel_rlimit, - AC_TRY_COMPILE([ -#include -#include - ], [ -int f; -f = RLIMIT_DATA; - ], rc_cv_kernel_rlimit=no, [ AC_TRY_COMPILE([ -#include -#define _KERNEL -#include -#undef _KERNEL - ], [ -int f; -f = RLIMIT_DATA; - ], rc_cv_kernel_rlimit=yes, rc_cv_kernel_rlimit=no)])) - case "$rc_cv_kernel_rlimit" in - yes) AC_DEFINE(RLIMIT_NEEDS_KERNEL, 1, [Define to 1 if `_KERNEL' must be defined for `RLIMIT_*' macros.]) ;; - esac -]) - -dnl Look for rlim_t in sys/types.h and sys/resource.h -AC_DEFUN([RC_TYPE_RLIM_T], [ - AC_CACHE_CHECK(for rlim_t, rc_cv_have_rlim_t, - AC_EGREP_CPP(rlim_t, [ -#include -#if RLIMIT_NEEDS_KERNEL -#define _KERNEL -#endif -#include - ], rc_cv_have_rlim_t=yes, rc_cv_have_rlim_t=no)) - - case "$rc_cv_have_rlim_t" in - yes) AC_DEFINE(HAVE_RLIM_T, 1, [Define to 1 if you have the `rlim_t' type.]) ;; - no) AC_CACHE_CHECK(for native quad_t, rc_cv_have_quad_t, - AC_TRY_COMPILE([ -#include - ], [ -typedef quad_t align_t; -align_t a; -a = (quad_t)0; - ], rc_cv_have_quad_t=yes, rc_cv_have_quad_t=no)) - - case "$rc_cv_have_quad_t" in - yes) AC_DEFINE(HAVE_QUAD_T, 1, [Define to 1 if you have the `quad_t' type.]) - AC_CACHE_CHECK(if rlimit values are quad_t, rc_cv_rlim_t_is_quad_t, - AC_TRY_RUN([ -#include -#include -#include -#if RLIMIT_NEEDS_KERNEL -#define _KERNEL -#endif -#include -#if RLIMIT_NEEDS_KERNEL -#undef _KERNEL -#endif -main(){ - struct rlimit rl; - exit(sizeof rl.rlim_cur != sizeof(quad_t)); -} - ], rc_cv_rlim_t_is_quad_t=yes, rc_cv_rlim_t_is_quad_t=no, $ac_cv_type_quad_t)) - - case "$rc_cv_rlim_t_is_quad_t" in - yes) AC_DEFINE(RLIM_T_IS_QUAD_T, 1, [Define to 1 if `rlim_t' is `quad_t'.]) ;; - esac - ;; - esac - ;; - esac -]) - - -dnl Check type of sig_atomic_t. -AC_DEFUN([RC_TYPE_SIG_ATOMIC_T], [ - AC_CACHE_CHECK(for sig_atomic_t, rc_cv_sig_atomic_t, - AC_EGREP_HEADER(sig_atomic_t, signal.h, - rc_cv_sig_atomic_t=yes, rc_cv_sig_atomic_t=no)) - case "$rc_cv_sig_atomic_t" in - no) AC_DEFINE(sig_atomic_t, int, [Define to 1 if you have the `sig_atomic_t' type.]) ;; - esac -]) - - -dnl Do we have /dev/fd or /proc/self/fd? -AC_DEFUN([RC_SYS_DEV_FD], [ - AC_CACHE_CHECK(for /dev/fd, rc_cv_sys_dev_fd, - if test -d /dev/fd && test -r /dev/fd/0; then - rc_cv_sys_dev_fd=yes - elif test -d /proc/self/fd && test -r /proc/self/fd/0; then - rc_cv_sys_dev_fd=odd - else - rc_cv_sys_dev_fd=no - fi - ) -]) - - -dnl Can mknod make FIFOs? -AC_DEFUN([RC_SYS_MKNOD_FIFO], [ - AC_CACHE_CHECK(for mknod FIFOs, rc_cv_sys_fifo, - AC_TRY_RUN([ -#include -#include - -main() { - exit(mknod("/tmp/rc$$.0", S_IFIFO | 0666, 0) != 0); -} - ], rc_cv_sys_fifo=yes, rc_cv_sys_fifo=no, rc_cv_sys_fifo=no)) - rm -f /tmp/rc$$.0 - case "$rc_cv_sys_fifo" in - yes) AC_DEFINE(HAVE_FIFO) ;; - esac -]) - -dnl Where is tgetent()? -AC_DEFUN([RC_LIB_TGETENT], [ - AC_CHECK_LIB(tinfo, tgetent, - rc_lib_tgetent=-ltinfo, - AC_CHECK_LIB(termcap, tgetent, - rc_lib_tgetent=-ltermcap, - AC_CHECK_LIB(ncurses, tgetent, - rc_lib_tgetent=-lncurses, - AC_MSG_ERROR(tgetent not found) - ) - ) - ) -]) diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 3f026c4..0000000 --- a/bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -autoreconf --force --install diff --git a/config.def.h b/config.def.h new file mode 100644 index 0000000..f8b457f --- /dev/null +++ b/config.def.h @@ -0,0 +1,123 @@ +/* Define if you want rc to hand off exec errors to (e.g.) /bin/sh. */ +#define DEFAULTINTERP "/bin/sh" + +/* Define to the default path used if $PATH is empty when rc starts. */ +#define DEFAULTPATH "/usr/local/bin","/usr/bin","/bin","." + +/* Define if your kernel has SysV special SIGCLD semantics. */ +#define HAVE_SYSV_SIGCLD 1 + +/* Define if you have /dev/fd. */ +#define HAVE_DEV_FD 1 + +/* Define if you have /proc/self/fd. */ +#define HAVE_PROC_SELF_FD 1 + +/* Define if you have named pipes. */ +#define HAVE_FIFO 1 + +/* Define if quad_t is a native type. */ +/* #undef HAVE_QUAD_T */ + +/* Define if you have rlim_t. */ +#define HAVE_RLIM_T 1 + +/* Define if you have sigsetjmp(). */ +#define HAVE_SIGSETJMP 1 + +/* Define if you have strerror(). */ +#define HAVE_STRERROR 1 + +/* Define if you want rc to encode strange characters in the environment. */ +#define PROTECT_ENV 1 + +/* Define if you want echo as a builtin. */ +#define RC_ECHO 1 + +/* Define if you want rc to support broken apps, like a job control shell. */ +#define RC_JOB 1 + +/* Define if rlim_t is quad_t. */ +/* #undef RLIM_T_IS_QUAD_T */ + +/* Define to 1 if you have the `getgroups' function. */ +#define HAVE_GETGROUPS 1 + +/* Define if you have POSIX getgroups(). */ +#define HAVE_POSIX_GETGROUPS 1 + +/* Define to the type of elements in the array set by `getgroups'. Usually + this is either `int' or `gid_t'. */ +#define GETGROUPS_T gid_t + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the `mkfifo' function. */ +/* #undef HAVE_MKFIFO */ + +/* Define to 1 if you have the `setpgrp' function. */ +#define HAVE_SETPGRP 1 + +/* Define to 1 if the `setpgrp' function takes no argument. */ +#define SETPGRP_VOID 1 + +/* Define to 1 if you have the `setrlimit' function. */ +#define HAVE_SETRLIMIT 1 + +/* Define if RLIMIT_* macros need _KERNEL. */ +/* #undef RLIMIT_NEEDS_KERNEL */ + +/* Define to 1 if you have the `sigaction' function. */ +#define HAVE_SIGACTION 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + diff --git a/configure.ac b/configure.ac deleted file mode 100644 index cd6bf9e..0000000 --- a/configure.ac +++ /dev/null @@ -1,260 +0,0 @@ -dnl Our package name, version, ... -AC_INIT([rc], [1.7.4]) - -dnl ... and git description -DESCRIPTION=$(git describe || echo '(git description unavailable)') -AC_DEFINE_UNQUOTED(DESCRIPTION, "$DESCRIPTION", [Release date]) - -dnl Get things going... -AC_CONFIG_SRCDIR([rc.h]) -AM_INIT_AUTOMAKE - -AC_CONFIG_HEADERS(config.h) - -dnl Find a standard C compiler -AC_PROG_CC - -dnl If we're using gcc, specify `-Wall'. I've also checked the code -dnl with `-pedantic -W -Wall -Wpointer-arith -Wstrict-prototypes -dnl -Wmissing-prototypes', and checked that all the warnings generated -dnl are harmless. -case "$GCC" in -yes) CFLAGS="-Wall $CFLAGS" ;; -esac - -AC_SYS_LARGEFILE - -AC_PROG_CPP -AC_PROG_YACC -AC_CHECK_PROGS(LN, ln cp) - -AC_CHECK_HEADERS(sys/resource.h sys/time.h sys/types.h unistd.h) -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_HEADER_SYS_WAIT - -AC_TYPE_GETGROUPS -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_TYPE_UID_T -AC_CHECK_TYPE(ssize_t, long) - -AC_CHECK_FUNCS(getgroups lstat setpgrp setrlimit sigaction) - -dnl We prefer system calls that don't restart. If we have sigaction() -dnl we'll use it. Otherwise, we check whether good ol' signal() -dnl produces interruptible system calls. -case "$ac_cv_func_sigaction" in -no) AC_SYS_RESTARTABLE_SYSCALLS ;; -esac -AM_CONDITIONAL(AMC_RESTART, test "$ac_cv_sys_restartable_syscalls" = yes) - -RC_FUNC_GETGROUPS - -RC_FUNC_SIGSETJMP - -AC_FUNC_SETPGRP - -RC_FUNC_STRERROR - -RC_NEED_KERNEL - -RC_TYPE_RLIM_T - -RC_TYPE_SIG_ATOMIC_T - -dnl Does the kernel handle `#! /interpreter'? -AC_SYS_INTERPRETER -case "$ac_cv_sys_interpreter" in -yes) AC_DEFINE(HASH_BANG, 1, [Define to 1 if your kernel understands `#!' magic numbers]) ;; -esac -AM_CONDITIONAL(AMC_NO_HASHBANG, test "$ac_cv_sys_interpreter" = no) - - -dnl What do we do for command arguments? We want /dev/fd or Linux's -dnl /proc/self/fd. Failing that, we'll try for POSIX mkfifo(), or a -dnl mknod() that makes FIFOs. -RC_SYS_DEV_FD -case "$rc_cv_sys_dev_fd" in -yes) AC_DEFINE(HAVE_DEV_FD, 1, [Define to 1 if you have /dev/fd.]) ;; -odd) AC_DEFINE(HAVE_PROC_SELF_FD, 1, [Define to 1 if you have /proc/self/fd.]) ;; -no) AC_CHECK_FUNCS(mkfifo) ;; -esac - -case "$ac_cv_func_mkfifo" in -yes) AC_DEFINE(HAVE_FIFO, 1, [Define to 1 if you have the `mkfifo' function.]) ;; -no) RC_SYS_MKNOD_FIFO ;; -esac - -dnl Now handle arguments. -AC_ARG_ENABLE(builtin-echo, [ --disable-builtin-echo Don't include `echo' as a builtin], - test "x$enableval" != "xno" && AC_DEFINE(RC_ECHO, 1, [Define to 1 to include `echo' as a builtin.]), - AC_DEFINE(RC_ECHO)) - -AC_ARG_ENABLE(job, [ --disable-job Don't do job-control-style backgrounding], - test "x$enableval" != "xno" && AC_DEFINE(RC_JOB, 1, [Define to 1 to use job-control-style backgrounding.]), - AC_DEFINE(RC_JOB)) - -AC_ARG_ENABLE(protect-env, [ --disable-protect-env Don't protect environment names], - test "x$enableval" != "xno" && AC_DEFINE(PROTECT_ENV, 1, [Define to 1 to encode exported environment names.]), - AC_DEFINE(PROTECT_ENV)) - -AC_ARG_ENABLE(def-interp, -[ --enable-def-interp=/bin/foo - Use /bin/foo as default interpreter [[/bin/sh]]], -[ - case "$enableval" in - no) - ;; - yes) - AC_DEFINE(DEFAULTINTERP, "/bin/sh", [The default interpreter]) - ;; - *) - AC_DEFINE_UNQUOTED(DEFAULTINTERP, "$enableval") - esac -], - AC_DEFINE(DEFAULTINTERP, "/bin/sh")) - -AC_ARG_ENABLE(def-path, -[ --enable-def-path=\"/usr/local/bin/\",\"/usr/bin\" - Default path [[All of these that exist - (/usr/local/bin /usr/bin /usr/bsd /usr/ucb /bin .)]]], -[ - case "$enableval" in - no|yes) ;; - *) AC_DEFINE_UNQUOTED(DEFAULTPATH, $enableval, [The default path]) ;; - esac -], - enable_def_path=yes) - -case "$enable_def_path" in -yes) AC_CACHE_CHECK(extant directories for default path, rc_cv_def_path,[ - rc_cv_def_path='' - for i in /usr/local/bin /usr/bin /usr/bsd /usr/ucb /bin .; do - if test -d $i; then - case "$rc_cv_def_path" in - '') rc_cv_def_path=\"$i\" ;; - *) rc_cv_def_path=$rc_cv_def_path,\"$i\" ;; - esac - fi - done - ]) - AC_DEFINE_UNQUOTED(DEFAULTPATH, $rc_cv_def_path) - ;; -esac - - -AC_ARG_ENABLE(develop, - [ --enable-develop Include extra code for developers],[ - case "$enableval" in - yes) - rc_develop=true - AC_DEFINE([RC_DEVELOP], 1, [Enable developer options]) ;; - no) ;; - *) AC_MSG_ERROR([bad value $enableval for --enable-develop]) ;; - esac]) -AM_CONDITIONAL(AMC_DEVELOP, test "$rc_develop" = true) - - -AC_ARG_WITH(history, - [ --with-history Build history subprograms],[ - case "$withval" in - yes) rc_history=yes ;; - *) rc_history=no ;; - esac - ], rc_history=no) -AM_CONDITIONAL(AMC_HISTORY, test "$rc_history" = yes) - - -AC_ARG_WITH(addon, [ --with-addon[[=foo.c]] Extra builtins, from addon.c by default ],[ - case "$withval" in - yes) ADDON=addon.o ;; - no) ADDON='' ;; - *) ADDON=`echo $withval |sed 's/\.c$/\.o/'` ;; - esac -]) -AM_CONDITIONAL(AMC_ADDON, test "$ADDON" != "") -case "$ADDON" in -?*) AC_DEFINE(RC_ADDON, 1, [Define to 1 to use addon functions.]) ;; -esac -AC_SUBST(ADDON) - - -EDIT=edit-null.o -AC_ARG_WITH(edit, [ --with-edit=(edit,editline,readline,vrl) Command line editing library], [ - case $withval in - yes) - AC_MSG_ERROR(must specify which library) - # might consider searching - ;; - no|null) - ;; - edit|bsd) - EDIT=edit-edit.o - RC_LIB_TGETENT - AC_CHECK_LIB(edit, el_init, [ - LIBS="$LIBS -ledit $rc_lib_tgetent" - ], AC_MSG_ERROR(edit library not found), $rc_lib_tgetent) - ;; - editline) - EDIT=edit-editline.o - RC_LIB_TGETENT - AC_CHECK_LIB(editline, el_ring_bell, [ - LIBS="$LIBS -leditline $rc_lib_tgetent" - ], AC_MSG_ERROR(editline library not found), $rc_lib_tgetent) - ;; - readline|gnu) - EDIT=edit-readline.o - RC_LIB_TGETENT - AC_CHECK_LIB(readline, readline, [ - LIBS="$LIBS -lreadline $rc_lib_tgetent" - ], AC_MSG_ERROR(readline library not found), $rc_lib_tgetent) - AC_TRY_LINK([ - #include - #include - ], [ - rl_catch_signals = 0; - ], [], AC_MSG_ERROR(readline >= 4.0 not found)) - ;; - vrl) - EDIT=edit-vrl.o - RC_LIB_TGETENT - AC_CHECK_LIB(vrl, iline_peekch, [ - LIBS="$LIBS -lvrl $rc_lib_tgetent" - ], AC_MSG_ERROR(vrl library not found), $rc_lib_tgetent) - ;; - *) - AC_MSG_ERROR(unknown editing library $withval) - ;; - esac -]) -AC_SUBST(EDIT) -dnl AC_CHECK_LIB(edit, readline, -dnl AC_DEFINE(EDITLINE, 1, [Define to 1 if you are using `editline' or `vrl'.]) LIBS="$LIBS -ledit", -dnl AC_MSG_ERROR(editline library not found))) - -dnl if test "${with_vrl+set}" = set -o "${with_readline+set}" = set; then -dnl RC_LIB_TGETENT -dnl fi - -dnl AC_ARG_WITH(vrl, [ --with-vrl Gert-Jan Vons's line editing], -dnl AC_CHECK_LIB(vrl, readline, -dnl AC_DEFINE(EDITLINE) LIBS="$LIBS -lvrl $rc_lib_tgetent", -dnl AC_MSG_ERROR(vrl library not found), $rc_lib_tgetent)) - -dnl There are (at least) two incompatible versions of readline, and we -dnl need to know which one we are using. We don't support readline 2.0. -dnl AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], [ -dnl AC_CHECK_LIB(readline, readline, [ -dnl AC_DEFINE(READLINE, 1, [Define to 1 if you are using GNU `readline'.]) -dnl LIBS="$LIBS -lreadline $rc_lib_tgetent" -dnl AC_CHECK_LIB(readline, _rl_clean_up_for_exit, , AC_DEFINE(READLINE_OLD, 1, [Define to 1 for older versions GNU `readline'.]), $rc_lib_tgetent) -dnl ], AC_MSG_ERROR(readline library not found), $rc_lib_tgetent) -dnl ]) -dnl AM_CONDITIONAL(AMC_READLINE, test "${with_readline+set}" = set) - -dnl For some reason CPPFLAGS doesn't get propagated. -dnl AC_SUBST(CPPFLAGS) - - -AC_OUTPUT(Makefile) diff --git a/configure.scan b/configure.scan deleted file mode 100644 index ffd9f27..0000000 --- a/configure.scan +++ /dev/null @@ -1,49 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ(2.56) -AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) -AC_CONFIG_SRCDIR([parse.c]) -AC_CONFIG_HEADER([config.h]) - -# Checks for programs. -AC_PROG_AWK -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_CPP - -# Checks for libraries. - -# Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/param.h sys/time.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_STDBOOL -AC_C_CONST -AC_TYPE_UID_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_C_VOLATILE - -# Checks for library functions. -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_FORK -AC_FUNC_GETGROUPS -AC_FUNC_GETPGRP -AC_FUNC_LSTAT -AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK -AC_FUNC_MALLOC -AC_FUNC_REALLOC -AC_TYPE_SIGNAL -AC_FUNC_STAT -AC_CHECK_FUNCS([dup2 memset mkfifo strchr strerror strrchr strspn]) - -AC_CONFIG_FILES([Makefile - rc-1.7s20020820/Makefile - rc-1.7s20021127/=build/Makefile - rc-1.7s20021127/Makefile]) -AC_OUTPUT diff --git a/mkinstalldirs b/mkinstalldirs deleted file mode 100755 index a31ce6d..0000000 --- a/mkinstalldirs +++ /dev/null @@ -1,162 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy - -scriptversion=2016-01-11.22; # UTC - -# Original author: Noah Friedman -# Created: 1993-05-16 -# Public domain. -# -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' -IFS=" "" $nl" -errstatus=0 -dirmode= - -usage="\ -Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... - -Create each directory DIR (with mode MODE, if specified), including all -leading file name components. - -Report bugs to ." - -# process command line arguments -while test $# -gt 0 ; do - case $1 in - -h | --help | --h*) # -h for help - echo "$usage" - exit $? - ;; - -m) # -m PERM arg - shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } - dirmode=$1 - shift - ;; - --version) - echo "$0 $scriptversion" - exit $? - ;; - --) # stop option processing - shift - break - ;; - -*) # unknown option - echo "$usage" 1>&2 - exit 1 - ;; - *) # first non-opt arg - break - ;; - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in - 0) exit 0 ;; -esac - -# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and -# mkdir -p a/c at the same time, both will detect that a is missing, -# one will create a, then the other will try to create a and die with -# a "File exists" error. This is a problem when calling mkinstalldirs -# from a parallel make. We use --version in the probe to restrict -# ourselves to GNU mkdir, which is thread-safe. -case $dirmode in - '') - if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - else - # On NextStep and OpenStep, the 'mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because '.' already - # exists. - test -d ./-p && rmdir ./-p - test -d ./--version && rmdir ./--version - fi - ;; - *) - if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && - test ! -d ./--version; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - else - # Clean up after NextStep and OpenStep mkdir. - for d in ./-m ./-p ./--version "./$dirmode"; - do - test -d $d && rmdir $d - done - fi - ;; -esac - -for file -do - case $file in - /*) pathcomp=/ ;; - *) pathcomp= ;; - esac - oIFS=$IFS - IFS=/ - set fnord $file - shift - IFS=$oIFS - - for d - do - test "x$d" = x && continue - - pathcomp=$pathcomp$d - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - lasterr= - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp=$pathcomp/ - done -done - -exit $errstatus - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/nonblock.c b/nonblock.c deleted file mode 100644 index dbe31d3..0000000 --- a/nonblock.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Set stdin to nonblocking. */ -#include -#include -#include -#include -int main(void) { - int flags; - flags = fcntl(0, F_GETFL); - flags |= O_NONBLOCK; - fcntl(0, F_SETFL, (long) flags); - flags = read(0, &flags, 1); - printf("read returns %d, errno == %d\n", flags, errno); - return 0; -} diff --git a/random.pl b/random.pl deleted file mode 100644 index 90998d5..0000000 --- a/random.pl +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/perl - -$count = 10; -$size = rand(1000); - -for ($i = 0; $i < $count; ++$i) { - open OUT, "> t$i" or die; - for ($j = 0; $j < $size; ++$j) { - printf OUT "%c", rand(256); - } - close OUT; - $cmd = "./rc t$i"; - print $cmd, "\n"; - system $cmd; -} diff --git a/slow b/slow deleted file mode 100644 index dcd19ce..0000000 --- a/slow +++ /dev/null @@ -1,11 +0,0 @@ -for (i in 0 1 2 3 4 5 6 7 8 9) { - x=() - y=() - for (j in 0 1 2 3 4 5 6 7 8 9) - for (k in 0 1 2 3 4 5 6 7 8 9) - for (l in 0 1 2 3 4 5 6 7 8 9) { - x = $x^. - y = ($y $x) - } - echo $#y -} diff --git a/stamp-h b/stamp-h deleted file mode 100644 index 9788f70..0000000 --- a/stamp-h +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/stamp-h.in b/stamp-h.in deleted file mode 100644 index 9788f70..0000000 --- a/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/tmp b/tmp deleted file mode 100644 index 1b54a36..0000000 --- a/tmp +++ /dev/null @@ -1,2 +0,0 @@ -x=('#' '#' '#') -eval z^`{whatis -v x} >[2]/dev/null diff --git a/version.c.in b/version.c.in deleted file mode 100644 index 691c9b0..0000000 --- a/version.c.in +++ /dev/null @@ -1 +0,0 @@ -const char id[] = "@(#)@PACKAGE@ version @VERSION@, @DESCRIPTION@."; -- cgit v1.2.3