Difference between revisions of "Libmad"

From CBLFS
Jump to navigationJump to search
(32Bit)
 
(16 intermediate revisions by 5 users not shown)
Line 2: Line 2:
 
|-
 
|-
 
!Download Source:
 
!Download Source:
| http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
+
| http://prdownloads.sourceforge.net/mad/libmad-{{Libmad-Version}}.tar.gz
 +
|-
 +
!Download Patch:
 +
| http://svn.cross-lfs.org/svn/repos/patches/libmad/libmad-{{Libmad-Version}}-fforce-2.patch
 
|}
 
|}
  
 
----
 
----
 +
 +
{{Package-Introduction|Libmad is a high-quality MPEG audio decoder capable of 24-bit output.|
 +
http://www.underbit.com/products/mad/}}
  
 
== Dependencies ==
 
== Dependencies ==
Line 13: Line 19:
 
Configure and compile the package:
 
Configure and compile the package:
  
 +
patch -Np1 -i ../libmad-{{Libmad-Version}}-fforce-2.patch &&
 
  ./configure --prefix=/usr &&
 
  ./configure --prefix=/usr &&
 
  make
 
  make
  
Install the package:
+
Create a pkg-config file:
  
make install
+
  cat > mad.pc << "EOF"
 
 
  cat > /usr/lib/pkgconfig/mad.pc << "EOF"
 
 
  prefix=/usr
 
  prefix=/usr
 
  exec_prefix=${prefix}
 
  exec_prefix=${prefix}
Line 28: Line 33:
 
  Name: mad
 
  Name: mad
 
  Description: MPEG audio decoder
 
  Description: MPEG audio decoder
  Requires:
+
  Version: {{Libmad-Version}}
  Version: 0.15.1b
+
   
 
  Libs: -L${libdir} -lmad
 
  Libs: -L${libdir} -lmad
 
  Cflags: -I${includedir}
 
  Cflags: -I${includedir}
 
  EOF
 
  EOF
 +
 +
Install the package
 +
 +
make install &&
 +
install -v -m644 mad.pc /usr/lib/pkgconfig
  
 
== Multilib ==
 
== Multilib ==
Line 40: Line 50:
 
Configure and compile the package:
 
Configure and compile the package:
  
 +
patch -Np1 -i ../libmad-{{Libmad-Version}}-fforce-2.patch &&
 
  CC="gcc ${BUILD32}" ./configure --prefix=/usr &&
 
  CC="gcc ${BUILD32}" ./configure --prefix=/usr &&
 
  make
 
  make
  
Install the package:
+
Create a pkg-config file:
 
 
make install
 
mkdir -pv /usr/include/32
 
  
  cat > /usr/lib/pkgconfig/mad.pc << "EOF"
+
  cat > mad.pc << "EOF"
 
  prefix=/usr
 
  prefix=/usr
 
  exec_prefix=${prefix}
 
  exec_prefix=${prefix}
Line 56: Line 64:
 
  Name: mad
 
  Name: mad
 
  Description: MPEG audio decoder
 
  Description: MPEG audio decoder
  Requires:
+
  Version: {{Libmad-Version}}
  Version: 0.15.1b
+
   
 
  Libs: -L${libdir} -lmad
 
  Libs: -L${libdir} -lmad
 
  Cflags: -I${includedir}
 
  Cflags: -I${includedir}
 
  EOF
 
  EOF
 +
 +
Install the package
 +
 +
make install &&
 +
mv -v /usr/include/mad{,-32}.h &&
 +
install -v -m644 mad.pc /usr/lib/pkgconfig
  
 
=== N32 ===
 
=== N32 ===
Line 66: Line 80:
 
Configure and compile the package:
 
Configure and compile the package:
  
 +
patch -Np1 -i ../libmad-{{Libmad-Version}}-fforce-2.patch &&
 
  CC="gcc ${BUILDN32}" ./configure --prefix=/usr --libdir=/usr/lib32 &&
 
  CC="gcc ${BUILDN32}" ./configure --prefix=/usr --libdir=/usr/lib32 &&
 
  make
 
  make
  
Install the package:
+
Create a pkg-config file:
  
make install
+
  cat > mad.pc << "EOF"
 
 
  cat > /usr/lib32/pkgconfig/mad.pc << "EOF"
 
 
  prefix=/usr
 
  prefix=/usr
 
  exec_prefix=${prefix}
 
  exec_prefix=${prefix}
Line 81: Line 94:
 
  Name: mad
 
  Name: mad
 
  Description: MPEG audio decoder
 
  Description: MPEG audio decoder
  Requires:
+
  Version: {{Libmad-Version}}
  Version: 0.15.1b
+
   
 
  Libs: -L${libdir} -lmad
 
  Libs: -L${libdir} -lmad
 
  Cflags: -I${includedir}
 
  Cflags: -I${includedir}
 
  EOF
 
  EOF
 +
 +
Install the package
 +
 +
make install &&
 +
mv -v /usr/include/mad{,-n32}.h &&
 +
install -v -m644 mad.pc /usr/lib32/pkgconfig
  
 
=== 64Bit ===
 
=== 64Bit ===
Line 91: Line 110:
 
Configure and compile the package:
 
Configure and compile the package:
  
 +
patch -Np1 -i ../libmad-{{Libmad-Version}}-fforce-2.patch &&
 
  CC="gcc ${BUILD64}" ./configure --prefix=/usr --libdir=/usr/lib64 &&
 
  CC="gcc ${BUILD64}" ./configure --prefix=/usr --libdir=/usr/lib64 &&
 
  make
 
  make
  
Install the package:
+
Create a pkg-config file:
  
make install
+
  cat > mad.pc << "EOF"
mkdir -pv /usr/include/64 &&
 
mv -v /usr/include/mad.h /usr/include/64
 
 
 
  cat > /usr/lib64/pkgconfig/mad.pc << "EOF"
 
 
  prefix=/usr
 
  prefix=/usr
 
  exec_prefix=${prefix}
 
  exec_prefix=${prefix}
Line 108: Line 124:
 
  Name: mad
 
  Name: mad
 
  Description: MPEG audio decoder
 
  Description: MPEG audio decoder
  Requires:
+
  Version: {{Libmad-Version}}
  Version: 0.15.1b
+
   
 
  Libs: -L${libdir} -lmad
 
  Libs: -L${libdir} -lmad
 
  Cflags: -I${includedir}
 
  Cflags: -I${includedir}
 
  EOF
 
  EOF
  
Fix the Headers
+
Install the package
   
+
 
  cat > /usr/include/mad.h << "EOF"
+
  make install &&
#ifndef __STUB__MAD_H__
+
  mv -v /usr/include/mad{,-64}.h &&
#define __STUB__MAD_H__
+
  install -v -m644 mad.pc /usr/lib64/pkgconfig
#ifdef __x86_64__
+
 
  #include "64/mad.h"
+
{{Stub-Header|mad}}
#else
 
#include "32/mad.h"
 
#endif /* __x86_64__ */
 
#endif /* __STUB__MAD_H__ */
 
EOF
 
  
*[[Audio/Media]]
+
[[Category:Media Libraries]]
*[[Main Page]]
 

Latest revision as of 15:28, 19 March 2009

Download Source: http://prdownloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz
Download Patch: http://svn.cross-lfs.org/svn/repos/patches/libmad/libmad-0.15.1b-fforce-2.patch

Introduction to Libmad

Libmad is a high-quality MPEG audio decoder capable of 24-bit output.

Project Homepage: http://www.underbit.com/products/mad/

Dependencies

Non-Multilib

Configure and compile the package:

patch -Np1 -i ../libmad-0.15.1b-fforce-2.patch &&
./configure --prefix=/usr &&
make

Create a pkg-config file:

cat > mad.pc << "EOF"
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: mad
Description: MPEG audio decoder
Version: 0.15.1b

Libs: -L${libdir} -lmad
Cflags: -I${includedir}
EOF

Install the package

make install &&
install -v -m644 mad.pc /usr/lib/pkgconfig

Multilib

32Bit

Configure and compile the package:

patch -Np1 -i ../libmad-0.15.1b-fforce-2.patch &&
CC="gcc ${BUILD32}" ./configure --prefix=/usr &&
make

Create a pkg-config file:

cat > mad.pc << "EOF"
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: mad
Description: MPEG audio decoder
Version: 0.15.1b

Libs: -L${libdir} -lmad
Cflags: -I${includedir}
EOF

Install the package

make install &&
mv -v /usr/include/mad{,-32}.h &&
install -v -m644 mad.pc /usr/lib/pkgconfig

N32

Configure and compile the package:

patch -Np1 -i ../libmad-0.15.1b-fforce-2.patch &&
CC="gcc ${BUILDN32}" ./configure --prefix=/usr --libdir=/usr/lib32 &&
make

Create a pkg-config file:

cat > mad.pc << "EOF"
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib32
includedir=${prefix}/include

Name: mad
Description: MPEG audio decoder
Version: 0.15.1b

Libs: -L${libdir} -lmad
Cflags: -I${includedir}
EOF

Install the package

make install &&
mv -v /usr/include/mad{,-n32}.h &&
install -v -m644 mad.pc /usr/lib32/pkgconfig

64Bit

Configure and compile the package:

patch -Np1 -i ../libmad-0.15.1b-fforce-2.patch &&
CC="gcc ${BUILD64}" ./configure --prefix=/usr --libdir=/usr/lib64 &&
make

Create a pkg-config file:

cat > mad.pc << "EOF"
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib64
includedir=${prefix}/include

Name: mad
Description: MPEG audio decoder
Version: 0.15.1b

Libs: -L${libdir} -lmad
Cflags: -I${includedir}
EOF

Install the package

make install &&
mv -v /usr/include/mad{,-64}.h &&
install -v -m644 mad.pc /usr/lib64/pkgconfig

Creating a Stub Header (Multilib Only)

Creating a Generic Stub Header

cat > /usr/include/mad.h << "EOF"
/* mad.h - Stub Header  */
#ifndef __STUB__MAD_H__
#define __STUB__MAD_H__

#if defined(__x86_64__) || \
    defined(__sparc64__) || \
    defined(__arch64__) || \
    defined(__powerpc64__) || \
    defined (__s390x__)
# include "mad-64.h"
#else
# include "mad-32.h"
#endif

#endif /* __STUB__MAD_H__ */
EOF

Creating a Stub Header For Mips

cat > /usr/include/mad.h << "EOF"
/* mad.h - Stub Header  */
#ifndef __STUB__MAD_H__
#define __STUB__MAD_H__

#include <sgidefs.h>

#if (_MIPS_SIM == _ABIO32)
# include "mad-32.h"
#elif (_MIPS_SIM == _ABIN32)
# include "mad-n32.h"
#elif (_MIPS_SIM == _ABI64)
# include "mad-64.h"
#endif

#endif /* __STUB__MAD_H__ */
EOF
Retrieved from "?title=Libmad&oldid=17530"