only call IPlayerCallback::OnPlayBackSpeedChanged if the speed has actually changed
[vuplus_xbmc] / configure.in
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.59)
5 AC_INIT([xbmc], [11.0], [http://trac.xbmc.org])
6 AC_CONFIG_HEADERS([xbmc/config.h])
7 AH_TOP([#pragma once])
8 m4_include([m4/ax_python_devel.m4])
9
10 AC_CONFIG_AUX_DIR([build-aux])
11 AM_INIT_AUTOMAKE([foreign])
12 AC_CANONICAL_HOST
13
14 tolower(){
15   echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
16 }
17
18 # check for library basenames
19 AC_DEFUN([XB_FIND_SONAME],
20 [
21   if [[ "$host_vendor" != "apple" ]]; then
22     AC_MSG_CHECKING([for lib$2 soname])
23     $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS -l$2 -Wl,-M 2>/dev/null | grep "^LOAD.*$2" | awk '{V=2; print $V}')
24     if [[ ! -z $$1_FILENAME ]]; then
25       $1_SONAME=$(objdump -p $$1_FILENAME | grep "SONAME.*$2" | awk '{V=2; print $V}')
26     fi
27   else
28     AC_MSG_CHECKING([for lib$2 dylib])
29     gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
30     env_lib_path=[`echo $LDFLAGS | sed 's/-L[ ]*//g'`]
31     if test "$cross_compiling" = yes; then
32       host_lib_path=""
33     else
34       host_lib_path="/usr/lib /usr/local/lib"
35     fi
36     for path in $gcc_lib_path $env_lib_path $host_lib_path; do
37       lib=[`ls -- $path/lib$2.dylib 2>/dev/null`]
38       if test x$lib != x; then
39         # we want the path/name that is embedded in the dylib 
40         $1_SONAME=[`otool -L $lib | grep -v lib$2.dylib | grep lib$2 | awk '{V=1; print $V}'`]
41         $1_SONAME=[`basename $$1_SONAME`]
42       fi
43     done
44   fi
45   if [[ -z "$$1_SONAME" ]]; then
46     AC_MSG_RESULT([no])
47     if test -z "$3" || test "x${$3}" = "xyes"; then
48       AC_MSG_ERROR([Unable to determine soname of lib$2 library])
49     else
50       AC_MSG_WARN([Unable to determine soname of lib$2 library])
51       $3=no
52       AC_MSG_WARN([lib$2 support disabled])
53     fi
54   else
55     AC_MSG_RESULT([$$1_SONAME])
56     AC_SUBST($1_SONAME)
57   fi
58 ])
59
60 # Function to push and pop libs and includes for a command
61 AC_DEFUN([XB_PUSH_FLAGS], [
62   SAVE_LIBS="$LIBS"
63   SAVE_INCLUDES="$INCLUDES"
64   LIBS="[$2]"
65   INCLUDES="[$1]"
66   [$3]
67   LIBS="$SAVE_LIBS"
68   INCLUDES="$SAVE_INCLUDES"
69 ])
70
71 # General message strings
72 configure_debug="ERROR: this is a configure debug statement"
73 missing_library="Could not find a required library. Please see the README for your platform."
74 missing_headers="Could not find some required headers. Please see the README for your platform."
75 missing_program="Could not find a required program. Please see the README for your platform."
76 xrandr_not_found="== Could not find libXRandR. SDL will be used for resolution support. =="
77 xrandr_disabled="== XRandR support disabled. SDL will be used for resolution support. =="
78 goom_enabled="== GOOM enabled. =="
79 goom_disabled="== GOOM disabled. =="
80 rsxs_enabled="== RSXS enabled. =="
81 rsxs_disabled="== RSXS disabled. =="
82 projectm_enabled="== ProjectM enabled. =="
83 projectm_disabled="== ProjectM disabled. =="
84 x11_enabled="== X11 enabled. =="
85 x11_disabled="== X11 disabled. =="
86 pulse_not_found="== Could not find libpulse. PulseAudio support disabled. =="
87 pulse_disabled="== PulseAudio support manually disabled. =="
88 dvdcss_enabled="== DVDCSS support enabled. =="
89 dvdcss_disabled="== DVDCSS support disabled. =="
90 hal_not_found="== Could not find hal. HAL support disabled. =="
91 halstorage_not_found="== Could not find hal-storage. HAL support disabled. =="
92 hal_disabled="== HAL support disabled. =="
93 avahi_not_found="== Could not find libavahi-common or libavahi-client. Avahi support disabled. =="
94 avahi_disabled="== Avahi support disabled. =="
95 vdpau_not_found="== Could not find libvdpau. VDPAU support disabled. =="
96 vdpau_disabled="== VDPAU support manually disabled. =="
97 vaapi_not_found="== Could not find libva. VAAPI support disabled. =="
98 vaapi_disabled="== VAAPI support manually disabled. =="
99 crystalhd_not_found="== Could not find libcrystalhd. CrystalHD support disabled. =="
100 crystalhd_disabled="== CrystalHD support manually disabled. =="
101 vdadecoder_enabled="== VDADecoder support enabled. =="
102 vdadecoder_disabled="== VDADecoder support manually disabled. =="
103 vtbdecoder_enabled="== VTBDecoder support enabled. =="
104 vtbdecoder_disabled="== VTBDecoder support manually disabled. =="
105 openmax_disabled="== OpenMax support manually disabled. =="
106 openmax_not_found="== Could not find libnvomx. OpenMax support disabled. =="
107 ssh_not_found="== Could not find libssh. SSH FTP VFS support disabled. =="
108 librtmp_not_found="== Could not find libRTMP. RTMP support disabled. =="
109 librtmp_disabled="== RTMP support disabled. =="
110 libnfs_not_found="== Could not find libnfs. NFS support disabled. =="
111 libnfs_disabled="== NFS support disabled. =="
112 libafpclient_not_found="== Could not find libafpclient. AFP support disabled. =="
113 libafpclient_disabled="== AFP support disabled. =="
114 libshairport_not_found="== Could not find libshairport. AirTunes support disabled. =="
115 libshairport_disabled="== AirTunes support disabled. =="
116 samba_disabled="== SAMBA support disabled. =="
117 libplist_not_found="== Could not find libplist. AirPlay support disabled. =="
118 libplist_disabled="== AirPlay support disabled. =="
119 alsa_not_found="== Could not find ALSA. ALSA support disabled. =="
120 dbus_not_found="== Could not find DBUS. DBUS support disabled. =="
121
122 libudev_not_found="== Could not find libudev. Will use polling to check for device changes. =="
123 libudev_disabled="== udev support disabled. Will use polling to check for device changes. =="
124 libusb_not_found="== Could not find libusb. Plug and play USB device support will not be available. =="
125 libusb_disabled="== libusb disabled. Plug and play USB device support will not be available. =="
126 libcec_not_found="== Could not find libcec. CEC device support will not be available. =="
127 libcec_disabled="== libcec disabled. CEC device support will not be available. =="
128
129 # External library message strings
130 external_libraries_enabled="== Use of all supported external libraries enabled. =="
131 external_libraries_disabled="== Use of all supported external libraries disabled. =="
132 external_ffmpeg_enabled="== Use of external ffmpeg enabled. =="
133 external_ffmpeg_disabled="== Use of external ffmpeg disabled. =="
134 ffmpeg_vdpau_not_supported="== External ffmpeg doesn't support VDPAU. VDPAU support disabled. =="
135 dashes="------------------------"
136 final_message="\n  XBMC Configuration:"
137 final_message="\n$dashes$final_message\n$dashes"
138
139
140 AC_ARG_ENABLE([debug],
141   [AS_HELP_STRING([--enable-debug],
142   [enable debugging information (default is yes)])],
143   [use_debug=$enableval],
144   [use_debug=yes])
145
146 AC_ARG_WITH([arch],
147   [AS_HELP_STRING([--with-arch],
148   [build with given arch passing to internal ffmpeg (default is no, needed for crosscompiling)])],
149   [use_arch=$withval],
150   [use_arch=no])
151
152 AC_ARG_WITH([cpu],
153   [AS_HELP_STRING([--with-cpu],
154   [build with given cpu passing to ffmpeg (default is no)])],
155   [use_cpu=$withval],
156   [use_cpu=no])
157
158 AC_ARG_ENABLE([optimizations],
159   [AS_HELP_STRING([--enable-optimizations],
160   [enable optimization (default is yes)])],
161   [use_optimizations=$enableval],
162   [use_optimizations=yes])
163
164 AC_ARG_ENABLE([gl],
165   [AS_HELP_STRING([--enable-gl],
166   [enable OpenGL rendering (default is yes)])],
167   [use_gl=$enableval],
168   [use_gl=yes])
169
170 AC_ARG_ENABLE([gles],
171   [AS_HELP_STRING([--enable-gles],
172   [enable OpenGLES rendering (default is no)])],
173   [use_gles=$enableval],
174   [use_gles=no])
175
176 AC_ARG_ENABLE([sdl],
177   [AS_HELP_STRING([--enable-sdl],
178   [enable SDL (default is auto)])],
179   [use_sdl=$enableval],
180   [use_sdl=auto])
181
182 AC_ARG_ENABLE([vdpau],
183   [AS_HELP_STRING([--enable-vdpau],
184   [enable VDPAU decoding (default is auto)])],
185   [use_vdpau=$enableval],
186   [use_vdpau=auto])
187
188 AC_ARG_ENABLE([vaapi],
189   [AS_HELP_STRING([--enable-vaapi],
190   [enable VAAPI decoding (default is auto)])],
191   [use_vaapi=$enableval],
192   [use_vaapi=auto])
193
194 AC_ARG_ENABLE([crystalhd],
195   [AS_HELP_STRING([--enable-crystalhd],
196   [enable CrystalHD decoding (default is auto)])],
197   [use_crystalhd=$enableval],
198   [use_crystalhd=auto])
199
200 AC_ARG_ENABLE([vdadecoder],
201   [AS_HELP_STRING([--enable-vdadecoder],
202   [enable VDADecoder decoding (default is auto)])],
203   [use_vdadecoder=$enableval],
204   [use_vdadecoder=auto])
205
206 AC_ARG_ENABLE([vtbdecoder],
207   [AS_HELP_STRING([--enable-vtbdecoder],
208   [enable VTBDecoder decoding (default is auto)])],
209   [use_vtbdecoder=$enableval],
210   [use_vtbdecoder=auto])
211
212 AC_ARG_ENABLE([openmax],
213   [AS_HELP_STRING([--enable-openmax],
214   [enable OpenMax decoding (default is auto, requires OpenGLES)])],
215   [use_openmax=$enableval],
216   [use_openmax=auto])
217
218 AC_ARG_ENABLE([tegra],
219   [AS_HELP_STRING([--enable-tegra],
220   [enable Tegra2 arm (default is no)])],
221   [use_tegra=$enableval],
222   [use_tegra=no])
223
224 AC_ARG_ENABLE([profiling],
225   [AS_HELP_STRING([--enable-profiling],
226   [enable gprof profiling (default is no)])],
227   [use_profiling=$enableval],
228   [use_profiling=no])
229
230 AC_ARG_ENABLE([joystick],
231   [AS_HELP_STRING([--enable-joystick],
232   [enable SDL joystick support (default is yes)])],
233   [use_joystick=$enableval],
234   [use_joystick=yes])
235
236 AC_ARG_ENABLE([xrandr],
237   [AS_HELP_STRING([--enable-xrandr],
238   [enable XRandR support (default is yes)])],
239   [use_xrandr=$enableval],
240   [use_xrandr=yes])
241
242 AC_ARG_ENABLE([goom],
243   [AS_HELP_STRING([--enable-goom],
244   [enable GOOM visualisation (default is no)])],
245   [use_goom=$enableval],
246   [use_goom=no])
247
248 AC_ARG_ENABLE([rsxs],
249   [AS_HELP_STRING([--enable-rsxs],
250   [enable really slick X screensavers (default is yes)])],
251   [use_rsxs=$enableval],
252   [use_rsxs=yes])
253
254 AC_ARG_ENABLE([projectm],
255   [AS_HELP_STRING([--enable-projectm],
256   [enable ProjectM visualisation (default is yes)])],
257   [use_projectm=$enableval],
258   [use_projectm=yes])
259
260 AC_ARG_ENABLE([x11],
261   [AS_HELP_STRING([--enable-x11],
262   [enable x11 (default is yes) 'Linux Only'])],
263   [use_x11=$enableval],
264   [use_x11=yes])
265
266 AC_ARG_ENABLE([ccache],
267   [AS_HELP_STRING([--enable-ccache],
268   [enable building with ccache feature (default is auto)])],
269   [use_ccache=$enableval],
270   [use_ccache=auto])
271
272 AC_ARG_ENABLE([pulse],
273   [AS_HELP_STRING([--enable-pulse],
274   [enable PulseAudio support (default is auto)])],
275   [use_pulse=$enableval],
276   [use_pulse=auto])
277
278 AC_ARG_ENABLE([rtmp],
279   [AS_HELP_STRING([--enable-rtmp],
280   [enable RTMP support via librtmp (default is auto)])],
281   [use_librtmp=$enableval],
282   [use_librtmp=auto])
283
284 AC_ARG_ENABLE([samba],
285   [AS_HELP_STRING([--disable-samba],
286   [disable SAMBA support (default is enabled)])],
287   [use_samba=$enableval],
288   [use_samba=yes])
289
290 AC_ARG_ENABLE([nfs],
291   [AS_HELP_STRING([--enable-nfs],
292   [enable NFS support via libnfs (default is auto)])],
293   [use_libnfs=$enableval],
294   [use_libnfs=auto])
295
296 AC_ARG_ENABLE([afpclient],
297   [AS_HELP_STRING([--enable-afpclient],
298   [enable AFP support via libafpclient (default is auto)])],
299   [use_libafpclient=$enableval],
300   [use_libafpclient=auto])
301
302 AC_ARG_ENABLE([airplay],
303   [AS_HELP_STRING([--enable-airplay],
304   [enable AirPlay support(default is auto)])],
305   [use_airplay=$enableval],
306   [use_airplay=auto])
307
308 AC_ARG_ENABLE([airtunes],
309   [AS_HELP_STRING([--enable-airtunes],
310   [enable AirTunes support(default is auto)])],
311   [use_airtunes=$enableval],
312   [use_airtunes=auto])
313
314 AC_ARG_ENABLE([ffmpeg_libvorbis],
315   [AS_HELP_STRING([--enable-ffmpeg-libvorbis],
316   [enable FFmpeg vorbis encoding (default is no)])],
317   [use_ffmpeg_libvorbis=$enableval],
318   [use_ffmpeg_libvorbis=no])
319
320 AC_ARG_ENABLE([dvdcss],
321   [AS_HELP_STRING([--enable-dvdcss],
322   [enable DVDCSS support (default is yes)])],
323   [use_dvdcss=$enableval],
324   [use_dvdcss=yes])
325
326 AC_ARG_ENABLE([mid],
327   [AS_HELP_STRING([--enable-mid],
328   [enable MID support (default is no)])],
329   [use_mid=$enableval],
330   [use_mid=no])
331
332 AC_ARG_ENABLE([hal],
333   [AS_HELP_STRING([--disable-hal],
334   [disable HAL support (default is enabled if hal and hal-storage is found)])],
335   [use_hal=$enableval],
336   [use_hal=yes])
337
338 AC_ARG_ENABLE([avahi],
339   [AS_HELP_STRING([--disable-avahi],
340   [disable Avahi support (default is enabled if libavahi-common and libavahi-client is found)])],
341   [use_avahi=$enableval],
342   [use_avahi=yes])
343
344 AC_ARG_ENABLE([non-free],
345   [AS_HELP_STRING([--disable-non-free],
346   [disable componentents with non-compliant licenses])],
347   [use_nonfree=$enableval],
348   [use_nonfree=yes])
349
350 AC_ARG_ENABLE([asap-codec],
351   [AS_HELP_STRING([--enable-asap-codec],
352   [enable ASAP ADPCM support])],
353   [use_asap=$enableval],
354   [use_asap=no])
355
356 AC_ARG_ENABLE([webserver],
357   [AS_HELP_STRING([--disable-webserver],
358   [disable webserver])],
359   [use_webserver=$enableval],
360   [use_webserver=yes])
361
362 AC_ARG_ENABLE([optical-drive],
363   [AS_HELP_STRING([--disable-optical-drive],
364   [disable optical drive])],
365   [use_optical_drive=$enableval],
366   [use_optical_drive=yes])
367
368 AC_ARG_ENABLE([libbluray],
369   [AS_HELP_STRING([--enable-libbluray],
370   [enable libbluray support])],
371   [use_libbluray=$enableval],
372   [use_libbluray=auto])
373
374 AC_ARG_ENABLE([texturepacker],
375   [AS_HELP_STRING([--enable-texturepacker],
376   [enable texturepacker support (default is yes)])],
377   [use_texturepacker=$enableval],
378   [use_texturepacker=auto])
379
380 AC_ARG_WITH([lirc-device],
381   [AS_HELP_STRING([--with-lirc-device=file],
382   [specify the default LIRC device (default is /dev/lircd)])],
383   [lirc_device=$withval],
384   [lirc_device=/dev/lircd])
385 AC_DEFINE_UNQUOTED([LIRC_DEVICE], ["$lirc_device"], [Default LIRC device])
386
387 AC_ARG_ENABLE([udev],
388   [AS_HELP_STRING([--enable-udev],
389   [enable udev support (default is auto)])],
390   [use_libudev=$enableval],
391   [use_libudev=auto])
392
393 AC_ARG_ENABLE([libusb],
394   [AS_HELP_STRING([--enable-libusb],
395   [enable libusb support (default is auto)])],
396   [use_libusb=$enableval],
397   [use_libusb=auto])
398
399 AC_ARG_ENABLE([libcec],
400   [AS_HELP_STRING([--enable-libcec],
401   [enable libcec support (default is auto)])],
402   [use_libcec=$enableval],
403   [use_libcec=auto])
404
405 ### External libraries options
406 AC_ARG_ENABLE([external-libraries],
407   [AS_HELP_STRING([--enable-external-libraries],
408   [enable use of all supported external libraries (default is no) 'Linux only'])],
409   [use_external_libraries=$enableval],
410   [use_external_libraries=no])
411
412 AC_ARG_ENABLE([external-ffmpeg],
413   [AS_HELP_STRING([--enable-external-ffmpeg],
414   [enable use of external ffmpeg libraries (default is no) 'Linux only'])],
415   [use_external_ffmpeg=$enableval],
416   [use_external_ffmpeg=$use_external_libraries])
417
418 ### End of external library options
419
420 if test "x$host_vendor" != "xapple"; then
421   DEFAULT_COMPILE_FLAGS="-fPIC -DPIC -D_REENTRANT"
422   DEFAULT_COMPILE_FLAGS="$DEFAULT_COMPILE_FLAGS -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
423 fi
424
425 # Checks for programs.
426 PASSED_CXXFLAGS=$CXXFLAGS # Hack to override autoconf default values
427 AC_PROG_CXX
428 CXXFLAGS="$PASSED_CXXFLAGS $DEFAULT_COMPILE_FLAGS"
429 PASSED_CFLAGS=$CFLAGS # Hack to override autoconf default values
430 AC_PROG_CC
431 AC_PROG_LIBTOOL
432 CFLAGS="$PASSED_CFLAGS $DEFAULT_COMPILE_FLAGS"
433 AC_PROG_AWK
434 AC_PROG_LN_S
435 AC_PROG_MAKE_SET
436 MAKE="${MAKE:-make}"
437
438 # host detection and setup
439 case $host in
440   i*86*-linux-gnu*)
441      ARCH="i486-linux"
442      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
443      ;;
444   x86_64-*-linux-gnu*)
445      ARCH="x86_64-linux"
446      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
447      ;;
448   arm-apple-darwin*)
449      use_joystick=no
450      use_crystalhd=no
451      use_vdadecoder=no
452      use_vtbdecoder=yes
453      use_optical_drive=no
454      use_dvdcss=no
455      use_gles=yes
456      use_cpu=cortex-a8
457      check_sdl_arch=[`file /opt/local/lib/libSDL_image.dylib | awk '{V=7; print $V}'`]
458      if test "x$check_sdl_arch" = "xi386"; then
459        use_texturepacker_native=yes
460        USE_TEXTUREPACKER_NATIVE_ROOT="/opt/local"
461      else
462        use_texturepacker=no
463      fi
464      ARCH="arm-osx"
465      use_arch="arm"
466      AC_SUBST(ARCH_DEFINES, "-D_ARMEL")
467      PYTHON_VERSION="2.6"
468      PYTHON_LDFLAGS="-L${prefix}/lib -lpython2.6"
469      PYTHON_CPPFLAGS="-I${prefix}/include/python2.6"
470      PYTHON_SITE_PKG="${prefix}/lib/python2.6/site-packages"
471      PYTHON_NOVERSIONCHECK="no-check"
472      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS -D_LINUX")
473      ;;
474   *86-apple-darwin*)
475      use_joystick=no
476      use_vtbdecoder=no
477      use_texturepacker_native=yes
478      USE_TEXTUREPACKER_NATIVE_ROOT="$prefix"
479      ARCH="x86-osx"
480      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
481      ;;
482   powerpc-apple-darwin*)
483      use_joystick=no
484      use_vdadecoder=no
485      use_vtbdecoder=no
486      use_crystalhd=no
487      ARCH="powerpc-osx"
488      use_arch="ppc"
489      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
490      ;;
491   powerpc-*-linux-gnu*)
492      ARCH="powerpc-linux"
493      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
494      ;;
495   powerpc64-*-linux-gnu*)
496      ARCH="powerpc64-linux"
497      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
498      ;;
499   arm*-*-linux-gnu*)
500      use_texturepacker=no
501      ARCH="arm"
502      use_arch="arm"
503      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL")
504      ;;
505   *)
506      AC_MSG_ERROR(unsupported host ($host))
507 esac
508 AC_SUBST([ARCH])
509
510 # platform debug flags
511 if test "$use_debug" = "yes"; then
512   final_message="$final_message\n  Debugging:\tYes"
513   if test "$use_profiling" = "yes"; then
514     final_message="$final_message\n  Profiling:\tYes"
515     DEBUG_FLAGS="-g -pg -D_DEBUG -Wall"
516   else
517     final_message="$final_message\n  Profiling:\tNo"
518     DEBUG_FLAGS="-g -D_DEBUG -Wall"
519   fi
520 else
521   final_message="$final_message\n  Debugging:\tNo"
522   if test "$use_profiling" = "yes"; then
523     final_message="$final_message\n  Profiling:\tYes"
524     DEBUG_FLAGS="-pg -DNDEBUG=1"
525   else
526     final_message="$final_message\n  Profiling:\tNo"
527     DEBUG_FLAGS="-DNDEBUG=1"
528   fi
529 fi
530 CFLAGS="$CFLAGS $DEBUG_FLAGS"
531 CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS"
532
533
534 if test "$use_optimizations" = "yes"; then
535   final_message="$final_message\n  Optimization:\tYes"
536   CXXFLAGS="$CXXFLAGS -O2"
537   CFLAGS="$CFLAGS -O2"
538 else
539   final_message="$final_message\n  Optimization:\tNo"
540 fi
541
542
543 # platform specific flags
544 if test "$host_vendor" = "apple" ; then
545   # standard xbmc paths
546   INCLUDES="$INCLUDES -I\$(abs_top_srcdir)/xbmc/osx"
547   if test "$use_arch" != "arm"; then
548     LIBS="$LIBS -framework IOKit"
549     LIBS="$LIBS -framework Cocoa"
550     LIBS="$LIBS -framework AppKit"
551     LIBS="$LIBS -framework Carbon"
552     LIBS="$LIBS -framework CoreAudio"
553     LIBS="$LIBS -framework QuickTime"
554     LIBS="$LIBS -framework AudioUnit"
555     LIBS="$LIBS -framework Foundation"
556     LIBS="$LIBS -framework CoreServices"
557     LIBS="$LIBS -framework CoreVideo"
558     LIBS="$LIBS -framework CoreAudio"
559     LIBS="$LIBS -framework AudioToolbox"
560     LIBS="$LIBS -framework CoreFoundation"
561     LIBS="$LIBS -framework DiskArbitration"
562     LIBS="$LIBS -framework ApplicationServices"
563   fi
564 elif test "$use_arch" = "arm"; then
565   CFLAGS="$CFLAGS -mfloat-abi=softfp -mno-apcs-stack-check"
566   CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp -mno-apcs-stack-check"
567   FFMPEG_EXTRACFLAGS="-mfloat-abi=softfp"
568   if test "$use_tegra" = "yes"; then
569     # Compile for ARMv7a architecture, need to test gcc for vfpv3-d16 support 
570     SAVE_CFLAGS="$CFLAGS"
571     CFLAGS="-mfpu=vfpv3-d16"
572     AC_COMPILE_IFELSE(
573       [AC_LANG_SOURCE([int foo;])],
574       [ CFLAGS="$SAVE_CFLAGS -Wno-psabi -Wa,-march=armv7a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mthumb-interwork"
575         CXXFLAGS="$CXXFLAGS -Wno-psabi -Wa,-march=armv7a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mthumb-interwork"
576         FFMPEG_EXTRACFLAGS+=" -mtune=cortex-a9 -mfpu=vfpv3-d16"
577         use_cpu=cortex-a9],
578       [ CFLAGS="$SAVE_CFLAGS -Wa,-march=armv6 -mtune=cortex-a8 -mthumb-interwork"
579         CXXFLAGS="$CXXFLAGS -Wa,-march=armv6 -mtune=cortex-a8 -mthumb-interwork"    
580         use_cpu=cortex-a8])
581   else
582     # Compile for ARMv7a architecture, CortexA8 cpu and NEON coprocessor
583     CFLAGS+=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad"
584     CXXFLAGS+=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad"
585     FFMPEG_EXTRACFLAGS+=" -mfpu=neon"
586   fi
587 fi
588
589 # Checks for library functions.
590 AC_FUNC_ALLOCA
591 AC_FUNC_CHOWN
592 AC_FUNC_CLOSEDIR_VOID
593 AC_FUNC_ERROR_AT_LINE
594 AC_FUNC_FSEEKO
595 AC_PROG_GCC_TRADITIONAL
596 AC_FUNC_LSTAT
597 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
598 AC_FUNC_MEMCMP
599 AC_FUNC_MKTIME
600 AC_FUNC_MMAP
601 # Boxee is apparently having compile problems
602 # if HAVE_REALLOC is defined.  Sort this later.
603 #AC_FUNC_REALLOC
604 AC_FUNC_SELECT_ARGTYPES
605 AC_FUNC_SETVBUF_REVERSED
606 AC_TYPE_SIGNAL
607 AC_FUNC_STAT
608 AC_FUNC_STRCOLL
609 AC_FUNC_STRFTIME
610 AC_FUNC_STRTOD
611 AC_FUNC_UTIME_NULL
612 AC_FUNC_VPRINTF
613 AC_CHECK_FUNCS([atexit dup2 fdatasync floor fs_stat_dev ftime ftruncate getcwd gethostbyaddr gethostbyname gethostname getpagesize getpass gettimeofday inet_ntoa lchown localeconv memchr memmove memset mkdir modf munmap pow rmdir select setenv setlocale socket sqrt strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strspn strstr strtol strtoul sysinfo tzset utime])
614
615 # Check for various sizes
616 AC_CHECK_SIZEOF([int])
617 AC_CHECK_SIZEOF([size_t])
618
619 # Add top source directory for all builds so we can use config.h
620 INCLUDES="$INCLUDES -I\$(abs_top_srcdir)"
621
622 # Check inotify availability
623 AC_CHECK_HEADER([sys/inotify.h], AC_DEFINE([HAVE_INOTIFY],[1],[Define if we have inotify]),)
624
625 # Checks for boost headers using CXX instead of CC
626 AC_LANG_PUSH([C++])
627 AC_CHECK_HEADER([boost/shared_ptr.hpp],, AC_MSG_ERROR($missing_library))
628 AC_LANG_POP([C++])
629
630 # Checks for platforms libraries.
631 if test "$use_gles" = "yes"; then
632   use_gl="no"
633   # GLES overwrites GL if both set to yes.
634   if test "$host_vendor" = "apple" ; then
635     AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."])
636     AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."])
637     AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.)
638   else
639     AC_CHECK_LIB([EGL],   [main],, AC_MSG_ERROR($missing_library))
640     AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library))
641   fi
642 else
643   if test "$use_gl" = "yes"; then
644     if test "$host_vendor" = "apple" ; then
645       # linking to OpenGL.framework instead of libGL, libGLU so AC_CHECK_LIB will fail
646       LIBS="$LIBS -framework OpenGL"
647       AC_DEFINE([HAVE_LIBGL],[1],["Define to 1 if you have the `GL' library (-lGL)."])
648       AC_MSG_RESULT(== WARNING: OpenGL support is assumed.)
649       AC_DEFINE([HAVE_LIBGLU],[1],["Define to 1 if you have the `GLU' library (-lGLU)."])
650       AC_MSG_RESULT(== WARNING: OpenGLU support is assumed.)
651       AC_CHECK_LIB([GLEW],[main],, AC_MSG_ERROR($missing_library))
652     else
653       AC_CHECK_LIB([GL],  [main],, AC_MSG_ERROR($missing_library))
654       AC_CHECK_LIB([GLEW],[main],, AC_MSG_ERROR($missing_library))
655       AC_CHECK_LIB([GLU], [main],, AC_MSG_ERROR($missing_library))
656     fi
657   else
658     AC_MSG_RESULT(== WARNING: OpenGL support is disabled. XBMC will run VERY slow. ==)
659     AC_CHECK_LIB([SDL_gfx],[main])
660   fi
661 fi
662
663 # platform common libraries
664 AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
665 if test $MYSQL_CONFIG = "yes"; then
666   INCLUDES="$INCLUDES `mysql_config --include`"
667   MYSQL_LIBS=`mysql_config --libs`
668   LIBS="$LIBS $MYSQL_LIBS"
669   AC_SUBST(MYSQL_LIBS)
670 else
671   AC_MSG_ERROR($missing_program)
672 fi
673 AC_CHECK_HEADER([ass/ass.h],, AC_MSG_ERROR($missing_library))
674 AC_CHECK_HEADER([mpeg2dec/mpeg2.h],, AC_MSG_ERROR($missing_library))
675 AC_CHECK_HEADER([mpeg2dec/mpeg2convert.h],, AC_MSG_ERROR($missing_library),
676   AC_INCLUDES_DEFAULT()
677   [#include <mpeg2dec/mpeg2.h>])
678 AC_CHECK_HEADER([mad.h],,            AC_MSG_ERROR($missing_library))
679 AC_CHECK_HEADER([jpeglib.h],,        AC_MSG_ERROR($missing_library))
680 AC_CHECK_HEADER([samplerate.h],,     AC_MSG_ERROR($missing_library))
681 AC_CHECK_HEADER([ogg/ogg.h],,        AC_MSG_ERROR($missing_library))
682 AC_CHECK_HEADER([vorbis/vorbisfile.h],, AC_MSG_ERROR($missing_library))
683 AC_CHECK_HEADER([vorbis/vorbisenc.h],, AC_MSG_ERROR($missing_library))
684 AC_CHECK_HEADER([libmodplug/modplug.h],, AC_MSG_ERROR($missing_library))
685 AC_CHECK_HEADER([curl/curl.h],, AC_MSG_ERROR($missing_library))
686 AC_CHECK_HEADER([FLAC/stream_decoder.h],, AC_MSG_ERROR($missing_library))
687 AC_CHECK_LIB([bz2],         [main],, AC_MSG_ERROR($missing_library))
688 AC_CHECK_LIB([jpeg],        [main],, AC_MSG_ERROR($missing_library)) # check for cximage
689 AC_CHECK_LIB([tiff],        [main],, AC_MSG_ERROR($missing_library))
690 AC_CHECK_LIB([pthread],     [main],, AC_MSG_ERROR($missing_library))
691 AC_CHECK_LIB([lzo2],        [main],, AC_MSG_ERROR($missing_library))
692 AC_CHECK_LIB([z],           [main],, AC_MSG_ERROR($missing_library))
693 AC_CHECK_LIB([crypto],      [main],, AC_MSG_ERROR($missing_library))
694 AC_CHECK_LIB([ssl],         [main],, AC_MSG_ERROR($missing_library))
695 AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
696 AC_CHECK_LIB([ssh],         [sftp_tell64],, AC_MSG_RESULT([Could not find suitable version of libssh]))
697 AC_CHECK_LIB([bluetooth],   [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
698 AC_CHECK_LIB([yajl],        [main],, AC_MSG_ERROR($missing_library))
699
700 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig],
701   [INCLUDES="$INCLUDES $FONTCONFIG_CFLAGS"; LIBS="$LIBS $FONTCONFIG_LIBS"],
702   AC_MSG_ERROR($missing_library))
703 PKG_CHECK_MODULES([FRIBIDI],    [fribidi],
704   [INCLUDES="$INCLUDES $FRIBIDI_CFLAGS"; LIBS="$LIBS $FRIBIDI_LIBS"],
705   AC_MSG_ERROR($missing_library))
706 PKG_CHECK_MODULES([SQLITE3],    [sqlite3],
707   [INCLUDES="$INCLUDES $SQLITE3_CFLAGS"; LIBS="$LIBS $SQLITE3_LIBS"],
708   AC_MSG_ERROR($missing_library))
709 PKG_CHECK_MODULES([PNG],        [libpng],
710   [INCLUDES="$INCLUDES $PNG_CFLAGS"; LIBS="$LIBS $PNG_LIBS"],
711   AC_MSG_ERROR($missing_library))
712 PKG_CHECK_MODULES([PCRE],       [libpcre],
713   [INCLUDES="$INCLUDES $PCRE_CFLAGS"; LIBS="$LIBS $PCRE_LIBS"]; \
714   AC_DEFINE([HAVE_LIBPCRE],[1],["Define to 1 if libpcre is installed"]),
715   AC_MSG_ERROR($missing_library))
716 PKG_CHECK_MODULES([PCRECPP],    [libpcrecpp],
717   [INCLUDES="$INCLUDES $PCRECPP_CFLAGS"; LIBS="$LIBS $PCRECPP_LIBS"]; \
718   AC_DEFINE([HAVE_LIBPCRECPP],[1],["Define to 1 if libpcrecpp is installed"]),
719   AC_MSG_ERROR($missing_library))
720 PKG_CHECK_MODULES([CDIO],       [libcdio],
721   [INCLUDES="$INCLUDES $CDIO_CFLAGS"; LIBS="$LIBS $CDIO_LIBS"],
722   AC_MSG_ERROR($missing_library))
723 PKG_CHECK_MODULES([SAMPLERATE], [samplerate],
724   [INCLUDES="$INCLUDES $SAMPLERATE_CFLAGS"; LIBS="$LIBS $SAMPLERATE_LIBS"],
725   AC_MSG_ERROR($missing_library))
726 PKG_CHECK_MODULES([FREETYPE2],  [freetype2],
727   [INCLUDES="$INCLUDES $FREETYPE2_CFLAGS"; LIBS="$LIBS $FREETYPE2_LIBS"],
728   AC_MSG_ERROR($missing_library))
729
730 # check for libbluray
731 AS_CASE([x$use_libbluray],
732   [xyes],[
733     PKG_CHECK_MODULES([LIBBLURAY],[libbluray],[use_libbluray="yes"], AC_MSG_ERROR($missing_library))
734   ],
735   [xauto],[
736     PKG_CHECK_MODULES([LIBBLURAY],[libbluray],[use_libbluray="yes"], [use_libbluray="no"])
737   ])
738
739 AS_CASE([x$use_libbluray],
740   [xyes],[
741     INCLUDES="$INCLUDES $LIBBLURAY_CFLAGS";
742     XB_FIND_SONAME([BLURAY], [bluray], [use_libbluray])
743     AC_DEFINE([HAVE_LIBBLURAY], 1, [System has libbluray library])
744     AC_SUBST([HAVE_LIBBLURAY], 1)
745
746         XB_PUSH_FLAGS(
747         [$LIBBLURAY_CFLAGS]
748       , [$LIBBLURAY_LIBS]
749
750       , AC_MSG_CHECKING([libbluray version])
751         AC_COMPILE_IFELSE(
752             AC_LANG_PROGRAM(
753                 [#include <libbluray/bluray.h>]
754                ,[bd_get_playlist_info(0, 0)])
755           ,[AC_MSG_RESULT(version has old angle api)
756             AC_DEFINE([HAVE_LIBBLURAY_NOANGLE],[],[System has an old api libbluray without angle support])]
757           ,[AC_MSG_RESULT(normal)]
758         )
759
760         AC_MSG_CHECKING([for libbluray log control])
761         AC_LINK_IFELSE(
762             AC_LANG_PROGRAM(
763                [#include <libbluray/bluray.h>
764                 #include <libbluray/log_control.h>]
765               ,[bd_set_debug_mask(0)])
766           , AC_MSG_RESULT(yes)
767           ,[AC_MSG_RESULT(no)
768             AC_DEFINE([HAVE_LIBBLURAY_NOLOGCONTROL],[],[System has an old api libbluray without log support])]
769         )
770     )
771   ],[
772 #    AC_DEFINE([HAVE_LIBBLURAY], 0, [System has libbluray library])
773     AC_SUBST([HAVE_LIBBLURAY], 0)
774   ]
775 )
776
777 # platform dependent libraries
778 if test "$host_vendor" = "apple" ; then
779   AC_CHECK_LIB([iconv],     [main],, AC_MSG_ERROR($missing_library))
780   if test "$use_arch" != "arm"; then
781     AC_CHECK_LIB([SDL_mixer],[main],, AC_MSG_ERROR($missing_library))
782     AC_CHECK_LIB([SDL],      [main],, AC_MSG_ERROR($missing_library))
783     AC_DEFINE([HAVE_SDL],[1],["Define to 1 if using sdl"])
784   fi
785 else
786   AC_CHECK_LIB([dl],         [main],, AC_MSG_ERROR($missing_library))
787   AC_CHECK_LIB([resolv],     [main],, AC_MSG_ERROR($missing_library))
788   AC_CHECK_LIB([jasper],     [main],, AC_MSG_ERROR($missing_library)) # check for cximage
789   AC_CHECK_LIB([rt],         [clock_gettime],, AC_MSG_ERROR($missing_library))
790
791   PKG_CHECK_MODULES([ALSA],  [alsa],
792     [INCLUDES="$INCLUDES $ALSA_CFLAGS"; LIBS="$LIBS $ALSA_LIBS"; use_alsa=yes],
793     AC_MSG_NOTICE($alsa_not_found); use_alsa=no)
794   PKG_CHECK_MODULES([DBUS],    [dbus-1],
795     [INCLUDES="$INCLUDES $DBUS_CFLAGS"; LIBS="$LIBS $DBUS_LIBS"; use_dbus=yes]; \
796     AC_DEFINE([HAVE_DBUS],[1],["Define to 1 if dbus is installed"]),
797     AC_MSG_NOTICE($missing_library); use_dbus=no)
798
799   if test "x$use_sdl" != "xno"; then
800     PKG_CHECK_MODULES([SDL],   [sdl],
801       [INCLUDES="$INCLUDES $SDL_CFLAGS"; LIBS="$LIBS $SDL_LIBS"],
802       AC_MSG_ERROR($missing_library))
803     AC_CHECK_LIB([SDL_mixer],  [main],, AC_MSG_ERROR($missing_library))
804     AC_CHECK_LIB([SDL_image],  [main],, AC_MSG_ERROR($missing_library))
805     AC_DEFINE([HAVE_SDL],[1],["Define to 1 if using sdl"])
806   fi
807 fi
808
809 XB_FIND_SONAME([MAD],         [mad])
810 XB_FIND_SONAME([OGG],         [ogg])
811 XB_FIND_SONAME([CURL],        [curl])
812 XB_FIND_SONAME([FLAC],        [FLAC])
813 XB_FIND_SONAME([VORBIS],      [vorbis])
814 XB_FIND_SONAME([VORBISENC],   [vorbisenc])
815 XB_FIND_SONAME([VORBISFILE],  [vorbisfile])
816 XB_FIND_SONAME([MODPLUG],     [modplug])
817 XB_FIND_SONAME([ASS],         [ass])
818 XB_FIND_SONAME([MPEG2],       [mpeg2])
819
820 # WebServer
821 if test "$use_webserver" = "yes"; then
822   AC_CHECK_LIB([microhttpd],  [main],, AC_MSG_ERROR($missing_library))
823 fi
824
825 # Optical
826 if test "$use_optical_drive" = "yes"; then
827   AC_DEFINE([HAS_DVD_DRIVE], [1], [Define to 1 to have optical drive support])
828 fi
829
830 # PulseAudio
831 if test "x$use_pulse" != "xno"; then
832   if test "$host_vendor" = "apple" ; then
833     if test "x$use_pulse" = "xyes"; then
834       AC_MSG_ERROR($pulse_disabled)
835     else
836       use_pulse="no"
837       AC_MSG_RESULT($pulse_disabled)
838     fi
839     USE_PULSE=0
840   else
841     AC_CHECK_LIB([pulse], [main],,
842       [if test "x$use_pulse" = "xyes"; then
843         AC_MSG_ERROR($pulse_not_found)
844       else
845         use_pulse=no
846         USE_PULSE=0
847         AC_MSG_RESULT($pulse_not_found)
848       fi])
849       USE_PULSE=1
850   fi
851 else
852   AC_MSG_RESULT($pulse_disabled)
853   USE_PULSE=0
854 fi
855
856 # HAL
857 if test "$host_vendor" = "apple" ; then
858   use_hal="no"
859   AC_MSG_RESULT($hal_disabled)
860 else
861   if test "$use_hal" = "yes"; then
862     PKG_CHECK_MODULES([HAL], [hal],
863       [INCLUDES="$INCLUDES $HAL_CFLAGS"; LIBS="$LIBS $HAL_LIBS"],
864       use_hal=no;AC_MSG_RESULT($hal_not_found))
865     PKG_CHECK_MODULES([HAL_STORAGE], [hal-storage],
866       [INCLUDES="$INCLUDES $HAL_STORAGE_CFLAGS"; LIBS="$LIBS $HAL_STORAGE_LIBS"],
867       use_hal=no;AC_MSG_RESULT($halstorage_not_found))
868   else
869     AC_MSG_RESULT($hal_disabled)
870   fi
871   if test "$use_hal" = "yes"; then
872     AC_DEFINE([HAS_HAL], [1], [Define to 1 if you have HAL installed])
873   fi
874 fi
875
876 # avahi
877 if test "$host_vendor" = "apple" ; then
878   use_avahi="no"
879   AC_MSG_RESULT($avahi_disabled)
880 else
881   if test "$use_avahi" = "yes"; then
882     AC_CHECK_LIB([avahi-common], [main],,
883       use_avahi=no;AC_MSG_RESULT($avahi_not_found))
884     if test "$use_avahi" = "yes"; then
885       #either both libs or none
886       AC_CHECK_LIB([avahi-client], [main],,
887         use_avahi=no;AC_MSG_RESULT($avahi_not_found))
888     fi
889   else
890     AC_MSG_RESULT($avahi_disabled)
891   fi
892 fi
893
894 # X11
895 if test "$use_x11" = "yes" && test "$host_vendor" != "apple"; then
896   AC_MSG_NOTICE($x11_enabled)
897   PKG_CHECK_MODULES([X11],    [x11],
898     [INCLUDES="$INCLUDES $X11_CFLAGS"; LIBS="$LIBS $X11_LIBS"],
899     AC_MSG_ERROR($missing_library))
900   PKG_CHECK_MODULES([XEXT],  [xext],
901     [INCLUDES="$INCLUDES $XEXT_CFLAGS"; LIBS="$LIBS $XEXT_LIBS"],
902     AC_MSG_ERROR($missing_library))
903   AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 libs installed.])
904 else
905   AC_MSG_RESULT($x11_disabled)
906 fi
907
908 # XRandR
909 if test "$host_vendor" = "apple" || test "$use_x11" = "no"; then
910   use_xrandr="no"
911   AC_MSG_RESULT($xrandr_disabled)
912 else
913   if test "$use_xrandr" = "yes" ; then
914     AC_CHECK_LIB([Xrandr], [main],,
915       use_xrandr="no";AC_MSG_RESULT($xrandr_not_found))
916   else
917     AC_MSG_RESULT($xrandr_disabled)
918   fi
919 fi
920
921 # GOOM
922 if test "$host_vendor" = "apple" ; then
923   AC_MSG_NOTICE($goom_disabled)
924   DISABLE_GOOM=1
925 else
926   if test "$use_goom" = "yes" && test "$use_gl" = "yes"; then
927     AC_MSG_NOTICE($goom_enabled)
928     DISABLE_GOOM=0
929   else
930     AC_MSG_NOTICE($goom_disabled)
931     DISABLE_GOOM=1
932   fi
933 fi
934
935 # RSXS
936 if test "$use_rsxs" = "no" || test "$use_gl" = "no"; then
937   AC_MSG_NOTICE($rsxs_disabled)
938   DISABLE_RSXS=1
939 else
940   AC_MSG_NOTICE($rsxs_enabled)
941   DISABLE_RSXS=0
942   # darwin osx can do rsxs but does not use x11, so do not pkg-config check for them
943   if test "$host_vendor" != "apple" ; then
944     PKG_CHECK_MODULES([XT],    [xt],
945       [INCLUDES="$INCLUDES $XT_CFLAGS"; LIBS="$LIBS $XT_LIBS"],
946       AC_MSG_ERROR($missing_library))
947     PKG_CHECK_MODULES([XMU],   [xmu],
948       [INCLUDES="$INCLUDES $XMU_CFLAGS"; LIBS="$LIBS $XMU_LIBS"],
949       AC_MSG_ERROR($missing_library))
950   fi
951 fi
952
953 # PROJECTM
954 if test "$use_projectm" = "no" || test "$use_gl" = "no"; then
955   AC_MSG_NOTICE($projectm_disabled)
956   DISABLE_PROJECTM=1
957 else
958   AC_MSG_NOTICE($projectm_enabled)
959   DISABLE_PROJECTM=0
960 fi
961
962 # libRTMP
963 if test "$use_librtmp" != "no"; then
964   AC_CHECK_HEADERS([librtmp/log.h librtmp/amf.h librtmp/rtmp.h],,
965    [if test "$use_librtmp" = "yes"; then
966       AC_MSG_ERROR($librtmp_not_found)
967     elif test "$use_librtmp" != "no"; then
968       AC_MSG_NOTICE($librtmp_not_found)
969       use_librtmp="no"
970     fi
971    ])
972   if test "$use_librtmp" != "no"; then
973     XB_FIND_SONAME([RTMP], [rtmp], [use_librtmp])
974   fi
975   if test "$use_librtmp" != "no"; then
976     AC_DEFINE([HAS_LIBRTMP], [1], [Whether to use libRTMP library.])
977   fi
978 else
979   AC_MSG_NOTICE($librtmp_disabled)
980 fi
981
982 # samba
983 if test "x$use_samba" != "xno"; then
984   AC_CHECK_LIB([smbclient], [main],,
985     use_samba=no;AC_MSG_ERROR($missing_library))
986     USE_LIBSMBCLIENT=0
987 else
988   AC_MSG_RESULT($samba_disabled)
989   USE_LIBSMBCLIENT=0
990 fi
991
992 if test "x$use_samba" != "xno"; then
993   AC_DEFINE([HAVE_LIBSMBCLIENT], [1], [Define to 1 if you have Samba installed])
994   USE_LIBSMBCLIENT=1
995 fi
996
997 # libnfs
998 if test "$use_libnfs" != "no"; then
999   AC_CHECK_HEADERS([nfsc/libnfs.h],,
1000    [if test "$use_libnfs" = "yes"; then
1001       AC_MSG_ERROR($libnfs_not_found)
1002       USE_LIBNFS=0
1003     elif test "$use_libnfs" != "no"; then
1004       AC_MSG_NOTICE($libnfs_not_found)
1005       use_libnfs="no"
1006       USE_LIBNFS=0
1007     fi
1008    ])
1009   if test "$use_libnfs" != "no"; then
1010     XB_FIND_SONAME([NFS], [nfs], [use_libnfs])
1011   fi
1012   if test "$use_libnfs" != "no"; then
1013     AC_DEFINE([HAVE_LIBNFS], [1], [Whether to use libnfs library.])
1014     USE_LIBNFS=1
1015   fi
1016 else
1017   USE_LIBNFS=0
1018   AC_MSG_NOTICE($libnfs_disabled)
1019 fi
1020
1021 # libafpclient
1022 USE_LIBAFPCLIENT=0
1023 if test "x$use_libafpclient" != "xno"; then
1024   AC_CHECK_HEADERS([afpfs-ng/libafpclient.h],,
1025    [if test "x$use_libafpclient" = "xyes"; then
1026       AC_MSG_ERROR($libafpclient_not_found)
1027     elif test "x$use_libafpclient" != "xno"; then
1028       AC_MSG_NOTICE($libafpclient_not_found)
1029       use_libafpclient="no"
1030     fi
1031    ])
1032   if test "x$use_libafpclient" != "xno"; then
1033     XB_FIND_SONAME([AFPCLIENT], [afpclient], [use_libafpclient])
1034     AC_DEFINE([HAVE_LIBAFPCLIENT], [1], [Whether to use libafpclient library.])
1035     USE_LIBAFPCLIENT=1
1036   fi
1037 else
1038   AC_MSG_NOTICE($libafpclient_disabled)
1039 fi
1040
1041 # libplist for airplay feature
1042 USE_AIRPLAY=0
1043 if test "$use_airplay" != "no"; then
1044   AC_CHECK_LIB([plist],[main],,
1045    [if test "$use_airplay" = "yes"; then
1046       AC_MSG_ERROR($libplist_not_found)
1047     elif test "$use_airplay" != "no"; then
1048       AC_MSG_NOTICE($libplist_not_found)
1049       use_airplay="no"
1050     fi
1051    ])
1052
1053   if test "$use_airplay" != "no"; then
1054     XB_FIND_SONAME([PLIST], [plist], [use_airplay])
1055     USE_AIRPLAY=1
1056   fi
1057 fi
1058
1059 # libshairport for AirTunes
1060 USE_AIRTUNES=0
1061 if test "x$use_airtunes" != "xno"; then
1062   AC_CHECK_LIB([shairport], [shairport_set_ao],,
1063    [if test "x$use_airtunes" = "xyes"; then
1064       AC_MSG_ERROR($libshairport_not_found)
1065     elif test "x$use_airtunes" != "xno"; then
1066       AC_MSG_NOTICE($libshairport_not_found)
1067       use_airtunes="no"
1068     fi
1069    ])
1070
1071   if test "x$use_airtunes" != "xno"; then
1072     XB_FIND_SONAME([SHAIRPORT], [shairport], [use_airtunes])
1073     USE_AIRTUNES=1
1074   fi
1075 fi
1076
1077 # libusb
1078 USE_LIBUSB=0
1079 if test "$host_vendor" = "apple" ; then
1080   use_libusb="no"
1081   AC_MSG_NOTICE($libusb_disabled)
1082 else
1083   if test "$use_libusb" = "auto"; then
1084     PKG_CHECK_MODULES([USB], [libusb],
1085       use_libusb="yes"; USE_LIBUSB=1; [INCLUDES="$INCLUDES $USB_CFLAGS"; LIBS="$LIBS $USB_LIBS"; USE_LIBUSB=1]; \
1086       AC_DEFINE([HAVE_LIBUSB],[1],["Define to 1 if libusb is installed"]),
1087       use_libusb="no"; AC_MSG_RESULT($libusb_not_found))
1088   elif test "$use_libusb" = "yes"; then
1089     PKG_CHECK_MODULES([USB], [libusb],
1090       use_libusb="yes"; USE_LIBUSB=1; [INCLUDES="$INCLUDES $USB_CFLAGS"; LIBS="$LIBS $USB_LIBS"; USE_LIBUSB=1]; \
1091       AC_DEFINE([HAVE_LIBUSB],[1],["Define to 1 if libusb is installed"]),
1092       use_libusb="no"; AC_MSG_ERROR($libusb_not_found))
1093   else
1094     use_libusb="no"
1095     AC_MSG_NOTICE($libusb_disabled)
1096   fi
1097 fi
1098
1099 # udev
1100 USE_LIBUDEV=0
1101 if test "$use_libusb" = "yes"; then
1102   if test "$host_vendor" = "apple" ; then
1103     use_libudev="no"
1104     AC_MSG_NOTICE($libudev_disabled)
1105   else
1106     if test "$use_libudev" = "auto"; then
1107       PKG_CHECK_MODULES([UDEV], [libudev],
1108         use_libudev="yes"; use_libusb="no"; USE_LIBUDEV=1; [INCLUDES="$INCLUDES $UDEV_CFLAGS"; LIBS="$LIBS $UDEV_LIBS"]; \
1109         AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"]),
1110             AC_MSG_RESULT($libudev_not_found))
1111     elif test "$use_libudev" = "yes" ; then
1112       PKG_CHECK_MODULES([UDEV], [libudev],
1113         use_libudev="yes"; use_libusb="no"; USE_LIBUDEV=1; [INCLUDES="$INCLUDES $UDEV_CFLAGS"; LIBS="$LIBS $UDEV_LIBS"]; \
1114         AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"]),
1115             AC_MSG_ERROR($libudev_not_found))
1116     else
1117       use_libudev="no"
1118       AC_MSG_NOTICE($libudev_disabled)
1119     fi
1120   fi
1121 else
1122   use_libudev="no"
1123   AC_MSG_NOTICE($libudev_disabled)
1124 fi
1125
1126 # libcec
1127 USE_LIBCEC=0
1128 if test "$use_libcec" = "auto"; then
1129   PKG_CHECK_MODULES([CEC], [libcec],
1130     use_libcec="yes"; USE_LIBCEC=1; [INCLUDES="$INCLUDES $CEC_CFLAGS"; LIBS="$LIBS $CEC_LIBS";] \
1131     AC_DEFINE([HAVE_LIBCEC],[1],["Define to 1 if libcec is installed"]),
1132         use_libcec="no"; AC_MSG_RESULT($libcec_not_found))
1133 elif test "$use_libcec" = "yes"; then
1134   PKG_CHECK_MODULES([CEC], [libcec],
1135     use_libcec="yes"; USE_LIBCEC=1; [INCLUDES="$INCLUDES $CEC_CFLAGS"; LIBS="$LIBS $CEC_LIBS";] \
1136     AC_DEFINE([HAVE_LIBCEC],[1],["Define to 1 if libcec is installed"]),
1137         use_libcec="no"; AC_MSG_ERROR($libcec_not_found))
1138 else
1139   use_libcec="no"
1140   AC_MSG_NOTICE($libcec_disabled)
1141 fi
1142
1143 ### External libraries checks
1144 # External FFmpeg
1145 if test "$use_external_ffmpeg" = "yes"; then
1146   FFMPEG_LIBNAMES="libavcodec libavfilter libavformat libavutil libpostproc libswscale"
1147
1148   # libavcore is optional
1149   PKG_CHECK_EXISTS([libavcore], FFMPEG_LIBNAMES="$FFMPEG_LIBNAMES libavcore")
1150
1151   PKG_CHECK_MODULES([FFMPEG], [$FFMPEG_LIBNAMES],
1152                     [INCLUDES="$INCLUDES $FFMPEG_CFLAGS"; LIBS="$LIBS $FFMPEG_LIBS"],
1153                     AC_MSG_ERROR($missing_library))
1154
1155   # Determine whether AVPacket and relevant functions are defined in libavformat
1156   # or libavcodec
1157   AC_CHECK_LIB([avcodec], [av_free_packet],
1158   [AC_MSG_NOTICE(== AVPacket and relevant functions defined in libavcodec. ==)],
1159   [AC_MSG_NOTICE(== AVPacket and relevant functions defined in libavformat. ==)
1160    AC_DEFINE([AVPACKET_IN_AVFORMAT], [1], [Whether AVPacket is in libavformat.])])
1161
1162   # in case the headers are in a custom directory
1163   SAVE_CPPFLAGS="$CPPFLAGS"
1164   CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
1165
1166   # Possible places the ffmpeg headers may be
1167   AC_CHECK_HEADERS([libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h libavutil/avutil.h libpostproc/postprocess.h libswscale/swscale.h],,
1168   [AC_CHECK_HEADERS([ffmpeg/avcodec.h ffmpeg/avfilter.h ffmpeg/avformat.h ffmpeg/avutil.h postproc/postprocess.h ffmpeg/swscale.h],,
1169   [AC_MSG_ERROR($missing_headers)])])
1170
1171   # optional
1172   AC_CHECK_HEADERS([libavcore/avcore.h libavcore/samplefmt.h libavutil/mem.h libavutil/samplefmt.h])
1173
1174   # old FFmpeg have this in libavcodec/opt.h instead:
1175   AC_CHECK_HEADERS([libavutil/opt.h])
1176
1177   # We'll support the use of rgb2rgb.h if it exists.
1178   AC_CHECK_HEADERS([libswscale/rgb2rgb.h],,)
1179   AC_CHECK_HEADERS([ffmpeg/rgb2rgb.h],,)
1180
1181   # Check if AVFilterBufferRefVideoProps AVRational member is named
1182   # 'pixel_aspect' or 'sample_aspect_ratio'.
1183   AC_CHECK_MEMBER([AVFilterBufferRefVideoProps.sample_aspect_ratio],
1184     [AC_DEFINE([HAVE_AVFILTERBUFFERREFVIDEOPROPS_SAMPLE_ASPECT_RATIO],
1185     [1],
1186     [Define to 1 if AVFilterBufferRefVideoProps has member sample_aspect_ratio.])],
1187       [AC_CHECK_MEMBER([AVFilterBufferRefVideoProps.sample_aspect_ratio],
1188       [AC_DEFINE([HAVE_AVFILTERBUFFERREFVIDEOPROPS_SAMPLE_ASPECT_RATIO],
1189       [1],
1190       [Define to 1 if AVFilterBufferRefVideoProps has member sample_aspect_ratio.])],
1191       ,
1192       [[#include <ffmpeg/avfilter.h>]])],
1193     [[#include <libavfilter/avfilter.h>]])
1194
1195   AC_MSG_NOTICE($external_ffmpeg_enabled)
1196   USE_EXTERNAL_FFMPEG=1
1197   AC_DEFINE([USE_EXTERNAL_FFMPEG], [1], [Whether to use external FFmpeg libraries.])
1198
1199   # Disable vdpau support if external libavcodec doesn't have it
1200   AC_CHECK_LIB([avcodec], [ff_vdpau_vc1_decode_picture],,
1201     [if test "x$use_vdpau" = "xyes"; then
1202       AC_MSG_ERROR($ffmpeg_vdpau_not_supported)
1203     else
1204       use_vdpau=no
1205       AC_MSG_RESULT($ffmpeg_vdpau_not_supported)
1206     fi])
1207
1208   # Check for 'PIX_FMT_VDPAU_MPEG4' from libavutil
1209   if test "x$use_vdpau" != "xno"; then
1210     AC_LANG_PUSH([C++])
1211     AC_LINK_IFELSE(
1212       [AC_LANG_SOURCE([ #include <libavutil/pixfmt.h>
1213         int main() { PixelFormat format = PIX_FMT_VDPAU_MPEG4; }])],
1214       [AC_DEFINE([PIX_FMT_VDPAU_MPEG4_IN_AVUTIL], [1],
1215       [Whether AVUtil defines PIX_FMT_VDPAU_MPEG4.])],)
1216     AC_LANG_POP([C++])
1217   fi
1218   CPPFLAGS="$SAVE_CPPFLAGS"
1219 else
1220   AC_MSG_NOTICE($external_ffmpeg_disabled)
1221   USE_EXTERNAL_FFMPEG=0
1222   AC_DEFINE([PIX_FMT_VDPAU_MPEG4_IN_AVUTIL], [1], [Whether AVUtil defines PIX_FMT_VDPAU_MPEG4.])
1223 fi
1224
1225 # Python
1226 if test -z "$PYTHON_NOVERSIONCHECK"; then
1227   AX_PYTHON_DEVEL([>= 2.4])
1228   PYTHON_VERSION=$ac_python_version
1229 fi
1230
1231 if test -z "$PYTHON_VERSION"; then
1232   AC_MSG_ERROR([Can't find a Python version.])
1233 else
1234   AC_MSG_NOTICE([Using Python $PYTHON_VERSION])
1235 fi
1236
1237 # VDPAU
1238 if test "x$use_vdpau" != "xno"; then
1239   if test "$host_vendor" = "apple" ; then
1240     if test "x$use_vdpau" = "xyes"; then
1241       AC_MSG_ERROR([VDPAU not supported on this platform])
1242     else
1243       use_vdpau="no"
1244       AC_MSG_NOTICE($vdpau_disabled)
1245     fi
1246     USE_VDPAU=0
1247   else
1248     USE_VDPAU=1
1249     AC_CHECK_HEADER([vdpau/vdpau.h],AC_DEFINE([HAVE_LIBVDPAU], [],
1250       [Define to 1 if you have the 'vdpau' library (-lvdpau).]),
1251     [if test "x$use_vdpau" = "xyes"; then
1252       USE_VDPAU=0
1253       AC_MSG_ERROR([$vdpau_not_found])
1254     else
1255       use_vdpau="no"
1256       USE_VDPAU=0
1257       AC_MSG_RESULT($vdpau_not_found)
1258     fi])
1259   fi
1260 else
1261   USE_VDPAU=0
1262   AC_MSG_NOTICE($vdpau_disabled)
1263 fi
1264
1265 # VAAPI
1266 if test "x$use_vaapi" != "xno"; then
1267   if test "$host_vendor" = "apple" ; then
1268     if test "x$use_vaapi" = "xyes"; then
1269       AC_MSG_ERROR([VAAPI not supported on this platform])
1270     else
1271       use_vaapi="no"
1272       AC_MSG_NOTICE($vaapi_disabled)
1273     fi
1274     USE_VAAPI=0
1275   else
1276     initial_val=$use_vaapi
1277     AC_CHECK_LIB([va], main, :, use_vaapi=no)
1278     if test "x$use_vaapi" != "xno"; then
1279       AC_CHECK_LIB([va-glx], main, LIBS="-lva -lva-glx $LIBS", use_vaapi=no, -lva)
1280     fi
1281
1282     if test "x$use_vaapi" = "xno"; then
1283       if test "x$initial_val" = "xyes"; then
1284         AC_MSG_ERROR($vaapi_not_found)
1285       else
1286         AC_MSG_RESULT($vaapi_not_found)
1287       fi
1288       USE_VAAPI=0
1289     else
1290       AC_DEFINE([HAVE_LIBVA], [1], [Define to 1 if you have the 'vaapi' libraries (-lva AND -lva-glx)])
1291       USE_VAAPI=1
1292     fi
1293   fi
1294 else
1295   AC_MSG_NOTICE($vaapi_disabled)
1296   USE_VAAPI=0
1297 fi
1298
1299 # CrystalHD
1300 if test "x$use_crystalhd" != "xno"; then
1301   SAVE_CFLAGS="$CFLAGS"
1302   CFLAGS="-D__LINUX_USER__"
1303   AC_CHECK_HEADER([libcrystalhd/libcrystalhd_if.h], [],
1304     [ if test "x$use_crystalhd" = "xyes"; then
1305         AC_MSG_ERROR($crystalhd_not_found)
1306       else
1307         use_crystalhd=no
1308         AC_MSG_RESULT($crystalhd_not_found)
1309       fi
1310       USE_CRYSTALHD=0
1311     ])
1312     CFLAGS="$SAVE_CFLAGS"
1313     if test "$host_vendor" != "apple"; then
1314       XB_FIND_SONAME([CRYSTALHD], [crystalhd], [use_crystalhd])
1315     fi
1316     if test "x$use_crystalhd" != "xno"; then
1317       SAVE_CFLAGS="$CFLAGS"
1318       CFLAGS="-D__LINUX_USER__ -llibcrystalhd"
1319       # check for new crystalhd lib
1320       AC_COMPILE_IFELSE(
1321         [AC_LANG_SOURCE([#include <libcrystalhd/bc_dts_types.h>
1322           #include <libcrystalhd/bc_dts_defs.h>
1323           PBC_INFO_CRYSTAL bCrystalInfo;])],
1324         [ AC_DEFINE([HAVE_LIBCRYSTALHD], [2], [Define to 2 if you have the 'New Broadcom Crystal HD' library.]) ], 
1325         [ AC_DEFINE([HAVE_LIBCRYSTALHD], [1], [Define to 1 if you have the 'Old Broadcom Crystal HD' library.]) ])
1326       CFLAGS="$SAVE_CFLAGS"
1327       USE_CRYSTALHD=1
1328     fi
1329 else
1330   AC_MSG_NOTICE($crystalhd_disabled)
1331   USE_CRYSTALHD=0
1332 fi
1333
1334 # VDADecoder
1335 if test "x$use_vdadecoder" != "xno"; then
1336   if test "$host_vendor" = "apple" ; then
1337     HAVE_LIBVDADECODER=1
1338     AC_DEFINE([HAVE_LIBVDADECODER], [1], [Define to 1 if you have the 'VDADecoder' library.])
1339     AC_MSG_NOTICE($vdadecoder_enabled)
1340     USE_VDA=1
1341   else
1342     if test "x$use_vdadecoder" = "xyes"; then
1343       AC_MSG_ERROR([VDA Decoder not supported on this platform])
1344     else
1345       use_vdadecoder="no"
1346       AC_MSG_NOTICE($vdadecoder_disabled)
1347     fi
1348     USE_VDA=0
1349   fi
1350 else
1351   AC_MSG_NOTICE($vdadecoder_disabled)
1352 fi
1353
1354 # VTBDecoder
1355 if test "x$use_vtbdecoder" != "xno"; then
1356   if test "$host_vendor" = "apple" ; then
1357     HAVE_VIDEOTOOLBOXDECODER=1
1358     AC_DEFINE([HAVE_VIDEOTOOLBOXDECODER], [1], [Define to 1 if you have the 'VTBDecoder' library.])
1359     AC_MSG_NOTICE($vtbdecoder_enabled)
1360   else
1361     if test "x$use_vtbdecoder" = "xyes"; then
1362       AC_MSG_ERROR([VTB Decoder not supported on this platform])
1363     else
1364       use_vtbdecoder="no"
1365       AC_MSG_NOTICE($vtbdecoder_disabled)
1366     fi
1367   fi
1368 else
1369   AC_MSG_NOTICE($vtbdecoder_disabled)
1370 fi
1371
1372 # OpenMax
1373 if test "$host_vendor" = "apple" ; then
1374   use_openmax="no"
1375   USE_OPENMAX=0
1376   AC_MSG_NOTICE($openmax_disabled)
1377 else
1378   if test "$use_gles" = "yes" && test "$use_openmax" = "auto"; then
1379     PKG_CHECK_MODULES([OPENMAX], [libomxil-bellagio],
1380                       USE_OPENMAX=1;[INCLUDES="$INCLUDES $OPENMAX_CFLAGS"; LIBS="$LIBS $OPENMAX_LIBS"],
1381                       use_openmax=no;USE_OPENMAX=0;AC_MSG_RESULT($openmax_not_found))
1382   elif test "$use_gles" = "yes" && test "$use_openmax" = "yes"; then
1383     PKG_CHECK_MODULES([OPENMAX], [libomxil-bellagio],
1384                       USE_OPENMAX=1;[INCLUDES="$INCLUDES $OPENMAX_CFLAGS"; LIBS="$LIBS $OPENMAX_LIBS"],
1385                       AC_MSG_ERROR($openmax_not_found))
1386   else
1387     AC_MSG_NOTICE($openmax_disabled)
1388     use_openmax=no
1389     USE_OPENMAX=0
1390   fi
1391 fi
1392
1393 # yajl version check (yajl_version.h was added in yajl 2.0)
1394 AC_CHECK_HEADERS([yajl/yajl_version.h], [], [
1395 AC_DEFINE(YAJL_MAJOR, 1, [yajl version 1])
1396 ], [])
1397
1398 # platform specific bin utilities
1399 if test "$host_vendor" != "apple" ; then
1400   AC_CHECK_PROG(HAVE_GAWK,gawk,"yes","no",)
1401   if test "$HAVE_GAWK" = "no" ; then
1402     AC_MSG_ERROR($missing_program)
1403   fi
1404 fi
1405
1406 if test "$use_arch" != "arm" ; then
1407   AC_CHECK_PROG(HAVE_CMAKE,cmake,"yes","no",)
1408   if test "$HAVE_CMAKE" = "no" ; then
1409     AC_MSG_ERROR($missing_program)
1410   fi
1411 fi
1412
1413 AC_CHECK_PROG(HAVE_GPERF,gperf,"yes","no",)
1414 if test "$HAVE_GPERF" = "no" ; then
1415   AC_MSG_ERROR($missing_program)
1416 fi
1417
1418 AC_CHECK_PROG(HAVE_UNZIP,unzip,"yes","no",)
1419 if test "$HAVE_UNZIP" = "no" ; then
1420   AC_MSG_ERROR($missing_program)
1421 fi
1422
1423 AC_CHECK_PROG(HAVE_ZIP,zip,"yes","no",)
1424 if test "$HAVE_ZIP" = "no" ; then
1425   AC_MSG_ERROR($missing_program)
1426 fi
1427
1428 if test "$ARCH" = "i486-linux" || test "$ARCH" = "x86-freebsd"; then
1429   AC_CHECK_PROG(HAVE_NASM,nasm,"yes","no",)
1430   if test "$HAVE_NASM" = "no" ; then
1431     AC_MSG_ERROR($missing_program)
1432   fi
1433 fi
1434
1435 AC_CHECK_PROG(HAVE_GIT,git,"yes","no",)
1436
1437 # Checks for header files.
1438 AC_HEADER_DIRENT
1439 AC_HEADER_STDC
1440 AC_HEADER_SYS_WAIT
1441 AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h limits.h locale.h \
1442   malloc.h memory.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h \
1443   strings.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h \
1444   sys/time.h sys/timeb.h sys/vfs.h termios.h unistd.h utime.h wchar.h wctype.h])
1445 AC_CHECK_HEADERS([cdio/iso9660.h],,AC_MSG_ERROR([$missing_headers]))
1446
1447 # Checks for typedefs, structures, and compiler characteristics.
1448 AC_HEADER_STAT
1449 AC_HEADER_STDBOOL
1450 AC_C_CONST
1451 AC_TYPE_UID_T
1452 AC_C_INLINE
1453 AC_TYPE_INT8_T
1454 AC_TYPE_INT16_T
1455 AC_TYPE_INT32_T
1456 AC_TYPE_INT64_T
1457 AC_TYPE_MODE_T
1458 AC_TYPE_OFF_T
1459 AC_TYPE_PID_T
1460 AC_C_RESTRICT
1461 AC_TYPE_SIZE_T
1462 AC_TYPE_SSIZE_T
1463 AC_CHECK_MEMBERS([struct stat.st_rdev])
1464 AC_HEADER_TIME
1465 AC_STRUCT_TM
1466 AC_TYPE_UINT8_T
1467 AC_TYPE_UINT16_T
1468 AC_TYPE_UINT32_T
1469 AC_TYPE_UINT64_T
1470 AC_C_BIGENDIAN
1471
1472 if test "$cross_compiling" = "yes"; then
1473   final_message="$final_message\n  Crosscomp.:\tYes"
1474 else
1475   final_message="$final_message\n  Crosscomp.:\tNo"
1476 fi
1477
1478 final_message="$final_message\n  target ARCH:\t$use_arch"
1479 final_message="$final_message\n  target CPU:\t$use_cpu"
1480
1481 if test "$use_gles" = "yes"; then
1482   final_message="$final_message\n  OpenGLES:\tYes"
1483   USE_OPENGLES=1
1484   USE_OPENGL=0
1485 else
1486   USE_OPENGLES=0
1487   if test "$use_gl" = "yes"; then
1488     final_message="$final_message\n  OpenGL:\tYes"
1489     USE_OPENGL=1
1490   else
1491     final_message="$final_message\n  OpenGL:\tNo (Very Slow)"
1492     SDL_DEFINES="-DHAS_SDL_2D"
1493     USE_OPENGL=0
1494   fi
1495 fi
1496
1497 if test "$use_alsa" = "yes"; then
1498   USE_ALSA=1
1499   AC_DEFINE([USE_ALSA],[1],["Define to 1 if alsa is installed"])
1500   final_message="$final_message\n  ALSA:\t\tYes"
1501 else
1502   USE_ALSA=0
1503   final_message="$final_message\n  ALSA:\t\tNo"
1504 fi
1505
1506 if test "$use_dbus" = "yes"; then
1507   final_message="$final_message\n  DBUS:\t\tYes"
1508 else
1509   final_message="$final_message\n  DBUS:\t\tNo"
1510 fi
1511
1512 if test "x$use_vdpau" != "xno"; then
1513   final_message="$final_message\n  VDPAU:\tYes"
1514 else
1515   final_message="$final_message\n  VDPAU:\tNo"
1516 fi
1517
1518 if test "x$use_vaapi" != "xno"; then
1519   final_message="$final_message\n  VAAPI:\tYes"
1520 else
1521   final_message="$final_message\n  VAAPI:\tNo"
1522 fi
1523
1524 if test "x$use_crystalhd" != "xno"; then
1525   final_message="$final_message\n  CrystalHD:\tYes"
1526 else
1527   final_message="$final_message\n  CrystalHD:\tNo"
1528 fi
1529
1530 if test "x$use_vdadecoder" != "xno"; then
1531   final_message="$final_message\n  VDADecoder:\tYes"
1532 else
1533   final_message="$final_message\n  VDADecoder:\tNo"
1534 fi
1535
1536 if test "x$use_vtbdecoder" != "xno"; then
1537   final_message="$final_message\n  VTBDecoder:\tYes"
1538 else
1539   final_message="$final_message\n  VTBDecoder:\tNo"
1540 fi
1541
1542 if test "$use_openmax" != "no"; then
1543   final_message="$final_message\n  OpenMax:\tYes"
1544 else
1545   final_message="$final_message\n  OpenMax:\tNo"
1546 fi
1547
1548 if test "$use_joystick" = "yes"; then
1549   final_message="$final_message\n  Joystick:\tYes"
1550   SDL_DEFINES="$SDL_DEFINES -DHAS_SDL_JOYSTICK"
1551 else
1552   final_message="$final_message\n  Joystick:\tNo"
1553 fi
1554
1555 if test "$use_xrandr" = "yes"; then
1556   final_message="$final_message\n  XRandR:\tYes"
1557   USE_XRANDR=1
1558 else
1559   final_message="$final_message\n  XRandR:\tNo"
1560   USE_XRANDR=0
1561 fi
1562
1563 if test "$use_goom" = "yes"; then
1564   final_message="$final_message\n  GOOM:\t\tYes"
1565 else
1566   final_message="$final_message\n  GOOM:\t\tNo"
1567 fi
1568
1569 if test "$use_rsxs" = "yes"; then
1570   final_message="$final_message\n  RSXS:\t\tYes"
1571 else
1572   final_message="$final_message\n  RSXS:\t\tNo"
1573 fi
1574
1575 if test "$use_projectm" = "yes"; then
1576   final_message="$final_message\n  ProjectM:\tYes"
1577 else
1578   final_message="$final_message\n  ProjectM:\tNo"
1579 fi
1580
1581 if test "$use_x11" = "yes"; then
1582   final_message="$final_message\n  X11:\t\tYes"
1583 else
1584   final_message="$final_message\n  X11:\t\tNo"
1585 fi
1586
1587 if test "$use_libbluray" = "yes"; then
1588   final_message="$final_message\n  Bluray:\tYes"
1589 else
1590   final_message="$final_message\n  Bluray:\tNo"
1591 fi
1592
1593 USE_TEXTUREPACKER_NATIVE=0
1594 if test "x$use_texturepacker" != "xno"; then
1595   final_message="$final_message\n  TexturePacker:Yes"
1596   USE_TEXTUREPACKER=1
1597   if test "x$use_texturepacker_native" = "xyes"; then
1598     USE_TEXTUREPACKER_NATIVE=1
1599     if [[ ! -d "$USE_TEXTUREPACKER_NATIVE_ROOT" ]]; then 
1600       USE_TEXTUREPACKER_NATIVE_ROOT= 
1601     fi
1602   fi
1603 else
1604   final_message="$final_message\n  TexturePacker:No"
1605   USE_TEXTUREPACKER=0
1606 fi
1607
1608 if test "$use_mid" = "yes"; then
1609   final_message="$final_message\n  MID Support:\tYes"
1610   SDL_DEFINES="$SDL_DEFINES -DMID"
1611 else
1612   final_message="$final_message\n  MID Support:\tNo"
1613 fi
1614
1615 ORIGCC=$CC
1616 ORIGCXX=$CXX
1617 if test "x$use_ccache" != "xno"; then
1618   AC_PATH_PROG(CCACHE,ccache,none)
1619   if test "$ac_cv_path_CCACHE" = "none"; then
1620     if test "x$use_ccache" = "xyes"; then
1621       AC_MSG_ERROR([ccache not found.]);
1622     else
1623       AC_MSG_NOTICE([ccache not found. Falling back to default CC])
1624       final_message="$final_message\n  ccache:\tNo"
1625     fi
1626   else
1627     CC="$ac_cv_path_CCACHE $CC"
1628     CXX="$ac_cv_path_CCACHE $CXX"
1629     AC_MSG_NOTICE(enabling ccache)
1630     final_message="$final_message\n  ccache:\tYes"
1631   fi
1632 else
1633   final_message="$final_message\n  ccache:\tNo"
1634 fi
1635
1636 if test "x$use_pulse" != "xno"; then
1637   XBMC_STANDALONE_SH_PULSE=tools/Linux/xbmc-standalone.sh.pulse
1638   final_message="$final_message\n  PulseAudio:\tYes"
1639 else
1640   XBMC_STANDALONE_SH_PULSE=/dev/null
1641   final_message="$final_message\n  PulseAudio:\tNo"
1642 fi
1643
1644 if test "$use_hal" = "yes"; then
1645   final_message="$final_message\n  HAL Support:\tYes"
1646 else
1647   final_message="$final_message\n  HAL Support:\tNo"
1648 fi
1649
1650 # DVDCSS
1651 if test "$use_dvdcss" = "yes"; then
1652   AC_MSG_NOTICE($dvdcss_enabled)
1653   final_message="$final_message\n  DVDCSS:\tYes"
1654   BUILD_DVDCSS=1
1655   SKIP_CONFIG_DVDCSS=0
1656   DVDREAD_CFLAGS="-D_XBMC -DHAVE_DVDCSS_DVDCSS_H"
1657 else
1658   AC_MSG_NOTICE($dvdcss_disabled)
1659   final_message="$final_message\n  DVDCSS:\tNo"
1660   BUILD_DVDCSS=0
1661   SKIP_CONFIG_DVDCSS=1
1662   DVDREAD_CFLAGS="-D_XBMC -UHAVE_DVDCSS_DVDCSS_H"
1663 fi
1664 if test "$host_vendor" = "apple"; then
1665  DVDREAD_CFLAGS="$DVDREAD_CFLAGS -D__DARWIN__"
1666 fi
1667
1668 if test "$use_avahi" = "yes"; then
1669   final_message="$final_message\n  Avahi:\tYes"
1670 else
1671   final_message="$final_message\n  Avahi:\tNo"
1672 fi
1673
1674 if test "$HAVE_GIT" = "yes"; then
1675   GIT_REV=$(git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}')
1676 fi
1677 if test "$GIT_REV" = ""; then
1678   GIT_REV="Unknown"
1679 fi
1680 if test "$host_vendor" = "apple"; then
1681   echo "#define GIT_REV \"$GIT_REV\"" > git_revision.h
1682 else
1683   SDL_DEFINES="$SDL_DEFINES -D'GIT_REV=\"$GIT_REV\"'"
1684 fi
1685
1686 if test "$use_nonfree" = "yes"; then
1687   final_message="$final_message\n  Non-free:\tYes"
1688   HAVE_XBMC_NONFREE=1
1689   AC_DEFINE([HAVE_XBMC_NONFREE], [1], [Define to 1 to enable non-free components.])
1690 else
1691   HAVE_XBMC_NONFREE=0
1692   final_message="$final_message\n  Non-free:\tNo"
1693 fi
1694
1695 if test "$use_asap" = "yes"; then
1696   AC_CHECK_PROG(HAVE_GDC,gdc,"yes","no")
1697   if test "$HAVE_GDC" = "no"; then
1698     AC_MSG_ERROR($missing_program);
1699   fi
1700   AC_CHECK_PROG(HAVE_FPC,fpc,"yes","no")
1701   if test "$HAVE_FPC" = "no"; then
1702     AC_MSG_ERROR($missing_program);
1703   fi
1704   USE_ASAP_CODEC=1
1705   AC_DEFINE([USE_ASAP_CODEC], [1], [Define to 1 to enable ASAP codec.])
1706   final_message="$final_message\n  ASAP Codec:\tYes"
1707 else
1708   USE_ASAP_CODEC=0
1709   final_message="$final_message\n  ASAP Codec:\tNo"
1710 fi
1711
1712 if test "$use_webserver" = "yes"; then
1713   final_message="$final_message\n  Webserver:\tYes"
1714 else
1715   final_message="$final_message\n  Webserver:\tNo"
1716 fi
1717
1718 if test "$use_librtmp" != "no"; then
1719   final_message="$final_message\n  libRTMP support:\tYes"
1720 else
1721   final_message="$final_message\n  libRTMP support:\tNo"
1722 fi
1723
1724 if test "x$use_samba" != "xno"; then
1725   final_message="$final_message\n  libsmbclient support:\tYes"
1726 else
1727   final_message="$final_message\n  libsmbclient support:\tNo"
1728 fi
1729
1730 if test "$use_libnfs" != "no"; then
1731   final_message="$final_message\n  libnfs support:\tYes"
1732 else
1733   final_message="$final_message\n  libnfs support:\tNo"
1734 fi
1735
1736 if test "x$use_libafpclient" != "xno"; then
1737   final_message="$final_message\n  libafpclient support:\tYes"
1738 else  
1739   final_message="$final_message\n  libafpclient support:\tNo"
1740 fi
1741
1742 if test "$use_airplay" != "no"; then
1743   final_message="$final_message\n  AirPlay support:\tYes"
1744 else
1745   final_message="$final_message\n  AirPLay support:\tNo"
1746 fi
1747
1748 if test "x$use_airtunes" != "xno"; then
1749   final_message="$final_message\n  AirTunes support:\tYes"  
1750 else
1751   final_message="$final_message\n  AirTunes support:\tNo"
1752 fi
1753
1754 if test "$use_optical_drive" = "yes"; then
1755   final_message="$final_message\n  Optical drive:\tYes"
1756 else
1757   final_message="$final_message\n  Optical drive:\tNo"
1758 fi
1759
1760 ### External libraries messages
1761 if test "$use_external_ffmpeg" = "yes"; then
1762   final_message="$final_message\n  External FFmpeg:\tYes"
1763 else
1764   final_message="$final_message\n  External FFmpeg:\tNo"
1765 fi
1766
1767 OUTPUT_FILES="Makefile \
1768     Makefile.include \
1769     addons/skin.confluence/media/Makefile \
1770     xbmc/Makefile \
1771     xbmc/cdrip/Makefile \
1772     xbmc/cores/Makefile \
1773     xbmc/cores/VideoRenderers/Makefile \
1774     xbmc/cores/dvdplayer/Makefile \
1775     lib/Makefile \
1776     lib/libdvd/Makefile \
1777     xbmc/cores/DllLoader/Makefile \
1778     xbmc/cores/dvdplayer/DVDCodecs/Makefile \
1779     xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile \
1780     xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile \
1781     xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile \
1782     xbmc/cores/dvdplayer/DVDDemuxers/Makefile \
1783     xbmc/cores/dvdplayer/DVDSubtitles/Makefile \
1784     xbmc/cores/AudioRenderers/Makefile \
1785     xbmc/cores/paplayer/Makefile \
1786     lib/timidity/Makefile \
1787     lib/xbadpcm/Makefile \
1788     lib/asap/Makefile \
1789     lib/nosefart/Makefile \
1790     lib/libsidplay2/Makefile \
1791     lib/vgmstream/Makefile \
1792     lib/snesapu/SNES/SNESAPU/Makefile \
1793     lib/stsound/StSoundLibrary/Makefile \
1794     xbmc/cores/playercorefactory/Makefile \
1795     xbmc/music/karaoke/Makefile \
1796     xbmc/osx/Makefile \
1797     xbmc/guilib/Makefile \
1798     xbmc/interfaces/Makefile \
1799     xbmc/network/Makefile \
1800     lib/libRTV/Makefile \
1801     lib/libexif/Makefile \
1802     lib/libXDAAP/Makefile \
1803     lib/cmyth/Makefile \
1804     lib/libhdhomerun/Makefile \
1805     lib/libsquish/Makefile \
1806     lib/libid3tag/Makefile \
1807     lib/cximage-6.0/Makefile \
1808     lib/addons/script.module.pil/Makefile \
1809     xbmc/interfaces/python/Makefile \
1810     xbmc/interfaces/python/xbmcmodule/Makefile \
1811     lib/libUPnP/Makefile \
1812     xbmc/DllPaths_generated.h \
1813     xbmc/linux/Makefile \
1814     xbmc/filesystem/Makefile \
1815     xbmc/screensavers/rsxs-0.9/xbmc/Makefile \
1816     xbmc/visualizations/XBMCProjectM/Makefile \
1817     xbmc/visualizations/Goom/Makefile \
1818     xbmc/visualizations/OpenGLSpectrum/Makefile \
1819     xbmc/visualizations/WaveForm/Makefile \
1820     xbmc/visualizations/iTunes/Makefile \
1821     tools/Linux/xbmc.sh \
1822     tools/Linux/xbmc-standalone.sh \
1823     tools/TexturePacker/Makefile \
1824     tools/EventClients/Clients/OSXRemote/Makefile \
1825     xbmc/peripherals/bus/Makefile \
1826     xbmc/peripherals/devices/Makefile"
1827
1828 # Line below is used so we can use AM_INIT_AUTOMAKE. The corresponding
1829 # .dummy.am does nothing.
1830 AC_CONFIG_FILES([.dummy])
1831
1832 AC_CONFIG_FILES([${OUTPUT_FILES}])
1833 OUTPUT_FILES="$OUTPUT_FILES \
1834   .dummy"
1835 AC_SUBST(CFLAGS)
1836 AC_SUBST(CXXFLAGS)
1837 AC_SUBST(INCLUDES)
1838 AC_SUBST(LDFLAGS)
1839 AC_SUBST(SDL_DEFINES)
1840 AC_SUBST(BUILD_DVDCSS)
1841 AC_SUBST(DISABLE_GOOM)
1842 AC_SUBST(DISABLE_RSXS)
1843 AC_SUBST(DISABLE_PROJECTM)
1844 AC_SUBST(USE_EXTERNAL_FFMPEG)
1845 AC_SUBST(PYTHON_VERSION)
1846 AC_SUBST(OUTPUT_FILES)
1847 AC_SUBST(HAVE_XBMC_NONFREE)
1848 AC_SUBST(USE_ASAP_CODEC)
1849 AC_SUBST(LIBCURL_BASENAME)
1850 AC_SUBST(LIBFLAC_BASENAME)
1851 AC_SUBST(LIBVORBISFILE_BASENAME)
1852 AC_SUBST(LIBMODPLUG_BASENAME)
1853 AC_SUBST(LIBMAD_BASENAME)
1854 AC_SUBST(LIBOGG_BASENAME)
1855 AC_SUBST(LIBVORBISENC_BASENAME)
1856 AC_SUBST(LIBVORBIS_BASENAME)
1857 AC_SUBST(LIBASS_BASENAME)
1858 AC_SUBST(LIBMEPG2_BASENAME)
1859 AC_SUBST_FILE(XBMC_STANDALONE_SH_PULSE)
1860 AC_SUBST(USE_OPENGL)
1861 AC_SUBST(USE_OPENGLES)
1862 AC_SUBST(USE_VDPAU)
1863 AC_SUBST(USE_VAAPI)
1864 AC_SUBST(USE_CRYSTALHD)
1865 AC_SUBST(USE_LIBSMBCLIENT)
1866 AC_SUBST(USE_LIBNFS)
1867 AC_SUBST(USE_LIBAFPCLIENT)
1868 AC_SUBST(USE_AIRPLAY)
1869 AC_SUBST(USE_VDA)
1870 AC_SUBST(USE_OPENMAX)
1871 AC_SUBST(USE_PULSE)
1872 AC_SUBST(USE_XRANDR)
1873 AC_SUBST(USE_ALSA)
1874 AC_SUBST(USE_TEXTUREPACKER)
1875 AC_SUBST(USE_TEXTUREPACKER_NATIVE)
1876 AC_SUBST(USE_TEXTUREPACKER_NATIVE_ROOT)
1877 AC_SUBST(USE_AIRTUNES)
1878 AC_SUBST(USE_LIBUDEV)
1879 AC_SUBST(USE_LIBUSB)
1880 AC_SUBST(USE_LIBCEC)
1881
1882 # pushd and popd are not available in other shells besides bash, so implement
1883 # our own pushd/popd functions
1884 XB_DIRSTACK="$PWD"
1885 xb_pushd()
1886 {
1887   local dirname="$1"
1888   if [[ -d "$dirname" ]] && [[ -x "$dirname" ]]; then
1889     cd "$dirname"
1890     XB_DIRSTACK="$dirname ${XB_DIRSTACK:-$PWD}"
1891     return 0
1892   else
1893     AC_MSG_ERROR(xb_pushd: unable to change to $dirname)
1894   fi
1895 }
1896 xb_popd()
1897 {
1898   if [[ -n "$XB_DIRSTACK" ]]; then
1899     XB_DIRSTACK="${XB_DIRSTACK#* }"
1900     cd "${XB_DIRSTACK%% *}"
1901     return 0
1902   else
1903     AC_MSG_ERROR(xb_popd: unable to go back to previous directory)
1904   fi
1905 }
1906
1907 # Function to run the configure scripts in our submodules
1908 # Consists of three paramaters, the path to the submodule, the configure command
1909 # with appropriate arguments, and a third parameter set to 1 if we are to skip
1910 # running the script, anything else if not.
1911 AC_DEFUN([XB_CONFIG_MODULE],[
1912 AC_CONFIG_COMMANDS_POST([
1913 if [[ $3 != "1" ]]; then
1914     if [[ -d $1 ]]; then
1915       xb_pushd $1
1916       $2
1917       if [[ $? -ne 0 ]]; then
1918         xb_popd
1919         AC_MSG_ERROR([[Submodule $1 failed to configure]])
1920       else
1921         xb_popd
1922       fi
1923     else
1924       AC_MSG_ERROR([[Submodule $1 does not exist]])
1925     fi
1926 else
1927     AC_MSG_NOTICE([[Skipping configuration of submodule $1.]])
1928 fi
1929 ])
1930 ])
1931
1932 XB_CONFIG_MODULE([lib/ffmpeg], [
1933   if test "$host_vendor" = "apple" ; then
1934     ./configure \
1935       --extra-cflags="$CFLAGS $FFMPEG_EXTRACFLAGS -w -D_DARWIN_C_SOURCE -Dattribute_deprecated=" \
1936       `if test "$use_arch" != "no"; then echo --enable-cross-compile; fi` \
1937       `if test "$use_arch" != "no"; then echo --arch=$use_arch; fi`\
1938       `if test "$use_cpu" != "no"; then echo --cpu=$use_cpu; fi`\
1939       --target-os=$(tolower $(uname -s)) \
1940       --disable-amd3dnow \
1941       --disable-armv5te \
1942       --disable-armv6t2 \
1943       `if test "$use_arch" != "yes"; then echo --enable-neon; fi`\
1944       --disable-static \
1945       `if test "$use_debug" = "no"; then echo --disable-debug; fi` \
1946       --disable-muxers \
1947       --enable-muxer=spdif \
1948       --enable-muxer=adts \
1949       --disable-encoders \
1950       --enable-encoder=ac3 \
1951       --enable-encoder=aac \
1952       `if test "$use_ffmpeg_libvorbis" = "yes"; then echo --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis; else echo --disable-libvorbis; fi` \
1953       --disable-devices \
1954       --disable-ffprobe \
1955       --disable-ffplay \
1956       --disable-ffserver \
1957       --disable-ffmpeg \
1958       --enable-shared \
1959       --disable-doc \
1960       --disable-decoder=mpeg_xvmc \
1961       --enable-postproc \
1962       --enable-gpl \
1963       --enable-protocol=http \
1964       --enable-pthreads \
1965       --enable-runtime-cpudetect \
1966       --cc="$CC" &&
1967     sed -i "" -e "s#YASM=yasm#YASM=${prefix}/bin/yasm#" config.mak &&
1968     sed -i "" -e "s#YASMDEP=yasm#YASMDEP=${prefix}/bin/yasm#" config.mak &&
1969     sed -i "" -e "s# -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 # #" config.mak
1970     if test "$use_arch" = "ppc"; then
1971       sed -i "" -e "s/HAVE_GNU_AS 1/HAVE_GNU_AS 0/" config.h
1972       sed -i "" -e "s/^HAVE_GNU_AS=yes/!HAVE_GNU_AS=yes/" config.mak
1973     fi
1974   else
1975     CFLAGS="" \
1976     LDFLAGS="$(echo "$LDFLAGS" | sed "s/-Wl,-Bsymbolic-functions//g")" \
1977     ./configure \
1978       --extra-cflags="$PASSED_CFLAGS $FFMPEG_EXTRACFLAGS" \
1979       --disable-static \
1980       `if test "$use_debug" = "no"; then echo --disable-debug; fi` \
1981       `if test "$cross_compiling" = "yes"; then echo --enable-cross-compile; fi` \
1982       `if test "$use_arch" != "no"; then echo --arch=$use_arch; fi`\
1983       `if test "$use_cpu" != "no"; then echo --cpu=$use_cpu; fi`\
1984       --target-os=$(tolower $(uname -s)) \
1985       --disable-muxers \
1986       --enable-muxer=spdif \
1987       --enable-muxer=adts \
1988       --disable-encoders \
1989       --enable-encoder=ac3 \
1990       --enable-encoder=aac \
1991       `if test "$use_ffmpeg_libvorbis" = "yes"; then echo --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis; else echo --disable-libvorbis; fi` \
1992       --disable-decoder=mpeg_xvmc \
1993       --disable-devices \
1994       --disable-ffprobe \
1995       --disable-ffplay \
1996       --disable-ffserver \
1997       --disable-ffmpeg \
1998       --enable-shared \
1999       --disable-doc \
2000       --enable-postproc \
2001       --enable-gpl \
2002       `if test "x$use_vdpau" != "xno"; then echo --enable-vdpau; else echo --disable-vdpau; fi` \
2003       `if test "x$use_vaapi" != "xno"; then echo --enable-vaapi; else echo --disable-vaapi; fi` \
2004       --enable-protocol=http \
2005       --enable-pthreads \
2006       --enable-runtime-cpudetect \
2007       --custom-libname-with-major="\$(FULLNAME)-\$(LIBMAJOR)-${ARCH}\$(SLIBSUF)" \
2008       `case $host_cpu in i?86*) echo --disable-pic ;; *) echo --enable-pic ;; esac` \
2009       --cc="$CC" &&
2010       sed -i -e "s#define HAVE_SYMVER 1#define HAVE_SYMVER 0#" config.h &&
2011       sed -i -e "s#define HAVE_SYMVER_GNU_ASM 1#define HAVE_SYMVER_GNU_ASM 0#" config.h
2012   fi
2013 ], [$USE_EXTERNAL_FFMPEG])
2014
2015 XB_CONFIG_MODULE([lib/libdvd/libdvdcss], [
2016   ./configure \
2017     CC="$CC" \
2018     CXX="$CXX" \
2019     CFLAGS="$CFLAGS" \
2020     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2021     --host=$host_alias \
2022     --build=$build_alias \
2023     --target=$target_alias \      
2024     --disable-doc \
2025     --enable-static \
2026     --with-pic
2027 ], [$SKIP_CONFIG_DVDCSS])
2028
2029 XB_CONFIG_MODULE([lib/libdvd/libdvdread], [
2030   ./configure2 \
2031     --extra-cflags="$CFLAGS $DVDREAD_CFLAGS -I`pwd`/../libdvdcss/src" \
2032     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2033     --host=$host_alias \
2034     --build=$build_alias \
2035     --target=$target_alias \      
2036     --enable-static \
2037     --disable-shared \
2038     --disable-strip \
2039     --disable-opts \
2040     --cc="$CC" &&
2041   $MAKE dvdread-config &&
2042   mkdir -p `pwd`/../includes/dvdread
2043   cp `pwd`/../libdvdread/src/*.h `pwd`/../includes/dvdread
2044 ], [0])
2045
2046 XB_CONFIG_MODULE([lib/libdvd/libdvdnav], [
2047   ./configure2 \
2048     --extra-cflags="$CFLAGS $DVDREAD_CFLAGS -I`pwd`/../includes" \
2049     --extra-ldflags="-L`pwd`/../libdvdread/obj" \
2050     --with-dvdread-config="`pwd`/../libdvdread/obj/dvdread-config" \
2051     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2052     --host=$host_alias \
2053     --build=$build_alias \
2054     --target=$target_alias \      
2055     --enable-static \
2056     --disable-shared \
2057     --cc="$CC"
2058 ], [0])
2059
2060 XB_CONFIG_MODULE([lib/libid3tag/libid3tag],[
2061   ./configure \
2062     CC="$CC" \
2063     CXX="$CXX" \
2064     CFLAGS="$CFLAGS" \ 
2065     CXXFLAGS="$CXXFLAGS" \
2066     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2067     --host=$host_alias \
2068     --build=$build_alias \
2069     --target=$target_alias \      
2070     --disable-static \
2071     --with-pic
2072 ], [0])
2073
2074 XB_CONFIG_MODULE([xbmc/visualizations/XBMCProjectM/libprojectM],[
2075   set -x
2076   rm -f CMakeCache.txt && CC="$ORIGCC" CXX="$ORIGCXX" cmake    \
2077     -DCMAKE_BUILD_TYPE=None -DUSE_FTGL:BOOL=OFF        \
2078     -DCMAKE_C_FLAGS:STRING="${CPPFLAGS} ${CFLAGS}"     \
2079     -DCMAKE_CXX_FLAGS:STRING="${CPPFLAGS} ${CXXFLAGS}" \
2080     -DCMAKE_INSTALL_PREFIX="${prefix}"                 \
2081     -DCMAKE_INSTALL_LIBDIR:PATH="${libdir}"            \
2082     -DINCLUDE_INSTALL_DIR:PATH="${includedir}"         \
2083     -DLIB_INSTALL_DIR:PATH="${libdir}"                 \
2084     -DSYSCONF_INSTALL_DIR:PATH="${sysconfdir}"         \
2085     -DSHARE_INSTALL_PREFIX:PATH="${datadir}" . &&
2086   if test "$host_vendor" = "apple" ; then
2087     # cmake has hardcoded paths to macports which bork our darwin depends cross/ppc, remove them
2088     sed -i "" -e "s|-L/opt/local/lib| |" CMakeFiles/projectM.dir/link.txt
2089     sed -i "" -e "s|-L/opt/local/lib| |" CMakeFiles/projectM.dir/flags.make
2090     sed -i "" -e "s|-I/opt/local/include| |" CMakeFiles/projectM.dir/flags.make
2091   fi
2092   set +x
2093 ], [$DISABLE_PROJECTM])
2094
2095 XB_CONFIG_MODULE([xbmc/visualizations/Goom/goom2k4-0],[
2096   ./configure  \
2097     CFLAGS="$CFLAGS" \ 
2098     CXXFLAGS="$CXXFLAGS" \
2099     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2100     --host=$host_alias \
2101     --build=$build_alias \
2102     --target=$target_alias \      
2103     --disable-shared \
2104     --enable-static \
2105     --with-pic
2106 ], [$DISABLE_GOOM])
2107
2108 XB_CONFIG_MODULE([xbmc/screensavers/rsxs-0.9/], [
2109   ./configure \
2110     CC="$CC" \
2111     CXX="$CXX" \
2112     CFLAGS="$CFLAGS" \ 
2113     CXXFLAGS="$CXXFLAGS" \
2114     `if test "$host_vendor" = "apple"; then echo --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib; fi` \
2115     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2116     --host=$host_alias \
2117     --build=$build_alias \
2118     --target=$target_alias \      
2119     --without-xscreensaver \
2120     --disable-sound \
2121     --disable-cyclone \
2122     --disable-fieldlines \
2123     --disable-flocks \
2124     --disable-flux \
2125     --disable-helios \
2126     --disable-hyperspace \
2127     --disable-lattice \
2128     --disable-skyrocket
2129 ], [$DISABLE_RSXS])
2130
2131 XB_CONFIG_MODULE([lib/libapetag], [
2132   ./configure \
2133     `if test "$host_vendor" = "apple"; then echo --disable-shared; fi` \
2134     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2135     --host=$host_alias \
2136     --build=$build_alias \
2137     --target=$target_alias CFLAGS="$CFLAGS" CC="$CC" CXX="$CXX"
2138 ], [0])
2139
2140 XB_CONFIG_MODULE([lib/cpluff], [
2141   ./configure --disable-nls \
2142     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2143     --host=$host_alias \
2144     --build=$build_alias \
2145     --target=$target_alias CFLAGS="$CFLAGS" CC="$CC" CXX="$CXX"
2146     #LDFLAGS="$LDFLAGS -Wl,-read_only_relocs,suppress"    
2147 ], [0])
2148
2149 AC_OUTPUT
2150
2151 final_message="$final_message\n  prefix:\t$prefix\n$dashes"
2152 echo -e "$final_message\n"