From f97c2127a619c956f0a330f272877a3fa4074f94 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 29 Oct 2005 18:24:12 +1000 Subject: [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. --- src/mkbuiltins | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'src/mkbuiltins') 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. -- cgit 1.4.1