- case "$target" in
- *-*-linux*)
- # Take data from Linux /proc
- if test -f /proc/cpuinfo; then
- cpuflags=`grep "^flags.*$1 " /proc/cpuinfo 2> /dev/null`
+ if test x$2 = xtrue; then
+ AC_ARG_ENABLE($1,
+ [ --enable-$1 ],
+ [
+ AC_MSG_RESULT(yes - enabled by --enable-$1)
+ x_have_cpu_$1=true
+ ])
+ fi
+
+ if test x$x_have_cpu_$1 = xfalse; then
+ case "$target" in
+ *-*-linux*)
+ # Take data from Linux /proc
+ if test -f /proc/cpuinfo; then
+ cpuflags=`grep "^flags.*$1 " /proc/cpuinfo 2> /dev/null`
+ if test $? != 0; then
+ AC_MSG_RESULT(no)
+ x_have_cpu_$1=false
+ ifelse([$4], , :, [$4])
+ else
+ AC_MSG_RESULT(yes)
+ x_have_cpu_$1=true
+ ifelse([$3], , :, [$3])
+ fi
+ else
+ AC_MSG_RESULT(no)
+ x_have_cpu_$1=false
+ ifelse([$4], , :, [$4])
+ fi
+ ;;
+
+ *-*-*bsd*)
+ # BSDs have some flags in sysctl 'machdep' variable
+ cpuflags=`/sbin/sysctl machdep 2> /dev/null | grep "\.$1.*.1"`