From a48a880c00176807cc9a76aa92545b3add684ab7 Mon Sep 17 00:00:00 2001 From: tg Date: Thu, 9 Nov 2006 22:51:49 +0000 Subject: [PATCH] ac_test for MKSH_SMALL presence in CPPFLAGS if present, don't even look for setmode as it's only used by mknod builtin --- Build.sh | 26 ++++++++++++++++++-------- setmode.c | 6 ++---- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Build.sh b/Build.sh index f968c28..a173439 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $MirOS: src/bin/mksh/Build.sh,v 1.68 2006/11/09 15:02:30 tg Exp $ +# $MirOS: src/bin/mksh/Build.sh,v 1.69 2006/11/09 22:51:49 tg Exp $ #- # Environment: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, NROFF @@ -18,8 +18,6 @@ ac_test() { f=$1 fu=`upper $f` - fd=$3 - test x"$fd" = x"" && fd=$f test 0 = "$HAVE_$fu" && return test 1 = "$HAVE_$fu" && return if test x"$2" = x""; then @@ -27,10 +25,14 @@ ac_test() else ft=`upper $2` eval ft=\$HAVE_$ft + shift fi + fd=$3 + test x"$fd" = x"" && fd=$f if test 0 = "$ft"; then - eval HAVE_$fu=0 CPPFLAGS=\"\$CPPFLAGS -DHAVE_$fu=0\" - $e "==> $fd... no" + eval HAVE_$fu=$2 + eval CPPFLAGS=\"\$CPPFLAGS -DHAVE_$fu=$2\" + $e "==> $fd... not checked ($2)" return fi $e ... $fd @@ -157,12 +159,20 @@ fi $e Scanning for functions... please ignore any errors. +ac_test mksh_full '' "if we're building without MKSH_SMALL" <<-'EOF' + #ifdef MKSH_SMALL + #error OK, we're building an extra small mksh. + #else + int main(void) { return (0); } + #endif +EOF + ac_test arc4random <<-'EOF' #include int main(void) { arc4random(); return (0); } EOF -ac_test arc4random_push arc4random <<-'EOF' +ac_test arc4random_push arc4random 0 <<-'EOF' #include int main(void) { arc4random_push(1); return (0); } EOF @@ -172,12 +182,12 @@ ac_test setlocale_ctype '' 'setlocale(LC_CTYPE, "")' <<'EOF' int main(void) { setlocale(LC_CTYPE, ""); return (0); } EOF -ac_test langinfo_codeset setlocale_ctype 'nl_langinfo(CODESET)' <<'EOF' +ac_test langinfo_codeset setlocale_ctype 0 'nl_langinfo(CODESET)' <<'EOF' #include int main(void) { nl_langinfo(CODESET); return (0); } EOF -ac_test setmode <<-'EOF' +ac_test setmode mksh_full 1 <<-'EOF' #include int main(int ac, char *av[]) { setmode(av[0]); return (ac); } EOF diff --git a/setmode.c b/setmode.c index d131a8f..dd0e816 100644 --- a/setmode.c +++ b/setmode.c @@ -1,5 +1,4 @@ -/** $MirOS: src/bin/mksh/setmode.c,v 1.5 2006/11/09 22:18:10 tg Exp $ */ -#ifndef MKSH_SMALL +/** $MirOS: src/bin/mksh/setmode.c,v 1.6 2006/11/09 22:51:49 tg Exp $ */ /** _MirOS: src/lib/libc/gen/setmode.c,v 1.6 2006/11/08 23:18:04 tg Exp $ */ /* $OpenBSD: setmode.c,v 1.17 2005/08/08 08:05:34 espie Exp $ */ /* $NetBSD: setmode.c,v 1.15 1997/02/07 22:21:06 christos Exp $ */ @@ -59,7 +58,7 @@ #endif __SCCSID("@(#)setmode.c 8.2 (Berkeley) 3/25/94"); -__RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.5 2006/11/09 22:18:10 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.6 2006/11/09 22:51:49 tg Exp $"); #define SET_LEN 6 /* initial # of bitcmd struct to malloc */ #define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */ @@ -463,4 +462,3 @@ compress_mode(BITCMD *set) } } } -#endif