shithub: aacenc

Download patch

ref: b81b6f5b1e3d8dc62f25147c10c57ddc44999348
parent: ee6e953ac45426a43e88acd6528ccd07a84d02f7
author: danchr <danchr>
date: Wed Jul 28 04:18:21 EDT 2004

Darwin portability fixes, should help on Linux too

--- a/Makefile.am
+++ b/Makefile.am
@@ -1,2 +1,1 @@
-SUBDIRS = libfaac frontend include
-
+SUBDIRS = include libfaac common frontend
--- a/bootstrap
+++ b/bootstrap
@@ -2,6 +2,10 @@
 
 aclocal -I .
 autoheader
-libtoolize --automake
+if test "`uname -s`" = Darwin; then
+    glibtoolize --automake
+else
+    libtoolize --automake
+fi
 automake --add-missing
 autoconf
--- /dev/null
+++ b/common/Makefile.am
@@ -1,0 +1,5 @@
+if WITH_MP4V2
+SUBDIRS = mp4v2
+else
+SUBDIRS =
+endif
--- a/common/mp4v2/Makefile.am
+++ b/common/mp4v2/Makefile.am
@@ -1,12 +1,10 @@
-SUBDIRS = . test util
-
 INCLUDES = -I$(top_srcdir)/include
 
-AM_CXXFLAGS = @BILLS_CPPWARNINGS@
+AM_CXXFLAGS = -Wall
 
 lib_LTLIBRARIES = libmp4v2.la 
 
-include_HEADERS = mp4.h
+include_HEADERS = mp4.h mpeg4ip.h mpeg4ip_version.h mpeg4ip_config.h
 
 libmp4v2_la_SOURCES = \
 	3gp.cpp \
--- a/configure.in
+++ b/configure.in
@@ -1,10 +1,12 @@
 AC_PREREQ(2.50)
-AC_INIT()
+AC_INIT(FAAC, 1.24+, faac-dev@lists.sourceforge.net)
 AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE(faac,1.0beta)
+AM_INIT_AUTOMAKE
 
 AM_CONFIG_HEADER(config.h)
 
+AC_ARG_WITH( mp4v2,  [  --with-mp4v2            compile libmp4v2],WITHMP4V2=$withval, WITHMP4V2=yes)
+
 AC_DEFUN(MY_DEFINE, [ AC_DEFINE($1, 1, [define if needed]) ])
 
 CFLAGS=${CFLAGS:-"-O2 -Wall"}
@@ -22,12 +24,27 @@
 AC_CHECK_DECL(strcasecmp, MY_DEFINE(HAVE_STRCASECMP))
 
 AC_CHECK_LIB(gnugetopt, getopt_long)
-AC_CHECK_LIB(mp4v2, MP4MetadataDelete,
-            [AC_MSG_NOTICE([*** Building with MP4 support ***])
-             MY_DEFINE([HAVE_LIBMP4V2])
-             LIBS="$LIBS -lstdc++ -lmp4v2"],
-             [AC_MSG_NOTICE([*** Building without MP4 support ***])],
-             -lstdc++)
+
+AM_CONDITIONAL(WITH_MP4V2, false)
+
+AC_CHECK_DECLS([MP4Create, MP4MetadataDelete],
+               AC_CHECK_LIB(mp4v2, MP4MetadataDelete, external_mp4v2=yes,
+                            external_mp4v2=no, -lstdc++),
+               external_mp4v2=no, [#include <mp4.h>])
+
+if test x$external_mp4v2 = xyes; then
+  AC_MSG_NOTICE([*** Building with external mp4v2 ***])
+else
+  if test x$WITHMP4V2 = xyes; then
+     AC_MSG_NOTICE([*** Building with internal mp4v2 ***])
+     AM_CONDITIONAL(WITH_MP4V2, true)
+     AC_CONFIG_LINKS(common/mp4v2/mpeg4ip_config.h:config.h)
+     MY_DEFINE(HAVE_LIBMP4V2)
+  else
+     AC_MSG_NOTICE([*** Building WITHOUT mp4v2 ***])
+  fi
+fi
+
 AC_C_BIGENDIAN
 
 dnl Checks for header files required for mp4.h
@@ -59,4 +76,6 @@
     [MY_DEFINE(HAVE_FPOS_T_POS)],,
      [#include <stdio.h>])
 
-AC_OUTPUT(libfaac/Makefile frontend/Makefile include/Makefile Makefile)
+AC_OUTPUT(common/Makefile common/mp4v2/Makefile \
+          libfaac/Makefile frontend/Makefile \
+          include/Makefile Makefile)
--- a/frontend/Makefile.am
+++ b/frontend/Makefile.am
@@ -2,6 +2,10 @@
 
 faac_SOURCES = main.c input.c
 
+if WITH_MP4V2
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4v2
+LDADD = $(top_builddir)/libfaac/libfaac.la $(top_srcdir)/common/mp4v2/libmp4v2.la -lm -lstdc++
+else
 INCLUDES = -I$(top_srcdir)/include 
 LDADD = $(top_builddir)/libfaac/libfaac.la -lm
-
+endif
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -18,7 +18,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: main.c,v 1.70 2004/05/03 11:39:05 danchr Exp $
+ * $Id: main.c,v 1.71 2004/07/28 08:18:21 danchr Exp $
  */
 
 #ifdef _MSC_VER
@@ -42,7 +42,11 @@
 #include <signal.h>
 #endif
 
-#if defined(__unix__) || defined(__APPLE__)
+#ifdef __APPLE__
+#define __unix__
+#endif
+
+#ifdef __unix__
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <unistd.h>
@@ -1136,6 +1140,9 @@
 
 /*
 $Log: main.c,v $
+Revision 1.71  2004/07/28 08:18:21  danchr
+Darwin portability fixes, should help on Linux too
+
 Revision 1.70  2004/05/03 11:39:05  danchr
 fix documentation bugs (per Hans-J�rgen's suggestions)
 enable (preliminary) multiple output file support