new function ac_testn() does the same as ac_test() but doesn't amend CPPFLAGS

This commit is contained in:
tg 2006-11-09 22:56:09 +00:00
parent 2bdcd71ef0
commit ee55f29a31

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.70 2006/11/09 22:53:21 tg Exp $ # $MirOS: src/bin/mksh/Build.sh,v 1.71 2006/11/09 22:56:09 tg Exp $
#- #-
# Environment: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, NROFF # Environment: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, NROFF
@ -14,7 +14,7 @@ upper()
echo "$@" | tr qwertyuiopasdfghjklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM echo "$@" | tr qwertyuiopasdfghjklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM
} }
ac_test() ac_testn()
{ {
f=$1 f=$1
fu=`upper $f` fu=`upper $f`
@ -23,15 +23,13 @@ ac_test()
if test x"$2" = x""; then if test x"$2" = x""; then
ft=1 ft=1
else else
ft=`upper $2` eval ft=\$HAVE_`upper $2`
eval ft=\$HAVE_$ft
shift shift
fi fi
fd=$3 fd=$3
test x"$fd" = x"" && fd=$f test x"$fd" = x"" && fd=$f
if test 0 = "$ft"; then if test 0 = "$ft"; then
eval HAVE_$fu=$2 eval HAVE_$fu=$2
eval CPPFLAGS=\"\$CPPFLAGS -DHAVE_$fu=$2\"
$e "==> $fd... not checked ($2)" $e "==> $fd... not checked ($2)"
return return
fi fi
@ -46,6 +44,13 @@ ac_test()
$e "==> $fd... no" $e "==> $fd... no"
fi fi
rm -f scn.c a.out a.exe rm -f scn.c a.out a.exe
}
ac_test()
{
f=$1
fu=`upper $f`
ac_testn "$@"
eval CPPFLAGS=\"\$CPPFLAGS -DHAVE_$fu=\$HAVE_$fu\" eval CPPFLAGS=\"\$CPPFLAGS -DHAVE_$fu=\$HAVE_$fu\"
} }
@ -160,7 +165,7 @@ fi
$e Scanning for functions... please ignore any errors. $e Scanning for functions... please ignore any errors.
ac_test mksh_full '' "if we're building without MKSH_SMALL" <<-'EOF' ac_testn mksh_full '' "if we're building without MKSH_SMALL" <<-'EOF'
#ifdef MKSH_SMALL #ifdef MKSH_SMALL
#error OK, we're building an extra small mksh. #error OK, we're building an extra small mksh.
#else #else