summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2010-04-30 08:21:51 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2010-04-30 08:21:51 +0000
commitdecd5d5aaaedbe878acb7c156e067ae14f23a704 (patch)
tree5c9a369eee37e4b647b86a2a28167aff6e7bba5d /media-libs/libmad
parentVersion bump. (diff)
downloadgentoo-2-decd5d5aaaedbe878acb7c156e067ae14f23a704.tar.gz
gentoo-2-decd5d5aaaedbe878acb7c156e067ae14f23a704.tar.bz2
gentoo-2-decd5d5aaaedbe878acb7c156e067ae14f23a704.zip
Fix building with GCC 4.4 on MIPS wrt #317871 by Manuel Lauss.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'media-libs/libmad')
-rw-r--r--media-libs/libmad/ChangeLog11
-rw-r--r--media-libs/libmad/files/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch77
-rw-r--r--media-libs/libmad/libmad-0.15.1b-r6.ebuild68
3 files changed, 154 insertions, 2 deletions
diff --git a/media-libs/libmad/ChangeLog b/media-libs/libmad/ChangeLog
index 99be863263f7..bb959be40832 100644
--- a/media-libs/libmad/ChangeLog
+++ b/media-libs/libmad/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for media-libs/libmad
-# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/libmad/ChangeLog,v 1.54 2008/04/18 21:14:50 flameeyes Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libmad/ChangeLog,v 1.55 2010/04/30 08:21:51 ssuominen Exp $
+
+*libmad-0.15.1b-r6 (30 Apr 2010)
+
+ 30 Apr 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +libmad-0.15.1b-r6.ebuild,
+ +files/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch:
+ Fix building with GCC 4.4 on MIPS wrt #317871 by Manuel Lauss.
*libmad-0.15.1b-r5 (18 Apr 2008)
diff --git a/media-libs/libmad/files/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch b/media-libs/libmad/files/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch
new file mode 100644
index 000000000000..bff7afe6b6bc
--- /dev/null
+++ b/media-libs/libmad/files/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch
@@ -0,0 +1,77 @@
+libmad: MIPS GCC-4.4 build fixes
+
+GCC-4.4 on MIPS removed the "h" asm constraint, fix this up.
+Taken from OE.
+
+http://patchwork.openembedded.org/patch/921/
+
+diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h
+--- libmad-0.15.1b-orig/fixed.h 2004-02-17 12:32:03.000000000 +1030
++++ libmad-0.15.1b/fixed.h 2009-08-05 10:46:30.000000000 +0930
+@@ -299,6 +299,23 @@
+
+ # elif defined(FPM_MIPS)
+
++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
++#define __GNUC_PREREQ(maj, min) \
++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++#define __GNUC_PREREQ(maj, min) 0
++#endif
++
++#if __GNUC_PREREQ(4,4)
++ typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
++# define MAD_F_MLX(hi, lo, x, y) \
++ do { \
++ u64_di_t __ll = (u64_di_t) (x) * (y); \
++ hi = __ll >> 32; \
++ lo = __ll; \
++ } while (0)
++#else
+ /*
+ * This MIPS version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+@@ -328,6 +345,7 @@
+ : "%r" ((x) >> 12), "r" ((y) >> 16))
+ # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
+ # endif
++#endif /* __GNU_PREREQ(4,4) */
+
+ # if defined(OPT_SPEED)
+ # define mad_f_scale64(hi, lo) \
+diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h
+--- libmad-0.15.1b-orig/mad.h 2004-02-17 13:25:44.000000000 +1030
++++ libmad-0.15.1b/mad.h 2009-08-05 10:42:40.000000000 +0930
+@@ -344,6 +344,23 @@
+
+ # elif defined(FPM_MIPS)
+
++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
++#define __GNUC_PREREQ(maj, min) \
++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++#define __GNUC_PREREQ(maj, min) 0
++#endif
++
++#if __GNUC_PREREQ(4,4)
++ typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
++# define MAD_F_MLX(hi, lo, x, y) \
++ do { \
++ u64_di_t __ll = (u64_di_t) (x) * (y); \
++ hi = __ll >> 32; \
++ lo = __ll; \
++ } while (0)
++#else
+ /*
+ * This MIPS version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+@@ -373,6 +390,7 @@
+ : "%r" ((x) >> 12), "r" ((y) >> 16))
+ # define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
+ # endif
++#endif /* __GNU_PREREQ(4,4) */
+
+ # if defined(OPT_SPEED)
+ # define mad_f_scale64(hi, lo) \
diff --git a/media-libs/libmad/libmad-0.15.1b-r6.ebuild b/media-libs/libmad/libmad-0.15.1b-r6.ebuild
new file mode 100644
index 000000000000..5ed5e6710f5b
--- /dev/null
+++ b/media-libs/libmad/libmad-0.15.1b-r6.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libmad/libmad-0.15.1b-r6.ebuild,v 1.1 2010/04/30 08:21:51 ssuominen Exp $
+
+inherit eutils autotools libtool flag-o-matic
+
+DESCRIPTION="\"M\"peg \"A\"udio \"D\"ecoder library"
+HOMEPAGE="http://mad.sourceforge.net"
+SRC_URI="mirror://sourceforge/mad/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="debug"
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/libmad-0.15.1b-cflags.patch
+ epatch "${FILESDIR}"/libmad-0.15.1b-cflags-O2.patch
+ epatch "${FILESDIR}"/libmad-0.15.1b-gcc44-mips-h-constraint-removal.patch
+
+ eautoreconf
+
+ elibtoolize
+ epunt_cxx #74490
+}
+
+src_compile() {
+ local myconf="--enable-accuracy"
+ # --enable-speed optimize for speed over accuracy
+ # --enable-accuracy optimize for accuracy over speed
+ # --enable-experimental enable code using the EXPERIMENTAL
+ # preprocessor define
+
+ # Fix for b0rked sound on sparc64 (maybe also sparc32?)
+ # default/approx is also possible, uses less cpu but sounds worse
+ use sparc && myconf="${myconf} --enable-fpm=64bit"
+
+ [[ $(tc-arch) == "amd64" ]] && myconf="${myconf} --enable-fpm=64bit"
+ [[ $(tc-arch) == "x86" ]] && myconf="${myconf} --enable-fpm=intel"
+ [[ $(tc-arch) == "ppc" ]] && myconf="${myconf} --enable-fpm=ppc"
+ [[ $(tc-arch) == "ppc64" ]] && myconf="${myconf} --enable-fpm=64bit"
+
+ econf \
+ $(use_enable debug debugging) \
+ ${myconf} || die "configure failed"
+ emake || die "make failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "make install failed"
+
+ dodoc CHANGES CREDITS README TODO VERSION
+
+ # This file must be updated with each version update
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins "${FILESDIR}"/mad.pc
+
+ # Use correct libdir in pkgconfig file
+ dosed "s:^libdir.*:libdir=/usr/$(get_libdir):" \
+ /usr/$(get_libdir)/pkgconfig/mad.pc
+
+ find "${D}" -name '*.la' -delete
+}