summary refs log tree commit diff
path: root/src/mkbuiltins
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-10-29 18:24:12 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2005-10-29 21:40:05 +1000
commitf97c2127a619c956f0a330f272877a3fa4074f94 (patch)
tree69abddf606a01c61ef79ebd5c33abf9306b5a4d9 /src/mkbuiltins
parent[SIGNAL] Added default implementation of killpg (diff)
downloaddash-f97c2127a619c956f0a330f272877a3fa4074f94.tar.gz
dash-f97c2127a619c956f0a330f272877a3fa4074f94.zip
[BUILTIN] Disable ulimit if there is no getrlimit
For systems without getrlimit (e.g., klibc) we will disable ulimit.

In order to achieve this, builtins.def is now produced by cpp which
allows us to use macros such as HAVE_GETRLIMIT in it.

Thie also means that we can get rid of the cflags parsing code in
mkbuiltins.
Diffstat (limited to '')
-rw-r--r--src/mkbuiltins22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/mkbuiltins b/src/mkbuiltins
index d0325c1..5e2cc86 100644
--- a/src/mkbuiltins
+++ b/src/mkbuiltins
@@ -39,22 +39,9 @@ trap 'rm -f $temp $temp2' EXIT
 temp=$(tempfile)
 temp2=$(tempfile)
 
-shell=$1
-builtins=$2
-objdir=$3
-cflags=$4
+builtins=$1
 
-havehist=1
-if [ -z "${cflags##*-DSMALL*}" ]; then
-	havehist=0
-fi
-
-havejobs=1
-if [ -z "${cflags##*-DJOBS=0*}" ]; then
-	havejobs=0
-fi
-
-exec > ${objdir}/builtins.c
+exec > builtins.c
 cat <<\!
 /*
  * This file was generated by the mkbuiltins program.
@@ -64,8 +51,7 @@ cat <<\!
 #include "builtins.h"
 
 !
-awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
-    print $0}' ${builtins} | sed 's/-[hj]//; s/#.*//' > $temp
+< $builtins sed '/^#/d; /^$/d' > $temp
 awk '{	printf "int %s(int, char **);\n", $1}' $temp
 echo '
 const struct builtincmd builtincmd[] = {'
@@ -85,7 +71,7 @@ awk '{	for (i = 2 ; i <= NF ; i++) {
 	}'
 echo '};'
 
-exec > ${objdir}/builtins.h
+exec > builtins.h
 cat <<\!
 /*
  * This file was generated by the mkbuiltins program.