- let it build on all archs

- don't redefine stuff we have in system headers

tested on vax with --null-audio
"looks sane" todd@
This commit is contained in:
deanna 2007-11-06 02:50:28 +00:00
parent 2d57ecd936
commit 06f82acff2
6 changed files with 135 additions and 4 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.2 2007/10/27 17:54:53 deanna Exp $
# $OpenBSD: Makefile,v 1.3 2007/11/06 02:50:28 deanna Exp $
COMMENT= lightweight sip client
DISTNAME= pjproject-0.7.0
PKGNAME= pjsua-0.7.0p0
PKGNAME= pjsua-0.7.0p1
CATEGORIES= telephony
HOMEPAGE= http://www.pjsip.org

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-pjlib_include_pj_config_h,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
$OpenBSD: patch-pjlib_include_pj_config_h,v 1.2 2007/11/06 02:50:28 deanna Exp $
--- pjlib/include/pj/config.h.orig Thu May 3 09:31:21 2007
+++ pjlib/include/pj/config.h Sat Jun 2 19:16:29 2007
+++ pjlib/include/pj/config.h Sat Nov 3 17:39:38 2007
@@ -120,6 +120,10 @@
* RTEMS
*/
@ -12,3 +12,32 @@ $OpenBSD: patch-pjlib_include_pj_config_h,v 1.1.1.1 2007/10/27 04:34:23 deanna E
#else
# error "Please specify target os."
#endif
@@ -133,6 +137,28 @@
* Autoconf configured
*/
#include <pj/compat/m_auto.h>
+
+#elif defined(__OpenBSD__)
+#include <sys/param.h>
+#include <machine/endian.h>
+#define PJ_M_NAME MACHINE
+#if defined(__LP64__)
+#define PJ_POOL_ALIGNMENT 8
+#else
+#define PJ_POOL_ALIGNMENT 4
+#endif
+#if defined(__i386__) || defined(__x86_64__)
+#define PJ_HAS_PENTIUM 1
+#else
+#define PJ_HAS_PENTIUM 0
+#endif
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#define PJ_IS_LITTLE_ENDIAN 1
+#define PJ_IS_BIG_ENDIAN 0
+#else
+#define PJ_IS_LITTLE_ENDIAN 0
+#define PJ_IS_BIG_ENDIAN 1
+#endif
#elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
defined(_X86_) || defined(x86) || defined(__i386__) || \

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-pjlib_include_pj_sock_h,v 1.1 2007/11/06 02:50:28 deanna Exp $
--- pjlib/include/pj/sock.h.orig Sat Nov 3 19:52:52 2007
+++ pjlib/include/pj/sock.h Sat Nov 3 20:03:22 2007
@@ -207,8 +207,6 @@ struct pj_sockaddr_in
char sin_zero[8]; /**< Padding. */
};
-#undef s6_addr
-
/**
* This structure describes IPv6 address.
*/
@@ -221,7 +219,7 @@ typedef struct pj_in6_addr
pj_uint32_t u6_addr32[4]; /**< u6_addr32 */
} in6_u;
/** Shortcut to access in6_u.u6_addr8. */
-#define s6_addr in6_u.u6_addr8
+#define pj_s6_addr in6_u.u6_addr8
/** Shortcut to access in6_u.u6_addr16. */
#define s6_addr16 in6_u.u6_addr16
/** Shortcut to access in6_u.u6_addr32. */

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-pjmedia_src_pjmedia_tonegen_c,v 1.1 2007/11/06 02:50:28 deanna Exp $
--- pjmedia/src/pjmedia/tonegen.c.orig Sat Nov 3 20:54:49 2007
+++ pjmedia/src/pjmedia/tonegen.c Sat Nov 3 20:58:27 2007
@@ -16,6 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <math.h>
#include <pjmedia/tonegen.h>
#include <pjmedia/errno.h>
#include <pj/assert.h>
@@ -44,7 +45,6 @@
* the normal sin() generator.
* Speed = 40.6 cycles per sample.
*/
-# include <math.h>
struct gen
{
DATA a, s0, s1;
@@ -99,7 +99,6 @@
#else
# error "Should never get to this part"
-# include <math.h>
/*
* Should never really reach here, but anyway it's provided for reference.
* This is the good old tone generator using sin().

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-third_party_speex_libspeex__kiss_fft_guts_h,v 1.1 2007/11/06 02:50:28 deanna Exp $
--- third_party/speex/libspeex/_kiss_fft_guts.h.orig Sat Nov 3 16:43:08 2007
+++ third_party/speex/libspeex/_kiss_fft_guts.h Sat Nov 3 16:44:10 2007
@@ -12,8 +12,8 @@ Redistribution and use in source and binary forms, wit
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define MIN(a,b) ((a)<(b) ? (a):(b))
-#define MAX(a,b) ((a)>(b) ? (a):(b))
+#define SPEEX_MIN(a,b) ((a)<(b) ? (a):(b))
+#define SPEEX_MAX(a,b) ((a)>(b) ? (a):(b))
/* kiss_fft.h
defines kiss_fft_scalar as either short or a float type
@@ -130,8 +130,8 @@ struct kiss_fft_state{
#ifdef FIXED_POINT
-# define KISS_FFT_COS(phase) floor(MIN(32767,MAX(-32767,.5+32768 * cos (phase))))
-# define KISS_FFT_SIN(phase) floor(MIN(32767,MAX(-32767,.5+32768 * sin (phase))))
+# define KISS_FFT_COS(phase) floor(SPEEX_MIN(32767,SPEEX_MAX(-32767,.5+32768 * cos (phase))))
+# define KISS_FFT_SIN(phase) floor(SPEEX_MIN(32767,SPEEX_MAX(-32767,.5+32768 * sin (phase))))
# define HALF_OF(x) ((x)>>1)
#elif defined(USE_SIMD)
# define KISS_FFT_COS(phase) _mm_set1_ps( cos(phase) )

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-third_party_speex_libspeex_stack_alloc_h,v 1.1 2007/11/06 02:50:28 deanna Exp $
--- third_party/speex/libspeex/stack_alloc.h.orig Sat Nov 3 16:37:45 2007
+++ third_party/speex/libspeex/stack_alloc.h Sat Nov 3 16:38:22 2007
@@ -93,19 +93,19 @@
#include <valgrind/memcheck.h>
-#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
+#define SPEEX_ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
-#define PUSH(stack, size, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),ALIGN((stack),sizeof(type)),VALGRIND_MAKE_WRITABLE(stack, ((size)*sizeof(type))),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
+#define PUSH(stack, size, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),SPEEX_ALIGN((stack),sizeof(type)),VALGRIND_MAKE_WRITABLE(stack, ((size)*sizeof(type))),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
-#define PUSHS(stack, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),ALIGN((stack),sizeof(long)),VALGRIND_MAKE_WRITABLE(stack, (sizeof(type))),(stack)+=(sizeof(type)),(type*)((stack)-(sizeof(type))))
+#define PUSHS(stack, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),SPEEX_ALIGN((stack),sizeof(long)),VALGRIND_MAKE_WRITABLE(stack, (sizeof(type))),(stack)+=(sizeof(type)),(type*)((stack)-(sizeof(type))))
#else
-#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
+#define SPEEX_ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
-#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
+#define PUSH(stack, size, type) (SPEEX_ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
-#define PUSHS(stack, type) (ALIGN((stack),sizeof(long)),(stack)+=(sizeof(type)),(type*)((stack)-(sizeof(type))))
+#define PUSHS(stack, type) (SPEEX_ALIGN((stack),sizeof(long)),(stack)+=(sizeof(type)),(type*)((stack)-(sizeof(type))))
#endif