external/flac-1.3.3.patch
author Ozkan Sezer
Tue, 17 Dec 2019 21:56:50 +0300
changeset 1091 8a09f3c0c340
parent 1050 300088719593
permissions -rw-r--r--
add patch note for Mix_MusicDuration addition
     1 diff -u /dev/null flac-1.3.3/android/config.h
     2 --- /dev/null
     3 +++ flac-1.3.3/android/config.h
     4 @@ -0,0 +1,254 @@
     5 +/* config.h.  Generated from config.h.in by configure.  */
     6 +/* config.h.in.  Generated from configure.ac by autoheader.  */
     7 +
     8 +/* Define if building universal (internal helper macro) */
     9 +/* #undef AC_APPLE_UNIVERSAL_BUILD */
    10 +
    11 +/* Target processor is big endian. */
    12 +#define CPU_IS_BIG_ENDIAN 0
    13 +
    14 +/* Target processor is little endian. */
    15 +#define CPU_IS_LITTLE_ENDIAN 1
    16 +
    17 +/* Set FLAC__BYTES_PER_WORD to 8 (4 is the default) */
    18 +#define ENABLE_64_BIT_WORDS 0
    19 +
    20 +/* define to align allocated memory on 32-byte boundaries */
    21 +#define FLAC__ALIGN_MALLOC_DATA 1
    22 +
    23 +/* define if building for ia32/i386 */
    24 +/* #undef FLAC__CPU_IA32 */
    25 +
    26 +/* define if building for PowerPC */
    27 +/* #undef FLAC__CPU_PPC */
    28 +
    29 +/* define if building for PowerPC64 */
    30 +/* #undef FLAC__CPU_PPC64 */
    31 +
    32 +/* define if building for SPARC */
    33 +/* #undef FLAC__CPU_SPARC */
    34 +
    35 +/* define if building for x86_64 */
    36 +/* #undef FLAC__CPU_X86_64 */
    37 +
    38 +/* define if you have docbook-to-man or docbook2man */
    39 +/* #undef FLAC__HAS_DOCBOOK_TO_MAN */
    40 +
    41 +/* define if you are compiling for x86 and have the NASM assembler */
    42 +/* #undef FLAC__HAS_NASM */
    43 +
    44 +/* define if you have the ogg library */
    45 +#define FLAC__HAS_OGG 1
    46 +
    47 +/* define if compiler has __attribute__((target("cpu=power8"))) support */
    48 +/* #undef FLAC__HAS_TARGET_POWER8 */
    49 +
    50 +/* define if compiler has __attribute__((target("cpu=power9"))) support */
    51 +/* #undef FLAC__HAS_TARGET_POWER9 */
    52 +
    53 +/* Set to 1 if <x86intrin.h> is available. */
    54 +#define FLAC__HAS_X86INTRIN 0
    55 +
    56 +/* define to disable use of assembly code */
    57 +/* #undef FLAC__NO_ASM */
    58 +
    59 +/* define if building for Darwin / MacOS X */
    60 +/* #undef FLAC__SYS_DARWIN */
    61 +
    62 +/* define if building for Linux */
    63 +/* #undef FLAC__SYS_LINUX */
    64 +
    65 +/* define to enable use of Altivec instructions */
    66 +#define FLAC__USE_ALTIVEC 1
    67 +
    68 +/* define to enable use of AVX instructions */
    69 +#define FLAC__USE_AVX 1
    70 +
    71 +/* define to enable use of VSX instructions */
    72 +/* #undef FLAC__USE_VSX */
    73 +
    74 +/* Compiler has the __builtin_bswap16 intrinsic */
    75 +#define HAVE_BSWAP16 1
    76 +
    77 +/* Compiler has the __builtin_bswap32 intrinsic */
    78 +#define HAVE_BSWAP32 1
    79 +
    80 +/* Define to 1 if you have the <byteswap.h> header file. */
    81 +#define HAVE_BYTESWAP_H 1
    82 +
    83 +/* define if you have clock_gettime */
    84 +/* #undef HAVE_CLOCK_GETTIME */
    85 +
    86 +/* Define to 1 if you have the <cpuid.h> header file. */
    87 +/* #undef HAVE_CPUID_H */
    88 +
    89 +/* Define to 1 if C++ supports variable-length arrays. */
    90 +#define HAVE_CXX_VARARRAYS 1
    91 +
    92 +/* Define to 1 if C supports variable-length arrays. */
    93 +#define HAVE_C_VARARRAYS 1
    94 +
    95 +/* Define to 1 if you have the <dlfcn.h> header file. */
    96 +#define HAVE_DLFCN_H 1
    97 +
    98 +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
    99 +#define HAVE_FSEEKO 1
   100 +
   101 +/* Define to 1 if you have the `getopt_long' function. */
   102 +#define HAVE_GETOPT_LONG 1
   103 +
   104 +/* Define if you have the iconv() function and it works. */
   105 +/* #undef HAVE_ICONV */
   106 +
   107 +/* Define to 1 if you have the <inttypes.h> header file. */
   108 +#define HAVE_INTTYPES_H 1
   109 +
   110 +/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
   111 +/* #undef HAVE_LANGINFO_CODESET */
   112 +
   113 +/* lround support */
   114 +#define HAVE_LROUND 1
   115 +
   116 +/* Define to 1 if you have the <memory.h> header file. */
   117 +#define HAVE_MEMORY_H 1
   118 +
   119 +/* Define to 1 if the system has the type `socklen_t'. */
   120 +/* #undef HAVE_SOCKLEN_T */
   121 +
   122 +/* Define to 1 if you have the <stdint.h> header file. */
   123 +#define HAVE_STDINT_H 1
   124 +
   125 +/* Define to 1 if you have the <stdlib.h> header file. */
   126 +#define HAVE_STDLIB_H 1
   127 +
   128 +/* Define to 1 if you have the <strings.h> header file. */
   129 +#define HAVE_STRINGS_H 1
   130 +
   131 +/* Define to 1 if you have the <string.h> header file. */
   132 +#define HAVE_STRING_H 1
   133 +
   134 +/* Define to 1 if you have the <sys/ioctl.h> header file. */
   135 +#define HAVE_SYS_IOCTL_H 1
   136 +
   137 +/* Define to 1 if you have the <sys/param.h> header file. */
   138 +#define HAVE_SYS_PARAM_H 1
   139 +
   140 +/* Define to 1 if you have the <sys/stat.h> header file. */
   141 +#define HAVE_SYS_STAT_H 1
   142 +
   143 +/* Define to 1 if you have the <sys/types.h> header file. */
   144 +#define HAVE_SYS_TYPES_H 1
   145 +
   146 +/* Define to 1 if you have the <termios.h> header file. */
   147 +#define HAVE_TERMIOS_H 1
   148 +
   149 +/* Define to 1 if typeof works with your compiler. */
   150 +#define HAVE_TYPEOF 1
   151 +
   152 +/* Define to 1 if you have the <unistd.h> header file. */
   153 +#define HAVE_UNISTD_H 1
   154 +
   155 +/* Define to 1 if you have the <x86intrin.h> header file. */
   156 +/* #undef HAVE_X86INTRIN_H */
   157 +
   158 +/* Define as const if the declaration of iconv() needs const. */
   159 +/* #undef ICONV_CONST */
   160 +
   161 +/* Define to the sub-directory where libtool stores uninstalled libraries. */
   162 +#define LT_OBJDIR ".libs/"
   163 +
   164 +/* Define if debugging is disabled */
   165 +#ifndef NDEBUG
   166 +#define NDEBUG
   167 +#endif
   168 +
   169 +/* Name of package */
   170 +#define PACKAGE "flac"
   171 +
   172 +/* Define to the address where bug reports for this package should be sent. */
   173 +#define PACKAGE_BUGREPORT "flac-dev@xiph.org"
   174 +
   175 +/* Define to the full name of this package. */
   176 +#define PACKAGE_NAME "flac"
   177 +
   178 +/* Define to the full name and version of this package. */
   179 +#define PACKAGE_STRING "flac 1.3.3"
   180 +
   181 +/* Define to the one symbol short name of this package. */
   182 +#define PACKAGE_TARNAME "flac"
   183 +
   184 +/* Define to the home page for this package. */
   185 +#define PACKAGE_URL "https://www.xiph.org/flac/"
   186 +
   187 +/* Define to the version of this package. */
   188 +#define PACKAGE_VERSION "1.3.3"
   189 +
   190 +/* The size of `off_t', as computed by sizeof. */
   191 +#define SIZEOF_OFF_T 4
   192 +
   193 +/* The size of `void*', as computed by sizeof. */
   194 +#define SIZEOF_VOIDP 4
   195 +
   196 +/* Define to 1 if you have the ANSI C header files. */
   197 +#define STDC_HEADERS 1
   198 +
   199 +/* Enable extensions on AIX 3, Interix.  */
   200 +#ifndef _ALL_SOURCE
   201 +# define _ALL_SOURCE 1
   202 +#endif
   203 +/* Enable GNU extensions on systems that have them.  */
   204 +#ifndef _GNU_SOURCE
   205 +# define _GNU_SOURCE 1
   206 +#endif
   207 +/* Enable threading extensions on Solaris.  */
   208 +#ifndef _POSIX_PTHREAD_SEMANTICS
   209 +# define _POSIX_PTHREAD_SEMANTICS 1
   210 +#endif
   211 +/* Enable extensions on HP NonStop.  */
   212 +#ifndef _TANDEM_SOURCE
   213 +# define _TANDEM_SOURCE 1
   214 +#endif
   215 +/* Enable general extensions on Solaris.  */
   216 +#ifndef __EXTENSIONS__
   217 +# define __EXTENSIONS__ 1
   218 +#endif
   219 +
   220 +
   221 +/* Version number of package */
   222 +#define VERSION "1.3.3"
   223 +
   224 +/* Target processor is big endian. */
   225 +#define WORDS_BIGENDIAN 0
   226 +
   227 +/* Enable large inode numbers on Mac OS X 10.5.  */
   228 +#ifndef _DARWIN_USE_64_BIT_INODE
   229 +# define _DARWIN_USE_64_BIT_INODE 1
   230 +#endif
   231 +
   232 +/* Number of bits in a file offset, on hosts where this is settable. */
   233 +/* #undef _FILE_OFFSET_BITS */
   234 +
   235 +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
   236 +/* #undef _LARGEFILE_SOURCE */
   237 +
   238 +/* Define for large files, on AIX-style hosts. */
   239 +/* #undef _LARGE_FILES */
   240 +
   241 +/* Define to 1 if on MINIX. */
   242 +/* #undef _MINIX */
   243 +
   244 +/* Define to 2 if the system does not provide POSIX.1 features except with
   245 +   this defined. */
   246 +/* #undef _POSIX_1_SOURCE */
   247 +
   248 +/* Define to 1 if you need to in order for `stat' and other things to work. */
   249 +/* #undef _POSIX_SOURCE */
   250 +
   251 +/* Define to `__inline__' or `__inline' if that's what the C compiler
   252 +   calls it, or to nothing if 'inline' is not supported under any name.  */
   253 +#ifndef __cplusplus
   254 +/* #undef inline */
   255 +#endif
   256 +
   257 +/* Define to __typeof__ if your compiler spells it that way. */
   258 +/* #undef typeof */
   259 diff -u /dev/null flac-1.3.3/Android.mk
   260 --- /dev/null
   261 +++ flac-1.3.3/Android.mk
   262 @@ -0,0 +1,50 @@
   263 +LOCAL_PATH := $(call my-dir)
   264 +
   265 +include $(CLEAR_VARS)
   266 +
   267 +LOCAL_MODULE := libFLAC
   268 +
   269 +FLAC_OGG_LIBRARY_PATH := ../libogg-1.3.2
   270 +
   271 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
   272 +                    $(LOCAL_PATH)/src/libFLAC/include \
   273 +                    $(LOCAL_PATH)/$(FLAC_OGG_LIBRARY_PATH)/include \
   274 +                    $(LOCAL_PATH)/$(FLAC_OGG_LIBRARY_PATH)/android
   275 +LOCAL_CFLAGS := -include $(LOCAL_PATH)/android/config.h
   276 +
   277 +LOCAL_SRC_FILES := \
   278 +    src/libFLAC/bitmath.c \
   279 +    src/libFLAC/bitreader.c \
   280 +    src/libFLAC/bitwriter.c \
   281 +    src/libFLAC/cpu.c \
   282 +    src/libFLAC/crc.c \
   283 +    src/libFLAC/fixed.c \
   284 +    src/libFLAC/fixed_intrin_sse2.c  \
   285 +    src/libFLAC/fixed_intrin_ssse3.c \
   286 +    src/libFLAC/float.c \
   287 +    src/libFLAC/format.c \
   288 +    src/libFLAC/lpc.c \
   289 +    src/libFLAC/lpc_intrin_sse.c   \
   290 +    src/libFLAC/lpc_intrin_sse2.c  \
   291 +    src/libFLAC/lpc_intrin_sse41.c \
   292 +    src/libFLAC/lpc_intrin_avx2.c  \
   293 +    src/libFLAC/lpc_intrin_vsx.c   \
   294 +    src/libFLAC/md5.c \
   295 +    src/libFLAC/memory.c \
   296 +    src/libFLAC/metadata_iterators.c \
   297 +    src/libFLAC/metadata_object.c \
   298 +    src/libFLAC/stream_decoder.c \
   299 +    src/libFLAC/stream_encoder.c \
   300 +    src/libFLAC/stream_encoder_intrin_sse2.c  \
   301 +    src/libFLAC/stream_encoder_intrin_ssse3.c \
   302 +    src/libFLAC/stream_encoder_intrin_avx2.c  \
   303 +    src/libFLAC/stream_encoder_framing.c \
   304 +    src/libFLAC/window.c \
   305 +    src/libFLAC/ogg_decoder_aspect.c \
   306 +    src/libFLAC/ogg_encoder_aspect.c \
   307 +    src/libFLAC/ogg_helper.c \
   308 +    src/libFLAC/ogg_mapping.c
   309 +
   310 +LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
   311 +
   312 +include $(BUILD_STATIC_LIBRARY)
   313 diff -u flac-1.3.3/src/libFLAC/format.c.orig flac-1.3.3/src/libFLAC/format.c
   314 --- flac-1.3.3/src/libFLAC/format.c.orig
   315 +++ flac-1.3.3/src/libFLAC/format.c
   316 @@ -45,6 +45,9 @@
   317  #include "private/macros.h"
   318  
   319  /* PACKAGE_VERSION should come from configure */
   320 +#ifndef PACKAGE_VERSION
   321 +#define PACKAGE_VERSION	"UNKNOWN"
   322 +#endif
   323  FLAC_API const char *FLAC__VERSION_STRING = PACKAGE_VERSION;
   324  
   325  FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " PACKAGE_VERSION " 20190804";