[flac-dev] flac-1.3.1pre1

LRN lrn1986 at gmail.com
Tue Nov 25 02:57:07 PST 2014


On 25.11.2014 11:43, Erik de Castro Lopo wrote:
> 
>     flac-1.3.1pre1.tar.xz  : The source code
>     flac-1.3.1pre1-win.zip : Windows 32 and 64 bit binaries
> 
> Please test.
> 
> I'm particularly interested in hearing about the windows binaries
> which were cross compiled from Linux to Windows. Unfortunately
> there is a bug in Wine which prevents me from running either of
> the testsuites. Maybe someone on windows could grab the source
> and the binaries, build from source, copy the binaries into the
> built flac tree and then run the tests.
> 

MSYS2 + i686-w64-mingw32-gcc-4.9.1 -> builds ok, passes all tests, although
there were some strange messages about compression ration being > 1.0 in two
seek tests.

Dropped x86 binaries into the same tree, ran the tests - passes (same ratio
warnings as above).
Dropped x86-64 binaries into the same tree, ran the tests - also passes (same
ratio warnings as above).

Logs of the output of all three "make check"s are available on demand
(uncompressed 1MB per log, wouldn't want to send this to the ML).

I did have to apply some compatibility patches, as usual, but nothing major.
Patches are attached.

-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org
-------------- next part --------------
From aa8982658dd12f16c8d228f4314f46804d890833 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
 =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986 at gmail.com>
Date: Tue, 25 Nov 2014 10:32:07 +0000
Subject: [PATCH 1/3] Use macros instead of exporting constants from C files

Extern vars might not work well when linking (with LTO, for example) on W32.
---
 src/libFLAC/include/private/ogg_mapping.h | 23 ++++++++++++-----------
 src/libFLAC/ogg_mapping.c                 | 10 ----------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/src/libFLAC/include/private/ogg_mapping.h b/src/libFLAC/include/private/ogg_mapping.h
index d35a46c..fca83fe 100644
--- a/src/libFLAC/include/private/ogg_mapping.h
+++ b/src/libFLAC/include/private/ogg_mapping.h
@@ -38,27 +38,28 @@
 /** The length of the packet type field in bytes. */
 #define FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH (1u)
 
-extern const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN; /* = 8 bits */
-
-extern const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE; /* = 0x7f */
-
 /** The length of the 'FLAC' magic in bytes. */
 #define FLAC__OGG_MAPPING_MAGIC_LENGTH (4u)
 
-extern const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC; /* = "FLAC" */
-
-extern const unsigned FLAC__OGG_MAPPING_VERSION_MAJOR_LEN; /* = 8 bits */
-extern const unsigned FLAC__OGG_MAPPING_VERSION_MINOR_LEN; /* = 8 bits */
-
 /** The length of the Ogg FLAC mapping major version number in bytes. */
 #define FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH (1u)
 
 /** The length of the Ogg FLAC mapping minor version number in bytes. */
 #define FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH (1u)
 
-extern const unsigned FLAC__OGG_MAPPING_NUM_HEADERS_LEN; /* = 16 bits */
-
 /** The length of the #-of-header-packets number bytes. */
 #define FLAC__OGG_MAPPING_NUM_HEADERS_LENGTH (2u)
 
+
+#define FLAC__OGG_MAPPING_PACKET_TYPE_LEN ((unsigned) 8) /* bits */
+
+#define FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE ((FLAC__byte) 0x7f)
+
+#define FLAC__OGG_MAPPING_MAGIC ((const FLAC__byte * const)"FLAC")
+
+#define FLAC__OGG_MAPPING_VERSION_MAJOR_LEN ((unsigned) 8) /* bits */
+#define FLAC__OGG_MAPPING_VERSION_MINOR_LEN ((unsigned) 8) /* bits */
+
+#define FLAC__OGG_MAPPING_NUM_HEADERS_LEN ((unsigned) 16) /* bits */
+
 #endif
diff --git a/src/libFLAC/ogg_mapping.c b/src/libFLAC/ogg_mapping.c
index 125b458..3018240 100644
--- a/src/libFLAC/ogg_mapping.c
+++ b/src/libFLAC/ogg_mapping.c
@@ -36,13 +36,3 @@
 
 #include "private/ogg_mapping.h"
 
-const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN = 8; /* bits */
-
-const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE = 0x7f;
-
-const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC = (const FLAC__byte * const)"FLAC";
-
-const unsigned FLAC__OGG_MAPPING_VERSION_MAJOR_LEN = 8; /* bits */
-const unsigned FLAC__OGG_MAPPING_VERSION_MINOR_LEN = 8; /* bits */
-
-const unsigned FLAC__OGG_MAPPING_NUM_HEADERS_LEN = 16; /* bits */
-- 
1.8.5.3
-------------- next part --------------
From f7f6b253d5ed3eef49fa794b6620b3486a36a2fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
 =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986 at gmail.com>
Date: Tue, 25 Nov 2014 10:35:00 +0000
Subject: [PATCH 2/3] MinGW-compatible dllexporting

We only need __attribute__((dllexport)) to tell GCC which symbols to export.
Importing declarations seem to be unnecessary.
---
 configure.ac            | 3 +++
 include/FLAC++/export.h | 7 +++++++
 include/FLAC/export.h   | 7 +++++++
 3 files changed, 17 insertions(+)

diff --git a/configure.ac b/configure.ac
index 3b51f56..40e1b01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -380,6 +380,9 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
 		CFLAGS="$CFLAGS -fvisibility=hidden"
 		CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
 		fi
+	if test "$OBJ_FORMAT" = win32; then
+		CPPFLAGS="$CPPFLAGS -DFLAC_API_EXPORTS=1 -DFLACPP_API_EXPORTS=1"
+		fi
 
 	if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
 		XIPH_ADD_CFLAGS([-fgnu89-inline])
diff --git a/include/FLAC++/export.h b/include/FLAC++/export.h
index 80b8b8f..5b8114a 100644
--- a/include/FLAC++/export.h
+++ b/include/FLAC++/export.h
@@ -66,6 +66,13 @@
 #define FLACPP_API __declspec(dllimport)
 #endif
 
+#elif defined(__MINGW32__) && defined(__GNUC__)
+#ifdef FLACPP_API_EXPORTS
+#define FLACPP_API __attribute__((dllexport))
+#else
+#define FLACPP_API
+#endif
+
 #elif defined(FLAC__USE_VISIBILITY_ATTR)
 #define FLACPP_API __attribute__ ((visibility ("default")))
 
diff --git a/include/FLAC/export.h b/include/FLAC/export.h
index 9cc9e13..5d1a37d 100644
--- a/include/FLAC/export.h
+++ b/include/FLAC/export.h
@@ -66,6 +66,13 @@
 #define FLAC_API __declspec(dllimport)
 #endif
 
+#elif defined(__MINGW32__) && defined(__GNUC__)
+#ifdef FLAC_API_EXPORTS
+#define FLAC_API __attribute__((dllexport))
+#else
+#define FLAC_API
+#endif
+
 #elif defined(FLAC__USE_VISIBILITY_ATTR)
 #define FLAC_API __attribute__ ((visibility ("default")))
 
-- 
1.8.5.3
-------------- next part --------------
From 4cb281c25597a2081b027b5be025410e8e50b804 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
 =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986 at gmail.com>
Date: Tue, 25 Nov 2014 10:36:52 +0000
Subject: [PATCH 3/3] Hook up libwin_utf8 to automakefiles

---
 src/flac/Makefile.am                  | 5 +++++
 src/metaflac/Makefile.am              | 5 +++++
 src/test_grabbag/cuesheet/Makefile.am | 8 +++++++-
 src/test_grabbag/picture/Makefile.am  | 7 ++++++-
 src/test_libFLAC++/Makefile.am        | 6 ++++++
 src/test_seeking/Makefile.am          | 8 +++++++-
 6 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/src/flac/Makefile.am b/src/flac/Makefile.am
index 7103d9d..117b913 100644
--- a/src/flac/Makefile.am
+++ b/src/flac/Makefile.am
@@ -48,6 +48,10 @@ flac_SOURCES = \
 	utils.h \
 	vorbiscomment.h
 
+if OS_IS_WINDOWS
+win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
+endif
+
 flac_LDADD = \
 	$(top_builddir)/src/share/utf8/libutf8.la \
 	$(top_builddir)/src/share/grabbag/libgrabbag.la \
@@ -55,6 +59,7 @@ flac_LDADD = \
 	$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
 	$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
 	$(top_builddir)/src/libFLAC/libFLAC.la \
+	$(win_utf8_lib) \
 	@LIBICONV@ \
 	-lm
 
diff --git a/src/metaflac/Makefile.am b/src/metaflac/Makefile.am
index e3355ce..5dba9b8 100644
--- a/src/metaflac/Makefile.am
+++ b/src/metaflac/Makefile.am
@@ -44,12 +44,17 @@ metaflac_SOURCES = \
 	utils.h
 metaflac_LDFLAGS = $(AM_LDFLAGS)
 
+if OS_IS_WINDOWS
+win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
+endif
+
 metaflac_LDADD = \
 	$(top_builddir)/src/share/grabbag/libgrabbag.la \
 	$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
 	$(top_builddir)/src/share/getopt/libgetopt.la \
 	$(top_builddir)/src/share/utf8/libutf8.la \
 	$(top_builddir)/src/libFLAC/libFLAC.la \
+	$(win_utf8_lib) \
 	@LIBICONV@
 
 CLEANFILES = metaflac.exe
diff --git a/src/test_grabbag/cuesheet/Makefile.am b/src/test_grabbag/cuesheet/Makefile.am
index 9241dd6..51efbd3 100644
--- a/src/test_grabbag/cuesheet/Makefile.am
+++ b/src/test_grabbag/cuesheet/Makefile.am
@@ -26,9 +26,15 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = test_cuesheet
 test_cuesheet_SOURCES = \
 	main.c
+
+if OS_IS_WINDOWS
+win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
+endif
+
 test_cuesheet_LDADD = \
 	$(top_builddir)/src/share/grabbag/libgrabbag.la \
 	$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
-	$(top_builddir)/src/libFLAC/libFLAC.la
+	$(top_builddir)/src/libFLAC/libFLAC.la \
+	$(win_utf8_lib)
 
 CLEANFILES = test_cuesheet.exe
diff --git a/src/test_grabbag/picture/Makefile.am b/src/test_grabbag/picture/Makefile.am
index 135a336..25a078b 100644
--- a/src/test_grabbag/picture/Makefile.am
+++ b/src/test_grabbag/picture/Makefile.am
@@ -27,8 +27,13 @@ noinst_PROGRAMS = test_picture
 test_picture_SOURCES = \
 	main.c
 
+if OS_IS_WINDOWS
+win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
+endif
+
 test_picture_LDADD = \
 	$(top_builddir)/src/share/grabbag/libgrabbag.la \
-	$(top_builddir)/src/libFLAC/libFLAC.la
+	$(top_builddir)/src/libFLAC/libFLAC.la \
+	$(win_utf8_lib)
 
 CLEANFILES = test_picture.exe
diff --git a/src/test_libFLAC++/Makefile.am b/src/test_libFLAC++/Makefile.am
index 92127ac..161aa1b 100644
--- a/src/test_libFLAC++/Makefile.am
+++ b/src/test_libFLAC++/Makefile.am
@@ -24,12 +24,18 @@ EXTRA_DIST = \
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = test_libFLAC++
+
+if OS_IS_WINDOWS
+win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
+endif
+
 test_libFLAC___LDADD = \
 	$(top_builddir)/src/share/grabbag/libgrabbag.la \
 	$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
 	$(top_builddir)/src/test_libs_common/libtest_libs_common.la \
 	$(top_builddir)/src/libFLAC++/libFLAC++.la \
 	$(top_builddir)/src/libFLAC/libFLAC.la \
+	$(win_utf8_lib) \
 	@OGG_LIBS@ \
 	-lm
 
diff --git a/src/test_seeking/Makefile.am b/src/test_seeking/Makefile.am
index 4b7761c..669f289 100644
--- a/src/test_seeking/Makefile.am
+++ b/src/test_seeking/Makefile.am
@@ -27,8 +27,14 @@ AM_CFLAGS = @OGG_CFLAGS@
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 
 noinst_PROGRAMS = test_seeking
+
+if OS_IS_WINDOWS
+win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
+endif
+
 test_seeking_LDADD = \
-	$(top_builddir)/src/libFLAC/libFLAC.la
+	$(top_builddir)/src/libFLAC/libFLAC.la \
+	$(win_utf8_lib)
 
 test_seeking_SOURCES = \
 	main.c
-- 
1.8.5.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x922360B0.asc
Type: application/pgp-keys
Size: 1717 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20141125/0011f351/attachment-0001.key 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20141125/0011f351/attachment-0001.pgp 


More information about the flac-dev mailing list