Package: gmerlin-avdecoder / 2.0.0~svn6298~dfsg0-5

cross-compiling.patch Patch series | download
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
Description: cross-compilation fixes
 Mostly: add 3rd option to AC_TRY_RUN
Author: IOhannes m zmölnig <umlaeute@debian.org>
Forwarded: no
Last-Update: 2022-08-31
--- gmerlin-avdecoder.orig/m4/check_funcs.m4
+++ gmerlin-avdecoder/m4/check_funcs.m4
@@ -746,31 +746,27 @@
 
 AC_MSG_CHECKING(for neaacdec.h usability for faad2)
 
-  AC_TRY_RUN([
+  AC_TRY_LINK([
     #include <neaacdec.h>
     #include <stdio.h>
-    main()
-    {
-    int faad_major;
-    int faad_minor;
+  ],[
     NeAACDecHandle dec;
 
     dec = NeAACDecOpen();
     if(!dec)
       return -1;
     return 0;
-    }
-  ],
-  [
+  ],[
     # program could be run
     have_faad2="true"
     AC_MSG_RESULT(yes)
     FAAD2_CFLAGS=$CFLAGS
     FAAD2_LIBS=$LIBS
     AC_DEFINE(HAVE_NEAACDEC_H)
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
+  ]
 )
 
 CFLAGS=$OLD_CFLAGS
@@ -816,28 +812,23 @@
 
 AC_MSG_CHECKING(for libdvdread >= 0.9.5)
 
-  AC_TRY_RUN([
+  AC_TRY_LINK([
     #include <dvdread/dvd_reader.h>
-    #include <stdio.h>
-    main()
-    {
-#if DVDREAD_VERSION < 905
-    return -1;
-#else
+  ],[
+    #if DVDREAD_VERSION < 905
+    # error libdvdread must be at least 0.9.5
+    #endif
     return 0;
-#endif
-    }
-  ],
-  [
+  ],[
     # program could be run
     have_dvdread="true"
     AC_MSG_RESULT(yes)
     DVDREAD_CFLAGS=""
     DVDREAD_LIBS="-ldvdread"
-
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
+  ]
 )
 
 if test "x$have_dvdread" = "xtrue"; then
@@ -916,13 +907,26 @@
     AC_MSG_RESULT(yes)
     FLAC_CFLAGS=$CFLAGS
     FLAC_LIBS=$LIBS
-    BGAV_FLAC_MAJOR=`cat flac_version | cut -d . -f 1`
-    BGAV_FLAC_MINOR=`cat flac_version | cut -d . -f 2`
-    BGAV_FLAC_PATCHLEVEL=`cat flac_version | cut -d . -f 3`
+    BGAV_FLAC_MAJOR=$(cat flac_version | cut -d . -f 1)
+    BGAV_FLAC_MINOR=$(cat flac_version | cut -d . -f 2)
+    BGAV_FLAC_PATCHLEVEL=$(cat flac_version | cut -d . -f 3)
     rm -f flac_version
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
+  ],[
+    if test -n "${FLAC_VERSION}"; then
+      have_flac="true"
+      AC_MSG_RESULT([assuming yes (cross-compiling)])
+      FLAC_CFLAGS=$CFLAGS
+      FLAC_LIBS=$LIBS
+      BGAV_FLAC_MAJOR=$(echo ${FLAC_VERSION} | cut -d . -f 1)
+      BGAV_FLAC_MINOR=$(echo ${FLAC_VERSION} | cut -d . -f 2)
+      BGAV_FLAC_PATCHLEVEL=$(echo ${FLAC_VERSION} | cut -d . -f 3)
+    else
+      AC_MSG_RESULT([no (cross-compiling)])
+    fi
+  ]
 )
 
 CFLAGS=$OLD_CFLAGS
@@ -972,27 +976,23 @@
 AH_TEMPLATE([HAVE_MUSEPACK], [Enable Musepack])
 AC_MSG_CHECKING(for libmpcdec)
 
-  AC_TRY_RUN([
+  AC_TRY_LINK([
     #include <mpcdec/mpcdec.h>
     #include <stdio.h>
-    main()
-    {
+  ],[
     mpc_streaminfo si;
     mpc_streaminfo_init(&si);
     return 0;
-    }
-  ],
-  [
+  ],[
     # program could be run
     have_musepack="true"
     AC_MSG_RESULT(yes)
     MUSEPACK_CFLAGS=$CFLAGS
     MUSEPACK_LIBS=$LIBS
-
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
-)
+  ])
 
 CFLAGS=$OLD_CFLAGS
 LIBS=$OLD_LIBS
@@ -1058,10 +1058,16 @@
     AC_MSG_RESULT(yes)
     MAD_CFLAGS=$CFLAGS
     MAD_LIBS=$LIBS
-
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
+  ],[
+    # cross-compiling
+    have_mad="true"
+    AC_MSG_RESULT([assuming yes (cross-compiling)])
+    MAD_CFLAGS=$CFLAGS
+    MAD_LIBS=$LIBS
+  ]
 )
 
 CFLAGS=$OLD_CFLAGS
@@ -1105,27 +1111,24 @@
 LIBS="$GMERLIN_DEP_LIBS -la52 -lm"
 CFLAGS="$GMERLIN_DEP_CFLAGS"
 LIBA52_REQUIRED="0.7.4"
-AC_MSG_CHECKING(for liba52)
+AC_MSG_CHECKING([for liba52])
 
-  AC_TRY_RUN([
+  AC_TRY_LINK([
     #include <inttypes.h>
     #include <a52dec/a52.h>
-    main()
-    {
+  ],[
     a52_state_t * state = a52_init(0);
     return 0;
-    }
-  ],
-  [
+  ],[
     # program could be run
     have_liba52="true"
     AC_MSG_RESULT(yes)
     LIBA52_CFLAGS=$CFLAGS
     LIBA52_LIBS=$LIBS
-
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
+  ]
 )
 
 CFLAGS=$OLD_CFLAGS
@@ -1374,10 +1377,16 @@
     AC_MSG_RESULT(yes)
     LAME_CFLAGS=$CFLAGS
     LAME_LIBS=$LIBS
-
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
+  ],[
+    # cross-compiling
+    have_lame="true"
+    AC_MSG_RESULT([assuming yes (cross-compiling)])
+    LAME_CFLAGS=$CFLAGS
+    LAME_LIBS=$LIBS
+  ]
 )
 
 CFLAGS=$OLD_CFLAGS
@@ -1448,9 +1457,16 @@
     FAAC_CFLAGS=$CFLAGS
     FAAC_LIBS=$LIBS
 
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
+  ],[
+    # cross-compiling
+    have_faac="true"
+    AC_MSG_RESULT([assuming yes (cross-compiling)])
+    FAAC_CFLAGS=$CFLAGS
+    FAAC_LIBS=$LIBS
+  ]
 )
 
 CFLAGS=$OLD_CFLAGS
@@ -1496,10 +1512,9 @@
 
 AC_MSG_CHECKING(for libjpeg)
 AC_TRY_LINK([#include <stdio.h>
-             #include <jpeglib.h>],
-            [struct jpeg_decompress_struct cinfo;
-             jpeg_create_decompress(&cinfo);],
-            [have_libjpeg=true])
+             #include <jpeglib.h>],[
+struct jpeg_decompress_struct cinfo; jpeg_create_decompress(&cinfo);
+            ],[have_libjpeg=true])
 case $have_libjpeg in
   true) AC_DEFINE(HAVE_LIBJPEG)
         AC_MSG_RESULT(yes)
@@ -1557,10 +1572,9 @@
 AC_SEARCH_LIBS([glBegin], [GL], [], [have_GL="false"], [])
 
 if test "x$have_GL" = "xtrue"; then
-AC_TRY_RUN([
-#include <GL/gl.h>
-int main() { if(0) glBegin(GL_QUADS); return 0;}
-],[],[have_GL="false"])
+AC_TRY_LINK([#include <GL/gl.h>],[
+if(0) glBegin(GL_QUADS); return 0;],
+[],[have_GL="false"])
 fi
 
 GL_LIBS=$LIBS
@@ -1577,10 +1591,9 @@
 AC_SEARCH_LIBS([glXCreateContext], [GL glx], [], [have_GLX="false"], [])
 
 if test "x$have_GL" = "xtrue"; then
-AC_TRY_RUN([
-#include <GL/glx.h>
-int main() { if(0) glXChooseFBConfig(NULL, 0,
-	NULL, NULL); return 0;}],[],[have_GLX="false"])
+AC_TRY_LINK([#include <GL/glx.h>],[
+if(0) glXChooseFBConfig(NULL, 0, NULL, NULL); return 0;
+],[],[have_GLX="false"])
 fi
 
 GLX_LIBS=$LIBS
@@ -1597,9 +1610,9 @@
 AC_SEARCH_LIBS([eglGetCurrentDisplay], [GL EGL], [], [have_EGL="false"], [])
 
 if test "x$have_GL" = "xtrue"; then
-AC_TRY_RUN([
-#include <EGL/egl.h>
-int main() { if(0) eglGetCurrentDisplay(); return 0;}],[],[have_EGL="false"])
+AC_TRY_LINK([#include <EGL/egl.h>],[
+if(0) eglGetCurrentDisplay(); return 0;
+],[],[have_EGL="false"])
 fi
 
 EGL_LIBS=$LIBS
@@ -1648,9 +1661,9 @@
 AC_SEARCH_LIBS([gluLookAt], [GLU], [], [have_GLU="false"], [])
 
 if test "x$have_GLU" = "xtrue"; then
-AC_TRY_RUN([
-#include <GL/glu.h>
-int main() { if(0) gluLookAt(0, 0, 0, 0, 0, 0, 0, 0, 0); return 0;}],[],[have_GLU="false"])
+AC_TRY_LINK([#include <GL/glu.h>],[
+if(0) gluLookAt(0, 0, 0, 0, 0, 0, 0, 0, 0); return 0;
+],[],[have_GLU="false"])
 fi
 
 GLU_CFLAGS=$CFLAGS
@@ -1714,9 +1727,15 @@
     have_posix_semaphores="true"
     AC_MSG_RESULT(yes)
     AC_DEFINE(HAVE_POSIX_SEMAPHORES)
-  ],
+  ],[
     # program could not be run
     AC_MSG_RESULT(no)
+  ],[
+    # cross compiling
+    have_posix_semaphores="true"
+    AC_MSG_RESULT([assuming yes (cross compiling)])
+    AC_DEFINE(HAVE_POSIX_SEMAPHORES)
+  ]
 )
 
 LIBS=$OLD_LIBS
--- gmerlin-avdecoder.orig/configure.ac
+++ gmerlin-avdecoder/configure.ac
@@ -184,7 +184,8 @@
 gmerlin_plugindir='$(libdir)/gmerlin/plugins'
 
 dnl LDFLAGS for plugins
-GMERLIN_PLUGIN_LDFLAGS="-export-symbols "`pkg-config --variable=prefix gmerlin`"/share/gmerlin/plugin.sym ${XTRA_LDFLAGS}"
+GMERLIN_PLUGIN_LDFLAGS="-export-symbols "`$PKG_CONFIG --variable=prefix gmerlin`"/share/gmerlin/plugin.sym ${XTRA_LDFLAGS}"
+
 
 fi