shithub: aacdec

Download patch

ref: 8405ad628d6c83d74e84ae61622c735914631c9c
parent: d6839757dffdf592ae300726a64e0f3199a9cd56
author: menno <menno>
date: Wed May 1 15:25:19 EDT 2002

Fixes for compilation under linux

--- a/Makefile.am
+++ b/Makefile.am
@@ -1,1 +1,1 @@
-SUBDIRS = libfaad frontend
+SUBDIRS = libfaad common frontend
--- /dev/null
+++ b/README.linux
@@ -1,0 +1,8 @@
+To compile under Linux:
+
+chmod +x bootstrap
+./bootstrap
+./configure
+
+For the compile to work "libsndfile" must be installed before installing faad2
+
--- a/common/mp4v2/Makefile.am
+++ b/common/mp4v2/Makefile.am
@@ -1,5 +1,3 @@
-SUBDIRS = . test util
-
 INCLUDES = -I$(top_srcdir)/include
 
 AM_CXXFLAGS = -Wall 
--- a/common/mp4v2/configure.in
+++ b/common/mp4v2/configure.in
@@ -1,8 +1,9 @@
 AC_INIT()
-AM_INIT_AUTOMAKE(mpeg4ip,0.9.2.8)
+AM_INIT_AUTOMAKE(mpeg4ip,0.9.2.8,dummy)
 
 AC_PROG_CC
 AC_PROG_CXX
+AC_PROG_INSTALL
 
 AM_PROG_LIBTOOL
 
@@ -10,5 +11,8 @@
 
 AC_CHECK_HEADERS(stdint.h)
 AC_CHECK_HEADERS(inttypes.h)
+
+AC_CHECK_FUNCS(strsep)
+
 
 AC_OUTPUT(Makefile)
--- a/common/mp4v2/systems.h
+++ b/common/mp4v2/systems.h
@@ -170,6 +170,12 @@
 #else
 #define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)(fpos)
 #define VAR_TO_FPOS(fpos, var) (fpos) = (var)
+
+#ifdef linux
+#define HAVE_SOCKLEN_T
+#endif
+
+
 #endif
 
 #define FOPEN_READ_BINARY "r"
--- a/configure.in
+++ b/configure.in
@@ -3,6 +3,7 @@
 
 AC_PROG_CC
 AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
 
 dnl Checks for programs.
 AC_PROG_CXX
@@ -28,15 +29,8 @@
   ])
 fi
 
-dnl Checks for mp4v2 library.
-AC_CHECK_LIB(mp4v2, MP4Create, have_mp4v2_lib=yes)
-AC_CHECK_HEADER(mp4.h, have_mp4_hdr=yes)
+AC_OUTPUT_COMMANDS(,[cd common/mp4v2; aclocal -I .; autoheader; libtoolize --automake; automake --add-missing; autoconf])
 
-if test x$have_mp4v2_lib != xyes -o x$have_mp4_hdr != xyes; then
-AC_MSG_ERROR([
-  *** FAAD requires libmp4v2 to be installed first.
-  *** A copy of it is included in common/mp4v2.
-])
-fi
+AC_CONFIG_SUBDIRS(common/mp4v2)
 
-AC_OUTPUT(libfaad/Makefile frontend/Makefile Makefile)
+AC_OUTPUT(libfaad/Makefile libfaad/fftw/Makefile common/Makefile  frontend/Makefile Makefile)
--- a/frontend/Makefile.am
+++ b/frontend/Makefile.am
@@ -2,8 +2,8 @@
 
 faad_SOURCES = main.c audio.c
 
-CXXFLAGS = -O0
-CFLAGS = -O0
-INCLUDES = -I$(top_srcdir)/include
+CXXFLAGS = -O2
+CFLAGS = -O2
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4v2
 LDFLAGS =
-LDADD = $(top_builddir)/libfaad/libfaad.la -lm -lsndfile -lmp4v2
+LDADD = $(top_builddir)/libfaad/libfaad.la $(top_builddir)/common/mp4v2/libmp4v2.la  -lm -lsndfile 
--- a/libfaad/Makefile.am
+++ b/libfaad/Makefile.am
@@ -1,12 +1,22 @@
 lib_LTLIBRARIES = libfaad.la
 
-libfaad_la_SOURCES = bits.c data.c decoder.c drc.c error.c filtbank.c 
-huffman.c ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c 
-pulse.c specrec.c syntax.c tns.c
+VPATH = @srcdir@:codebook:
 
-libfaad_la_INCLUDES = analysis.h bits.h data.h decoder.h drc.h error.h 
-filtbank.h huffman.h ic_predict.h is.h kbd_win.h lt_predict.h mdct.h mp4.h 
-ms.h output.h pns.h pulse.h specrec.h syntax.h tns.h
+libfaad_la_SOURCES = bits.c data.c decoder.c drc.c error.c filtbank.c \
+ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c \
+pulse.c specrec.c syntax.c tns.c \
+hcb_1.c hcb_2.c hcb_3.c hcb_4.c hcb_5.c hcb_6.c hcb_7.c hcb_8.c \
+hcb_9.c hcb_10.c hcb_11.c hcb_sf.c
 
+libfaad_la_INCLUDES = analysis.h bits.h data.h decoder.h drc.h error.h \
+filtbank.h huffman.h ic_predict.h is.h kbd_win.h lt_predict.h mdct.h mp4.h \
+ms.h output.h pns.h pulse.h specrec.h syntax.h tns.h \
+codebook/hcb.h
+libfaad_la_LIBADD = fftw/libfftw.la
+libfaad_la_LDFLAGS = -static
+
+#CFLAGS = -O2 -DERROR_RESILIENCE
 CFLAGS = -O2
-INCLUDES = -I$(top_srcdir)/include
\ No newline at end of file
+INCLUDES = -I$(top_srcdir)/include -Ifftw
+
+SUBDIRS = fftw
--- a/libfaad/common.h
+++ b/libfaad/common.h
@@ -1,22 +1,22 @@
 /*
 ** FAAD - Freeware Advanced Audio Decoder
 ** Copyright (C) 2002 M. Bakker
-**  
+**
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
 ** the Free Software Foundation; either version 2 of the License, or
 ** (at your option) any later version.
-** 
+**
 ** This program is distributed in the hope that it will be useful,
 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ** GNU General Public License for more details.
-** 
+**
 ** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: common.h,v 1.9 2002/04/21 09:00:40 menno Exp $
+** $Id: common.h,v 1.10 2002/05/01 19:25:19 menno Exp $
 **/
 
 #ifndef __COMMON_H__
@@ -44,13 +44,6 @@
 #define min(a, b) (((a) < (b)) ? (a) : (b))
 #endif
 
-#ifndef M_PI
-#define M_PI 3.14159265358979323846f
-#endif
-#ifndef M_PI_2 /* PI/2 */
-#define M_PI_2 1.57079632679489661923
-#endif
-
 #ifndef LN2
 #define LN2 0.6931471805599453
 #endif
@@ -180,6 +173,12 @@
 /* common functions */
 uint32_t int_log2(uint32_t val);
 
+#ifndef M_PI
+#define M_PI 3.14159265358979323846f
+#endif
+#ifndef M_PI_2 /* PI/2 */
+#define M_PI_2 1.57079632679489661923
+#endif
 
 #ifdef __cplusplus
 }
--- a/libfaad/fftw/Makefile.am
+++ b/libfaad/fftw/Makefile.am
@@ -1,10 +1,7 @@
-# This file was automatically generated
-# DO NOT EDIT!
-#
-lib_LTLIBRARIES = libXXX_FFTW_PREFIX_XXXfftw.la
-include_HEADERS = XXX_FFTW_PREFIX_XXXfftw.h
-INCLUDES = -I$(srcdir)/../fftw -I$(srcdir)
+noinst_LTLIBRARIES = libfftw.la
 
+INCLUDES = -I$(srcdir)
+
 NOTW_CODELETS= fn_1.c fn_2.c fn_3.c fn_4.c fn_5.c fn_6.c fn_7.c fn_8.c fn_9.c fn_10.c fn_11.c fn_12.c fn_13.c fn_14.c fn_15.c fn_16.c fn_32.c fn_64.c
 TWID_CODELETS= ftw_2.c ftw_3.c ftw_4.c ftw_5.c ftw_6.c ftw_7.c ftw_8.c ftw_9.c ftw_10.c ftw_16.c ftw_32.c ftw_64.c
 NOTWI_CODELETS= fni_1.c fni_2.c fni_3.c fni_4.c fni_5.c fni_6.c fni_7.c fni_8.c fni_9.c fni_10.c fni_11.c fni_12.c fni_13.c fni_14.c fni_15.c fni_16.c fni_32.c fni_64.c
@@ -15,20 +12,9 @@
 	   generic.c fftwnd.c malloc.c wisdom.c wisdomio.c putils.c rader.c \
            fftwf77.c f77_func.h
 
-libXXX_FFTW_PREFIX_XXXfftw_la_SOURCES = $(CODELETS) $(OTHERSRC)             \
+libfftw_la_SOURCES = $(CODELETS) $(OTHERSRC)             \
                                         fftw.h fftw-int.h 
 
-libXXX_FFTW_PREFIX_XXXfftw_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
 MAINTAINERCLEANFILES = $(CODELETS) config.c
 DISTCLEANFILES = fftw.h sfftw.h dfftw.h
 
-XXX_FFTW_PREFIX1_XXXfftw.h: fftw.h
-	rm -f XXX_FFTW_PREFIX_XXXfftw.h
-	sed 's/<fftw/<XXX_FFTW_PREFIX_XXXfftw/g;s/<rfftw/<XXX_FFTW_PREFIX_XXXrfftw/g' fftw.h > XXX_FFTW_PREFIX_XXXfftw.h
-
-CLEANFILES = XXX_FFTW_PREFIX1_XXXfftw.h
-
-# for some reason, automake tries to use autoheader in order to
-# generate config.h.in, and fails because config.h.in is GNU-lly
-# incorrect.  Just disable autoheader
-AUTOHEADER=echo
--- a/libfaad/output.h
+++ b/libfaad/output.h
@@ -1,22 +1,22 @@
 /*
 ** FAAD - Freeware Advanced Audio Decoder
 ** Copyright (C) 2002 M. Bakker
-**  
+**
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
 ** the Free Software Foundation; either version 2 of the License, or
 ** (at your option) any later version.
-** 
+**
 ** This program is distributed in the hope that it will be useful,
 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ** GNU General Public License for more details.
-** 
+**
 ** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: output.h,v 1.3 2002/02/25 19:58:33 menno Exp $
+** $Id: output.h,v 1.4 2002/05/01 19:25:19 menno Exp $
 **/
 
 #ifndef __OUTPUT_H__
@@ -32,6 +32,7 @@
                     uint16_t frame_len,
                     uint8_t format);
 
+typedef float float32_t;
 
 #ifdef __cplusplus
 }