summaryrefslogtreecommitdiff
path: root/multimedia/libvpx/patches/patch-ad
blob: 37e2d5f9f40ff23d5ead8628866db386eefcf8b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
$NetBSD: patch-ad,v 1.13 2014/05/05 21:16:28 ryoon Exp $

*BSD and qnx are identified as linux.
Add another SDK path on Mac OS X.

--- build/make/configure.sh.orig	2013-12-17 17:05:18.000000000 +0000
+++ build/make/configure.sh
@@ -665,7 +665,7 @@ process_common_toolchain() {
                 [ -z "$tgt_isa" ] && tgt_isa=x86
                 tgt_os=win32
                 ;;
-            *linux*|*bsd*)
+            *linux*|*bsd*|*qnx6*)
                 tgt_os=linux
                 ;;
             *solaris2.10)
@@ -799,7 +799,7 @@ process_common_toolchain() {
 
         case ${tgt_cc} in
         gcc)
-            CROSS=${CROSS:-arm-none-linux-gnueabi-}
+#            CROSS=${CROSS:-arm-none-linux-gnueabi-}
             link_with_cc=gcc
             setup_gnu_toolchain
             arch_int=${tgt_isa##armv}
@@ -988,8 +988,6 @@ EOF
             check_add_cflags -mips32r2 -mdspr2
             disable_feature fast_unaligned
         fi
-        check_add_cflags -march=${tgt_isa}
-        check_add_asflags -march=${tgt_isa}
         check_add_asflags -KPIC
     ;;
     ppc*)
@@ -1219,7 +1217,7 @@ EOF
     check_cc <<EOF
     unsigned int e = 'O'<<24 | '2'<<16 | 'B'<<8 | 'E';
 EOF
-    [ -f "${TMP_O}" ] && od -A n -t x1 "${TMP_O}" | tr -d '\n' |
+    [ -f "${TMP_O}" ] && od -t x1 "${TMP_O}" | cut -c 8- | tr -d '\n' |
         grep '4f *32 *42 *45' >/dev/null 2>&1 && enable_feature big_endian
 
     # Try to find which inline keywords are supported
@@ -1235,10 +1233,32 @@ EOF
         case ${toolchain} in
             *-win*-vs*);;
             *-android-gcc);;
-            *) check_header pthread.h && add_extralibs -lpthread
+            *) check_header pthread.h && add_extralibs ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}
         esac
     fi
 
+    case ${tgt_os} in
+    darwin*)
+       add_extralibs -lm
+       ;;
+    solaris*)
+       add_extralibs -lm -lrt
+       ;;
+    linux*)
+       case ${gcctarget} in
+       *qnx6*)
+           add_extralibs -lm
+           ;;
+       *openbsd*)
+           add_extralibs -lm
+           ;;
+       *)
+           add_extralibs -lm -lrt
+           ;;
+       esac
+       ;;
+    esac
+
     # only for MIPS platforms
     case ${toolchain} in
         mips*)