configure: fix handling of non linux operating systems

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.
This commit is contained in:
Anton Lindqvist
2021-12-05 08:52:21 +01:00
parent a05db62100
commit 5aeb4ab9ed
+7 -4
View File
@@ -22,10 +22,13 @@ if test "z$with_os" = "z"; then
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