[vlc-commits] commit: Contribs: build sidplay2 and patch it so it can actually compile ( Jean-Baptiste Kempf )
git at videolan.org
git at videolan.org
Tue Dec 28 23:47:14 CET 2010
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Dec 28 23:46:42 2010 +0100| [64f1b9a158a8350c9d1545fdd66c943c89c862bc] | committer: Jean-Baptiste Kempf
Contribs: build sidplay2 and patch it so it can actually compile
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=64f1b9a158a8350c9d1545fdd66c943c89c862bc
---
extras/contrib/src/Patches/sidplay2-endian.patch | 60 ++++++++++++++++++++
extras/contrib/src/Patches/sidplay2-openmode.patch | 40 +++++++++++++
extras/contrib/src/Patches/sidplay2-smartprt.patch | 26 +++++++++
extras/contrib/src/contrib-src.mak | 21 +++++++
extras/contrib/src/packages.mak | 1 +
5 files changed, 148 insertions(+), 0 deletions(-)
diff --git a/extras/contrib/src/Patches/sidplay2-endian.patch b/extras/contrib/src/Patches/sidplay2-endian.patch
new file mode 100644
index 0000000..f24db0c
--- /dev/null
+++ b/extras/contrib/src/Patches/sidplay2-endian.patch
@@ -0,0 +1,60 @@
+--- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/sidendian.h
++++ sidplay-libs-2.1.1/libsidplay/include/sidplay/sidendian.h
+@@ -16,6 +16,10 @@
+ ***************************************************************************/
+ /***************************************************************************
+ * $Log: sidendian.h,v $
++ * Revision 1.6 2005/11/20 11:02:06 s_a_white
++ * Work around for bug in gcc 4 (optimiser breaks if variable never has a
++ * direct assignment).
++ *
+ * Revision 1.5 2001/07/03 22:44:13 s_a_white
+ * Added endian_16 to convert a 16 bit value to an array of 8s.
+ *
+@@ -141,7 +145,7 @@
+ // Convert high-byte and low-byte to 16-bit word.
+ inline uint_least16_t endian_16 (uint8_t hi, uint8_t lo)
+ {
+- uint_least16_t word;
++ uint_least16_t word = 0;
+ endian_16lo8 (word, lo);
+ endian_16hi8 (word, hi);
+ return word;
+@@ -334,7 +338,7 @@
+ // Swap word endian.
+ inline void endian_32swap8 (uint_least32_t &dword)
+ {
+- uint_least16_t lo, hi;
++ uint_least16_t lo = 0, hi = 0;
+ lo = endian_32lo16 (dword);
+ hi = endian_32hi16 (dword);
+ endian_16swap8 (lo);
+@@ -346,8 +350,8 @@
+ // Convert high-byte and low-byte to 32-bit word.
+ inline uint_least32_t endian_32 (uint8_t hihi, uint8_t hilo, uint8_t hi, uint8_t lo)
+ {
+- uint_least32_t dword;
+- uint_least16_t word;
++ uint_least32_t dword = 0;
++ uint_least16_t word = 0;
+ endian_32lo8 (dword, lo);
+ endian_32hi8 (dword, hi);
+ endian_16lo8 (word, hilo);
+@@ -374,7 +378,7 @@
+ defined(SID_WORDS_LITTLEENDIAN)
+ *((uint_least32_t *) ptr) = dword;
+ #else
+- uint_least16_t word;
++ uint_least16_t word = 0;
+ ptr[0] = endian_32lo8 (dword);
+ ptr[1] = endian_32hi8 (dword);
+ word = endian_32hi16 (dword);
+@@ -401,7 +405,7 @@
+ defined(SID_WORDS_BIGENDIAN)
+ *((uint_least32_t *) ptr) = dword;
+ #else
+- uint_least16_t word;
++ uint_least16_t word = 0;
+ word = endian_32hi16 (dword);
+ ptr[1] = endian_16lo8 (word);
+ ptr[0] = endian_16hi8 (word);
diff --git a/extras/contrib/src/Patches/sidplay2-openmode.patch b/extras/contrib/src/Patches/sidplay2-openmode.patch
new file mode 100644
index 0000000..80a8e27
--- /dev/null
+++ b/extras/contrib/src/Patches/sidplay2-openmode.patch
@@ -0,0 +1,40 @@
+--- sidplay-libs-2.1.1/libsidplay/src/sidtune/SidTune.cpp.old 2008-07-25 16:55:02.000000000 \
++0000
++++ sidplay-libs-2.1.1/libsidplay/src/sidtune/SidTune.cpp 2008-07-25 16:53:58.000000000 \
++0000
+@@ -283,7 +283,7 @@
+ uint_least32_t fileLen = 0;
+
+ // This sucks big time
+- openmode createAtrr = std::ios::in;
++ std::_Ios_Openmode createAtrr = std::ios::in;
+ #ifdef HAVE_IOS_NOCREATE
+ createAtrr |= std::ios::nocreate;
+ #endif
+@@ -952,7 +952,7 @@
+ if ( status )
+ {
+ // Open binary output file stream.
+- openmode createAttr = std::ios::out;
++ std::_Ios_Openmode createAttr = std::ios::out;
+ #if defined(HAVE_IOS_BIN)
+ createAttr |= std::ios::bin;
+ #else
+@@ -1002,7 +1002,7 @@
+ if ( status )
+ {
+ // Open ASCII output file stream.
+- openmode createAttr = std::ios::out;
++ std::_Ios_Openmode createAttr = std::ios::out;
+ if ( overWriteFlag )
+ createAttr |= std::ios::trunc;
+ else
+@@ -1036,7 +1036,7 @@
+ if ( status )
+ {
+ // Open binary output file stream.
+- openmode createAttr = std::ios::out;
++ std::_Ios_Openmode createAttr = std::ios::out;
+ #if defined(HAVE_IOS_BIN)
+ createAttr |= std::ios::bin;
+ #else
diff --git a/extras/contrib/src/Patches/sidplay2-smartprt.patch b/extras/contrib/src/Patches/sidplay2-smartprt.patch
new file mode 100644
index 0000000..19a9e62
--- /dev/null
+++ b/extras/contrib/src/Patches/sidplay2-smartprt.patch
@@ -0,0 +1,26 @@
+--- sidplay-2.1.1/libsidplay/include/sidplay/SmartPtr.h 2004-06-14 22:08:04.000000000 +0200
++++ sidplay2/libsidplay/include/sidplay/SmartPtr.h 2010-12-28 23:33:07.803027697 +0100
+@@ -211,16 +211,16 @@
+ {
+ if ( bufferLen >= 1 )
+ {
+- pBufCurrent = ( bufBegin = buffer );
+- bufEnd = bufBegin + bufferLen;
+- bufLen = bufferLen;
+- status = true;
++ this->pBufCurrent = ( this->bufBegin = buffer );
++ this->bufEnd = this->bufBegin + bufferLen;
++ this->bufLen = bufferLen;
++ this->status = true;
+ }
+ else
+ {
+- pBufCurrent = bufBegin = bufEnd = 0;
+- bufLen = 0;
+- status = false;
++ this->pBufCurrent = this->bufBegin = this->bufEnd = 0;
++ this->bufLen = 0;
++ this->status = false;
+ }
+ }
+ };
diff --git a/extras/contrib/src/contrib-src.mak b/extras/contrib/src/contrib-src.mak
index 37de859..4ab3aa8 100644
--- a/extras/contrib/src/contrib-src.mak
+++ b/extras/contrib/src/contrib-src.mak
@@ -2644,6 +2644,27 @@ CLEAN_FILE += .gme
CLEAN_PKG += game-music-emu-$(GME_VERSION)
DISTCLEAN_PKG += game-music-emu-$(GME_VERSION).tbz2
+# ********************************
+# SidPlay2
+# ********************************
+sidplay-libs-2.1.1.tar.gz:
+ $(WGET) $(SID_URL)
+
+sidplay-2.1.1: sidplay-libs-2.1.1.tar.gz
+ $(EXTRACT_GZ)
+ (cd $@; patch -p1 < ../Patches/sidplay2-openmode.patch)
+ (cd $@; patch -p1 < ../Patches/sidplay2-endian.patch)
+ (cd $@; patch -p1 < ../Patches/sidplay2-smartprt.patch)
+
+.sidplay: sidplay-2.1.1
+ (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make -C libsidplay && make -C libsidplay install )
+
+CLEAN_FILE += .sidplay
+CLEAN_PKG += sidplay-2.1.1
+DISTCLEAN_PKG += sidplay-libs-2.1.1.tar.gz
+
+##
+
tools: $(TOOLS)
# ***************************************************************************
diff --git a/extras/contrib/src/packages.mak b/extras/contrib/src/packages.mak
index 1f4bc81..b8b7fc0 100644
--- a/extras/contrib/src/packages.mak
+++ b/extras/contrib/src/packages.mak
@@ -246,3 +246,4 @@ VPX_VERSION=0.9.2
VPX_URL=http://webm.googlecode.com/files/libvpx-$(VPX_VERSION).tar.bz2
GME_VERSION=0.5.5
GME_URL=http://game-music-emu.googlecode.com/files/game-music-emu-$(GME_VERSION).tbz2
+SID_URL=$(SF)/sidplay2/sidplay2/sidplay-libs-2.1.1/sidplay-libs-2.1.1.tar.gz
More information about the vlc-commits
mailing list