From: Anton Lindqvist Date: Thu, 2 Dec 2021 10:57:40 +0000 (+0100) Subject: configure: fix handling of non linux operating systems X-Git-Tag: 4.1-rc1~24^2~357^2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aeb4ab9ed759d130efc1d1c27ae5afb0b6e9c18;p=thirdparty%2Fshairport-sync.git 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. --- diff --git a/configure.ac b/configure.ac index e0dcb10f..32eae4fe 100644 --- a/configure.ac +++ b/configure.ac @@ -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= argument must linux freebsd openbsd or darwin) -fi +case "x${with_os}" in +xlinux|xfreebsd|xopenbsd|xdarwin) + ;; +*) + AC_MSG_ERROR([--with-os= argument must be one of linux, freebsd, openbsd or darwin]) + ;; +esac # Checks for programs. AC_PROG_CC