shithub: opus-tools

Download patch

ref: d35a677985c542319c598d40b691fca751602165
parent: 79e0969fcce4eb59224d3fcf1ddfcf5ac731e474
author: Gregory Maxwell <greg@xiph.org>
date: Sat Dec 3 09:45:53 EST 2011

Minor changes to make it easier to cross compile.

--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
-CC=gcc
-CFLAGS=-DHAVE_SYS_SOUNDCARD_H -O2 -g -fstack-protector-all -c -Wall -Wextra -DHAVE_GETOPT_H -DEXPORT= -DRANDOM_PREFIX=opustools -DOUTSIDE_SPEEX -DFLOATING_POINT
+#CC=gcc
+CFLAGS:=-DHAVE_SYS_SOUNDCARD_H -O2 -g -c -Wall -Wextra -DHAVE_GETOPT_H -DEXPORT= -DRANDOM_PREFIX=opustools -DOUTSIDE_SPEEX -DFLOATING_POINT $(CFLAGS)
 INCLUDES=-I../../opus/include
 
 all: opusenc opusdec
@@ -8,10 +8,10 @@
 	$(CC) $(CFLAGS) $(INCLUDES) $< -o $@
 
 opusenc: opus_header.o opusenc.o resample.o audio-in.o diag_range.o
-	gcc opus_header.o audio-in.o diag_range.o opusenc.o resample.o -o opusenc ../../opus/.libs/libopus.a -lm -logg
+	$(CC) $(LDFLAGS) opus_header.o audio-in.o diag_range.o opusenc.o resample.o -o opusenc ../../opus/.libs/libopus.a -lm -logg
 
 opusdec: opus_header.o wav_io.o wave_out.o opusdec.o resample.o diag_range.o
-	gcc wave_out.o opus_header.o wav_io.o diag_range.o opusdec.o resample.o -o opusdec ../../opus/.libs/libopus.a -lm -logg
+	$(CC) $(LDFLAGS) wave_out.o opus_header.o wav_io.o diag_range.o opusdec.o resample.o -o opusdec ../../opus/.libs/libopus.a -lm -logg
 
 clean:
 	rm -f *.o opusenc opusdec
--- a/src/audio-in.c
+++ b/src/audio-in.c
@@ -29,7 +29,7 @@
 */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <stdlib.h>
--- a/src/diag_range.c
+++ b/src/diag_range.c
@@ -27,8 +27,12 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <stdio.h>
-#include "opus.h"
+#include <opus.h>
 #include "diag_range.h"
 
 /*This is some non-exported code copied wholesale from libopus.
--- a/src/opus_header.c
+++ b/src/opus_header.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include "opus_header.h"
 #include <string.h>
 #include <stdio.h>
--- a/src/opus_header.h
+++ b/src/opus_header.h
@@ -1,7 +1,7 @@
 #ifndef OPUS_HEADER_H
 #define OPUS_HEADER_H
 
-#include "opus_types.h"
+#include <opus_types.h>
 
 typedef struct {
    int version;
--- a/src/resample.c
+++ b/src/resample.c
@@ -58,7 +58,7 @@
 */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
 #endif
 
 #ifdef OUTSIDE_SPEEX