head	1.20;
access;
symbols
	RELENG_8_4:1.20.0.2
	RELENG_9_1_0_RELEASE:1.18.2.1.4.2
	RELENG_9_1:1.18.2.1.0.4
	RELENG_9_1_BP:1.18.2.1
	RELENG_8_3_0_RELEASE:1.16.10.2.4.1
	RELENG_8_3:1.16.10.2.0.4
	RELENG_8_3_BP:1.16.10.2
	RELENG_9_0_0_RELEASE:1.18.2.1.2.1
	RELENG_9_0:1.18.2.1.0.2
	RELENG_9_0_BP:1.18.2.1
	RELENG_9:1.18.0.2
	RELENG_9_BP:1.18
	RELENG_7_4_0_RELEASE:1.16.14.1
	RELENG_8_2_0_RELEASE:1.16.10.2.2.1
	RELENG_7_4:1.16.0.14
	RELENG_7_4_BP:1.16
	RELENG_8_2:1.16.10.2.0.2
	RELENG_8_2_BP:1.16.10.2
	RELENG_8_1_0_RELEASE:1.16.10.1.4.1
	RELENG_8_1:1.16.10.1.0.4
	RELENG_8_1_BP:1.16.10.1
	RELENG_7_3_0_RELEASE:1.16.12.1
	RELENG_7_3:1.16.0.12
	RELENG_7_3_BP:1.16
	RELENG_8_0_0_RELEASE:1.16.10.1.2.1
	RELENG_8_0:1.16.10.1.0.2
	RELENG_8_0_BP:1.16.10.1
	RELENG_8:1.16.0.10
	RELENG_8_BP:1.16
	RELENG_7_2_0_RELEASE:1.16.8.1
	RELENG_7_2:1.16.0.8
	RELENG_7_2_BP:1.16
	RELENG_7_1_0_RELEASE:1.16.6.1
	RELENG_6_4_0_RELEASE:1.14.2.2.6.1
	RELENG_7_1:1.16.0.6
	RELENG_7_1_BP:1.16
	RELENG_6_4:1.14.2.2.0.6
	RELENG_6_4_BP:1.14.2.2
	RELENG_7_0_0_RELEASE:1.16
	RELENG_6_3_0_RELEASE:1.14.2.2
	RELENG_7_0:1.16.0.4
	RELENG_7_0_BP:1.16
	RELENG_6_3:1.14.2.2.0.4
	RELENG_6_3_BP:1.14.2.2
	RELENG_7:1.16.0.2
	RELENG_7_BP:1.16
	RELENG_6_2_0_RELEASE:1.14.2.2
	RELENG_6_2:1.14.2.2.0.2
	RELENG_6_2_BP:1.14.2.2
	RELENG_5_5_0_RELEASE:1.13
	RELENG_5_5:1.13.0.8
	RELENG_5_5_BP:1.13
	RELENG_6_1_0_RELEASE:1.14.2.1
	RELENG_6_1:1.14.2.1.0.2
	RELENG_6_1_BP:1.14.2.1
	RELENG_6_0_0_RELEASE:1.14
	RELENG_6_0:1.14.0.4
	RELENG_6_0_BP:1.14
	RELENG_6:1.14.0.2
	RELENG_6_BP:1.14
	RELENG_5_4_0_RELEASE:1.13
	RELENG_5_4:1.13.0.6
	RELENG_5_4_BP:1.13
	RELENG_4_11_0_RELEASE:1.8.2.3
	RELENG_4_11:1.8.2.3.0.8
	RELENG_4_11_BP:1.8.2.3
	RELENG_5_3_0_RELEASE:1.13
	RELENG_5_3:1.13.0.4
	RELENG_5_3_BP:1.13
	RELENG_5:1.13.0.2
	RELENG_5_BP:1.13
	RELENG_4_10_0_RELEASE:1.8.2.3
	RELENG_4_10:1.8.2.3.0.6
	RELENG_4_10_BP:1.8.2.3
	RELENG_5_2_1_RELEASE:1.12
	RELENG_5_2_0_RELEASE:1.12
	RELENG_5_2:1.12.0.2
	RELENG_5_2_BP:1.12
	RELENG_4_9_0_RELEASE:1.8.2.3
	RELENG_4_9:1.8.2.3.0.4
	RELENG_4_9_BP:1.8.2.3
	RELENG_5_1_0_RELEASE:1.11
	RELENG_5_1:1.11.0.4
	RELENG_5_1_BP:1.11
	RELENG_4_8_0_RELEASE:1.8.2.3
	RELENG_4_8:1.8.2.3.0.2
	RELENG_4_8_BP:1.8.2.3
	RELENG_5_0_0_RELEASE:1.11
	RELENG_5_0:1.11.0.2
	RELENG_5_0_BP:1.11
	RELENG_4_7_0_RELEASE:1.8.2.2
	RELENG_4_7:1.8.2.2.0.2
	RELENG_4_7_BP:1.8.2.2
	RELENG_4_6_2_RELEASE:1.8.2.1
	RELENG_4_6_1_RELEASE:1.8.2.1
	RELENG_4_6_0_RELEASE:1.8.2.1
	RELENG_4_6:1.8.2.1.0.8
	RELENG_4_6_BP:1.8.2.1
	RELENG_4_5_0_RELEASE:1.8.2.1
	RELENG_4_5:1.8.2.1.0.6
	RELENG_4_5_BP:1.8.2.1
	RELENG_4_4_0_RELEASE:1.8.2.1
	RELENG_4_4:1.8.2.1.0.4
	RELENG_4_4_BP:1.8.2.1
	RELENG_4_3_0_RELEASE:1.8.2.1
	RELENG_4_3:1.8.2.1.0.2
	RELENG_4_3_BP:1.8.2.1
	RELENG_4_2_0_RELEASE:1.8
	RELENG_4_1_1_RELEASE:1.8
	PRE_SMPNG:1.8
	RELENG_4_1_0_RELEASE:1.8
	RELENG_3_5_0_RELEASE:1.7.2.1
	RELENG_4_0_0_RELEASE:1.8
	RELENG_4:1.8.0.2
	RELENG_4_BP:1.8
	RELENG_3_4_0_RELEASE:1.7.2.1
	RELENG_3_3_0_RELEASE:1.7.2.1
	RELENG_3_2_PAO:1.7.0.4
	RELENG_3_2_PAO_BP:1.7
	RELENG_3_2_0_RELEASE:1.7
	RELENG_3_1_0_RELEASE:1.7
	RELENG_3:1.7.0.2
	RELENG_3_BP:1.7
	RELENG_2_2_8_RELEASE:1.5.2.1
	RELENG_3_0_0_RELEASE:1.7
	RELENG_2_2_7_RELEASE:1.5
	RELENG_2_2_6_RELEASE:1.5
	RELENG_2_2_5_RELEASE:1.5
	RELENG_2_2_2_RELEASE:1.5
	RELENG_2_2_1_RELEASE:1.5
	RELENG_2_2_0_RELEASE:1.5
	RELENG_2_1_7_RELEASE:1.3
	RELENG_2_1_6_1_RELEASE:1.3
	RELENG_2_1_6_RELEASE:1.3
	RELENG_2_2:1.5.0.2
	RELENG_2_2_BP:1.5
	RELENG_2_1_5_RELEASE:1.3
	bsd_44_lite_2:1.1.1.2
	RELENG_2_1_0_RELEASE:1.3
	RELENG_2_1_0:1.3.0.4
	RELENG_2_1_0_BP:1.3
	RELENG_2_0_5_RELEASE:1.3
	RELENG_2_0_5:1.3.0.2
	RELENG_2_0_5_BP:1.3
	RELENG_2_0_5_ALPHA:1.3
	RELEASE_2_0:1.2
	BETA_2_0:1.2
	ALPHA_2_0:1.2.0.2
	bsd_44_lite:1.1.1.1
	CSRG:1.1.1;
locks; strict;
comment	@# @;


1.20
date	2012.11.17.01.48.32;	author svnexp;	state Exp;
branches
	1.20.2.1;
next	1.19;

1.19
date	2012.05.24.19.48.15;	author marcel;	state Exp;
branches;
next	1.18;

1.18
date	2011.06.13.21.03.27;	author jilles;	state Exp;
branches
	1.18.2.1;
next	1.17;

1.17
date	2009.12.27.18.04.05;	author jilles;	state Exp;
branches;
next	1.16;

1.16
date	2006.04.02.18.43.33;	author stefanf;	state Exp;
branches
	1.16.2.1
	1.16.6.1
	1.16.8.1
	1.16.10.1
	1.16.12.1
	1.16.14.1;
next	1.15;

1.15
date	2005.08.13.08.09.22;	author stefanf;	state Exp;
branches;
next	1.14;

1.14
date	2005.01.10.08.39.25;	author imp;	state Exp;
branches
	1.14.2.1;
next	1.13;

1.13
date	2004.04.06.20.06.51;	author markm;	state Exp;
branches;
next	1.12;

1.12
date	2003.09.13.06.59.22;	author schweikh;	state Exp;
branches;
next	1.11;

1.11
date	2002.10.18.10.33.32;	author tjr;	state Exp;
branches;
next	1.10;

1.10
date	2002.02.18.06.08.23;	author imp;	state Exp;
branches;
next	1.9;

1.9
date	2000.11.22.11.05.51;	author kris;	state Exp;
branches;
next	1.8;

1.8
date	99.08.27.23.15.18;	author peter;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	97.02.22.13.58.36;	author peter;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	97.01.14.05.33.16;	author jkh;	state Exp;
branches;
next	1.5;

1.5
date	96.09.01.10.20.48;	author peter;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	96.06.24.04.22.22;	author jkh;	state Exp;
branches;
next	1.3;

1.3
date	95.03.30.19.45.20;	author phk;	state Exp;
branches
	1.3.4.1;
next	1.2;

1.2
date	94.09.24.02.57.53;	author davidg;	state Exp;
branches;
next	1.1;

1.1
date	94.05.26.06.18.45;	author rgrimes;	state Exp;
branches
	1.1.1.1;
next	;

1.20.2.1
date	2012.11.17.01.48.32;	author svnexp;	state dead;
branches;
next	1.20.2.2;

1.20.2.2
date	2013.03.28.13.00.06;	author svnexp;	state Exp;
branches;
next	;

1.18.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.18.2.1.2.1
	1.18.2.1.4.1;
next	1.18.2.2;

1.18.2.2
date	2012.11.17.11.36.04;	author svnexp;	state Exp;
branches;
next	;

1.18.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.18.2.1.2.2;

1.18.2.1.2.2
date	2012.11.17.08.36.05;	author svnexp;	state Exp;
branches;
next	;

1.18.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.18.2.1.4.2;

1.18.2.1.4.2
date	2012.11.17.08.46.54;	author svnexp;	state Exp;
branches;
next	;

1.16.2.1
date	2012.11.17.08.00.50;	author svnexp;	state Exp;
branches;
next	;

1.16.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.16.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.16.10.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.16.10.1.2.1
	1.16.10.1.4.1;
next	1.16.10.2;

1.16.10.2
date	2010.10.03.21.56.20;	author jilles;	state Exp;
branches
	1.16.10.2.2.1
	1.16.10.2.4.1;
next	1.16.10.3;

1.16.10.3
date	2012.11.17.10.35.49;	author svnexp;	state Exp;
branches;
next	;

1.16.10.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.16.10.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.16.10.2.2.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.16.10.2.4.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.16.10.2.4.2;

1.16.10.2.4.2
date	2012.11.17.08.24.31;	author svnexp;	state Exp;
branches;
next	;

1.16.12.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.16.14.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.16.14.2;

1.16.14.2
date	2012.11.17.08.16.32;	author svnexp;	state Exp;
branches;
next	;

1.14.2.1
date	2005.11.06.20.39.48;	author stefanf;	state Exp;
branches;
next	1.14.2.2;

1.14.2.2
date	2006.06.03.15.38.07;	author stefanf;	state Exp;
branches
	1.14.2.2.6.1;
next	1.14.2.3;

1.14.2.3
date	2012.11.17.07.38.38;	author svnexp;	state Exp;
branches;
next	;

1.14.2.2.6.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.8.2.1
date	2001.02.18.02.10.18;	author kris;	state Exp;
branches;
next	1.8.2.2;

1.8.2.2
date	2002.07.19.04.38.51;	author tjr;	state Exp;
branches;
next	1.8.2.3;

1.8.2.3
date	2002.11.30.07.54.49;	author tjr;	state Exp;
branches;
next	1.8.2.4;

1.8.2.4
date	2012.11.17.07.22.05;	author svnexp;	state Exp;
branches;
next	;

1.7.2.1
date	99.08.29.14.13.52;	author peter;	state Exp;
branches;
next	;

1.5.2.1
date	98.11.03.15.57.36;	author cracauer;	state Exp;
branches;
next	1.5.2.2;

1.5.2.2
date	99.09.05.10.59.53;	author peter;	state Exp;
branches;
next	;

1.3.4.1
date	99.09.05.11.01.46;	author peter;	state Exp;
branches;
next	;

1.1.1.1
date	94.05.26.06.18.46;	author rgrimes;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	96.05.27.01.40.30;	author peter;	state Exp;
branches;
next	;


desc
@@


1.20
log
@Switching exporter and resync
@
text
@#!/bin/sh -

#-
# Copyright (c) 1991, 1993
#	The Regents of the University of California.  All rights reserved.
#
# This code is derived from software contributed to Berkeley by
# Kenneth Almquist.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 4. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#	@@(#)mkbuiltins	8.2 (Berkeley) 5/4/95
# $FreeBSD: head/bin/sh/mkbuiltins 235927 2012-05-24 19:48:15Z marcel $

temp=`/usr/bin/mktemp -t ka`
havehist=1
if [ "X$1" = "X-h" ]; then
	havehist=0
	shift
fi
srcdir=$1
havejobs=0
if grep '^#define[	 ]*JOBS[	 ]*1' $srcdir/shell.h > /dev/null
then	havejobs=1
fi
exec > builtins.c
cat <<\!
/*
 * This file was generated by the mkbuiltins program.
 */

#include <stdlib.h>
#include "shell.h"
#include "builtins.h"

!
awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
    print $0}' $srcdir/builtins.def | sed 's/-[hj]//' > $temp
echo 'int (*const builtinfunc[])(int, char **) = {'
awk '/^[^#]/ {	printf "\t%s,\n", $1}' $temp
echo '};

const struct builtincmd builtincmd[] = {'
awk '{	for (i = 2 ; i <= NF ; i++) {
		if ($i == "-s") {
			spc = 1;
		} else {
			printf "\t{ \"%s\", %d, %d },\n",  $i, NR-1, spc
			spc = 0;
		}
	}}' $temp
echo '	{ NULL, 0, 0 }
};'

exec > builtins.h
cat <<\!
/*
 * This file was generated by the mkbuiltins program.
 */

#include <sys/cdefs.h>
!
tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ < $temp |
	awk '{	printf "#define %s %d\n", $1, NR-1}'
echo '
struct builtincmd {
      const char *name;
      int code;
      int special;
};

extern int (*const builtinfunc[])(int, char **);
extern const struct builtincmd builtincmd[];
'
awk '{	printf "int %s(int, char **);\n", $1}' $temp
rm -f $temp
@


1.20.2.1
log
@file mkbuiltins was added on branch RELENG_8_4 on 2013-03-28 13:00:06 +0000
@
text
@d1 98
@


1.20.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 98
#!/bin/sh -

#-
# Copyright (c) 1991, 1993
#	The Regents of the University of California.  All rights reserved.
#
# This code is derived from software contributed to Berkeley by
# Kenneth Almquist.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 4. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#	@@(#)mkbuiltins	8.2 (Berkeley) 5/4/95
# $FreeBSD: releng/8.4/bin/sh/mkbuiltins 213390 2010-10-03 21:56:20Z jilles $

temp=`/usr/bin/mktemp -t ka`
havejobs=0
if grep '^#define[	 ]*JOBS[	 ]*1' shell.h > /dev/null
then	havejobs=1
fi
havehist=1
if [ "X$1" = "X-h" ]; then
	havehist=0
	shift
fi
objdir=$1
exec > ${objdir}/builtins.c
cat <<\!
/*
 * This file was generated by the mkbuiltins program.
 */

#include <stdlib.h>
#include "shell.h"
#include "builtins.h"

!
awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
    print $0}' builtins.def | sed 's/-[hj]//' > $temp
awk '{	printf "int %s(int, char **);\n", $1}' $temp
echo '
int (*const builtinfunc[])(int, char **) = {'
awk '/^[^#]/ {	printf "\t%s,\n", $1}' $temp
echo '};

const struct builtincmd builtincmd[] = {'
awk '{	for (i = 2 ; i <= NF ; i++) {
		if ($i == "-s") {
			spc = 1;
		} else {
			printf "\t{ \"%s\", %d, %d },\n",  $i, NR-1, spc
			spc = 0;
		}
	}}' $temp
echo '	{ NULL, 0, 0 }
};'

exec > ${objdir}/builtins.h
cat <<\!
/*
 * This file was generated by the mkbuiltins program.
 */

#include <sys/cdefs.h>
!
tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ < $temp |
	awk '{	printf "#define %s %d\n", $1, NR-1}'
echo '
struct builtincmd {
      const char *name;
      int code;
      int special;
};

extern int (*const builtinfunc[])(int, char **);
extern const struct builtincmd builtincmd[];'
rm -f $temp
@


1.19
log
@SVN rev 235927 on 2012-05-24 19:48:15Z by marcel

Work better with how make/bmake works:
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.
@
text
@d35 1
a35 1
# $FreeBSD$
@


1.18
log
@SVN rev 223060 on 2011-06-13 21:03:27Z by jilles

sh: Fix duplicate prototypes for builtins.

Have mkbuiltins write the prototypes for the *cmd functions to builtins.h
instead of builtins.c and include builtins.h in more .c files instead of
duplicating prototypes for *cmd functions in other headers.
@
text
@a37 4
havejobs=0
if grep '^#define[	 ]*JOBS[	 ]*1' shell.h > /dev/null
then	havejobs=1
fi
d43 6
a48 2
objdir=$1
exec > ${objdir}/builtins.c
d60 1
a60 1
    print $0}' builtins.def | sed 's/-[hj]//' > $temp
d77 1
a77 1
exec > ${objdir}/builtins.h
@


1.18.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.18.2.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d35 1
a35 1
# $FreeBSD: stable/9/bin/sh/mkbuiltins 223060 2011-06-13 21:03:27Z jilles $
@


1.18.2.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.18.2.1.4.2
log
@Switch importer
@
text
@d35 1
a35 1
# $FreeBSD: releng/9.1/bin/sh/mkbuiltins 223060 2011-06-13 21:03:27Z jilles $
@


1.18.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.18.2.1.2.2
log
@Switch importer
@
text
@d35 1
a35 1
# $FreeBSD: releng/9.0/bin/sh/mkbuiltins 223060 2011-06-13 21:03:27Z jilles $
@


1.17
log
@SVN rev 201053 on 2009-12-27 18:04:05Z by jilles

sh: Various warning fixes (from WARNS=6 NO_WERROR=1):
- const
- initializations to silence -Wuninitialized (it was safe anyway)
- remove nested extern declarations
- rename "index" locals to "idx"
@
text
@d61 1
a61 3
awk '{	printf "int %s(int, char **);\n", $1}' $temp
echo '
int (*const builtinfunc[])(int, char **) = {'
d95 3
a97 1
extern const struct builtincmd builtincmd[];'
@


1.16
log
@Use -s to flag POSIX's "special built-in" utilities in builtins.def.  Add a
new member to struct builtincmd and set it to 1 if -s was specified.  This
is done because there are cases where special builtins must be treated
differently from other builtins.

Obtained from:	NetBSD (builtins.def part)
@
text
@d91 1
a91 1
      char *name;
@


1.16.2.1
log
@Switch importer
@
text
@d35 1
a35 1
# $FreeBSD: stable/7/bin/sh/mkbuiltins 157413 2006-04-02 18:43:33Z stefanf $
@


1.16.14.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.16.14.2
log
@Switch importer
@
text
@d35 1
a35 1
# $FreeBSD: releng/7.4/bin/sh/mkbuiltins 157413 2006-04-02 18:43:33Z stefanf $
@


1.16.12.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.16.10.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.16.10.2
log
@SVN rev 213390 on 2010-10-03 21:56:20Z by jilles

MFC r201053: sh: Various warning fixes (from WARNS=6 NO_WERROR=1):
- const
- initializations to silence -Wuninitialized (it was safe anyway)
- remove nested extern declarations
- rename "index" locals to "idx"
@
text
@d91 1
a91 1
      const char *name;
@


1.16.10.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d35 1
a35 1
# $FreeBSD: stable/8/bin/sh/mkbuiltins 213390 2010-10-03 21:56:20Z jilles $
@


1.16.10.2.4.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.16.10.2.4.2
log
@Switch importer
@
text
@d35 1
a35 1
# $FreeBSD: releng/8.3/bin/sh/mkbuiltins 213390 2010-10-03 21:56:20Z jilles $
@


1.16.10.2.2.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.16.10.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.16.10.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.16.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.16.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.15
log
@Use prototypes in the generated builtins.{c,h} files.
@
text
@d69 6
a74 1
		printf "\t{ \"%s\", %d },\n",  $i, NR-1
d76 1
a76 1
echo '	{ NULL, 0 }
d93 1
@


1.14
log
@/*- or .\"- or #- to begin license clauses.
@
text
@d61 1
a61 1
awk '{	printf "int %s();\n", $1}' $temp
d63 1
a63 1
int (*const builtinfunc[])() = {'
d90 1
a90 1
extern int (*const builtinfunc[])();
@


1.14.2.1
log
@Sync with HEAD's code:
- Support for command -v and -V.
- Fixes for the errexit option.
- A fix for a crash caused by SIGINT.
- POSIX compliant set +o ouput.
- A fix for unalias' exit code.
- Man page updates.
- Code cleanups, WARNS 3.
@
text
@d61 1
a61 1
awk '{	printf "int %s(int, char **);\n", $1}' $temp
d63 1
a63 1
int (*const builtinfunc[])(int, char **) = {'
d90 1
a90 1
extern int (*const builtinfunc[])(int, char **);
@


1.14.2.2
log
@MFC:
- POSIX special built-ins (builtin.defs 1.19, main.c 1.28, mkbuiltins 1.16,
    eval.c 1.51, exec.c 1.29, exec.h 1.15, options.c 1.25)
- Fix el_gets() buffer handling (input.c 1.23).
- Sort 'set' output (var.c 1.31).
- Document that '#' starts a comment (sh.1 1.118).
@
text
@d69 1
a69 6
		if ($i == "-s") {
			spc = 1;
		} else {
			printf "\t{ \"%s\", %d, %d },\n",  $i, NR-1, spc
			spc = 0;
		}
d71 1
a71 1
echo '	{ NULL, 0, 0 }
a87 1
      int special;
@


1.14.2.3
log
@Switch importer
@
text
@d35 1
a35 1
# $FreeBSD: stable/6/bin/sh/mkbuiltins 159191 2006-06-03 15:38:08Z stefanf $
@


1.14.2.2.6.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.13
log
@Remove clause 3 from the UCB licenses.

OK'ed by:	imp, core
@
text
@d2 2
a3 1
#
@


1.12
log
@Do not assume there is only a space between #define and the macro name
when grepping for JOBS. The recent style cleanup replaced the space with
a tab and broke job control detection. Little edits, disastrous consequences.

Submitted by:	Peter Edwards <pmedwards@@eircom.net>
X-MFC when:	    in about 5 weeks with the other sh arithmetic fixes.
@
text
@a16 4
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#	This product includes software developed by the University of
#	California, Berkeley and its contributors.
@


1.11
log
@Avoid accidentally making "-h" a synonym for "fc".

Obtained from:	NetBSD
@
text
@d42 1
a42 1
if grep '^#define JOBS[	 ]*1' shell.h > /dev/null
@


1.10
log
@Remove now-obsolete __STDC__ ifdefs, remove redundant NULL definition and
include stdlib.h for NULL.
@
text
@d63 1
a63 1
    print $0}' builtins.def | sed 's/-j//' > $temp
@


1.9
log
@Use secure temporary filenames during build.

Audited by:	markm, cracauer
@
text
@d38 1
a38 1
# $FreeBSD: src/bin/sh/mkbuiltins,v 1.8 1999/08/27 23:15:18 peter Exp $
d57 1
@


1.8
log
@$Id$ -> $FreeBSD$
@
text
@d38 1
a38 1
# $FreeBSD$
d40 1
a40 1
temp=/tmp/ka$$
@


1.8.2.1
log
@MFC: Use secure tempfiles during build
@
text
@d38 1
a38 1
# $FreeBSD: src/bin/sh/mkbuiltins,v 1.8 1999/08/27 23:15:18 peter Exp $
d40 1
a40 1
temp=`/usr/bin/mktemp -t ka`
@


1.8.2.2
log
@Sync with HEAD, except that printf(1) is still a shell builtin and old
libedit history interface is still used. This gives the following
new features/bug fixes:
 - Quote output of alias, export, readonly builtins
 - -L (logical) and -P (physical) options added to cd and pwd, logical
   behaviour made default.
 - -C (noclobber) option and >>| redirection is implemented
 - hash builtin only shows normal commands, no functions or builtins
 - -u (nounset) option is implemented
 - fc builtin's -e option works correctly again
 - No longer assumes there is a tty on fd 2 (PR 36671)
 - fg/bg command show more info about job being manipulated
 - -l and -s options added to jobs builtin, output closer to POSIX spec.
 - %+ (current job) %- (previous job) and %? (substring) job ID's implemented
 - >&- (and similar) redirection operators close descriptors correctly
 - set +o output corrected
 - Style: __FBSDID, __P removal, ANSI-style function declarations
@
text
@d38 1
a38 1
# $FreeBSD$
a56 1
#include <stdlib.h>
@


1.8.2.3
log
@MFC rev 1.11: Avoid accidentally making "-h" a synonym for "fc".
@
text
@d63 1
a63 1
    print $0}' builtins.def | sed 's/-[hj]//' > $temp
@


1.8.2.4
log
@Switch importer
@
text
@d38 1
a38 1
# $FreeBSD: stable/4/bin/sh/mkbuiltins 107407 2002-11-30 07:54:49Z tjr $
@


1.7
log
@Revert $FreeBSD$ to $Id$
@
text
@d38 1
a38 1
#	$Id$
@


1.7.2.1
log
@$Id$ -> $FreeBSD$
@
text
@d38 1
a38 1
# $FreeBSD$
@


1.6
log
@Make the long-awaited change from $Id$ to $FreeBSD$

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.
@
text
@d38 1
a38 1
#	$FreeBSD$
@


1.5
log
@Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning.  This is a
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
@
text
@d38 1
a38 1
#	$Id: mkbuiltins,v 1.4 1996/06/24 04:22:22 jkh Exp $
@


1.5.2.1
log
@Merge remaining -current fixes into -stable.
Obtained from: Most fixes in this diff are by Tor Egge
@
text
@d38 1
a38 1
#	$Id: mkbuiltins,v 1.7 1997/02/22 13:58:36 peter Exp $
@


1.5.2.2
log
@$Id$ -> $FreeBSD$
@
text
@d38 1
a38 1
# $FreeBSD$
@


1.4
log
@Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src.  This is the final version of the
patches, incorporating the feedback I've received from -current.
@
text
@d37 2
a38 2
#	@@(#)mkbuiltins	8.1 (Berkeley) 5/31/93
#	$Id: mkbuiltins,v 1.3 1995/03/30 19:45:20 phk Exp $
d45 4
a48 4
if [ -d ${OBJDIR} ] ; then
	exec > ${OBJDIR}/builtins.c
else
	exec > builtins.c
d50 2
d61 2
a62 2
awk '/^[^#]/ {if('$havejobs' || $2 != "-j") print $0}' builtins |
	sed 's/-j//' > $temp
d71 1
a71 1
		printf "\t\"%s\", %d,\n",  $i, NR-1
d73 1
a73 1
echo '	NULL, 0
d76 1
a76 5
if [ -d ${OBJDIR} ] ; then
	exec > ${OBJDIR}/builtins.h
else
	exec > builtins.h
fi
@


1.3
log
@Make build work, even if there is no obj subdir.
@
text
@d38 1
a38 1
#	$Id: mkbuiltins,v 1.2 1994/09/24 02:57:53 davidg Exp $
d45 2
a46 2
if [ -d obj ] ; then
	exec > obj/builtins.c
d74 2
a75 2
if [ -d obj ] ; then
	exec > obj/builtins.h
@


1.3.4.1
log
@$Id$ -> $FreeBSD$
@
text
@d38 1
a38 1
# $FreeBSD$
@


1.2
log
@Added $Id$
@
text
@d38 1
a38 1
#	$Id$
d45 5
a49 1
exec > obj/builtins.c
d74 5
a78 1
exec > obj/builtins.h
@


1.1
log
@Initial revision
@
text
@d38 1
@


1.1.1.1
log
@BSD 4.4 Lite bin Sources
@
text
@@


1.1.1.2
log
@Import the 4.4BSD-Lite2 /bin/sh sources

Requested by: joerg

(Note, this is mostly going to be conflicts, which is expected.  Our entire
 sh source has a mainline, so this should not change anything except for
 a few new files appearing.  I dont think they are a problem)
@
text
@d37 1
a37 1
#	@@(#)mkbuiltins	8.2 (Berkeley) 5/4/95
d44 1
a44 7
havehist=1
if [ "X$1" = "X-h" ]; then
	havehist=0
	shift
fi
objdir=$1
exec > ${objdir}/builtins.c
d54 2
a55 2
awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
    print $0}' builtins.def | sed 's/-j//' > $temp
d64 1
a64 1
		printf "\t{ \"%s\", %d },\n",  $i, NR-1
d66 1
a66 1
echo '	{ NULL, 0 }
d69 1
a69 1
exec > ${objdir}/builtins.h
@
