The OS whitelist conditional is malformed due to missing test(1) commands
causing the following error to be emitted during configure while using something
other than Linux:
../configure[3340]: xopenbsd: not found
Instead, favor a switch statement which makes the line a bit shorter as well.
Also, the AC_MSG_ERROR argument must be wrapped in brackets due to presence of a
comma. Otherwise, the tail will be interpreted as an additional argument.
with_os="linux"
fi
with_os=`echo ${with_os} | tr '[[:upper:]]' '[[:lower:]]' `
-
-if test "x${with_os}" != xlinux && "x${with_os}" != xfreebsd && "x${with_os}" != xdarwin ; then
- AC_MSG_ERROR(--with-os=<arg> argument must linux freebsd openbsd or darwin)
-fi
+case "x${with_os}" in
+xlinux|xfreebsd|xopenbsd|xdarwin)
+ ;;
+*)
+ AC_MSG_ERROR([--with-os=<arg> argument must be one of linux, freebsd, openbsd or darwin])
+ ;;
+esac
# Checks for programs.
AC_PROG_CC