shithub: opus

Download patch

ref: 2852cb1486ca68fe418bdebcda7ecc9581127b4d
parent: 5840aaf26c83f0e6beff57ced047a31be995dd20
author: Ralph Giles <[email protected]>
date: Tue Aug 2 07:43:43 EDT 2011

Tell automake to put object files in subdirectories.

Previously the autotools build litered whatever directory
'make' was invoked from with intermediate files. Adding
'subdir-objects' to AUTOMAKE_OPTIONS tells it to put them
in subdirectories according to the relative paths to the
source files, .i.e. silk/schur.o for $(srcdir)/silk/schur.c

The change to autogen.sh is necessary to handle the
(apparently new) case where an AUTOMAKE_OPTIONS line is
given without a minimum version number.

--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 lib_LTLIBRARIES = libopus.la
 
 INCLUDES = -I$(top_srcdir)/libcelt -I$(top_srcdir)/silk -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed
--- a/autogen.sh
+++ b/autogen.sh
@@ -22,10 +22,14 @@
 
 VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]*\).*/\1/"
 VERSIONMKINT="sed -e s/[^0-9]//"
-                                                                                
+
 # do we need automake?
 if test -r Makefile.am; then
-  AM_NEEDED=`fgrep AUTOMAKE_OPTIONS Makefile.am | $VERSIONGREP`
+  AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
+  AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
+  if test "$AM_NEEDED" = "$AM_OPTIONS"; then
+    AM_NEEDED=""
+  fi
   if test -z $AM_NEEDED; then
     echo -n "checking for automake... "
     AUTOMAKE=automake
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,7 @@
 
 AC_CANONICAL_HOST
 AM_PROG_LIBTOOL
+AM_PROG_CC_C_O
 
 AC_PROG_CC_C99
 AC_C_BIGENDIAN