summaryrefslogtreecommitdiffstats
path: root/bin/sh/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Sync sh(1) in stable/10 to head.jmmv2014-03-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a MFC of all the commits listed below. My original goal of this change was to only merge the move of the tests from tools/regression/bin/ into the new layout (which include tests for sh(1) and other tools as well). However, doing so is tricky due to the ongoing work in sh(1) and, especially, the many changes to its tests since stable/10 was first branched. Merging everything is the simplest way to achieve this goal and, as a bonus point, we get various fixes and miscellaneous improvements into the branch. Per jilles' suggestion, I'm avoiding the merge of a couple of changes (r256850 and r257506) that required depending kernel changes. I'm also avoiding very recent changes that have not had a long enough time to be validated in current. This is "make tinderbox" clean. r256735 sh: Remove one syscall when waiting for a foreground job. r257399 sh: Allow trapping SIGINT/SIGQUIT after ignore because of '&'. r257504 sh: Reorder union node to reduce its size on 64-bit platforms. r257920 sh: Add a test case for would-be assignments that are not due to quoting. r257929 sh: Properly quote alias output from command -v. r258489 sh: Add tests for the </dev/null implicit in a background command. r258533 sh: Add more tests for the </dev/null implicit in a background command. r258535 sh: Make <&0 disable the </dev/null implicit in a background command. r258776 sh: Prefer memcpy() to strcpy() in most cases. Remove the scopy macro. r259047 sh: Split set -x output into a separate function. r259210 Migrate tools/regression/bin/ tests to the new layout. r259844 sh: Remove an unused variable. r259846 sh: Initialize OPTIND=1 even if it came from the environment. r259874 sh: Simplify code related to PPID variable. r259946 sh: Don't check input for non-whitespace if history is disabled. r260246 sh(1): Discourage use of -e. r260506 Run the sh(1) and test(1) tests as unprivileged. r260586 Mark the bin/pax tests as requiring perl. r260634 Use TAP_TESTS_PERL to register the legacy_test in bin/pax. r260635 Replace hand-crafted Kyuafiles with automatic generation. r260654 sh: Remove SIGWINCH handler and just check for resize before every read. r261121 sh: Add test for nested alias. r261125 sh: Solve the alias recursion problem in a less hackish way. r261141 sh: Do not depend on parse/execute split in new alias test. r261160 sh: Add tests for alias names after another alias. r261192 sh: Allow aliases to force alias substitution on the following word. r262533 sh: Make expari() static. r262565 sh: Do not corrupt internal representation if LINENO inner expansion fails. r262697 sh: Simplify expari(). Reviewed by: jilles
* sh: Remove mkinit.jilles2013-07-251-8/+3
| | | | | | | | | | | | | | Replace the RESET blocks with regular functions and a reset() function that calls them all. This code generation tool is unusual and does not appear to provide much benefit. I do not think isolating the knowledge about which modules need to be reset is worth an almost 500-line build tool and wider scope for variables used by the reset functions. Also, relying on reset functions is often wrong: the cleanup should be done in exception handlers so that no stale state remains after 'command eval' and the like.
* Work better with how make/bmake works:marcel2012-05-241-1/+1
| | | | | | | | | | | | 1. Avoid a cd back into ${.CURDIR} to run mkbuiltins when we know make will first cd into ${.OBJDIR}. Keep the cwd to what make sets it to. 2. Don't tell mkbuiltins where to write to (= ${.OBJDIR}), but where to get sources from (= ${.CURDIR}). This to compensate for point 1. This fixes a problem with bmake's mk files that optimize ${.OBJDIR} to expand to "." after changing cwd, not taking into account that the target is pretty much undoing that and not getting the full path to the object tree anymore.
* sh: Import arithmetic expression code from dash.jilles2011-02-081-5/+5
| | | | | | | | | | | | | | | | New features: * proper lazy evaluation of || and && * ?: ternary operator * executable is considerably smaller (8K on i386) because lex and yacc are no longer used Differences from dash: * arith_t instead of intmax_t * imaxdiv() not used * unset or null variables default to 0 * let/exp builtin (undocumented, will probably be removed later) Obtained from: dash
* sh: Add kill builtin.jilles2010-12-211-1/+2
| | | | | | | | | | | | | | | | | This allows specifying a %job (which is equivalent to the corresponding process group). Additionally, it improves reliability of kill from sh in high-load situations and ensures "kill" finds the correct utility regardless of PATH, as required by POSIX (unless the undocumented %builtin mechanism is used). Side effect: fatal errors (any error other than kill(2) failure) now return exit status 2 instead of 1. (This is consistent with other sh builtins, but not in NetBSD.) Code size increases about 1K on i386. Obtained from: NetBSD
* sh: Add printf builtin.jilles2010-11-191-2/+3
| | | | | | | | | | | | | | | | | This was removed in 2001 but I think it is appropriate to add it back: * I do not want to encourage people to write fragile and non-portable echo commands by making printf much slower than echo. * Recent versions of Autoconf use it a lot. * Almost no software still wants to support systems that do not have printf(1) at all. * In many other shells printf is already a builtin. Side effect: printf is now always the builtin version (which behaves identically to /usr/bin/printf) and cannot be overridden via PATH (except via the undocumented %builtin mechanism). Code size increases about 5K on i386. Embedded folks might want to replace /usr/bin/printf with a hard link to /usr/bin/alias.
* We only need to look as far as '..' to find 'test/'.obrien2010-10-131-1/+1
|
* In the spirit of r90111, depend on c89 and remove the "STATIC" macroobrien2010-10-131-1/+1
| | | | and its usage.
* If one wishes to set breakpoints of static the functions here, theyobrien2010-10-131-1/+1
| | | | | | cannot be inlined. Submitted by: jhb
* Suggest that DEBUG_FLAGS be used to enable extra debugging rather thanjhb2010-10-131-1/+1
| | | | | | | frobbing CFLAGS directly. DEBUG_FLAGS is something that can be specified on the make command line without having to edit the Makefile directly. Submitted by: Garrett Cooper
* If DEBUG is 3 or greater, disable STATICization of functions.obrien2010-10-121-1/+1
| | | | Also correct the documented location of the trace file.
* Allow one to regression test 'sh' changes without having to installobrien2010-10-121-0/+3
| | | | a potentially bad /bin/sh first.
* Reduce the WARNS level to avoid a compiler warning about a variablejb2007-11-181-1/+1
| | | | possibly being clobbered by a longjmp or a fork with gcc4.
* Whitespace nits.schweikh2006-04-171-1/+1
|
* Recent cleanups made it possible to bump WARNS to 3.stefanf2005-08-141-1/+1
|
* Install /bin/sh safely. This allows a shell script to be usedru2004-03-181-0/+1
| | | | | | | to strip binaries by specifying it in the STRIPBIN environment variable honoured by install(1). MFC after: 3 days
* style.Makefile:johan2004-02-231-1/+1
| | | | Use WARNS?= instead of WARNS=
* Fixed style of DPADD and LDADD assignments as per style.Makefile(5).ru2004-02-051-2/+2
|
* Removed duplicate y.tab.h from SRCS and CLEANFILES.ru2004-01-201-1/+1
|
* The is_name and is_in_name macros are FUBAR'ed.obrien2003-05-021-0/+2
| | | | | | Due to the use of signed vs. unsigned chars on our various platforms, one gets "warning: comparison is always true due to limited range of data type" from GCC 3.3.
* It is now safe to remove WARNS=0 and WFORMAT=0.mux2002-10-011-2/+0
| | | | Tested on: alpha, i386, sparc64
* Add back WARNS=0 and WFORMAT=0; gcc is finding nonexistent format stringtjr2002-10-011-0/+2
| | | | errors with %qd formats.
* Remove WARNS=0 and WFORMAT=0. The shell compiles cleanly at WARNS=2tjr2002-10-011-2/+0
| | | | | on at least i386. If there are warnings on other archs, I'd rather hear about them than pretend they didn't exist.
* Lock down with WFORMAT=1 except those directories with unfixed warnings.kris2002-02-041-0/+1
| | | | Tested on i386 and alpha.
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyobrien2001-12-041-0/+1
| | | | | | set WARNS=0. Reviewed by: mike
* Remove the printf builtin command from sh(1), which command is notknu2001-11-201-3/+2
| | | | | | | | | | | | used so often that it's worth keeping it as a builtin. Now that all the printf invocations from within the system startup scripts, we can safely remove it. Urged by: sheldonh :) No MFC is planned so far because it may break compatibility and violate POLA.
* Make test(1) a builtin command of our sh(1) for efficiency. Theknu2001-11-171-2/+4
| | | | | | | | | | | binary size increase is 3,784 bytes (about 0.6%). I don't drop the printf builtin while I'm here because some /etc/rc.* scripts seem to use it before mounting /usr where printf(1) resides. Reviewed by: arch (sheldonh) Inspired by: NetBSD, ksh Clued by: ume (on how the printf builtin is used)
* Improve shell documentation:sheldonh1999-09-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | * Consistently misspell built-in as builtin. * Add a builtin(1) manpage and create builtin(1) MLINKS for all shell builtin commands for which no standalone utility exists. These MLINKS replace those that were created for csh(1). * Add appropriate xrefs for builtin(1) to the csh(1) and sh(1) manpages, as well as to the manpages of standalone utilities which are supported as shell builtin commands in at least one of the shells. In such manpages, explain that similar functionality may be provided as a shell builtin command. * Improve sh(1)'s description of the cd builtin command. Csh(1) already describes it adequately. Replace the cd(1) manpage with a builtin(1) MLINKS link. * Clean up some mdoc problems: use Xr instead of literal "foo(n)"; use Ic instead of Xr for shell builtin commands. * Undo English contractions. Reviewed by: mpp, rgrimes
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Added a `build-tools' target for internal tools.bde1998-07-071-4/+3
| | | | | | Removed explicit dependencies of foo.o on foo.c. These were mainly placeholders for comments about missing dependencies of tools objects on headers. This problem needs to be handled more generally.
* Backed out previous backout. Put y.tab.h back in SRCS.bde1998-05-061-10/+6
|
* Backed out previous commit. It was tested, but not for the case wherebde1998-05-051-4/+8
| | | | | a separate object tree doesn't exist. Crufty makefiles will have to put y.tab.h in SRCS so that we know not to create foo.h from foo.y.
* Fixed races in `make -jN' using new yacc rules.bde1998-05-041-8/+4
|
* Backed out most of rev.1.19 (explicit dependencies of object filesbde1998-04-261-19/+1
| | | | on generated headers). This is now handled generally in bsd.prog.mk.
* Changes to support full make parallelism (-j<n>) in the worldjkh1997-10-051-6/+9
| | | | | | target. Reviewed by: <many different folks> Submitted by: Nickolay N. Dudorov" <nnd@nnd.itfs.nsk.su>
* Restored clobbered parts of rev.1.15 (build intermediate object filesbde1997-08-251-2/+14
| | | | for tools).
* Remove y.tab.h from the beforedepend target. Also add asteve1997-05-211-2/+3
| | | | | | rule that shows the dependency of arith_lex.[co] on y.tab.h. Suggested by: Bruce Evans <bde@zeta.org.au>
* Add explicit y.tab.h rule so that 'make depend clean all' doessteve1997-05-191-2/+4
| | | | not fail with an "don't know how to make y.tab.h" error.
* Miscellaneous sorting and addition of rules for object files thatsteve1997-05-191-11/+25
| | | | | | depend on generated headers. Reviewed by: Bruce Evans <bde@zeta.org.au>
* Shamelessly pilfer most of NetBSD's Makefile so that thesteve1997-04-281-28/+16
| | | | | | | | problem with 'make -j n' and no .depend file goes away. I think Bruce mentioned this somewhere on one of the mailing lists. Obtained from: NetBSD
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Build intermediate object files for mkinit, mknodes and mksyntaxbde1996-10-251-6/+19
| | | | | | | | so that simple regresssion tests based on `cmp' work. mkdep still doesn't work right for these tools. They should probably be in separate directories. Sorted dependencies.
* oops, I didn't mean for the unconditional DEBUG code to go in, it's beenpeter1996-09-011-1/+3
| | | | | off in FreeBSD for some time. I realised this a few seconds after the commit started..
* Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is apeter1996-09-011-38/+26
| | | | | | | | | | | | | | merge of parallel duplicate work by Steve Price and myself. :-] There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes. This closes a pile of /bin/sh PR's, but not all of them.. Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
* Bring in my changes for removing the pestilent obj links (unless youjkh1996-06-241-2/+2
| | | | | really want them) from /usr/src. This is the final version of the patches, incorporating the feedback I've received from -current.
* Backup yacc changes.phk1996-06-021-4/+3
|
* Use new yacc rules. (I'm fixing the tree as fast as I can :-)phk1996-05-301-4/+5
|
* Fix the borokeness that crept in with rev 1.10 of parser.c, the shjoerg1996-02-031-1/+4
| | | | | | | | didn't correctly start background jobs anymore. Strange that nobody was complaining... Add a dummy target for `builtins' in the Makefile, to prevent it from attempting to build this file by compiling builtins.c. :-/
* Make the shell handle a null command in a &&/|| sequence correctly.joerg1995-08-271-1/+3
| | | | | | | | | | | | | The && and || tokens do also terminate a command, not only the newline. While i was at it, disabled trace code by default, it served no good purpose since it required the use of a debugger anyway to be turned on. Instead, placed a hint in the Makefile on how to turn it on. This makes the shell ~ 10 % faster and ~ 4 KB smaller. :) Pointed out by: jan@physik.TU-Berlin.DE (Jan Riedinger)
OpenPOWER on IntegriCloud