SDL_mixer: Freshly unpacked FLAC 1.3.4 and reapplied the patch

From a3f8f83e0f812943303007c5247f8e0fe2b86991 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 1 May 2022 03:43:57 -0700
Subject: [PATCH] Freshly unpacked FLAC 1.3.4 and reapplied the patch

It was missing the build directory, which was missing because "build" is listed in .gitignore
---
 external/flac-1.3.4/0001-flac-PR216.patch     |   27 -
 external/flac-1.3.4/0002-flac-PR292.patch     |  135 --
 external/flac-1.3.4/0003-flac-PR299.patch     |  124 --
 external/flac-1.3.4/0004-flac-PR304.patch     |  107 --
 external/flac-1.3.4/CMakeLists.txt            |    4 +-
 external/flac-1.3.4/aclocal.m4                | 1239 +++++++++++++++++
 external/flac-1.3.4/build/Makefile.am         |   23 +
 external/flac-1.3.4/build/Makefile.in         |  510 +++++++
 external/flac-1.3.4/build/compile.mk          |   49 +
 external/flac-1.3.4/build/config.mk           |  159 +++
 external/flac-1.3.4/build/exe.mk              |  107 ++
 external/flac-1.3.4/build/lib.mk              |  138 ++
 external/flac-1.3.4/config.cmake.h.in         |   12 +-
 external/flac-1.3.4/config.h.in               |    6 -
 external/flac-1.3.4/configure                 |   14 +-
 external/flac-1.3.4/configure.ac              |    5 +-
 external/flac-1.3.4/src/libFLAC/cpu.c         |    9 +-
 .../src/libFLAC/include/private/cpu.h         |   64 +-
 .../src/libFLAC/metadata_iterators.c          |    2 +-
 external/flac-1.3.4/src/share/grabbag/file.c  |    2 +-
 .../src/test_libFLAC++/metadata_manip.cpp     |    2 +-
 .../src/test_libFLAC/metadata_manip.c         |    2 +-
 22 files changed, 2268 insertions(+), 472 deletions(-)
 delete mode 100644 external/flac-1.3.4/0001-flac-PR216.patch
 delete mode 100644 external/flac-1.3.4/0002-flac-PR292.patch
 delete mode 100644 external/flac-1.3.4/0003-flac-PR299.patch
 delete mode 100644 external/flac-1.3.4/0004-flac-PR304.patch
 create mode 100644 external/flac-1.3.4/aclocal.m4
 create mode 100644 external/flac-1.3.4/build/Makefile.am
 create mode 100644 external/flac-1.3.4/build/Makefile.in
 create mode 100644 external/flac-1.3.4/build/compile.mk
 create mode 100644 external/flac-1.3.4/build/config.mk
 create mode 100644 external/flac-1.3.4/build/exe.mk
 create mode 100644 external/flac-1.3.4/build/lib.mk

diff --git a/external/flac-1.3.4/0001-flac-PR216.patch b/external/flac-1.3.4/0001-flac-PR216.patch
deleted file mode 100644
index defe5ce6..00000000
--- a/external/flac-1.3.4/0001-flac-PR216.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From d76b29153eba2ea7acedcff02d6257414598c94b Mon Sep 17 00:00:00 2001
-From: David Callu <callu.david@gmail.com>
-Date: Fri, 5 Jun 2020 15:47:30 +0200
-Subject: [PATCH] cmake: fix c/cxx compile option use with asm code
-
----
- CMakeLists.txt | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c83dd83e01..158540a358 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -90,11 +90,11 @@ add_compile_options(
-     $<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_DECL_AFTER_STMT_FLAG}>>:-Wdeclaration-after-statement>)
- 
- if(HAVE_STACK_PROTECTOR_FLAG)
--    add_compile_options(-fstack-protector-strong)
-+    add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-fstack-protector-strong>)
- endif()
- 
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND HAVE_STACKREALIGN_FLAG)
--    add_compile_options(-mstackrealign)
-+    add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-mstackrealign>)
- endif()
- 
- include_directories("include")
diff --git a/external/flac-1.3.4/0002-flac-PR292.patch b/external/flac-1.3.4/0002-flac-PR292.patch
deleted file mode 100644
index a9993414..00000000
--- a/external/flac-1.3.4/0002-flac-PR292.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-From 4c62082f64132bfcbcb6569aa914c5ec283303f9 Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Date: Mon, 21 Feb 2022 18:21:11 +0100
-Subject: [PATCH] Fix uclibc build
-
-Commit 4fbb6d4f2ecf2a96c17ea9880108409f852c08a9 reverted commit
-44036c9a9b45d03373fe90e9c112852bfc054c51 and so broke again the build on
-uclibc
-
-So put back the sys/auxv.h check as well as a getauxval check in a way
-that doesn't break iOS
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
----
- configure.ac      | 5 ++++-
- src/libFLAC/cpu.c | 9 ++++-----
- 2 files changed, 8 insertions(+), 6 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 4d7dc2e466..6f32fa45b2 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -69,7 +69,7 @@ AC_C_INLINE
- AC_C_VARARRAYS
- AC_C_TYPEOF
- 
--AC_CHECK_HEADERS([stdint.h inttypes.h byteswap.h sys/param.h sys/ioctl.h termios.h x86intrin.h cpuid.h])
-+AC_CHECK_HEADERS([stdint.h inttypes.h byteswap.h sys/auxv.h sys/param.h sys/ioctl.h termios.h x86intrin.h cpuid.h])
- 
- XIPH_C_BSWAP32
- XIPH_C_BSWAP16
-@@ -101,6 +101,9 @@ fi
- # For the XMMS plugin.
- AC_CHECK_TYPES(socklen_t, [], [])
- 
-+dnl check for getauxval in standard library
-+AC_CHECK_FUNCS(getauxval)
-+
- dnl check for getopt in standard library
- dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
- AC_CHECK_FUNCS(getopt_long, [], [])
-diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c
-index 8b92f4c76d..64c6acade0 100644
---- a/src/libFLAC/cpu.c
-+++ b/src/libFLAC/cpu.c
-@@ -53,11 +53,9 @@
- #define dfprintf(file, format, ...)
- #endif
- 
--#if defined FLAC__CPU_PPC
--#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD__ >= 12))
-+#if defined(HAVE_SYS_AUXV_H)
- #include <sys/auxv.h>
- #endif
--#endif
- 
- #if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM
- 
-@@ -247,7 +245,7 @@ ppc_cpu_info (FLAC__CPUInfo *info)
- #define PPC_FEATURE2_ARCH_2_07		0x80000000
- #endif
- 
--#ifdef __linux__
-+#if defined (__linux__) && defined(HAVE_GETAUXVAL)
- 	if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_3_00) {
- 		info->ppc.arch_3_00 = true;
- 	} else if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) {
-@@ -267,7 +265,8 @@ ppc_cpu_info (FLAC__CPUInfo *info)
- 	info->ppc.arch_2_07 = false;
- 	info->ppc.arch_3_00 = false;
- #else
--#error Unsupported platform! Please add support for reading ppc hwcaps.
-+	info->ppc.arch_2_07 = false;
-+	info->ppc.arch_3_00 = false;
- #endif
- 
- #else
-
-
-================
-
-diff -u flac-1.3.4/config.h.in~ flac-1.3.4/config.h.in
---- flac-1.3.4/config.h.in~
-+++ flac-1.3.4/config.h.in
-@@ -103,6 +103,9 @@
- /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
- #undef HAVE_FSEEKO
- 
-+/* Define to 1 if you have the `getauxval' function. */
-+#undef HAVE_GETAUXVAL
-+
- /* Define to 1 if you have the `getopt_long' function. */
- #undef HAVE_GETOPT_LONG
- 
-@@ -136,6 +139,9 @@
- /* Define to 1 if you have the <string.h> header file. */
- #undef HAVE_STRING_H
- 
-+/* Define to 1 if you have the <sys/auxv.h> header file. */
-+#undef HAVE_SYS_AUXV_H
-+
- /* Define to 1 if you have the <sys/ioctl.h> header file. */
- #undef HAVE_SYS_IOCTL_H
- 
-diff -u flac-1.3.4/configure~ flac-1.3.4/configure
---- flac-1.3.4/configure~
-+++ flac-1.3.4/configure
-@@ -18142,7 +18142,7 @@
-   fi
- 
- 
--for ac_header in stdint.h inttypes.h byteswap.h sys/param.h sys/ioctl.h termios.h x86intrin.h cpuid.h
-+for ac_header in stdint.h inttypes.h byteswap.h sys/auxv.h sys/param.h sys/ioctl.h termios.h x86intrin.h cpuid.h
- do :
-   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
- ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-@@ -18517,6 +18517,18 @@
- fi
- 
- 
-+for ac_func in getauxval
-+do :
-+  ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval"
-+if test "x$ac_cv_func_getauxval" = xyes ; then :
-+  cat >>confdefs.h <<_ACEOF
-+#define HAVE_GETAUXVAL 1
-+_ACEOF
-+
-+fi
-+done
-+
-+
- for ac_func in getopt_long
- do :
-   ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
diff --git a/external/flac-1.3.4/0003-flac-PR299.patch b/external/flac-1.3.4/0003-flac-PR299.patch
deleted file mode 100644
index fd0a9fbd..00000000
--- a/external/flac-1.3.4/0003-flac-PR299.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From 254ce9f56d36662c4289f5d0b8d627e9391afb46 Mon Sep 17 00:00:00 2001
-From: Martijn van Beurden <mvanb1@gmail.com>
-Date: Fri, 4 Mar 2022 14:02:37 +0100
-Subject: [PATCH] [CMake] Honor WITH_AVX
-
-Fixes https://github.com/xiph/flac/issues/286
----
- config.cmake.h.in                 |  6 ++-
- src/libFLAC/include/private/cpu.h | 64 +++++++++++++++++--------------
- 2 files changed, 40 insertions(+), 30 deletions(-)
-
-diff --git a/config.cmake.h.in b/config.cmake.h.in
-index 1d96f4268b..6122387f09 100644
---- a/config.cmake.h.in
-+++ b/config.cmake.h.in
-@@ -44,8 +44,10 @@
- #cmakedefine FLAC__USE_ALTIVEC
- 
- /* define to enable use of AVX instructions */
--#cmakedefine01 WITH_AVX
--#define FLAC__USE_AVX WITH_AVX
-+#cmakedefine WITH_AVX
-+#ifdef WITH_AVX
-+  #define FLAC__USE_AVX
-+#endif
- 
- /* define to enable use of VSX instructions */
- #cmakedefine FLAC__USE_VSX
-diff --git a/src/libFLAC/include/private/cpu.h b/src/libFLAC/include/private/cpu.h
-index 0b50839f94..638c1b20b3 100644
---- a/src/libFLAC/include/private/cpu.h
-+++ b/src/libFLAC/include/private/cpu.h
-@@ -69,12 +69,14 @@
-     #define FLAC__SSSE3_SUPPORTED 1
-     #define FLAC__SSE4_1_SUPPORTED 1
-   #endif
--  #if (__INTEL_COMPILER >= 1110) /* Intel C++ Compiler 11.1 */
--    #define FLAC__AVX_SUPPORTED 1
--  #endif
--  #if (__INTEL_COMPILER >= 1300) /* Intel C++ Compiler 13.0 */
--    #define FLAC__AVX2_SUPPORTED 1
--    #define FLAC__FMA_SUPPORTED 1
-+  #ifdef FLAC__USE_AVX
-+    #if (__INTEL_COMPILER >= 1110) /* Intel C++ Compiler 11.1 */
-+      #define FLAC__AVX_SUPPORTED 1
-+    #endif
-+    #if (__INTEL_COMPILER >= 1300) /* Intel C++ Compiler 13.0 */
-+      #define FLAC__AVX2_SUPPORTED 1
-+      #define FLAC__FMA_SUPPORTED 1
-+    #endif
-   #endif
- #elif defined __clang__ && __has_attribute(__target__) /* clang */
-   #define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
-@@ -90,14 +92,16 @@
-   #if __has_builtin(__builtin_ia32_pmuldq128)
-     #define FLAC__SSE4_1_SUPPORTED 1
-   #endif
--  #if __has_builtin(__builtin_ia32_maxps256)
--    #define FLAC__AVX_SUPPORTED 1
--  #endif
--  #if __has_builtin(__builtin_ia32_pabsd256)
--    #define FLAC__AVX2_SUPPORTED 1
--  #endif
--  #if __has_builtin(__builtin_ia32_vfmaddps)
--    #define FLAC__FMA_SUPPORTED 1
-+  #ifdef FLAC__USE_AVX
-+    #if __has_builtin(__builtin_ia32_maxps256)
-+      #define FLAC__AVX_SUPPORTED 1
-+    #endif
-+    #if __has_builtin(__builtin_ia32_pabsd256)
-+      #define FLAC__AVX2_SUPPORTED 1
-+    #endif
-+    #if __has_builtin(__builtin_ia32_vfmaddps)
-+      #define FLAC__FMA_SUPPORTED 1
-+    #endif
-   #endif
- #elif defined __GNUC__ && !defined __clang__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */
-   #define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
-@@ -118,12 +122,14 @@
-     #define FLAC__SSSE3_SUPPORTED 1
-     #define FLAC__SSE4_1_SUPPORTED 1
-   #endif
--  #if (_MSC_FULL_VER >= 160040219) /* MS Visual Studio 2010 SP1 */
--    #define FLAC__AVX_SUPPORTED 1
--  #endif
--  #if (_MSC_VER >= 1700) /* MS Visual Studio 2012 */
--    #define FLAC__AVX2_SUPPORTED 1
--    #define FLAC__FMA_SUPPORTED 1
-+  #ifdef FLAC__USE_AVX
-+    #if (_MSC_FULL_VER >= 160040219) /* MS Visual Studio 2010 SP1 */
-+      #define FLAC__AVX_SUPPORTED 1
-+    #endif
-+    #if (_MSC_VER >= 1700) /* MS Visual Studio 2012 */
-+      #define FLAC__AVX2_SUPPORTED 1
-+      #define FLAC__FMA_SUPPORTED 1
-+    #endif
-   #endif
- #else
-   #define FLAC__SSE_TARGET(x)
-@@ -139,14 +145,16 @@
-   #ifdef __SSE4_1__
-     #define FLAC__SSE4_1_SUPPORTED 1
-   #endif
--  #ifdef __AVX__
--    #define FLAC__AVX_SUPPORTED 1
--  #endif
--  #ifdef __AVX2__
--    #define FLAC__AVX2_SUPPORTED 1
--  #endif
--  #ifdef __FMA__
--    #define FLAC__FMA_SUPPORTED 1
-+  #ifdef FLAC__USE_AVX
-+    #ifdef __AVX__
-+      #define FLAC__AVX_SUPPORTED 1
-+    #endif
-+    #ifdef __AVX2__
-+      #define FLAC__AVX2_SUPPORTED 1
-+    #endif
-+    #ifdef __FMA__
-+      #define FLAC__FMA_SUPPORTED 1
-+    #endif
-   #endif
- #endif /* compiler version */
- #endif /* intrinsics support */
diff --git a/external/flac-1.3.4/0004-flac-PR304.patch b/external/flac-1.3.4/0004-flac-PR304.patch
deleted file mode 100644
index 39ddad48..00000000
--- a/external/flac-1.3.4/0004-flac-PR304.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 8d0309b5495fb8ff1ca572167161feb494cd60b4 Mon Sep 17 00:00:00 2001
-From: Cameron Cawley <ccawley2011@gmail.com>
-Date: Fri, 18 Mar 2022 17:16:07 +0000
-Subject: [PATCH 1/2] Always use utimbuf when building for Windows
-
----
- src/libFLAC/metadata_iterators.c      | 2 +-
- src/share/grabbag/file.c              | 2 +-
- src/test_libFLAC++/metadata_manip.cpp | 2 +-
- src/test_libFLAC/metadata_manip.c     | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c
-index 17f25cd6e1..6f805aeda8 100644
---- a/src/libFLAC/metadata_iterators.c
-+++ b/src/libFLAC/metadata_iterators.c
-@@ -3422,7 +3422,7 @@ FLAC__bool get_file_stats_(const char *filename, struct flac_stat_s *stats)
- 
- void set_file_stats_(const char *filename, struct flac_stat_s *stats)
- {
--#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
-+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) && !defined(_WIN32)
- 	struct timespec srctime[2] = {};
- 	srctime[0].tv_sec = stats->st_atime;
- 	srctime[1].tv_sec = stats->st_mtime;
-diff --git a/src/share/grabbag/file.c b/src/share/grabbag/file.c
-index 5f3bc4ef2c..924650a280 100644
---- a/src/share/grabbag/file.c
-+++ b/src/share/grabbag/file.c
-@@ -54,7 +54,7 @@ void grabbag__file_copy_metadata(const char *srcpath, const char *destpath)
- 	struct flac_stat_s srcstat;
- 
- 	if(0 == flac_stat(srcpath, &srcstat)) {
--#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
-+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) && !defined(_WIN32)
- 		struct timespec srctime[2] = {};
- 		srctime[0].tv_sec = srcstat.st_atime;
- 		srctime[1].tv_sec = srcstat.st_mtime;
-diff --git a/src/test_libFLAC++/metadata_manip.cpp b/src/test_libFLAC++/metadata_manip.cpp
-index f9380d9e7f..1fb22a9902 100644
---- a/src/test_libFLAC++/metadata_manip.cpp
-+++ b/src/test_libFLAC++/metadata_manip.cpp
-@@ -272,7 +272,7 @@ void set_file_stats_(const char *filename, struct flac_stat_s *stats)
- 	FLAC__ASSERT(0 != filename);
- 	FLAC__ASSERT(0 != stats);
- 
--#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
-+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) && !defined(_WIN32)
- 	struct timespec srctime[2] = {};
- 	srctime[0].tv_sec = stats->st_atime;
- 	srctime[1].tv_sec = stats->st_mtime;
-diff --git a/src/test_libFLAC/metadata_manip.c b/src/test_libFLAC/metadata_manip.c
-index 4f74f7c7bf..84fce88ac4 100644
---- a/src/test_libFLAC/metadata_manip.c
-+++ b/src/test_libFLAC/metadata_manip.c
-@@ -255,7 +255,7 @@ static FLAC__bool get_file_stats_(const char *filename, struct flac_stat_s *stat
- 
- static void set_file_stats_(const char *filename, struct flac_stat_s *stats)
- {
--#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
-+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) && !defined(_WIN32)
- 	struct timespec srctime[2] = {};
- 	srctime[0].tv_sec = stats->st_atime;
- 	srctime[1].tv_sec = stats->st_mtime;
-
-From a877988305df54d2aaf86d38d0cc38d5c11135d8 Mon Sep 17 00:00:00 2001
-From: Cameron Cawley <ccawley2011@gmail.com>
-Date: Fri, 18 Mar 2022 17:25:41 +0000
-Subject: [PATCH 2/2] Only define _FORTIFY_SOURCE, _XOPEN_SOURCE and __EXTENSIONS__ when necessary
-
----
- config.cmake.h.in | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/config.cmake.h.in b/config.cmake.h.in
-index 1d96f4268b..486231a69e 100644
---- a/config.cmake.h.in
-+++ b/config.cmake.h.in
-@@ -176,13 +176,17 @@
- 
- #ifndef _FORTIFY_SOURCE
- #cmakedefine DODEFINE_FORTIFY_SOURCE 2
-+#ifdef DODEFINE_FORTIFY_SOURCE
- #define _FORTIFY_SOURCE DODEFINE_FORTIFY_SOURCE
- #endif
-+#endif
- 
- #ifndef _XOPEN_SOURCE
- #cmakedefine DODEFINE_XOPEN_SOURCE 500
-+#ifdef DODEFINE_XOPEN_SOURCE
- #define _XOPEN_SOURCE DODEFINE_XOPEN_SOURCE
- #endif
-+#endif
- 
- /* Enable threading extensions on Solaris.  */
- #ifndef _POSIX_PTHREAD_SEMANTICS
-@@ -195,8 +199,10 @@
- /* Enable general extensions on Solaris.  */
- #ifndef __EXTENSIONS__
- #cmakedefine DODEFINE_EXTENSIONS
-+#ifdef DODEFINE_EXTENSIONS
- #define __EXTENSIONS__ DODEFINE_EXTENSIONS
- #endif
-+#endif
- 
- 
- /* Target processor is big endian. */
diff --git a/external/flac-1.3.4/CMakeLists.txt b/external/flac-1.3.4/CMakeLists.txt
index 73c7c6be..9bcb1076 100644
--- a/external/flac-1.3.4/CMakeLists.txt
+++ b/external/flac-1.3.4/CMakeLists.txt
@@ -93,11 +93,11 @@ add_compile_options(
     $<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_DECL_AFTER_STMT_FLAG}>>:-Wdeclaration-after-statement>)
 
 if(HAVE_STACK_PROTECTOR_FLAG)
-    add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-fstack-protector-strong>)
+    add_compile_options(-fstack-protector-strong)
 endif()
 
 if(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND HAVE_STACKREALIGN_FLAG)
-    add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-mstackrealign>)
+    add_compile_options(-mstackrealign)
 endif()
 
 include_directories("include")
diff --git a/external/flac-1.3.4/aclocal.m4 b/external/flac-1.3.4/aclocal.m4
new file mode 100644
index 00000000..446f9e4e
--- /dev/null
+++ b/external/flac-1.3.4/aclocal.m4
@@ -0,0 +1,1239 @@
+# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
+
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.16'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.16.2], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.16.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AR([ACT-IF-FAIL])
+# -------------------------
+# Try to determine the archiver interface, and trigger the ar-lib wrapper
+# if it is needed.  If the detection of archiver interface fails, run
+# ACT-IF-FAIL (default is to abort configure with a proper error message).
+AC_DEFUN([AM_PROG_AR],
+[AC_BEFORE([$0], [LT_INIT])dnl
+AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([ar-lib])dnl
+AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+: ${AR=ar}
+
+AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+  [AC_LANG_PUSH([C])
+   am_cv_ar_interface=ar
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([am_ar_try])
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+        AC_TRY_EVAL([am_ar_try])
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+     ])
+   AC_LANG_POP([C])])
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  m4_default([$1],
+             [AC_MSG_ERROR([could not determine $AR interface])])
+  ;;
+esac
+AC_SUBST([AR])dnl
+])
+
+# Figure out how to run the assembler.                      -*- Autoconf -*-
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AS
+# ----------
+AC_DEFUN([AM_PROG_AS],
+[# By default we simply use the C compiler to build assembly code.
+AC_REQUIRE([AC_PROG_CC])
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
+AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
+])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) brea

(Patch may be truncated, please check the link at the top of this post.)