Commit Graph

3065 Commits

Author SHA1 Message Date
Erik de Castro Lopo
f67928dec4 Fix VC project files to use /objs/ directory instead of /obj/ directory. 2013-01-02 22:49:55 +11:00
Erik de Castro Lopo
33fa7dc643 Minor Linux fixes for Makefile.lite build method. 2013-01-02 22:49:55 +11:00
Erik de Castro Lopo
85d5c53803 Fix all Makefile.lite to use /objs/ directory instead of /obj/ directory. 2013-01-02 22:49:37 +11:00
Hendricks266
96d081c1c9 Fix building with MSYS and MinGW(-w64); Improve Makefile.lite build system
This is a patch to allow building of the project using MSYS, MinGW, and MinGW-w64 with the following invocation:

make -f Makefile.lite libFLAC libFLAC++ flac metaflac test_libs_common test_libFLAC test_libFLAC++ test_grabbag test_seeking test_streams utils examples

This patch addresses eight points:
1. `uname -p` in MSYS returns "unknown" so we must use `gcc -dumpmachine` to gain information about the target, 32-bit or 64-bit.
2. MinGW-w64 does not ship with a working iconv.h, so we must disable it under this specific compiler.
3. The code requires <inttypes.h> in a handful of C files, but config.mk did not contain -DHAVE_INTTYPES_H, which under the full build process (I assume) is added by autoconf.
4. The compiler complained when lround() in lpc.c was static, so it is no longer static.
5. Additional scattered linking directives (and reordering) (particularly FLAC, grabbag, and replaygain_analysis) were necessary to build some of the components.
6. The Makefile.lite build system benefited from some cleanup, particularly by rigorously defining all entries, factoring redundancy, and establishing dependencies. (Some typos were fixed too.)
7. Shared objects on Windows use .dll, not .so. (Added *.dll, *.dylib, and *.exe to .gitignore.)
8. To allow more freedom using Makefile.lite without configure, I added the variables USE_OGG and USE_ICONV which can toggle these two components in the build process.
ex: make -f Makefile.lite examples USE_OGG=0 USE_ICONV=0

These improvements make use of some use-time Makefile variable expansion.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-01-02 21:35:47 +11:00
nu774
0da96d3cfd Fix to allow the flac command to parse piped WAV input with
WAVEFORMATEXTENSIBLE format.

MinGW's fseeko() doesn't return error for the attempt to seek on non
seekable file (same behavior as MSVC).
The simplest solution would be to change #ifdef _MSC_VER to #ifdef
_WIN32 here.
Instead, this patch tests file with fstat(), and use fseeko() only when
it is a regular file.
This is confirmed to work properly both on MSVC and MinGW, can seek if
stdin is a redirected regular file, and doesn't require #ifdef.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-12-28 11:31:35 +11:00
Erik de Castro Lopo
55788ea96b Rename obj/ directory to objs/ to avoid BSD make issue. 2012-12-28 11:06:38 +11:00
Erik de Castro Lopo
592021edf7 configure.ac : Treat powerpc64 like powerpc. 2012-12-28 09:50:49 +11:00
Max Horn
0b47ede01b configure: modernize autoconf usage
In particular:
- quote several macro arguments properly
- switch to the extended version of AC_INIT
- replace AM_CONFIG_HEADER by AC_CONFIG_HEADERS
- remove obsolete extra AC_CHECK_SIZEOF param
- upgrade minimal automake version from 1.7 to 1.11
  (which is when dist-xz was introduced)

Signed-off-by: Max Horn <max@quendi.de>
2012-12-13 08:12:56 +11:00
Max Horn
21f68f4fad configure: merge AC_CHECK_HEADERS calls
Also removed some pointless AC_SUBST invocation, which would only be
necessary if the Makefiles were using the results of the header
detection, which they are not.

Signed-off-by: Max Horn <max@quendi.de>
2012-12-13 08:12:43 +11:00
Max Horn
cdcb88bdc9 configure: always print ac_cv_c_compiler_gnu
Previously, we only printed whether the used compiler was
detected as gcc if the answer was positive. Now we always
print the result (but the GCC version still is only
printed when we are using GCC)

Signed-off-by: Max Horn <max@quendi.de>
2012-12-13 08:12:30 +11:00
Max Horn
66c0a581d2 autogen.sh: replace this by a simple call to autoreconf
The autoreconf tool is provided by autoconf to do what custom
autogen.sh scripts in many projects used to do. Only it is more
robust and widely tested. It has been available for several years,
too. No reason to rely on custom code for this.

Signed-off-by: Max Horn <max@quendi.de>
2012-12-13 08:12:14 +11:00
Max Horn
f20164e41e configure: replace XIPH_C_FIND_ENDIAN by AC_C_BIGENDIAN
Signed-off-by: Max Horn <max@quendi.de>
2012-12-13 08:11:32 +11:00
Timothy B. Terriberry
0920bc1ffb Fix a copy & paste error in a comment. 2012-12-09 13:13:12 +11:00
Erik de Castro Lopo
762ae01893 Covert 2 C source files from dos to unix line endings. 2012-12-06 06:42:34 +11:00
Miroslav Lichvar
6a1f59b58f Update FSF address. 2012-12-06 06:17:26 +11:00
Miroslav Lichvar
a43f56c0b2 Update library version-info. 2012-12-04 17:45:51 +11:00
Miroslav Lichvar
49b9673c89 Hide symbols with nasm.
Hide all cglobal symbols with nasm >= 2.
2012-12-04 17:45:32 +11:00
Miroslav Lichvar
19c78e58d7 Hide symbols with gcc.
With gcc >= 4 and ELF, set default visibility to hidden and make visible
only the symbols with FLAC_API or FLACPP_API.

A convenience libFLAC-static.la is created for test_libFLAC as it
depends on the hidden symbols.
2012-12-04 17:45:06 +11:00
Miroslav Lichvar
18e01547ac Don't override user-specified CFLAGS. 2012-12-04 17:44:42 +11:00
Miroslav Lichvar
7edf67769f Remove old GNU-stack sections from nasm files.
They are not needed since the section is defined in nasm.h.
2012-12-04 17:43:49 +11:00
Miroslav Lichvar
b61825df87 Add missing options to flac man page. 2012-12-04 17:42:27 +11:00
Erik de Castro Lopo
70be52b1dd src/libFLAC/stream_encoder.c : Fix typo.
FLAC__treamEncoderReadStatusString -> FLAC__StreamEncoderReadStatusString

Thanks to nu774 on github.
2012-11-30 15:33:59 +11:00
Erik de Castro Lopo
86efeb5903 Replace printfs with "%s" format strings with puts.
Thanks to Elan Ruusamäe for the suggestion.
2012-11-13 17:26:08 +11:00
Erik de Castro Lopo
1f0daccf2b Add a regresion test for compression levels. 2012-10-14 21:40:40 +11:00
Erik de Castro Lopo
fc360735ce Fix a regression that severely impacted compression levels.
Regression was introducted in commit 8bbbf56403
(Feb 1 19:58:09 2012) when fixing compiler warnings. In src/libFLAC/lpc.c the
line:

        ref[i] = (r/=err);

was erroniously removed because the left hand side, ref[i] was never used.
Obviously, the correct thing to do was to replace that line with:

        r /= err;

This code has not been officially released. The only people who would have
been affected are people who compiled FLAC from git between February and
now.

The only adverse affect of this error was that compression ratio would have
been severely compromised. No audio is lost, and if anyone has a file that
compressed with a bad version of FLAC can decompress it to WAV and then
re-compress with a fixed version.
2012-10-12 22:02:49 +11:00
Erik de Castro Lopo
a2923e64c0 Regenerate manpages. 2012-09-19 18:06:49 +10:00
Erik de Castro Lopo
6f3f7f06c8 Updates to metaflac manpage from Jaren Stangret <sirjaren@gmail.com>. 2012-09-19 18:06:10 +10:00
Erik de Castro Lopo
023f06f6cb man/Makefile : Fail more gracefully. 2012-09-19 18:03:19 +10:00
Erik de Castro Lopo
b21f190861 Add a convenience function to create a Metadata::Padding object with a
certain size in one statement.

Patch from Bastiaan Timmer <basjetimmer@yahoo.com>
2012-09-11 15:52:24 +10:00
Miroslav Lichvar
8d9e5c6e8e Optimize FLAC__bitreader_read_rice_signed_block.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-08-28 21:17:18 +10:00
Miroslav Lichvar
7b37472a2f Add new clz function which works with input 0.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-08-28 21:17:15 +10:00
Miroslav Lichvar
d69e807e10 Make FLAC__clz_soft_uint32 static.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-08-28 21:17:12 +10:00
Samuli Suominen
12022d90dd Fix assembler code to make it PIC so the dynamic linker does
not have to do text relocations on-the-fly. Patch from Gentoo
via Jaren Stangret <sirjaren@gmail.com>

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-07-26 17:21:41 +10:00
Erik de Castro Lopo
a9f3bc8eed Change order of flac_LDADD libs so it works with mingw. 2012-07-04 20:05:11 +10:00
Erik de Castro Lopo
4ef5bfbc56 Add 'ar-lib' to .gitignore. 2012-07-04 19:54:48 +10:00
Erik de Castro Lopo
3e2cd27d05 configure.ac : Make sure FLAC__HAS_OGG gets defined to either 0 or 1. 2012-07-04 19:53:31 +10:00
Erik de Castro Lopo
a7e3705d05 Move code inside #ifdef _MSC_VER to compat.h. 2012-06-22 16:03:04 +10:00
Erik de Castro Lopo
5b62b770bc Move all definitions of FLAC__U64L to one place. 2012-06-22 14:52:53 +10:00
Bastiaan Timmer
1294b64996 Adds last functions from C metadata api to C++ metadata api
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-06-22 14:35:07 +10:00
Erik de Castro Lopo
8749dc278d Fix building when configured with --disable-shared.
The problem was that the function safe_malloc_mul_2op_() was originally
defined as static inline in inclide/share/alloc.h but had to be moved
because GCC was refusing to inline it. Once moved however, static linking
would fail when building the flac executable because the function ended
up beiong linked twice.
2012-06-22 14:23:56 +10:00
Erik de Castro Lopo
feab11e9bd Fix FLAC__stream_decoder_delete() and FLAC__stream_encoder_delete()
so that they will simply return if passed a NULL pointer (ie just
like the C free() stdlib function).
2012-06-22 13:39:40 +10:00
Cristian Rodríguez
63c874f0fd Fix build with automake 1.12
recent autotools require calling AM_PROG_AR before LT_INIT
this macro needs to be conditionally defined as it is not
present in old versions.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-06-08 20:13:29 +10:00
Bastiaan Timmer
04ca6fd9e1 Quick patch to fix FLAC_metadata_object api docs.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-06-08 19:58:41 +10:00
Cristian Rodríguez
387b72731d bitmath: Finish up optimizations
This patch adds support for other compilers and systems
including MSVC, Intel C compiler etc..

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-06-08 19:58:29 +10:00
Erik de Castro Lopo
605f920816 Fix more compiler warnings. 2012-05-08 20:08:06 +10:00
Erik de Castro Lopo
7c07a0ddfe configure.ac : For gcc use -Wall -Wextra when using --enable-gcc-werror. 2012-05-08 20:06:22 +10:00
Erik de Castro Lopo
56c3191827 metadata.cpp : Fix compiler warning on 64 bit.
Patch from Bastiaan Timmer <basjetimmer@yahoo.com>.
2012-05-08 19:51:50 +10:00
Erik de Castro Lopo
155719b470 src/libFLAC/lpc.c : Include <inttypes.h> so compiling debug version works. 2012-05-08 19:23:08 +10:00
Erik de Castro Lopo
601e96102c Add missing functions to VorbisComment class.
Patch from Bastiaan Timmer <basjetimmer@yahoo.com> sent to the
<flac-dev@xiph.org> mailing list.
2012-05-08 19:12:58 +10:00
Miroslav Lichvar
5289b309cf Optimize COUNT_ZERO_MSBS macro
Reorder the conditions according to the expected distribution of input
signal. This seems to make it almost as fast as the clz builtin using
the bsr instruction.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-05-07 21:45:33 +10:00