]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
configure: fix handling of non linux operating systems
authorAnton Lindqvist <anton@basename.se>
Thu, 2 Dec 2021 10:57:40 +0000 (11:57 +0100)
committerAnton Lindqvist <anton@basename.se>
Sun, 5 Dec 2021 07:52:21 +0000 (08:52 +0100)
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.

configure.ac

index e0dcb10f58df3248b2a0eb564dab9f6c4b975d1c..32eae4fe43fa123e4f4a76c830d668606f1fb7b5 100644 (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