]> git.alsa-project.org Git - alsa-lib.git/commitdiff
add FreeBSD build support (except test/)
authorSASANO Takayoshi <uaa@uaa.org.uk>
Tue, 12 Jul 2022 11:37:44 +0000 (20:37 +0900)
committerJaroslav Kysela <perex@perex.cz>
Mon, 17 Oct 2022 11:11:34 +0000 (13:11 +0200)
Note: NetBSD and OpenBSD has both <endian.h> and <sys/endian.h>

Fixes: https://github.com/alsa-project/alsa-lib/pull/250
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
configure.ac
include/sound/type_compat.h
include/sound/uapi/asound.h
src/ucm/ucm_exec.c

index 9a9eda9b79c8b93e41b164f59fff94e0fd677036..8256c032c542441dbbbbda19246367e72e859727 100644 (file)
@@ -764,8 +764,9 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
 dnl Create asoundlib.h dynamically according to configure options
 echo "Creating asoundlib.h..."
 cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
+if test "$ac_cv_header_sys_endian_h" != "yes"; then
 test "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
-if test "$ac_cv_header_sys_endian_h" = "yes"; then
+else
 cat >> include/asoundlib.h <<EOF
 #include <sys/endian.h>
 #ifndef __BYTE_ORDER
index 0c424efcf9f6f1d6c64d3a34d0475c808d67150c..c670245c46ef321d0ca89a3b829bbcefb13db236 100644 (file)
@@ -22,7 +22,7 @@ typedef int64_t __s64;
 #define __cpu_to_le16 LE_16(x)
 #define __cpu_to_be16 BE_16(x)
 #else
-#include <endian.h>
+#include <sys/endian.h>
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #define __cpu_to_le32(x) (x)
 #define __cpu_to_be32(x) bswap_32(x)
index c3f65e1397f88300e18e61855bb984b78fe47a6e..fc18c024fc629dcaa5d3557828e5ce8395c9a633 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/types.h>
 #include <asm/byteorder.h>
 #else
-#include <endian.h>
+#include <sys/endian.h>
 #include <sys/ioctl.h>
 #endif
 
index d5251fabebfabe6f4e7d95cdf785e05fb8187996..500a3b1312572671e3fc83f81fcece4b62d293b2 100644 (file)
@@ -33,7 +33,7 @@
 #include <limits.h>
 #include <dirent.h>
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
 #include <signal.h>
 extern char **environ;
 #endif