summaryrefslogtreecommitdiff
path: root/packages/mythtv/mythtv-0.21/configure.patch
blob: 3b0b9a313a1c225d80aefa6d6779df65dd3077fc (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
--- /tmp/configure	2008-06-30 08:40:35.000000000 +0200
+++ mythtv/configure	2008-07-23 09:51:41.000000000 +0200
@@ -475,12 +475,13 @@
 }
 
 check_cmd(){
-    log "$@"
+   	echo "Checking $@" 
+	log "$@"
     "$@" >>$logfile 2>&1
 }
 
 check_cc(){
-    log check_cc "$@"
+	log check_cc "$@"
     cat >$TMPC
     log_file $TMPC
     check_cmd $cc $CFLAGS $ECFLAGS $OPTFLAGS "$@" -c -o $TMPO $TMPC
@@ -1115,11 +1116,11 @@
 fi
 
 # machine
-arch=`uname -m`
+disabled cross_compile && arch=`uname -m`
 arch_raw="$arch"
 cpu="generic"
 cpu_override="no"
-processor=`uname -p 2>/dev/null`
+disabled cross_compile && processor=`uname -p 2>/dev/null`
 processor_flags=""
 tune="generic"
 
@@ -1183,7 +1184,7 @@
 lamemp3="yes"
 lirc="yes"
 mac_bundle="no"
-opengl="yes"
+opengl="no"
 v4l="yes"
 x11="yes"
 x11_include_path="/usr/X11R6/include"
@@ -1212,7 +1213,7 @@
 # build settings
 SHFLAGS='-shared -Wl,-soname,$@'
 VHOOKSHFLAGS='$(SHFLAGS)'
-LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
+#LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
 FFSERVERLDFLAGS=-Wl,-E
 LDCONFIG="ldconfig"
 LIBPREF="lib"
@@ -1707,7 +1708,7 @@
 
 has_library()
 {
-    if test -f /etc/ld.so.conf ; then
+	if test -f /etc/ld.so.conf && disabled cross_compile ; then
         LIBPATHS=`cat /etc/ld.so.conf | grep -v "#" | grep -v "include"`
     else
         LIBPATHS=''
@@ -1718,7 +1719,7 @@
     LIBPATHS="$LIBPATHS `echo $DYLD_LIBRARY_PATH | sed s/':'/' '/g` "
 
     # recurse down just one level, should be enough in most cases
-    if test -f /etc/ld.so.conf ; then
+    if test -f /etc/ld.so.conf && disabled cross_compile ; then
         INCL=`cat /etc/ld.so.conf | grep -v "#" | grep  "^include"`
         SRCH=`echo "$INCL" | sed '{ s/^include \//\//; s/^include /\/etc\//}'`
         for x in $SRCH ; do
@@ -1727,9 +1728,9 @@
         done
     fi
 
-    LIBPATHS="`echo $LIBPATHS /$libdir_name /usr/$libdir_name /usr/local/$libdir_name /usr/X11R6/$libdir_name | sed s/'\/ '/' '/g` "
+    enabled cross_compile || LIBPATHS="`echo $LIBPATHS /$libdir_name /usr/$libdir_name /usr/local/$libdir_name /usr/X11R6/$libdir_name | sed s/'\/ '/' '/g` "
 
-    HAS_IT="no"
+    HAS_IT="yes"
     for LIBPATH in $LIBPATHS ; do
         if test x`ls $LIBPATH/$1* 2> /dev/null | head -n 1` != x"" ; then
             echo "$1  IS at $LIBPATH"
@@ -1745,17 +1746,18 @@
 
 has_header()
 {
-    HPATHS="/usr/local/include /usr/include /usr/include/g++-v3 /usr/X11R6/include"
+    enabled cross_compile || HPATHS="/usr/local/include /usr/include /usr/include/g++-v3 /usr/X11R6/include"
     INCL=`echo $DYLD_LIBRARY_PATH $LD_LIBRARY_PATH | sed s/':'/' '/g`
     HPATHS="$HPATHS "$(echo $INCL | sed "s/$libdir_name/include/g")
 
-    HAS_IT="no"
+    HAS_IT="yes"
     for HPATH in $HPATHS ; do
         if test x`ls $HPATH/$1* 2> /dev/null | head -n 1` != x"" ; then
             HAS_IT="yes"
         fi
     done
-    expr $HAS_IT : "yes" > /dev/null
+    echo "$1: $HAS_IT"
+	expr $HAS_IT : "yes" > /dev/null
 }
 
 append CCONFIG "$compile_type"
@@ -1861,13 +1863,15 @@
 if test x"$cmov" = x"default"; then
     disable cmov
     if enabled cpu_override; then
-        is_x86_cmov_cpu "$cpu" && enable cmov
+        disabled cross_compile && is_x86_cmov_cpu "$cpu" && enable cmov
         disabled cmov || is_x86_slow_cmov_cpu "$cpu" || enable fast_cmov
     elif expr "$processor_flags" : ".*cmov" > /dev/null ; then
-        enable cmov
+        disabled cross_compile && enable cmov
     fi
 fi
 
+enabled cross_compile && disable cmov
+
 # use different default ARCHFLAGS for CPU missing cmov (Via C3 ...)
 if test x"$arch" = x"x86_32" && disabled cmov && disabled cpu_override; then
     ARCHFLAGS="-march=i586"
@@ -2239,7 +2243,7 @@
 EOF
 
 if $cc $CFLAGS $ECFLAGS -o $TMPE $TMPC 2>/dev/null ; then
-$TMPE && cpuclipspositive="yes"
+enabled cross_compile || $TMPE && cpuclipspositive="yes"
 fi
 
 # test negative wrap
@@ -2254,7 +2258,7 @@
 EOF
 
 if $cc $CFLAGS $ECFLAGS -o $TMPE $TMPC 2>/dev/null ; then
-$TMPE && cpuclipsnegative="yes"
+enabled cross_compile || $TMPE && cpuclipsnegative="yes"
 fi
 
 # test for distcc
@@ -2607,33 +2611,9 @@
 check_ldflags -Wl,--warn-common
 check_ldflags $LDLATEFLAGS
 
-# GCC version
-cat > $TMPC << EOF
-int main(int argc, char **argv)
-{
-    int ret = 0;
-    if (argc == 1)
-    {
-        #if defined(__GNUC__)
-            ret = __GNUC__;
-        #endif
-    }
-    else
-    {
-        #if defined(__GNUC_MINOR__)
-            ret = __GNUC_MINOR__;
-        #endif
-    }
-    return ret;
-}
-EOF
-
-if $cc $CFLAGS $TMPC -o $TMPE ; then
-    $TMPE
-    GCC_MAJOR=$?
-    $TMPE "minor"
-    GCC_MINOR=$?
-fi
+gcc_version=$($cc -v 2>&1 | grep version | cut -s -d' ' -f 3) 
+GCC_MAJOR=$(echo ${gcc_version} | cut -s -d'.' -f1) 
+GCC_MINOR=$(echo ${gcc_version} | cut -s -d'.' -f2)
 
 if enabled symbol_visibility; then
     if test x"$GCC_MAJOR" = x"4" ; then
@@ -2727,6 +2707,7 @@
 
 check_header GL/gl.h
 has_library libGL || has_library libopengl32 || disable opengl
+enabled cross_compile && disable opengl
 
 VENDOR_XVMC_LIBS=""
 check_header X11/extensions/XvMClib.h