fix building on gcc2 archs; from Moritz Grimm

This commit is contained in:
naddy 2007-07-28 17:06:20 +00:00
parent ce80b733e3
commit 536a03a9e2
4 changed files with 77 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.14 2007/05/29 23:52:20 naddy Exp $
# $OpenBSD: Makefile,v 1.15 2007/07/28 17:06:20 naddy Exp $
COMMENT= "patent-free speech codec"
@ -21,7 +21,8 @@ LIB_DEPENDS= ogg.>=5::audio/libogg
WANTLIB= c m
USE_LIBTOOL= Yes
CONFIGURE_STYLE=gnu
AUTOCONF_VERSION=2.61
CONFIGURE_STYLE=autoconf
CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
--with-ogg=${LOCALBASE}

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-configure_ac,v 1.1 2007/07/28 17:06:20 naddy Exp $
--- configure.ac.orig Thu May 17 16:14:35 2007
+++ configure.ac Thu Jul 26 02:38:18 2007
@@ -40,7 +40,8 @@ AC_C_RESTRICT
AC_MSG_CHECKING(for C99 variable-size arrays)
AC_TRY_COMPILE( , [
-int foo=10;
+int foo;
+foo = 10;
int array[foo];
],
[has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
@@ -49,8 +50,14 @@ has_var_arrays=no
)
AC_MSG_RESULT($has_var_arrays)
+AC_CHECK_HEADERS(alloca.h)
AC_MSG_CHECKING(for alloca)
-AC_TRY_COMPILE( [#include <alloca.h>], [
+AC_TRY_COMPILE( [
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
+#include <stdlib.h>
+], [
int foo=10;
int *array = alloca(foo);
],

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-libspeex_stack_alloc_h,v 1.3 2007/07/28 17:06:20 naddy Exp $
--- libspeex/stack_alloc.h.orig Wed Mar 14 15:31:22 2007
+++ libspeex/stack_alloc.h Thu Jul 26 02:38:18 2007
@@ -36,11 +36,15 @@
#define STACK_ALLOC_H
#ifdef USE_ALLOCA
-#ifdef WIN32
-#include <malloc.h>
-#else
-#include <alloca.h>
-#endif
+# ifdef WIN32
+# include <malloc.h>
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# include <stdlib.h>
+# endif
+# endif
#endif
/**

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-libspeex_testecho_c,v 1.1 2007/07/28 17:06:20 naddy Exp $
--- libspeex/testecho.c.orig Sun May 13 02:49:51 2007
+++ libspeex/testecho.c Thu Jul 26 02:38:18 2007
@@ -17,7 +17,7 @@
int main(int argc, char **argv)
{
- int echo_fd, ref_fd, e_fd;
+ int echo_fd, ref_fd, e_fd, tmp;
short echo_buf[NN], ref_buf[NN], e_buf[NN];
SpeexEchoState *st;
SpeexPreprocessState *den;
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
st = speex_echo_state_init(NN, TAIL);
den = speex_preprocess_state_init(NN, 8000);
- int tmp = 8000;
+ tmp = 8000;
speex_echo_ctl(st, SPEEX_ECHO_SET_SAMPLING_RATE, &tmp);
speex_preprocess_ctl(den, SPEEX_PREPROCESS_SET_ECHO_STATE, st);