+printf "checking whether compiler needs attribute((may_alias)) suppression... "
+cat > "$tmpc" <<EOF
+typedef int
+#ifdef __GNUC__
+__attribute__((__may_alias__))
+#endif
+x;
+EOF
+if $CC $CFLAGS_C99FSE -I./arch/$ARCH -I./include $CPPFLAGS $CFLAGS \
+ -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
+printf "no\n"
+else
+printf "yes\n"
+CFLAGS_C99FSE="$CFLAGS_C99FSE -D__may_alias__="
+fi
+
+#
+# Check for options that may be needed to prevent the compiler from
+# generating self-referential versions of memcpy,, memmove, memcmp,
+# and memset. Really, we should add a check to determine if this
+# option is sufficient, and if not, add a macro to cripple these
+# functions with volatile...
+#
+tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns
+
+#
+# Enable debugging if requessted.
+#
+test "$debug" = yes && CFLAGS_AUTO=-g
+
+#
+# Possibly add a -O option to CFLAGS and select modules to optimize with
+# -O3 based on the status of --enable-optimize and provided CFLAGS.
+#
+printf "checking for optimization settings... "
+case "x$optimize" in
+xauto)
+if fnmatch '-O*|*\ -O*' "$CFLAGS_AUTO $CFLAGS" ; then
+printf "using provided CFLAGS\n" ;optimize=no
+else
+printf "using defaults\n" ; optimize=yes
+fi
+;;
+xsize|xnone) printf "minimize size\n" ; optimize=size ;;
+xno|x) printf "disabled\n" ; optimize=no ;;
+*) printf "custom\n" ;;
+esac
+
+test "$optimize" = no || tryflag CFLAGS_AUTO -Os || tryflag CFLAGS_AUTO -O2
+test "$optimize" = yes && optimize="internal,malloc,string"
+
+if fnmatch 'no|size' "$optimize" ; then :