autoconf for -std=gnu99 (not c99 because of brokenness in the field)

from ankon -> solaris 10 with gcc 3.4.6 from sunfreeware
This commit is contained in:
tg 2007-01-14 21:38:25 +00:00
parent 29b62b186d
commit a00fbd3eb7
1 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.110 2007/01/12 03:30:40 tg Exp $
# $MirOS: src/bin/mksh/Build.sh,v 1.111 2007/01/14 21:38:25 tg Exp $
#-
# Environment: CC, CFLAGS, CPP, CPPFLAGS, LDFLAGS, LIBS, NOWARN, NROFF
# With -x (cross compile): TARGET_OS (default: uname -s)
@ -227,6 +227,15 @@ if test 0 = $HAVE_MKSH_FULL; then
check_categories=$check_categories,smksh
fi
# I'd use -std=c99 but this wrecks havoc on glibc and cygwin based
# systems (at least) because their system headers are so broken...
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -std=gnu99"
ac_testn can_stdg99 '' 'if -std=gnu99 (ISO C99) can be used' <<-'EOF'
int main(void) { return (0); }
EOF
test 1 = $HAVE_CAN_STDG99 || CFLAGS=$save_CFLAGS
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -fwhole-program --combine"
ac_testn can_fwholepgm '' 'if -fwhole-program --combine can be used' <<-'EOF'