Skip to content

Commit 9c13616

Browse files
author
menno
committed
Linux compilation fixes
mp4ff should compile now xmmsmp4 should compile now spec file added for Red Hat (make dist should now work)
1 parent 0647406 commit 9c13616

File tree

13 files changed

+293
-48
lines changed

13 files changed

+293
-48
lines changed

Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
SUBDIRS = libfaad common frontend plugins
2+
3+
EXTRA_DIST = faad2.spec

common/Makefile.am

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
SUBDIRS = mp4v2
1+
if WITH_MP4V2
2+
SUBDIRS = mp4v2 mp4ff
3+
else
4+
SUBDIRS = mp4ff
5+
endif

common/mp4ff/Makefile.am

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
lib_LTLIBRARIES = libmp4ff.la
2+
3+
include_HEADERS = mp4ff.h
4+
5+
libmp4ff_la_SOURCES = atom.c ctts.c dinf.c dref.c edts.c \
6+
elst.c esds.c hdlr.c iods.c matrix.c mdat.c mdhd.c \
7+
mdia.c minf.c moov.c mp4ff.c mvhd.c smhd.c stbl.c \
8+
stco.c stsc.c stsd.c stsdtable.c stss.c stsz.c stts.c \
9+
tkhd.c trak.c udta.c util.c vmhd.c \
10+
funcprotos.h mp4ff.h private.h
11+
12+
AM_CFLAGS = -O2 -g
13+
LIBTOOL_DEPS =
14+
LIBS =
15+

common/mp4ff/mp4ff.h

+80-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,87 @@
55
extern "C" {
66
#endif
77

8+
#ifdef _WIN32
9+
10+
#include <stdio.h>
11+
#include <stdlib.h>
12+
13+
#else
14+
#ifdef HAVE_CONFIG_H
15+
# include "../../config.h"
16+
#endif
17+
818
#include <stdio.h>
9-
#include <stdlib.h>
19+
#if HAVE_SYS_TYPES_H
20+
# include <sys/types.h>
21+
#endif
22+
#if HAVE_SYS_STAT_H
23+
# include <sys/stat.h>
24+
#endif
25+
#if STDC_HEADERS
26+
# include <stdlib.h>
27+
# include <stddef.h>
28+
#else
29+
# if HAVE_STDLIB_H
30+
# include <stdlib.h>
31+
# endif
32+
#endif
33+
#if HAVE_STRING_H
34+
# if !STDC_HEADERS && HAVE_MEMORY_H
35+
# include <memory.h>
36+
# endif
37+
# include <string.h>
38+
#endif
39+
#if HAVE_STRINGS_H
40+
# include <strings.h>
41+
#endif
42+
#if HAVE_INTTYPES_H
43+
# include <inttypes.h>
44+
#else
45+
# if HAVE_STDINT_H
46+
# include <stdint.h>
47+
# else
48+
/* we need these... */
49+
typedef unsigned long long uint64_t;
50+
typedef unsigned long uint32_t;
51+
typedef unsigned short uint16_t;
52+
typedef unsigned char uint8_t;
53+
typedef long long int64_t;
54+
typedef long int32_t;
55+
typedef short int16_t;
56+
typedef char int8_t;
57+
# endif
58+
#endif
59+
#if HAVE_UNISTD_H
60+
# include <unistd.h>
61+
#endif
62+
63+
#ifndef HAVE_FLOAT32_T
64+
typedef float float32_t;
65+
#endif
66+
67+
#if STDC_HEADERS
68+
# include <string.h>
69+
#else
70+
# if !HAVE_STRCHR
71+
# define strchr index
72+
# define strrchr rindex
73+
# endif
74+
char *strchr(), *strrchr();
75+
# if !HAVE_MEMCPY
76+
# define memcpy(d, s, n) bcopy((s), (d), (n))
77+
# define memmove(d, s, n) bcopy((s), (d), (n))
78+
# endif
79+
#endif
80+
81+
#ifndef FALSE
82+
#define FALSE 0
83+
#endif
84+
#ifndef TRUE
85+
#define TRUE 1
86+
#endif
87+
88+
#endif
1089

1190

1291
#include "private.h"

configure.in

+33-19
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ AC_PROG_MAKE_SET
1414

1515
AM_CONFIG_HEADER(config.h)
1616

17-
AC_ARG_WITH( xmms, [ --with-xmms compile XMMS plugin],WITHXMMS=$withval, WITHXMMS=no)
18-
19-
AC_ARG_WITH( xmmsmp4,[ --with-xmmsmp4 compile XMMS MP4 plugin],WITHXMMSMP4=$withval, WITHXMMSMP4=no)
17+
AC_ARG_WITH( xmms, [ --with-xmms compile XMMS plugins],WITHXMMS=$withval, WITHXMMS=no)
2018

2119
AC_ARG_WITH( drm, [ --with-drm compile libfaad with DRM support],WITHDRM=$withval, WITHDRM=no)
2220

21+
AC_ARG_WITH( mp4v2, [ --with-mp4v2 compile libmp4v2],WITHMP4V2=$withval, WITHMP4V2=no)
22+
2323
dnl Checks for header files required for mp4.h
2424
AC_HEADER_STDC
2525
AC_CHECK_HEADERS(stdint.h inttypes.h)
@@ -32,6 +32,8 @@ AC_HEADER_TIME
3232
AC_C_INLINE
3333
AC_C_BIGENDIAN
3434

35+
AC_TYPE_OFF_T
36+
3537
AC_DEFUN(MY_CHECK_TYPEDEF_FROM_INCLUDE,
3638
[
3739
AC_MSG_CHECKING([for $1])
@@ -69,39 +71,51 @@ AC_CHECK_LIB(mp4v2, MP4Create, , external_mp4v2=no, -lstdc++)
6971
AC_CHECK_LIB(mp4v2, MP4MetadataDelete, external_mp4v2=no, , -lstdc++)
7072
AC_CHECK_HEADER(mp4.h, , external_mp4v2=no)
7173

74+
AM_CONDITIONAL(WITH_MP4V2, false)
75+
7276
if test x$external_mp4v2 = xyes; then
7377
AM_CONDITIONAL(HAVE_MPEG4IP, true)
7478
MPEG4IP_PLAYER_PLUGIN_DIR=`mpeg4ip-config --player-plugin-dir`
7579
AC_SUBST(MPEG4IP_PLAYER_PLUGIN_DIR)
76-
AC_CONFIG_FILES(plugins/mpeg4ip/Makefile)
7780
AC_MSG_NOTICE([*** Building with external mp4v2 ***])
7881
else
7982
AM_CONDITIONAL(HAVE_MPEG4IP, false)
80-
AC_CONFIG_FILES(common/mp4v2/Makefile)
83+
if test x$WITHMP4V2 = xyes; then
84+
AM_CONDITIONAL(WITH_MP4V2, true)
85+
fi
8186
fi
8287

8388
if test x$WITHXMMS = xyes; then
84-
xmmsplugin=yes
85-
AC_CHECK_PROGS(XMMS_CONFIG, xmms-config,"no_found")
86-
if test "$XMMS_CONFIG" = "no_found"; then
87-
AC_MSG_ERROR("*** xmms-config not found - omitting xmms plugin build")
88-
xmmsplugin=no
89-
AM_CONDITIONAL(HAVE_XMMS, false)
90-
else
91-
AM_CONDITIONAL(HAVE_XMMS, true)
92-
AC_CONFIG_SUBDIRS(plugins/xmms)
89+
AC_CHECK_PROGS(XMMS_CONFIG, xmms-config,"not_found")
90+
if test "$XMMS_CONFIG" = "not_found"; then
91+
AC_MSG_ERROR("*** xmms-config not found - xmms plugin can't be build")
9392
fi
93+
AC_CHECK_HEADER(pthread.h,,
94+
AC_MSG_ERROR(*** pthread headers support not installed or not found))
95+
AC_CHECK_HEADER(id3.h,,
96+
AC_MSG_ERROR(*** id3lib headers support not installed or not found))
97+
AC_CHECK_PROGS(GTK_CONFIG, gtk-config, "not_found")
98+
99+
if test x$GTK_CONFIG = xnot_found; then
100+
AC_MSG_ERROR("*** gtk-config not found - xmms plugin can't be build")
101+
fi
102+
103+
AM_CONDITIONAL(HAVE_XMMS, true)
104+
AC_MSG_NOTICE("xmms plugin requires libmp4v2 to be build")
105+
AM_CONDITIONAL(WITH_MP4V2, true)
94106
else
95107
AM_CONDITIONAL(HAVE_XMMS, false)
96-
xmmsplugin=no
97108
fi
98109

99110
if test x$WITHDRM = xyes; then
100111
AC_DEFINE(DRM, 1, [Define if you want to use libfaad together with Digital Radio Mondiale (DRM)])
101112
fi
102113

103-
AC_CONFIG_FILES(libfaad/Makefile frontend/Makefile common/Makefile Makefile plugins/Makefile)
104-
AC_OUTPUT
114+
AC_CONFIG_FILES(libfaad/Makefile frontend/Makefile common/Makefile plugins/Makefile Makefile )
105115

106-
dnl AC_CONFIG_SUBDIRS(plugins/xmmsmp4/src)
107-
dnl AC_OUTPUT(plugins/xmmsmp4/Makefile plugins/xmmsmp4/src/Makefile)
116+
AC_CONFIG_FILES(plugins/mpeg4ip/Makefile)
117+
AC_CONFIG_FILES(plugins/xmms/Makefile plugins/xmms/src/Makefile)
118+
AC_CONFIG_FILES(plugins/xmmsmp4/Makefile plugins/xmmsmp4/src/Makefile)
119+
120+
AC_CONFIG_FILES(common/mp4ff/Makefile common/mp4v2/Makefile)
121+
AC_OUTPUT

faad2.spec

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
Summary: C library and frontend for decoding MPEG2/4 AAC
2+
Name: faad2
3+
Version: 2.0.031105
4+
Release: 1
5+
License: GPL
6+
Group: Applications/Multimedia
7+
Source0: http://download.sourceforge.net/faad/%{name}-%{version}.tar.gz
8+
BuildRequires: autoconf, automake, libtool, gcc-c++
9+
BuildRequires: xmms-devel, id3lib-devel, gtk+-devel
10+
URL: http://www.audiocoding.com/
11+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
12+
13+
14+
%description
15+
FAAD 2 is a LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder, completely
16+
written from scratch. FAAD 2 is licensed under the GPL.
17+
18+
%package devel
19+
Summary: Development libraries the FAAD 2 AAC decoder.
20+
Group: Development/Libraries
21+
Requires: %{name} = %{version}-%{release}
22+
23+
%description devel
24+
Header files and development documentation for libfaad.
25+
26+
%package xmms
27+
Group: Applications/Multimedia
28+
Summary: AAC and MP4 input plugin for xmms
29+
Requires: %{name} = %{version}-%{release}, %{version}-%{release}-libmp4ff, xmms, id3lib
30+
31+
32+
%description xmms
33+
The AAC xmms input plugin for xmms recognizes AAC files by an
34+
.aac extension.
35+
This MP4 xmms plugin reads AAC files with and without ID3 tags (version 2.x).
36+
AAC files are MPEG2 or MPEG4 files that can be found in MPEG4 audio files
37+
(.mp4). MPEG4 files with AAC inside can be read by RealPlayer or Quicktime.
38+
39+
40+
%package libmp4v2
41+
Summary: C++ library to handle MP4 (Quicktime) content
42+
Group: Development/Libraries
43+
44+
%description libmp4v2
45+
C++ library to handle MP4 (Quicktime) content
46+
47+
48+
%package libmp4ff
49+
Summary: Library to handle MP4 (Quicktime)
50+
Group: Development/Libraries
51+
52+
%description libmp4ff
53+
This is a Quicktime library for UNIX in a freely redistributable,
54+
statically linkable library.
55+
56+
%prep
57+
%setup -n faad2
58+
%patch -p0
59+
60+
%build
61+
sh bootstrap
62+
./configure --with-drm --with-xmms --prefix=/usr
63+
make
64+
65+
%install
66+
rm -rf %{buildroot}
67+
make install DESTDIR=%{buildroot}
68+
69+
%post -p /sbin/ldconfig
70+
71+
%postun -p /sbin/ldconfig
72+
73+
%clean
74+
rm -rf %{buildroot}
75+
76+
%files
77+
%defattr(-, root, root)
78+
%doc AUTHORS COPYING ChangeLog NEWS README TODO
79+
%{_bindir}/*
80+
%{_libdir}/libfaad.so*
81+
82+
%files devel
83+
%defattr(-, root, root)
84+
%{_libdir}/libfaad.a
85+
%{_libdir}/libfaad.la
86+
%{_includedir}/faad.h
87+
88+
%files xmms
89+
%defattr(-,root,root)
90+
%doc plugins/xmms/README
91+
%_libdir/xmms/Input/*
92+
93+
%files libmp4v2
94+
%defattr(-, root, root)
95+
%{_libdir}/libmp4v2.*
96+
%{_includedir}/mp4.h
97+
%{_includedir}/mpeg4ip.h
98+
99+
%files libmp4ff
100+
%defattr(-, root, root)
101+
%{_libdir}/libmp4ff.*
102+
%{_includedir}/mp4ff.h
103+
104+
%changelog
105+
* Wed Nov 05 2003 Alexander Kurpiers <[email protected]>
106+
- include xmms plugins/libmp4v2/libmp4ff into RPM
107+
108+
* Tue Aug 12 2003 Matthias Saou <[email protected]>
109+
- Update to 2.0rc1.
110+
- Introduced LD_LIBRARY_PATH workaround.
111+
- Removed optional xmms plugin build, it seems mandatory now.
112+
- Added gtk+ build dep for the xmms plugin.
113+
114+
* Wed May 14 2003 Matthias Saou <[email protected]>
115+
- Added xmms plugin build.
116+
117+
* Wed Apr 9 2003 Matthias Saou <[email protected]>
118+
- Spec file cleanup.
119+
- Now exclude .la file.
120+
- Update to latest CVS checkout to fix compile problem.
121+
122+
123+
* Fri Aug 10 2002 Alexander Kurpiers <[email protected]>
124+
- changes to compile v1.1 release
125+
126+
* Tue Jun 18 2002 Alexander Kurpiers <[email protected]>
127+
- First RPM.
128+

frontend/Makefile.am

+4-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ faad_SOURCES = main.c audio.c $(top_srcdir)/common/faad/getopt.c \
44
audio.h
55

66
AM_CFLAGS = -O2
7-
if HAVE_MPEG4IP
8-
einc=
9-
elib=-lmp4v2
10-
else
11-
einc=-I$(top_srcdir)/common/mp4v2
12-
elib=$(top_builddir)/common/mp4v2/libmp4v2.la
13-
endif
7+
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/common/faad \
8+
-I$(top_srcdir)/common/mp4ff
9+
LDADD = $(top_builddir)/libfaad/libfaad.la \
10+
$(top_builddir)/common/mp4ff/libmp4ff.la
1411

15-
INCLUDES = -I$(top_srcdir)/include $(einc) -I$(top_srcdir)/common/faad
16-
LDADD = $(top_builddir)/libfaad/libfaad.la $(elib) -lm
1712

1813
CCLD = $(CXX)

frontend/main.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222
** Commercial non-GPL licensing of this software is possible.
2323
** For more info contact Ahead Software through [email protected].
2424
**
25-
** $Id: main.c,v 1.57 2003/11/02 20:24:03 menno Exp $
25+
** $Id: main.c,v 1.58 2003/11/06 11:04:13 menno Exp $
2626
**/
2727

2828
#ifdef _WIN32
2929
#define WIN32_LEAN_AND_MEAN
3030
#include <windows.h>
31+
typedef __int64 off_t
3132
#else
3233
#include <time.h>
3334
#endif
@@ -176,22 +177,22 @@ size_t write_callback(void *buffer, size_t length)
176177
return 0;
177178
}
178179

179-
__int64 get_position_callback()
180+
off_t get_position_callback()
180181
{
181182
return ftell(g_mp4File);
182183
}
183184

184-
__int64 get_length_callback()
185+
off_t get_length_callback()
185186
{
186-
__int64 oldpos, size = 0;
187+
off_t oldpos, size = 0;
187188
oldpos = ftell(g_mp4File);
188189
fseek(g_mp4File, 0, SEEK_END);
189190
size = ftell(g_mp4File);
190191
fseek(g_mp4File, oldpos, SEEK_SET);
191192
return size;
192193
}
193194

194-
int seek_callback(__int64 position)
195+
int seek_callback(off_t position)
195196
{
196197
return fseek(g_mp4File, position, SEEK_SET);
197198
}

0 commit comments

Comments
 (0)