--- a/configure.ac
+++ b/configure.ac
-@@ -181,6 +181,9 @@ case "${host_os}" in
+@@ -175,6 +175,9 @@ case "${host_os}" in
linux-gnu*)
OSARCH=linux-gnu
;;
kfreebsd*-gnu)
OSARCH=kfreebsd-gnu
;;
-@@ -1402,9 +1405,11 @@ if test "${PBX_BFD}" = "0"; then
- AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])
- fi
+@@ -1509,9 +1512,11 @@ AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_ope
+ # openSUSE requires -lz
+ AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty -lz])
-if test "x${OSARCH}" = "xlinux-gnu" ; then
+case "${OSARCH}" in
AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220])
--- a/main/Makefile
+++ b/main/Makefile
-@@ -47,7 +47,7 @@ AST_LIBS+=$(UUID_LIB)
+@@ -47,7 +47,7 @@ AST_LIBS+=$(AST_CLANG_BLOCKS_LIBS)
AST_LIBS+=$(RT_LIB)
AST_LIBS+=$(SYSTEMD_LIB)
-ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc kfreebsd-gnu),)
+ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc linux-musl kfreebsd-gnu),)
- ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
AST_LIBS+=-ldl
- endif
+ ifneq (x$(CAP_LIB),x)
+ AST_LIBS+=$(CAP_LIB)