2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([xbmc], [11.9.7], [http://trac.xbmc.org])
6 AC_CONFIG_HEADERS([xbmc/config.h])
8 m4_include([m4/ax_python_devel.m4])
10 AC_CONFIG_AUX_DIR([build-aux])
11 AM_INIT_AUTOMAKE([foreign])
15 echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
18 # check for enabling additional players
19 AC_DEFUN([XB_ADD_PLAYER],
21 AC_MSG_CHECKING([for $2])
25 AC_DEFINE([HAS_$1], 1, [using $2])
26 AC_MSG_RESULT([enabling $2])
29 AC_MSG_RESULT([$2 is not enabled])
33 # check for library basenames
34 AC_DEFUN([XB_FIND_SONAME],
36 if echo "$host" | grep -q freebsd ; then
37 AC_MSG_CHECKING([for lib$2 soname])
38 $1_SONAME=[`ldconfig -r | sed -n "s;.* \(/.*lib$2\.so.*\)$;\1;p" | head -n 1`]
39 if test x$$1_SONAME != x ; then
40 $1_SONAME=[`basename $$1_SONAME`]
42 elif [[ "$host_vendor" != "apple" ]]; then
43 AC_MSG_CHECKING([for lib$2 soname])
44 $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS -l$2 -Wl,-M 2>/dev/null | grep "^LOAD.*$2" | awk '{V=2; print $V}')
45 if [[ -z $$1_FILENAME ]]; then
46 #try gold linker syntax
47 $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS -l$2 -Wl,-t 3>&1 1>&2 2>&3 | grep "$2")
49 if [[ ! -z $$1_FILENAME ]]; then
50 $1_SONAME=$($OBJDUMP -p $$1_FILENAME | grep "SONAME.*$2" | awk '{V=2; print $V}')
53 AC_MSG_CHECKING([for lib$2 dylib])
54 gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
55 env_lib_path=[`echo $LDFLAGS | sed 's/-L[ ]*//g'`]
56 if test "$cross_compiling" = yes; then
59 host_lib_path="/usr/lib /usr/local/lib"
61 for path in $gcc_lib_path $env_lib_path $host_lib_path; do
62 lib=[`ls -- $path/lib$2.dylib 2>/dev/null`]
63 if test x$lib != x; then
64 # we want the path/name that is embedded in the dylib
65 $1_SONAME=[`otool -L $lib | grep -v lib$2.dylib | grep lib$2 | awk '{V=1; print $V}'`]
66 $1_SONAME=[`basename $$1_SONAME`]
70 if [[ -z "$$1_SONAME" ]]; then
72 if test -z "$3" || test "x${$3}" = "xyes"; then
73 AC_MSG_ERROR([Unable to determine soname of lib$2 library])
75 AC_MSG_WARN([Unable to determine soname of lib$2 library])
77 AC_MSG_WARN([lib$2 support disabled])
80 AC_MSG_RESULT([$$1_SONAME])
85 # Function to push and pop libs and includes for a command
86 AC_DEFUN([XB_PUSH_FLAGS], [
88 SAVE_INCLUDES="$INCLUDES"
93 INCLUDES="$SAVE_INCLUDES"
96 # General message strings
97 configure_debug="ERROR: this is a configure debug statement"
98 missing_library="Could not find a required library. Please see the README for your platform."
99 missing_headers="Could not find some required headers. Please see the README for your platform."
100 missing_program="Could not find a required program. Please see the README for your platform."
101 xrandr_not_found="== Could not find libXRandR. SDL will be used for resolution support. =="
102 xrandr_disabled="== XRandR support disabled. SDL will be used for resolution support. =="
103 goom_enabled="== GOOM enabled. =="
104 goom_disabled="== GOOM disabled. =="
105 alsa_disabled="== ALSA support disabled. =="
106 rsxs_enabled="== RSXS enabled. =="
107 rsxs_disabled="== RSXS disabled. =="
108 projectm_enabled="== ProjectM enabled. =="
109 projectm_disabled="== ProjectM disabled. =="
110 x11_enabled="== X11 enabled. =="
111 x11_disabled="== X11 disabled. =="
112 pulse_not_found="== Could not find libpulse. PulseAudio support disabled. =="
113 pulse_disabled="== PulseAudio support manually disabled. =="
114 dvdcss_enabled="== DVDCSS support enabled. =="
115 dvdcss_disabled="== DVDCSS support disabled. =="
116 hal_not_found="== Could not find hal. HAL support disabled. =="
117 halstorage_not_found="== Could not find hal-storage. HAL support disabled. =="
118 hal_disabled="== HAL support disabled. =="
119 avahi_not_found="== Could not find libavahi-common or libavahi-client. Avahi support disabled. =="
120 avahi_disabled="== Avahi support disabled. =="
121 vdpau_not_found="== Could not find libvdpau. VDPAU support disabled. =="
122 vdpau_disabled="== VDPAU support manually disabled. =="
123 vaapi_not_found="== Could not find libva. VAAPI support disabled. =="
124 vaapi_disabled="== VAAPI support manually disabled. =="
125 crystalhd_not_found="== Could not find libcrystalhd. CrystalHD support disabled. =="
126 crystalhd_disabled="== CrystalHD support manually disabled. =="
127 vdadecoder_enabled="== VDADecoder support enabled. =="
128 vdadecoder_disabled="== VDADecoder support manually disabled. =="
129 vtbdecoder_enabled="== VTBDecoder support enabled. =="
130 vtbdecoder_disabled="== VTBDecoder support manually disabled. =="
131 openmax_disabled="== OpenMax support manually disabled. =="
132 openmax_not_found="== Could not find libnvomx. OpenMax support disabled. =="
133 ssh_not_found="== Could not find libssh. SSH FTP VFS support disabled. =="
134 librtmp_not_found="== Could not find libRTMP. RTMP support disabled. =="
135 librtmp_disabled="== RTMP support disabled. =="
136 libnfs_not_found="== Could not find libnfs. NFS client support disabled. =="
137 libnfs_disabled="== NFS support disabled. =="
138 libafpclient_not_found="== Could not find libafpclient. AFP client support disabled. =="
139 libafpclient_disabled="== AFP support disabled. =="
140 libshairport_not_found="== Could not find libshairport. AirTunes support disabled. =="
141 libshairport_disabled="== AirTunes support disabled. =="
142 samba_disabled="== SAMBA support disabled. =="
143 libplist_not_found="== Could not find libplist. AirPlay support disabled. =="
144 libplist_disabled="== AirPlay support disabled. =="
145 alsa_not_found="== Could not find ALSA. ALSA support disabled. =="
146 dbus_not_found="== Could not find DBUS. DBUS support disabled. =="
147 libcap_disabled="== Capabilities detection support disabled. =="
148 libcap_not_found="== Could not find libcap. Capabilities detection support disabled. =="
149 gtest_enabled="== Google Test Framework will be configured. =="
150 gtest_disabled="== Google Test Framework will not be configured. =="
152 libudev_not_found="== Could not find libudev. Will use polling to check for device changes. =="
153 libudev_disabled="== udev support disabled. Will use polling to check for device changes. =="
154 libusb_not_found="== Could not find libusb. Plug and play USB device support will not be available. =="
155 libusb_disabled="== libusb disabled. Plug and play USB device support will not be available. =="
156 libusb_disabled_udev_found="== libusb disabled. =="
157 libcec_enabled="== libcec enabled. =="
158 libcec_disabled="== libcec disabled. CEC adapter support will not be available. =="
159 libcec_disabled_missing_libs="== libcec disabled because it either needs libudev, or libusb a compatible version of the RPi API. CEC adapter support will not be available. =="
160 cec_rpi_api_missing="== no compatible RPi API found =="
162 # External library message strings
163 external_libraries_enabled="== Use of all supported external libraries enabled. =="
164 external_libraries_disabled="== Use of all supported external libraries disabled. =="
165 external_ffmpeg_enabled="== Use of external ffmpeg enabled. =="
166 external_ffmpeg_disabled="== Use of external ffmpeg disabled. =="
167 ffmpeg_vdpau_not_supported="== External ffmpeg doesn't support VDPAU. VDPAU support disabled. =="
168 dashes="------------------------"
169 final_message="\n XBMC Configuration:"
170 final_message="\n$dashes$final_message\n$dashes"
172 AC_ARG_ENABLE([shared-lib],
173 [AS_HELP_STRING([--enable-shared-lib],
174 [build libxbmc. helpful for tests (default is no)])],
175 [build_shared_lib=$enableval],
176 [build_shared_lib=no])
178 AC_ARG_ENABLE([debug],
179 [AS_HELP_STRING([--enable-debug],
180 [enable debugging information (default is yes)])],
181 [use_debug=$enableval],
185 [AS_HELP_STRING([--with-arch],
186 [build with given arch passing to internal ffmpeg (default is no, needed for crosscompiling)])],
190 AC_ARG_WITH([platform],
191 [AS_HELP_STRING([--with-platform],
192 [use a pre-configured config for common arm boards])],
193 [use_platform=$withval],
197 [AS_HELP_STRING([--with-cpu],
198 [build with given cpu passing to ffmpeg (default is no)])],
202 AC_ARG_ENABLE([neon],
203 [AS_HELP_STRING([--enable-neon],
204 [enable neon passing to ffmpeg (default is no)])],
205 [use_neon=$enableval],
208 AC_ARG_ENABLE([optimizations],
209 [AS_HELP_STRING([--enable-optimizations],
210 [enable optimization (default is yes)])],
211 [use_optimizations=$enableval],
212 [use_optimizations=yes])
215 [AS_HELP_STRING([--enable-gl],
216 [enable OpenGL rendering (default is yes)])],
220 AC_ARG_ENABLE([gles],
221 [AS_HELP_STRING([--enable-gles],
222 [enable OpenGLES rendering (default is no)])],
223 [use_gles=$enableval],
227 [AS_HELP_STRING([--enable-sdl],
228 [enable SDL (default is auto)])],
229 [use_sdl=$enableval],
232 AC_ARG_ENABLE([vdpau],
233 [AS_HELP_STRING([--enable-vdpau],
234 [enable VDPAU decoding (default is auto)])],
235 [use_vdpau=$enableval],
238 AC_ARG_ENABLE([vaapi],
239 [AS_HELP_STRING([--enable-vaapi],
240 [enable VAAPI decoding (default is auto)])],
241 [use_vaapi=$enableval],
244 AC_ARG_ENABLE([crystalhd],
245 [AS_HELP_STRING([--enable-crystalhd],
246 [enable CrystalHD decoding (default is auto)])],
247 [use_crystalhd=$enableval],
248 [use_crystalhd=auto])
250 AC_ARG_ENABLE([vdadecoder],
251 [AS_HELP_STRING([--enable-vdadecoder],
252 [enable VDADecoder decoding (default is auto)])],
253 [use_vdadecoder=$enableval],
254 [use_vdadecoder=auto])
256 AC_ARG_ENABLE([vtbdecoder],
257 [AS_HELP_STRING([--enable-vtbdecoder],
258 [enable VTBDecoder decoding (default is auto)])],
259 [use_vtbdecoder=$enableval],
260 [use_vtbdecoder=auto])
262 AC_ARG_ENABLE([openmax],
263 [AS_HELP_STRING([--enable-openmax],
264 [enable OpenMax decoding (default is auto, requires OpenGLES)])],
265 [use_openmax=$enableval],
268 AC_ARG_ENABLE([tegra],
269 [AS_HELP_STRING([--enable-tegra],
270 [enable Tegra2 arm (default is no)])],
271 [use_tegra=$enableval],
274 AC_ARG_ENABLE([profiling],
275 [AS_HELP_STRING([--enable-profiling],
276 [enable gprof profiling (default is no)])],
277 [use_profiling=$enableval],
280 AC_ARG_ENABLE([joystick],
281 [AS_HELP_STRING([--enable-joystick],
282 [enable SDL joystick support (default is yes)])],
283 [use_joystick=$enableval],
286 AC_ARG_ENABLE([xrandr],
287 [AS_HELP_STRING([--enable-xrandr],
288 [enable XRandR support (default is yes)])],
289 [use_xrandr=$enableval],
292 AC_ARG_ENABLE([goom],
293 [AS_HELP_STRING([--enable-goom],
294 [enable GOOM visualisation (default is no)])],
295 [use_goom=$enableval],
298 AC_ARG_ENABLE([rsxs],
299 [AS_HELP_STRING([--enable-rsxs],
300 [enable really slick X screensavers (default is yes)])],
301 [use_rsxs=$enableval],
304 AC_ARG_ENABLE([projectm],
305 [AS_HELP_STRING([--enable-projectm],
306 [enable ProjectM visualisation (default is yes)])],
307 [use_projectm=$enableval],
311 [AS_HELP_STRING([--enable-x11],
312 [enable x11 (default is yes) 'Linux Only'])],
313 [use_x11=$enableval],
316 AC_ARG_ENABLE([ccache],
317 [AS_HELP_STRING([--enable-ccache],
318 [enable building with ccache feature (default is auto)])],
319 [use_ccache=$enableval],
322 AC_ARG_ENABLE([alsa],
323 [AS_HELP_STRING([--disable-alsa],
324 [disable ALSA support (only for linux/freebsd)])],
325 [use_alsa=$enableval],
328 AC_ARG_ENABLE([pulse],
329 [AS_HELP_STRING([--enable-pulse],
330 [enable PulseAudio support (default is no)])],
331 [use_pulse=$enableval],
334 AC_ARG_ENABLE([rtmp],
335 [AS_HELP_STRING([--enable-rtmp],
336 [enable RTMP support via librtmp (default is auto)])],
337 [use_librtmp=$enableval],
340 AC_ARG_ENABLE([samba],
341 [AS_HELP_STRING([--disable-samba],
342 [disable SAMBA support (default is enabled)])],
343 [use_samba=$enableval],
347 [AS_HELP_STRING([--enable-nfs],
348 [enable NFS support via libnfs (default is auto)])],
349 [use_libnfs=$enableval],
352 AC_ARG_ENABLE([afpclient],
353 [AS_HELP_STRING([--enable-afpclient],
354 [enable AFP support via libafpclient (default is auto)])],
355 [use_libafpclient=$enableval],
356 [use_libafpclient=auto])
358 AC_ARG_ENABLE([airplay],
359 [AS_HELP_STRING([--enable-airplay],
360 [enable AirPlay support(default is auto)])],
361 [use_airplay=$enableval],
364 AC_ARG_ENABLE([airtunes],
365 [AS_HELP_STRING([--enable-airtunes],
366 [enable AirTunes support(default is auto)])],
367 [use_airtunes=$enableval],
370 AC_ARG_ENABLE([upnp],
371 [AS_HELP_STRING([--disable-upnp],
372 [disable UPnP support (default is enabled)])],
373 [use_upnp=$enableval],
376 AC_ARG_ENABLE([ffmpeg_libvorbis],
377 [AS_HELP_STRING([--enable-ffmpeg-libvorbis],
378 [enable FFmpeg vorbis encoding (default is no)])],
379 [use_ffmpeg_libvorbis=$enableval],
380 [use_ffmpeg_libvorbis=no])
382 AC_ARG_ENABLE([dvdcss],
383 [AS_HELP_STRING([--enable-dvdcss],
384 [enable DVDCSS support (default is yes)])],
385 [use_dvdcss=$enableval],
389 [AS_HELP_STRING([--enable-mid],
390 [enable MID support (default is no)])],
391 [use_mid=$enableval],
395 [AS_HELP_STRING([--disable-hal],
396 [disable HAL support (default is enabled if hal and hal-storage is found)])],
397 [use_hal=$enableval],
400 AC_ARG_ENABLE([avahi],
401 [AS_HELP_STRING([--disable-avahi],
402 [disable Avahi support (default is enabled if libavahi-common and libavahi-client is found)])],
403 [use_avahi=$enableval],
406 AC_ARG_ENABLE([non-free],
407 [AS_HELP_STRING([--disable-non-free],
408 [disable componentents with non-compliant licenses])],
409 [use_nonfree=$enableval],
412 AC_ARG_ENABLE([asap-codec],
413 [AS_HELP_STRING([--enable-asap-codec],
414 [enable ASAP ADPCM support])],
415 [use_asap=$enableval],
418 AC_ARG_ENABLE([mysql],
419 [AS_HELP_STRING([--disable-mysql],
421 [use_mysql=$enableval],
424 AC_ARG_ENABLE([webserver],
425 [AS_HELP_STRING([--disable-webserver],
426 [disable webserver])],
427 [use_webserver=$enableval],
430 AC_ARG_ENABLE([optical-drive],
431 [AS_HELP_STRING([--disable-optical-drive],
432 [disable optical drive])],
433 [use_optical_drive=$enableval],
434 [use_optical_drive=yes])
436 AC_ARG_ENABLE([libbluray],
437 [AS_HELP_STRING([--enable-libbluray],
438 [enable libbluray support])],
439 [use_libbluray=$enableval],
440 [use_libbluray=auto])
442 AC_ARG_ENABLE([texturepacker],
443 [AS_HELP_STRING([--enable-texturepacker],
444 [enable texturepacker support (default is yes)])],
445 [use_texturepacker=$enableval],
446 [use_texturepacker=auto])
448 AC_ARG_WITH([lirc-device],
449 [AS_HELP_STRING([--with-lirc-device=file],
450 [specify the default LIRC device (default is /dev/lircd)])],
451 [lirc_device=$withval],
452 [lirc_device=/dev/lircd])
453 AC_DEFINE_UNQUOTED([LIRC_DEVICE], ["$lirc_device"], [Default LIRC device])
455 AC_ARG_ENABLE([udev],
456 [AS_HELP_STRING([--enable-udev],
457 [enable udev support (default is auto)])],
458 [use_libudev=$enableval],
461 AC_ARG_ENABLE([libusb],
462 [AS_HELP_STRING([--enable-libusb],
463 [enable libusb support (default is auto)])],
464 [use_libusb=$enableval],
467 AC_ARG_ENABLE([libcec],
468 [AS_HELP_STRING([--enable-libcec],
469 [enable libcec support (default is auto)])],
470 [use_libcec=$enableval],
473 AC_ARG_ENABLE([libmp3lame],
474 [AS_HELP_STRING([--enable-libmp3lame],
475 [enable lame mp3 encoder support (default is auto)])],
476 [use_libmp3lame=$enableval],
477 [use_libmp3lame=auto])
479 AC_ARG_ENABLE([vorbisenc],
480 [AS_HELP_STRING([--enable-libvorbisenc],
481 [enable vorbis encoder support (default is auto)])],
482 [use_libvorbisenc=$enableval],
483 [use_libvorbisenc=auto])
485 AC_ARG_ENABLE([libcap],
486 [AS_HELP_STRING([--enable-libcap],
487 [enable libcap support (default is auto)])],
488 [use_libcap=$enableval],
491 AC_ARG_ENABLE([player],
492 [AS_HELP_STRING([--enable-player],
493 [enable additional players from a list of comma separated names, (default is none, choices are amlplayer, omxplayer)])],
494 [add_players=$enableval],
497 AC_ARG_ENABLE([gtest],
498 [AS_HELP_STRING([--enable-gtest],
499 [configure Google Test Framework (default is no)])],
500 [configure_gtest=$enableval],
501 [configure_gtest=no])
503 ### External libraries options
504 AC_ARG_ENABLE([external-libraries],
505 [AS_HELP_STRING([--enable-external-libraries],
506 [enable use of all supported external libraries (default is no) 'Linux only'])],
507 [use_external_libraries=$enableval],
508 [use_external_libraries=no])
510 AC_ARG_ENABLE([external-ffmpeg],
511 [AS_HELP_STRING([--enable-external-ffmpeg],
512 [enable use of external ffmpeg libraries (default is no) 'Linux only'])],
513 [use_external_ffmpeg=$enableval],
514 [use_external_ffmpeg=$use_external_libraries])
516 ### End of external library options
518 if test "x$host_vendor" != "xapple"; then
519 DEFAULT_COMPILE_FLAGS="-fPIC -DPIC -D_REENTRANT"
520 DEFAULT_COMPILE_FLAGS="$DEFAULT_COMPILE_FLAGS -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
523 # Checks for programs.
524 PASSED_CXXFLAGS=$CXXFLAGS # Hack to override autoconf default values
526 CXXFLAGS="$PASSED_CXXFLAGS $DEFAULT_COMPILE_FLAGS"
527 PASSED_CFLAGS=$CFLAGS # Hack to override autoconf default values
530 CFLAGS="$PASSED_CFLAGS $DEFAULT_COMPILE_FLAGS"
535 OBJDUMP="${OBJDUMP:-objdump}"
537 # ffmpeg needs the output of uname -s (e.x. linux, darwin) for the target_os
538 # there is no autoconf variable which will give
539 # the correct output format when doing cross compilation
540 # so we have to use our own var here
541 # defaults to the build side target_os
542 # and should be overridden for cross below (see android)
543 ffmpeg_target_os=$(tolower $(uname -s))
545 # host detection and setup
547 i*86*-android-linux-gnu*)
548 target_platform=target_android
552 ffmpeg_target_os=linux
556 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
560 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
565 use_external_ffmpeg="yes"
566 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX")
569 ARCH="x86_64-freebsd"
571 use_external_ffmpeg="yes"
572 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX")
585 check_sdl_arch=[`file /opt/local/lib/libSDL_image.dylib | awk '{V=7; print $V}'`]
586 if test "x$check_sdl_arch" = "xi386"; then
587 use_texturepacker_native=yes
588 USE_TEXTUREPACKER_NATIVE_ROOT="/opt/local"
595 PYTHON_LDFLAGS="-L${prefix}/lib -lpython2.6"
596 PYTHON_CPPFLAGS="-I${prefix}/include/python2.6"
597 PYTHON_SITE_PKG="${prefix}/lib/python2.6/site-packages"
598 PYTHON_NOVERSIONCHECK="no-check"
599 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS -D_LINUX")
604 use_texturepacker_native=yes
605 USE_TEXTUREPACKER_NATIVE_ROOT="$prefix"
607 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
609 powerpc-apple-darwin*)
616 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
618 powerpc-*-linux-gnu*)
620 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
622 powerpc64-*-linux-gnu*)
623 ARCH="powerpc64-linux"
624 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
630 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
632 arm*-*linux-android*)
633 target_platform=target_android
637 ffmpeg_target_os=linux
640 AC_MSG_ERROR(unsupported host ($host))
645 check_sdl_arch=[`file $USE_TEXTUREPACKER_NATIVE_ROOT/lib/libSDL_image.dylib | awk '{print $NF}'`]
646 if test "x$check_sdl_arch" = "xi386" ; then
647 DARWIN_NATIVE_ARCH=-m32
648 elif test "x$check_sdl_arch" = "xx86_64" ; then
649 DARWIN_NATIVE_ARCH=-m64
651 AC_SUBST([DARWIN_NATIVE_ARCH])
653 if test "$target_platform" = "target_android" ; then
655 use_texturepacker_native=yes
656 webserver_checkdepends=yes
657 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID")
658 CFLAGS="$CFLAGS -Wno-psabi"
659 CXXFLAGS="$CXXFLAGS -Wno-psabi"
660 AC_DEFINE(HAS_EGLGLES, [1], [Define if supporting EGL based GLES Framebuffer])
663 case $use_platform in
665 target_platform=target_raspberry_pi
667 use_texturepacker=yes
668 use_texturepacker_native=yes
671 use_hardcoded_tables="yes"
673 USE_TEXTUREPACKER_NATIVE_ROOT="$TEXTUREPACKER_NATIVE_ROOT"
675 AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI")
676 AC_DEFINE(HAS_EGLGLES, [1], [Define if supporting EGL based GLES Framebuffer])
677 USE_OMXLIB=1; AC_DEFINE([HAVE_OMXLIB],[1],["Define to 1 if OMX libs is enabled"])
680 ffmpeg_target_os=linux
684 if test "$build_shared_lib" = "yes"; then
685 final_message="$final_message\n Shared lib\tYes"
686 AC_SUBST(USE_LIBXBMC,1)
690 # platform debug flags
691 if test "$use_debug" = "yes"; then
692 final_message="$final_message\n Debugging:\tYes"
693 if test "$use_profiling" = "yes"; then
694 final_message="$final_message\n Profiling:\tYes"
695 DEBUG_FLAGS="-g -pg -D_DEBUG -Wall"
697 final_message="$final_message\n Profiling:\tNo"
698 DEBUG_FLAGS="-g -D_DEBUG -Wall"
701 final_message="$final_message\n Debugging:\tNo"
702 if test "$use_profiling" = "yes"; then
703 final_message="$final_message\n Profiling:\tYes"
704 DEBUG_FLAGS="-pg -DNDEBUG=1"
706 final_message="$final_message\n Profiling:\tNo"
707 DEBUG_FLAGS="-DNDEBUG=1"
710 CFLAGS="$CFLAGS $DEBUG_FLAGS"
711 CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS"
714 if test "$use_optimizations" = "yes"; then
715 final_message="$final_message\n Optimization:\tYes"
716 if test "$target_platform" = "target_raspberry_pi"; then
720 CXXFLAGS="$CXXFLAGS -O2"
724 final_message="$final_message\n Optimization:\tNo"
728 # platform specific flags
729 if echo "$ARCH" | grep -q "freebsd" ; then
730 LOCALBASE="${LOCALBASE:-/usr/local}"
731 CFLAGS="$CFLAGS -I$LOCALBASE/include"
732 CXXFLAGS="$CXXFLAGS -I$LOCALBASE/include"
733 CPPFLAGS="$CPPFLAGS -I$LOCALBASE/include"
734 LDFLAGS="$LDFLAGS -L$LOCALBASE/lib"
736 if test "$host_vendor" = "apple" ; then
737 # standard xbmc paths
738 INCLUDES="$INCLUDES -I\$(abs_top_srcdir)/xbmc/osx"
739 if test "$use_arch" != "arm"; then
740 LIBS="$LIBS -framework ApplicationServices"
741 LIBS="$LIBS -framework AudioUnit"
742 LIBS="$LIBS -framework AudioToolbox"
743 LIBS="$LIBS -framework Cocoa"
744 LIBS="$LIBS -framework CoreAudio"
745 LIBS="$LIBS -framework CoreVideo"
746 LIBS="$LIBS -framework CoreServices"
747 LIBS="$LIBS -framework CoreFoundation"
748 LIBS="$LIBS -framework DiskArbitration"
749 LIBS="$LIBS -framework IOKit"
750 LIBS="$LIBS -framework IOSurface"
751 LIBS="$LIBS -framework QuartzCore"
752 LIBS="$LIBS -framework SystemConfiguration"
754 USE_EXTERNAL_FFMPEG=1
755 elif test "$target_platform" = "target_raspberry_pi"; then
758 elif test "$use_arch" = "arm"; then
759 CFLAGS="$CFLAGS -mno-apcs-stack-check"
760 CXXFLAGS="$CXXFLAGS -mno-apcs-stack-check"
761 FFMPEG_EXTRACFLAGS=""
762 if test "$use_tegra" = "yes"; then
763 # Compile for ARMv7a architecture, need to test gcc for vfpv3-d16 support
764 SAVE_CFLAGS="$CFLAGS"
765 CFLAGS="-mfpu=vfpv3-d16"
767 [AC_LANG_SOURCE([int foo;])],
768 [ CFLAGS="$SAVE_CFLAGS -Wno-psabi -Wa,-march=armv7a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mthumb-interwork"
769 CXXFLAGS="$CXXFLAGS -Wno-psabi -Wa,-march=armv7a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mthumb-interwork"
770 FFMPEG_EXTRACFLAGS="$FFMPEG_EXTRACFLAGS -mtune=cortex-a9 -mfpu=vfpv3-d16"
772 [ CFLAGS="$SAVE_CFLAGS -Wa,-march=armv6 -mtune=cortex-a8 -mthumb-interwork"
773 CXXFLAGS="$CXXFLAGS -Wa,-march=armv6 -mtune=cortex-a8 -mthumb-interwork"
776 if test "$use_neon" = "yes"; then
777 CFLAGS="$CFLAGS -mfpu=neon -mvectorize-with-neon-quad"
778 CXXFLAGS="$CXXFLAGS -mfpu=neon -mvectorize-with-neon-quad"
779 FFMPEG_EXTRACFLAGS="$FFMPEG_EXTRACFLAGS -mfpu=neon"
784 # Checks for library functions.
787 AC_FUNC_CLOSEDIR_VOID
788 AC_FUNC_ERROR_AT_LINE
790 AC_PROG_GCC_TRADITIONAL
792 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
796 # Boxee is apparently having compile problems
797 # if HAVE_REALLOC is defined. Sort this later.
799 AC_FUNC_SELECT_ARGTYPES
800 AC_FUNC_SETVBUF_REVERSED
808 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])
810 # Check for various sizes
811 AC_CHECK_SIZEOF([int])
812 AC_CHECK_SIZEOF([size_t])
814 # Add top source directory for all builds so we can use config.h
815 INCLUDES="$INCLUDES -I\$(abs_top_srcdir)"
817 # Check inotify availability
818 AC_CHECK_HEADER([sys/inotify.h], AC_DEFINE([HAVE_INOTIFY],[1],[Define if we have inotify]),)
820 # Checks for boost headers using CXX instead of CC
822 AC_CHECK_HEADER([boost/shared_ptr.hpp],, AC_MSG_ERROR($missing_library))
826 if test -z "$PYTHON_NOVERSIONCHECK"; then
827 AX_PYTHON_DEVEL([>= 2.4])
828 PYTHON_VERSION=$ac_python_version
831 if test -z "$PYTHON_VERSION"; then
832 AC_MSG_ERROR([Can't find a Python version.])
834 LIBS="$LIBS $PYTHON_LDFLAGS"
835 AC_MSG_NOTICE([Using Python $PYTHON_VERSION])
838 # Checks for platforms libraries.
839 if test "$use_gles" = "yes"; then
841 # GLES overwrites GL if both set to yes.
842 if test "$host_vendor" = "apple" ; then
843 AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."])
844 AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."])
845 AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.)
847 if test "$target_platform" = "target_raspberry_pi"; then
848 AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."])
849 AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."])
850 AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.)
851 LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm"
853 AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library))
854 AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library))
858 if test "$use_gl" = "yes"; then
859 if test "$host_vendor" = "apple" ; then
860 # linking to OpenGL.framework instead of libGL, libGLU so AC_CHECK_LIB will fail
861 LIBS="$LIBS -framework OpenGL"
862 AC_DEFINE([HAVE_LIBGL],[1],["Define to 1 if you have the `GL' library (-lGL)."])
863 AC_MSG_RESULT(== WARNING: OpenGL support is assumed.)
864 AC_DEFINE([HAVE_LIBGLU],[1],["Define to 1 if you have the `GLU' library (-lGLU)."])
865 AC_MSG_RESULT(== WARNING: OpenGLU support is assumed.)
866 AC_CHECK_LIB([GLEW],[main],, AC_MSG_ERROR($missing_library))
868 AC_CHECK_LIB([GL], [main],, AC_MSG_ERROR($missing_library))
869 AC_CHECK_LIB([GLEW],[main],, AC_MSG_ERROR($missing_library))
870 AC_CHECK_LIB([GLU], [main],, AC_MSG_ERROR($missing_library))
873 AC_MSG_RESULT(== WARNING: OpenGL support is disabled. XBMC will run VERY slow. ==)
874 AC_CHECK_LIB([SDL_gfx],[main])
878 # platform common libraries
879 if test "$use_mysql" = "yes"; then
880 AC_PATH_PROG(MYSQL_CONFIG, mysql_config,"no")
881 if test "x$MYSQL_CONFIG" != "xno"; then
882 AC_DEFINE([HAVE_MYSQL],[1],["Define to 1 if you have the `mysql' library (-lmysqlclient)."])
883 INCLUDES="$INCLUDES `$MYSQL_CONFIG --include`"
884 MYSQL_LIBS=`$MYSQL_CONFIG --libs`
885 LIBS="$LIBS $MYSQL_LIBS"
888 AC_MSG_ERROR($missing_program)
891 AC_CHECK_HEADER([ass/ass.h],, AC_MSG_ERROR($missing_library))
892 AC_CHECK_HEADER([mpeg2dec/mpeg2.h],, AC_MSG_ERROR($missing_library))
893 AC_CHECK_HEADER([mpeg2dec/mpeg2convert.h],, AC_MSG_ERROR($missing_library),
894 AC_INCLUDES_DEFAULT()
895 [#include <mpeg2dec/mpeg2.h>])
896 AC_CHECK_HEADER([mad.h],, AC_MSG_ERROR($missing_library))
897 AC_CHECK_HEADER([jpeglib.h],, AC_MSG_ERROR($missing_library))
898 AC_CHECK_HEADER([samplerate.h],, AC_MSG_ERROR($missing_library))
899 AC_CHECK_HEADER([ogg/ogg.h],, AC_MSG_ERROR($missing_library))
900 AC_CHECK_HEADER([vorbis/vorbisfile.h],, AC_MSG_ERROR($missing_library))
901 AC_CHECK_HEADER([libmodplug/modplug.h],, AC_MSG_ERROR($missing_library))
902 AC_CHECK_HEADER([curl/curl.h],, AC_MSG_ERROR($missing_library))
903 AC_CHECK_HEADER([FLAC/stream_decoder.h],, AC_MSG_ERROR($missing_library))
905 # we need to check for the header because if it exists we set the openssl
906 # and gcrypt MT callback hooks. This is mostly so that libcurl operates
907 # in MT manner correctly.
908 AC_CHECK_HEADER([openssl/crypto.h], AC_DEFINE([HAVE_OPENSSL],[1],[Define if we have openssl]),)
909 AC_CHECK_HEADER([gcrypt.h], gcrypt_headers_available=yes,gcrypt_headers_available=no)
910 if test "$gcrypt_headers_available" = "yes"; then
911 # if we have the headers then we must have the lib
912 AC_CHECK_LIB([gpg-error],[main],, AC_MSG_ERROR($missing_library))
913 AC_CHECK_LIB([gcrypt],[gcry_control],, AC_MSG_ERROR($missing_library))
914 AC_DEFINE([HAVE_GCRYPT],[1],[Define if we have gcrypt])
917 AC_CHECK_LIB([bz2], [main],, AC_MSG_ERROR($missing_library))
918 AC_CHECK_LIB([jpeg], [main],, AC_MSG_ERROR($missing_library)) # check for cximage
919 AC_CHECK_LIB([tiff], [main],, AC_MSG_ERROR($missing_library))
920 if echo "$ARCH" | grep -q freebsd; then
921 AC_CHECK_LIB([pthread], [main],LIBS="-pthread $LIBS", AC_MSG_ERROR($missing_library))
923 if test "$target_platform" != "target_android" ; then
924 AC_CHECK_LIB([pthread], [main],, AC_MSG_ERROR($missing_library))
927 AC_CHECK_LIB([lzo2], [main],, AC_MSG_ERROR($missing_library))
928 AC_CHECK_LIB([z], [main],, AC_MSG_ERROR($missing_library))
929 AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR($missing_library))
930 AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR($missing_library))
931 if test "$use_mysql" = "yes"; then
932 AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
934 AC_CHECK_LIB([ssh], [sftp_tell64],, AC_MSG_RESULT([Could not find suitable version of libssh]))
935 AC_CHECK_LIB([bluetooth], [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
936 AC_CHECK_LIB([yajl], [main],, AC_MSG_ERROR($missing_library))
937 AC_CHECK_LIB([tinyxml], [main],, AC_MSG_ERROR($missing_library))
938 if test "$target_platform" = "target_android" ; then
939 #android hack for static python. Required to maintain correct linking order.
940 AC_CHECK_LIB([python$PYTHON_VERSION], [main],, AC_MSG_ERROR($missing_library))
941 AC_CHECK_LIB([android], [main],, AC_MSG_ERROR($missing_library))
943 PKG_CHECK_MODULES([FRIBIDI], [fribidi],
944 [INCLUDES="$INCLUDES $FRIBIDI_CFLAGS"; LIBS="$LIBS $FRIBIDI_LIBS"],
945 AC_MSG_ERROR($missing_library))
946 PKG_CHECK_MODULES([SQLITE3], [sqlite3],
947 [INCLUDES="$INCLUDES $SQLITE3_CFLAGS"; LIBS="$LIBS $SQLITE3_LIBS"],
948 AC_MSG_ERROR($missing_library))
949 PKG_CHECK_MODULES([PNG], [libpng],
950 [INCLUDES="$INCLUDES $PNG_CFLAGS"; LIBS="$LIBS $PNG_LIBS"],
951 AC_MSG_ERROR($missing_library))
952 PKG_CHECK_MODULES([PCRECPP], [libpcrecpp],
953 [INCLUDES="$INCLUDES $PCRECPP_CFLAGS"; LIBS="$LIBS $PCRECPP_LIBS"]; \
954 AC_DEFINE([HAVE_LIBPCRECPP],[1],["Define to 1 if libpcrecpp is installed"]),
955 AC_MSG_ERROR($missing_library))
956 PKG_CHECK_MODULES([PCRE], [libpcre],
957 [INCLUDES="$INCLUDES $PCRE_CFLAGS"; LIBS="$LIBS $PCRE_LIBS"]; \
958 AC_DEFINE([HAVE_LIBPCRE],[1],["Define to 1 if libpcre is installed"]),
959 AC_MSG_ERROR($missing_library))
960 PKG_CHECK_MODULES([CDIO], [libcdio],
961 [INCLUDES="$INCLUDES $CDIO_CFLAGS"; LIBS="$LIBS $CDIO_LIBS"],
962 AC_MSG_ERROR($missing_library))
963 PKG_CHECK_MODULES([SAMPLERATE], [samplerate],
964 [INCLUDES="$INCLUDES $SAMPLERATE_CFLAGS"; LIBS="$LIBS $SAMPLERATE_LIBS"],
965 AC_MSG_ERROR($missing_library))
966 PKG_CHECK_MODULES([FREETYPE2], [freetype2],
967 [INCLUDES="$INCLUDES $FREETYPE2_CFLAGS"; LIBS="$LIBS $FREETYPE2_LIBS"],
968 AC_MSG_ERROR($missing_library))
969 PKG_CHECK_MODULES([TAGLIB], [taglib >= 1.8],
970 [INCLUDES="$INCLUDES $TAGLIB_CFLAGS"; LIBS="$LIBS $TAGLIB_LIBS"],
971 AC_MSG_ERROR($missing_library))
973 if test "$target_platform" = "target_android" ; then
974 PKG_CHECK_MODULES([ZIP], [libzip],
975 [INCLUDES="$INCLUDES $ZIP_CFLAGS"; LIBS="$LIBS $ZIP_LIBS"],
976 AC_MSG_ERROR($missing_library))
979 # check for libbluray
980 AS_CASE([x$use_libbluray],
982 PKG_CHECK_MODULES([LIBBLURAY],[libbluray >= 0.2.1],[use_libbluray="yes"], AC_MSG_ERROR($missing_library))
985 PKG_CHECK_MODULES([LIBBLURAY],[libbluray >= 0.2.1],[use_libbluray="yes"], [use_libbluray="no"])
988 AS_CASE([x$use_libbluray],
990 INCLUDES="$INCLUDES $LIBBLURAY_CFLAGS";
991 XB_FIND_SONAME([BLURAY], [bluray], [use_libbluray])
992 AC_DEFINE([HAVE_LIBBLURAY], 1, [System has libbluray library])
993 AC_SUBST([HAVE_LIBBLURAY], 1)
995 AC_SUBST([HAVE_LIBBLURAY], 0)
999 # platform dependent libraries
1000 if test "$host_vendor" = "apple" ; then
1001 AC_CHECK_LIB([iconv], [main],, AC_MSG_ERROR($missing_library))
1002 if test "$use_arch" != "arm"; then
1003 AC_CHECK_LIB([SDL], [main],, AC_MSG_ERROR($missing_library))
1004 AC_DEFINE([HAVE_SDL],[1],["Define to 1 if using sdl"])
1008 linux*) AC_CHECK_LIB([dl], [main],, AC_MSG_ERROR($missing_library)) ;;
1009 freebsd*) AC_CHECK_LIB([iconv], [main],, AC_MSG_ERROR($missing_library)) ;;
1014 if test "$target_platform" != "target_android" ; then
1015 AC_CHECK_LIB([resolv], [main],, AC_MSG_ERROR($missing_library))
1019 if test "$target_platform" != "target_android" ; then
1020 AC_CHECK_LIB([jasper], [main],, AC_MSG_ERROR($missing_library)) # check for cximage
1021 AC_CHECK_LIB([rt], [clock_gettime],, AC_MSG_ERROR($missing_library))
1023 if test "x$use_alsa" != "xno"; then
1024 PKG_CHECK_MODULES([ALSA], [alsa],
1025 [INCLUDES="$INCLUDES $ALSA_CFLAGS"; LIBS="$LIBS $ALSA_LIBS"; use_alsa=yes],
1026 AC_MSG_NOTICE($alsa_not_found); use_alsa=no)
1028 PKG_CHECK_MODULES([DBUS], [dbus-1],
1029 [INCLUDES="$INCLUDES $DBUS_CFLAGS"; LIBS="$LIBS $DBUS_LIBS"; use_dbus=yes]; \
1030 AC_DEFINE([HAVE_DBUS],[1],["Define to 1 if dbus is installed"]),
1031 AC_MSG_NOTICE($missing_library); use_dbus=no)
1032 if test "x$use_sdl" != "xno"; then
1033 PKG_CHECK_MODULES([SDL], [sdl],
1034 [INCLUDES="$INCLUDES $SDL_CFLAGS"; LIBS="$LIBS $SDL_LIBS"],
1035 AC_MSG_ERROR($missing_library))
1036 AC_CHECK_LIB([SDL_image], [main],, AC_MSG_ERROR($missing_library))
1037 AC_DEFINE([HAVE_SDL],[1],["Define to 1 if using sdl"])
1041 XB_FIND_SONAME([MAD], [mad])
1042 XB_FIND_SONAME([OGG], [ogg])
1043 XB_FIND_SONAME([CURL], [curl])
1044 XB_FIND_SONAME([FLAC], [FLAC])
1045 XB_FIND_SONAME([VORBIS], [vorbis])
1046 XB_FIND_SONAME([VORBISFILE], [vorbisfile])
1047 XB_FIND_SONAME([MODPLUG], [modplug])
1048 XB_FIND_SONAME([ASS], [ass])
1049 XB_FIND_SONAME([MPEG2], [mpeg2])
1052 if test "x$use_libmp3lame" != "xno"; then
1053 XB_FIND_SONAME([LAMEENC], [mp3lame], [use_libmp3lame])
1054 if test "x$use_libmp3lame" != "xno"; then
1055 AC_CHECK_HEADER([lame/lame.h],, AC_MSG_ERROR($missing_headers))
1058 AS_CASE([x$use_libmp3lame],
1060 AC_SUBST([HAVE_LIBMP3LAME], 0)
1063 AC_DEFINE([HAVE_LIBMP3LAME], 1, [System has libmp3lame library])
1064 AC_SUBST([HAVE_LIBMP3LAME], 1)
1067 if test "x$use_libvorbisenc" != "xno"; then
1068 XB_FIND_SONAME([VORBISENC], [vorbisenc], [use_libvorbisenc])
1069 if test "x$use_libvorbisenc" != "xno"; then
1070 AC_CHECK_HEADER([vorbis/vorbisenc.h],, AC_MSG_ERROR($missing_headers))
1073 AS_CASE([x$use_libvorbisenc],
1075 AC_SUBST([HAVE_LIBVORBISENC], 0)
1077 AC_DEFINE([HAVE_LIBVORBISENC], 1, [System has libvorbisenc library])
1078 AC_SUBST([HAVE_LIBVORBISENC], 1)
1083 if test "$use_webserver" = "yes"; then
1084 AC_CHECK_LIB([microhttpd], [main],, AC_MSG_ERROR($missing_library))
1088 if test "$use_optical_drive" = "yes"; then
1089 AC_DEFINE([HAS_DVD_DRIVE], [1], [Define to 1 to have optical drive support])
1093 if test "$use_alsa" = "yes" && test "$host_vendor" != "apple"; then
1094 PKG_CHECK_MODULES([ALSA], [alsa],
1095 [INCLUDES="$INCLUDES $ALSA_CFLAGS"; LIBS="$LIBS $ALSA_LIBS"],
1096 AC_MSG_ERROR($missing_library))
1097 AC_DEFINE([HAS_ALSA], [1], [Define to 0 to disable ALSA support])
1100 AC_MSG_RESULT($alsa_disabled)
1104 if test "x$use_pulse" != "xno"; then
1105 if test "$host_vendor" = "apple" ; then
1106 if test "x$use_pulse" = "xyes"; then
1107 AC_MSG_ERROR($pulse_disabled)
1110 AC_MSG_RESULT($pulse_disabled)
1114 AC_CHECK_LIB([pulse], [main],,
1115 [if test "x$use_pulse" = "xyes"; then
1116 AC_MSG_ERROR($pulse_not_found)
1120 AC_MSG_RESULT($pulse_not_found)
1125 AC_MSG_RESULT($pulse_disabled)
1130 if test "$host_vendor" = "apple" ; then
1132 AC_MSG_RESULT($hal_disabled)
1134 if test "$use_hal" = "yes"; then
1135 PKG_CHECK_MODULES([HAL], [hal],
1136 [INCLUDES="$INCLUDES $HAL_CFLAGS"; LIBS="$LIBS $HAL_LIBS"],
1137 use_hal=no;AC_MSG_RESULT($hal_not_found))
1138 PKG_CHECK_MODULES([HAL_STORAGE], [hal-storage],
1139 [INCLUDES="$INCLUDES $HAL_STORAGE_CFLAGS"; LIBS="$LIBS $HAL_STORAGE_LIBS"],
1140 use_hal=no;AC_MSG_RESULT($halstorage_not_found))
1142 AC_MSG_RESULT($hal_disabled)
1144 if test "$use_hal" = "yes"; then
1145 AC_DEFINE([HAS_HAL], [1], [Define to 1 if you have HAL installed])
1150 if test "$host_vendor" = "apple" ; then
1152 AC_MSG_RESULT($avahi_disabled)
1154 if test "$use_avahi" = "yes"; then
1155 AC_CHECK_LIB([avahi-common], [main],,
1156 use_avahi=no;AC_MSG_RESULT($avahi_not_found))
1157 if test "$use_avahi" = "yes"; then
1158 #either both libs or none
1159 AC_CHECK_LIB([avahi-client], [main],,
1160 use_avahi=no;AC_MSG_RESULT($avahi_not_found))
1163 AC_MSG_RESULT($avahi_disabled)
1168 if test "$use_x11" = "yes" && test "$host_vendor" != "apple"; then
1169 AC_MSG_NOTICE($x11_enabled)
1170 PKG_CHECK_MODULES([X11], [x11],
1171 [INCLUDES="$INCLUDES $X11_CFLAGS"; LIBS="$LIBS $X11_LIBS"],
1172 AC_MSG_ERROR($missing_library))
1173 PKG_CHECK_MODULES([XEXT], [xext],
1174 [INCLUDES="$INCLUDES $XEXT_CFLAGS"; LIBS="$LIBS $XEXT_LIBS"],
1175 AC_MSG_ERROR($missing_library))
1176 AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 libs installed.])
1178 AC_MSG_RESULT($x11_disabled)
1182 if test "$host_vendor" = "apple" || test "$use_x11" = "no"; then
1184 AC_MSG_RESULT($xrandr_disabled)
1186 if test "$use_xrandr" = "yes" ; then
1187 AC_CHECK_LIB([Xrandr], [main],,
1188 use_xrandr="no";AC_MSG_RESULT($xrandr_not_found))
1190 AC_MSG_RESULT($xrandr_disabled)
1195 if test "$host_vendor" = "apple" ; then
1196 AC_MSG_NOTICE($goom_disabled)
1199 if test "$use_goom" = "yes" && test "$use_gl" = "yes"; then
1200 AC_MSG_NOTICE($goom_enabled)
1203 AC_MSG_NOTICE($goom_disabled)
1209 if test "$use_rsxs" = "no" || test "$use_gl" = "no"; then
1210 AC_MSG_NOTICE($rsxs_disabled)
1213 AC_MSG_NOTICE($rsxs_enabled)
1215 # darwin osx can do rsxs but does not use x11, so do not pkg-config check for them
1216 if test "$host_vendor" != "apple" ; then
1217 PKG_CHECK_MODULES([XT], [xt],
1218 [INCLUDES="$INCLUDES $XT_CFLAGS"; LIBS="$LIBS $XT_LIBS"],
1219 AC_MSG_ERROR($missing_library))
1220 PKG_CHECK_MODULES([XMU], [xmu],
1221 [INCLUDES="$INCLUDES $XMU_CFLAGS"; LIBS="$LIBS $XMU_LIBS"],
1222 AC_MSG_ERROR($missing_library))
1227 if test "$use_projectm" = "no" || test "$use_gl" = "no"; then
1228 AC_MSG_NOTICE($projectm_disabled)
1231 AC_MSG_NOTICE($projectm_enabled)
1237 if [[ -f "addons/skin.touched/addon.xml" ]]; then
1238 use_skin_touched=yes
1240 AC_DEFINE([HAS_SKIN_TOUCHED], [1], [Whether to build skin touched.])
1247 if test "$use_librtmp" != "no"; then
1248 AC_CHECK_HEADERS([librtmp/log.h librtmp/amf.h librtmp/rtmp.h],,
1249 [if test "$use_librtmp" = "yes"; then
1250 AC_MSG_ERROR($librtmp_not_found)
1251 elif test "$use_librtmp" != "no"; then
1252 AC_MSG_NOTICE($librtmp_not_found)
1256 if test "$use_librtmp" != "no"; then
1257 XB_FIND_SONAME([RTMP], [rtmp], [use_librtmp])
1259 if test "$use_librtmp" != "no"; then
1260 AC_DEFINE([HAS_LIBRTMP], [1], [Whether to use libRTMP library.])
1263 AC_MSG_NOTICE($librtmp_disabled)
1267 if test "x$use_samba" != "xno"; then
1268 AC_CHECK_LIB([smbclient], [main],,
1269 use_samba=no;AC_MSG_ERROR($missing_library))
1272 AC_MSG_RESULT($samba_disabled)
1276 if test "x$use_samba" != "xno"; then
1277 AC_DEFINE([HAVE_LIBSMBCLIENT], [1], [Define to 1 if you have Samba installed])
1282 if test "$use_libnfs" != "no"; then
1283 AC_CHECK_HEADERS([nfsc/libnfs.h],,
1284 [if test "$use_libnfs" = "yes"; then
1285 AC_MSG_ERROR($libnfs_not_found)
1287 elif test "$use_libnfs" != "no"; then
1288 AC_MSG_NOTICE($libnfs_not_found)
1293 if test "$use_libnfs" != "no"; then
1294 XB_FIND_SONAME([NFS], [nfs], [use_libnfs])
1296 if test "$use_libnfs" != "no"; then
1297 AC_DEFINE([HAVE_LIBNFS], [1], [Whether to use libnfs library.])
1302 AC_MSG_NOTICE($libnfs_disabled)
1307 if test "x$use_libafpclient" != "xno"; then
1308 AC_CHECK_HEADERS([afpfs-ng/libafpclient.h],,
1309 [if test "x$use_libafpclient" = "xyes"; then
1310 AC_MSG_ERROR($libafpclient_not_found)
1311 elif test "x$use_libafpclient" != "xno"; then
1312 AC_MSG_NOTICE($libafpclient_not_found)
1313 use_libafpclient="no"
1316 if test "x$use_libafpclient" != "xno"; then
1317 XB_FIND_SONAME([AFPCLIENT], [afpclient], [use_libafpclient])
1318 AC_DEFINE([HAVE_LIBAFPCLIENT], [1], [Whether to use libafpclient library.])
1322 AC_MSG_NOTICE($libafpclient_disabled)
1325 # libplist for airplay feature
1327 if test "$use_airplay" != "no"; then
1328 AC_CHECK_HEADER([plist/plist.h],,
1329 [if test "$use_airplay" = "yes"; then
1330 AC_MSG_ERROR($libplist_not_found)
1331 elif test "$use_airplay" != "no"; then
1332 AC_MSG_NOTICE($libplist_not_found)
1337 if test "$use_airplay" != "no"; then
1338 XB_FIND_SONAME([PLIST], [plist], [use_airplay])
1340 AC_DEFINE([HAVE_LIBPLIST],[1],["Define to 1 if you have libplist."])
1344 # libshairport for AirTunes
1346 if test "x$use_airtunes" != "xno"; then
1347 AC_CHECK_HEADERS([shairport/shairport.h shairport/ao.h],,
1348 [if test "x$use_airtunes" = "xyes"; then
1349 AC_MSG_ERROR($libshairport_not_found)
1350 elif test "x$use_airtunes" != "xno"; then
1351 AC_MSG_NOTICE($libshairport_not_found)
1356 if test "x$use_airtunes" != "xno"; then
1357 XB_FIND_SONAME([SHAIRPORT], [shairport], [use_airtunes])
1359 AC_CHECK_MEMBERS([struct AudioOutput.ao_set_metadata],,,
1360 [[#include <shairport/shairport.h>]])
1361 AC_DEFINE([HAVE_LIBSHAIRPORT],[1],["Define to 1 if you have libshairport."])
1367 if test "$host_vendor" = "apple" ; then
1369 AC_MSG_NOTICE($libudev_disabled)
1371 if test "$use_libudev" = "auto"; then
1372 PKG_CHECK_MODULES([UDEV],[libudev],,[use_libudev="no";AC_MSG_RESULT($libudev_not_found)])
1373 elif test "$use_libudev" = "yes" ; then
1374 PKG_CHECK_MODULES([UDEV],[libudev],,[use_libudev="no";AC_MSG_ERROR($libudev_not_found)])
1376 AC_MSG_NOTICE($libudev_disabled)
1379 if test "x$use_libudev" != "xno"; then
1380 USE_LIBUDEV=1;INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS"
1381 AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"])
1388 # if libudev is available, we don't need libusb
1389 if test "x$use_libudev" != "xno"; then
1391 AC_MSG_NOTICE($libusb_disabled_udev_found)
1393 if test "$host_vendor" = "apple" ; then
1395 AC_MSG_NOTICE($libusb_disabled)
1397 if echo "$ARCH" | grep -q freebsd ; then
1398 AC_CHECK_LIB([usb],[main],
1399 [use_libusb="yes";USB_LIBS="-lusb"],
1400 [use_libusb="no";AC_MSG_RESULT($libusb_not_found)])
1401 elif test "$use_libusb" = "auto"; then
1402 PKG_CHECK_MODULES([USB],[libusb],,[use_libusb="no";AC_MSG_RESULT($libusb_not_found)])
1403 elif test "$use_libusb" = "yes"; then
1404 PKG_CHECK_MODULES([USB],[libusb],,[use_libusb="no";AC_MSG_ERROR($libusb_not_found)])
1406 AC_MSG_NOTICE($libusb_disabled)
1409 if test "x$use_libusb" != "xno"; then
1410 USE_LIBUSB=1;INCLUDES="$INCLUDES $USB_CFLAGS";LIBS="$LIBS $USB_LIBS"
1411 AC_DEFINE([HAVE_LIBUSB],[1],["Define to 1 if libusb is installed"])
1419 use_rpi_cec_api="auto"
1420 if test "x$use_libcec" != "xno"; then
1421 case "${host_cpu}" in
1423 echo "will check for RPi support"
1424 AC_CHECK_HEADER(interface/vmcs_host/vc_cec.h,,use_rpi_cec_api="no")
1427 echo "will not check for RPi support (unsupported cpu: ${host_cpu})"
1428 use_rpi_cec_api="no"
1432 # libcec needs libudev, libusb or the RPi API under linux, or the device will never be detected.
1433 if test "$host_vendor" != "apple" && test "$use_libusb" = "no" && test "$use_libudev" = "no" && test "$use_rpi_cec_api" = "no"; then
1434 if test "x$use_libcec" != "xauto"; then
1435 AC_MSG_ERROR($libcec_disabled_missing_libs)
1438 AC_MSG_NOTICE($libcec_disabled_missing_libs)
1442 # libcec is dyloaded, so we need to check for its headers and link any depends.
1443 if test "x$use_libcec" != "xno"; then
1444 if test "x$use_libcec" != "xauto"; then
1445 PKG_CHECK_MODULES([CEC],[libcec >= 1.8.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)])
1447 PKG_CHECK_MODULES([CEC],[libcec >= 1.8.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])
1450 if test "x$use_libcec" != "xno"; then
1451 INCLUDES="$INCLUDES $CEC_CFLAGS"
1452 USE_LIBCEC=1;AC_DEFINE([HAVE_LIBCEC],[1],["Define to 1 if libcec is installed"])
1453 if test "x$use_rpi_cec_api" != "xno"; then
1454 LIBS+=" -lvcos -lvchiq_arm"
1455 AC_DEFINE([HAVE_CEC_RPI_API],[1],["Define to 1 if the CEC RPi API is installed"])
1458 XB_FIND_SONAME([LIBCEC],[cec],[use_libcec])
1459 AC_MSG_NOTICE($libcec_enabled)
1462 AC_MSG_NOTICE($libcec_disabled)
1467 AC_MSG_NOTICE($libcec_disabled)
1471 if test "$use_libcap" != "no"; then
1472 AC_CHECK_HEADERS([sys/capability.h],,
1473 [if test "$use_libcap" = "yes"; then
1474 AC_MSG_ERROR($libcap_not_found)
1475 elif test "$use_libcap" != "no"; then
1476 AC_MSG_NOTICE($libcap_not_found)
1480 if test "$use_libcap" != "no"; then
1481 AC_CHECK_LIB([cap], main, LIBS="$LIBS -lcap", use_libcap=no)
1483 if test "$use_libcap" != "no"; then
1484 AC_DEFINE([HAVE_LIBCAP], [1], [Whether to use libcap library.])
1487 AC_MSG_NOTICE($libcap_disabled)
1490 ### External libraries checks
1493 if test "$use_external_ffmpeg" = "yes"; then
1494 FFMPEG_LIBNAMES="libavcodec libavfilter libavformat libavutil libpostproc libswscale"
1496 # libavcore is optional
1497 PKG_CHECK_EXISTS([libavcore], FFMPEG_LIBNAMES="$FFMPEG_LIBNAMES libavcore")
1499 # one of libswresample or libavresample is needed
1500 PKG_CHECK_EXISTS([libswresample], FFMPEG_LIBNAMES="$FFMPEG_LIBNAMES libswresample",
1501 [PKG_CHECK_EXISTS([libavresample],
1502 FFMPEG_LIBNAMES="$FFMPEG_LIBNAMES libavresample",
1503 AC_MSG_ERROR([You need either libswresample
1504 or libavresample.]))])
1506 PKG_CHECK_MODULES([FFMPEG], [$FFMPEG_LIBNAMES],
1507 [INCLUDES="$INCLUDES $FFMPEG_CFLAGS"; LIBS="$LIBS $FFMPEG_LIBS"],
1508 AC_MSG_ERROR($missing_library))
1510 # Determine whether AVPacket and relevant functions are defined in libavformat
1512 AC_CHECK_LIB([avcodec], [av_free_packet],
1513 [AC_MSG_NOTICE(== AVPacket and relevant functions defined in libavcodec. ==)],
1514 [AC_MSG_NOTICE(== AVPacket and relevant functions defined in libavformat. ==)
1515 AC_DEFINE([AVPACKET_IN_AVFORMAT], [1], [Whether AVPacket is in libavformat.])])
1517 # in case the headers are in a custom directory
1518 SAVE_CPPFLAGS="$CPPFLAGS"
1519 CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
1521 # Possible places the ffmpeg headers may be
1522 AC_CHECK_HEADERS([libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h libavutil/avutil.h libpostproc/postprocess.h libswscale/swscale.h],,
1523 [AC_CHECK_HEADERS([ffmpeg/avcodec.h ffmpeg/avfilter.h ffmpeg/avformat.h ffmpeg/avutil.h postproc/postprocess.h ffmpeg/swscale.h],,
1524 [AC_MSG_ERROR($missing_headers)])])
1527 AC_CHECK_HEADERS([libavcore/avcore.h libavcore/samplefmt.h libavutil/mem.h libavutil/samplefmt.h])
1529 # old FFmpeg have this in libavcodec/opt.h instead:
1530 AC_CHECK_HEADERS([libavutil/opt.h])
1532 # new FFmpeg have math headers
1533 AC_CHECK_HEADERS([libavutil/mathematics.h],,)
1535 # We'll support the use of rgb2rgb.h if it exists.
1536 AC_CHECK_HEADERS([libswscale/rgb2rgb.h],,)
1537 AC_CHECK_HEADERS([ffmpeg/rgb2rgb.h],,)
1539 # Check for libswresample or libavresample headers.
1540 AC_CHECK_HEADERS([libswresample/swresample.h libavresample/avresample.h])
1542 # Check if AVFilterBufferRefVideoProps AVRational member is named
1543 # 'pixel_aspect' or 'sample_aspect_ratio'.
1544 AC_CHECK_MEMBER([AVFilterBufferRefVideoProps.sample_aspect_ratio],
1545 [AC_DEFINE([HAVE_AVFILTERBUFFERREFVIDEOPROPS_SAMPLE_ASPECT_RATIO],
1547 [Define to 1 if AVFilterBufferRefVideoProps has member sample_aspect_ratio.])],
1548 [AC_CHECK_MEMBER([AVFilterBufferRefVideoProps.sample_aspect_ratio],
1549 [AC_DEFINE([HAVE_AVFILTERBUFFERREFVIDEOPROPS_SAMPLE_ASPECT_RATIO],
1551 [Define to 1 if AVFilterBufferRefVideoProps has member sample_aspect_ratio.])],
1553 [[#include <ffmpeg/avfilter.h>]])],
1554 [[#include <libavfilter/avfilter.h>]])
1556 AC_MSG_NOTICE($external_ffmpeg_enabled)
1557 USE_EXTERNAL_FFMPEG=1
1558 AC_DEFINE([USE_EXTERNAL_FFMPEG], [1], [Whether to use external FFmpeg libraries.])
1560 # Disable vdpau support if external libavcodec doesn't have it
1561 AC_CHECK_LIB([avcodec], [ff_vdpau_vc1_decode_picture],,
1562 [if test "x$use_vdpau" = "xyes"; then
1563 AC_MSG_ERROR($ffmpeg_vdpau_not_supported)
1566 AC_MSG_RESULT($ffmpeg_vdpau_not_supported)
1569 # Check for 'PIX_FMT_VDPAU_MPEG4' from libavutil
1570 if test "x$use_vdpau" != "xno"; then
1573 [AC_LANG_SOURCE([ #include <libavutil/pixfmt.h>
1574 int main() { PixelFormat format = PIX_FMT_VDPAU_MPEG4; }])],
1575 [AC_DEFINE([PIX_FMT_VDPAU_MPEG4_IN_AVUTIL], [1],
1576 [Whether AVUtil defines PIX_FMT_VDPAU_MPEG4.])],)
1579 CPPFLAGS="$SAVE_CPPFLAGS"
1581 AC_MSG_NOTICE($external_ffmpeg_disabled)
1582 USE_EXTERNAL_FFMPEG=0
1583 AC_DEFINE([PIX_FMT_VDPAU_MPEG4_IN_AVUTIL], [1], [Whether AVUtil defines PIX_FMT_VDPAU_MPEG4.])
1586 echo "Checking for SWIG installation"
1587 AC_PATH_PROG(SWIG_EXE, swig, "none")
1588 if test "$SWIG_EXE" = "none"; then
1589 AC_PATH_PROG(SWIG20_EXE, swig2.0, "none")
1590 if test "$SWIG20_EXE" != "none" ; then
1591 SWIG_EXE=$SWIG20_EXE
1594 if test "$SWIG_EXE" = "none"; then
1595 AC_MSG_ERROR($missing_program)
1597 final_message="$final_message\n SWIG Available:\tYes"
1599 echo "Checking for a jre installation"
1600 AC_PATH_PROG(JAVA_EXE, java, "none")
1601 if test "$JAVA_EXE" = "none"; then
1602 AC_MSG_ERROR($missing_program)
1604 final_message="$final_message\n JRE Available:\tYes"
1606 echo "Checking for doxygen installation"
1607 AC_PATH_PROG(DOXYGEN_EXE, doxygen, "none")
1608 if test "$DOXYGEN_EXE" = "none"; then
1609 AC_MSG_WARN([Unable to find doxygen installation. Will not be able to make docstrings for the python api])
1610 final_message="$final_message\n Doxygen Available:\tNo"
1613 final_message="$final_message\n Doxygen Available:\tYes"
1618 if test "x$use_vdpau" != "xno"; then
1619 if test "$host_vendor" = "apple" ; then
1620 if test "x$use_vdpau" = "xyes"; then
1621 AC_MSG_ERROR([VDPAU not supported on this platform])
1624 AC_MSG_NOTICE($vdpau_disabled)
1629 AC_CHECK_HEADER([vdpau/vdpau.h],AC_DEFINE([HAVE_LIBVDPAU], [],
1630 [Define to 1 if you have the 'vdpau' library (-lvdpau).]),
1631 [if test "x$use_vdpau" = "xyes"; then
1633 AC_MSG_ERROR([$vdpau_not_found])
1637 AC_MSG_RESULT($vdpau_not_found)
1642 AC_MSG_NOTICE($vdpau_disabled)
1646 if test "x$use_vaapi" != "xno"; then
1647 if test "$host_vendor" = "apple" ; then
1648 if test "x$use_vaapi" = "xyes"; then
1649 AC_MSG_ERROR([VAAPI not supported on this platform])
1652 AC_MSG_NOTICE($vaapi_disabled)
1656 initial_val=$use_vaapi
1657 AC_CHECK_LIB([va], main, :, use_vaapi=no)
1658 if test "x$use_vaapi" != "xno"; then
1659 AC_CHECK_LIB([va-glx], main, LIBS="-lva -lva-glx $LIBS", use_vaapi=no, -lva)
1662 if test "x$use_vaapi" = "xno"; then
1663 if test "x$initial_val" = "xyes"; then
1664 AC_MSG_ERROR($vaapi_not_found)
1666 AC_MSG_RESULT($vaapi_not_found)
1670 AC_DEFINE([HAVE_LIBVA], [1], [Define to 1 if you have the 'vaapi' libraries (-lva AND -lva-glx)])
1675 AC_MSG_NOTICE($vaapi_disabled)
1680 if test "x$use_crystalhd" != "xno"; then
1681 SAVE_CFLAGS="$CFLAGS"
1682 CFLAGS="-D__LINUX_USER__"
1683 AC_CHECK_HEADER([libcrystalhd/libcrystalhd_if.h], [],
1684 [ if test "x$use_crystalhd" = "xyes"; then
1685 AC_MSG_ERROR($crystalhd_not_found)
1688 AC_MSG_RESULT($crystalhd_not_found)
1692 CFLAGS="$SAVE_CFLAGS"
1693 if test "$host_vendor" != "apple"; then
1694 XB_FIND_SONAME([CRYSTALHD], [crystalhd], [use_crystalhd])
1696 if test "x$use_crystalhd" != "xno"; then
1697 SAVE_CFLAGS="$CFLAGS"
1698 CFLAGS="-D__LINUX_USER__ -lcrystalhd"
1699 # check for new crystalhd lib
1701 [AC_LANG_SOURCE([#include <libcrystalhd/bc_dts_types.h>
1702 #include <libcrystalhd/bc_dts_defs.h>
1703 PBC_INFO_CRYSTAL bCrystalInfo;])],
1704 [ AC_DEFINE([HAVE_LIBCRYSTALHD], [2], [Define to 2 if you have the 'New Broadcom Crystal HD' library.]) ],
1705 [ AC_DEFINE([HAVE_LIBCRYSTALHD], [1], [Define to 1 if you have the 'Old Broadcom Crystal HD' library.]) ])
1706 CFLAGS="$SAVE_CFLAGS"
1710 AC_MSG_NOTICE($crystalhd_disabled)
1715 if test "x$use_vdadecoder" != "xno"; then
1716 if test "$host_vendor" = "apple" ; then
1717 HAVE_LIBVDADECODER=1
1718 AC_DEFINE([HAVE_LIBVDADECODER], [1], [Define to 1 if you have the 'VDADecoder' library.])
1719 AC_MSG_NOTICE($vdadecoder_enabled)
1722 if test "x$use_vdadecoder" = "xyes"; then
1723 AC_MSG_ERROR([VDA Decoder not supported on this platform])
1726 AC_MSG_NOTICE($vdadecoder_disabled)
1731 AC_MSG_NOTICE($vdadecoder_disabled)
1735 if test "x$use_vtbdecoder" != "xno"; then
1736 if test "$host_vendor" = "apple" ; then
1737 HAVE_VIDEOTOOLBOXDECODER=1
1738 AC_DEFINE([HAVE_VIDEOTOOLBOXDECODER], [1], [Define to 1 if you have the 'VTBDecoder' library.])
1739 AC_MSG_NOTICE($vtbdecoder_enabled)
1741 if test "x$use_vtbdecoder" = "xyes"; then
1742 AC_MSG_ERROR([VTB Decoder not supported on this platform])
1745 AC_MSG_NOTICE($vtbdecoder_disabled)
1749 AC_MSG_NOTICE($vtbdecoder_disabled)
1753 if test "$host_vendor" = "apple" ; then
1756 AC_MSG_NOTICE($openmax_disabled)
1757 elif test "$target_platform" = "target_raspberry_pi"; then
1760 AC_MSG_NOTICE($openmax_disabled)
1762 if test "$use_gles" = "yes" && test "$use_openmax" = "auto"; then
1763 PKG_CHECK_MODULES([OPENMAX], [libomxil-bellagio],
1764 USE_OPENMAX=1;[INCLUDES="$INCLUDES $OPENMAX_CFLAGS"; LIBS="$LIBS $OPENMAX_LIBS"],
1765 use_openmax=no;USE_OPENMAX=0;AC_MSG_RESULT($openmax_not_found))
1766 elif test "$use_gles" = "yes" && test "$use_openmax" = "yes"; then
1767 PKG_CHECK_MODULES([OPENMAX], [libomxil-bellagio],
1768 USE_OPENMAX=1;[INCLUDES="$INCLUDES $OPENMAX_CFLAGS"; LIBS="$LIBS $OPENMAX_LIBS"],
1769 AC_MSG_ERROR($openmax_not_found))
1771 AC_MSG_NOTICE($openmax_disabled)
1777 # yajl version check (yajl_version.h was added in yajl 2.0)
1778 AC_CHECK_HEADERS([yajl/yajl_version.h], [], [
1779 AC_DEFINE(YAJL_MAJOR, 1, [yajl version 1])
1782 # additional internal players
1783 case $add_players in
1785 AC_CHECK_HEADER([amlplayer/amports/amstream.h],, AC_MSG_ERROR($missing_headers))
1786 XB_ADD_PLAYER([AMLPLAYER], [amlplayer])
1789 XB_ADD_PLAYER([OMXPLAYER], [omxplayer])
1793 # platform specific bin utilities
1794 if test "$host_vendor" != "apple" ; then
1795 AC_CHECK_PROG(HAVE_GAWK,gawk,"yes","no",)
1796 if test "$HAVE_GAWK" = "no" ; then
1797 AC_MSG_ERROR($missing_program)
1801 if test "$use_arch" != "arm" ; then
1802 AC_CHECK_PROG(HAVE_CMAKE,cmake,"yes","no",)
1803 if test "$HAVE_CMAKE" = "no" ; then
1804 AC_MSG_ERROR($missing_program)
1808 AC_CHECK_PROG(HAVE_GPERF,gperf,"yes","no",)
1809 if test "$HAVE_GPERF" = "no" ; then
1810 AC_MSG_ERROR($missing_program)
1813 AC_CHECK_PROG(HAVE_UNZIP,unzip,"yes","no",)
1814 if test "$HAVE_UNZIP" = "no" ; then
1815 AC_MSG_ERROR($missing_program)
1818 AC_CHECK_PROG(HAVE_ZIP,zip,"yes","no",)
1819 if test "$HAVE_ZIP" = "no" ; then
1820 AC_MSG_ERROR($missing_program)
1823 if test "$ARCH" = "i486-linux" || test "$ARCH" = "x86-freebsd"; then
1824 AC_CHECK_PROG(HAVE_NASM,nasm,"yes","no",)
1825 if test "$HAVE_NASM" = "no" ; then
1826 AC_MSG_ERROR($missing_program)
1830 AC_CHECK_PROG(HAVE_GIT,git,"yes","no",)
1832 # Checks for header files.
1836 AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h limits.h locale.h \
1837 malloc.h memory.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h \
1838 strings.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h \
1839 sys/time.h sys/timeb.h sys/vfs.h termios.h unistd.h utime.h wchar.h wctype.h])
1840 AC_CHECK_HEADERS([cdio/iso9660.h],,AC_MSG_ERROR([$missing_headers]))
1842 # Checks for typedefs, structures, and compiler characteristics.
1858 AC_CHECK_MEMBERS([struct stat.st_rdev])
1867 if test "$cross_compiling" = "yes"; then
1868 final_message="$final_message\n Crosscomp.:\tYes"
1870 final_message="$final_message\n Crosscomp.:\tNo"
1873 final_message="$final_message\n target ARCH:\t$use_arch"
1874 final_message="$final_message\n target CPU:\t$use_cpu"
1876 if test "$use_gles" = "yes"; then
1877 final_message="$final_message\n OpenGLES:\tYes"
1882 if test "$use_gl" = "yes"; then
1883 final_message="$final_message\n OpenGL:\tYes"
1886 final_message="$final_message\n OpenGL:\tNo (Very Slow)"
1887 SDL_DEFINES="-DHAS_SDL_2D"
1892 if test "$use_alsa" = "yes"; then
1894 AC_DEFINE([USE_ALSA],[1],["Define to 1 if alsa is installed"])
1895 final_message="$final_message\n ALSA:\t\tYes"
1898 final_message="$final_message\n ALSA:\t\tNo"
1901 if test "$use_dbus" = "yes"; then
1902 final_message="$final_message\n DBUS:\t\tYes"
1904 final_message="$final_message\n DBUS:\t\tNo"
1907 if test "x$use_vdpau" != "xno"; then
1908 final_message="$final_message\n VDPAU:\tYes"
1910 final_message="$final_message\n VDPAU:\tNo"
1913 if test "x$use_vaapi" != "xno"; then
1914 final_message="$final_message\n VAAPI:\tYes"
1916 final_message="$final_message\n VAAPI:\tNo"
1919 if test "x$use_crystalhd" != "xno"; then
1920 final_message="$final_message\n CrystalHD:\tYes"
1922 final_message="$final_message\n CrystalHD:\tNo"
1925 if test "x$use_vdadecoder" != "xno"; then
1926 final_message="$final_message\n VDADecoder:\tYes"
1928 final_message="$final_message\n VDADecoder:\tNo"
1931 if test "x$use_vtbdecoder" != "xno"; then
1932 final_message="$final_message\n VTBDecoder:\tYes"
1934 final_message="$final_message\n VTBDecoder:\tNo"
1937 if test "$use_openmax" != "no"; then
1938 final_message="$final_message\n OpenMax:\tYes"
1940 final_message="$final_message\n OpenMax:\tNo"
1943 if test "$use_joystick" = "yes"; then
1944 final_message="$final_message\n Joystick:\tYes"
1945 SDL_DEFINES="$SDL_DEFINES -DHAS_SDL_JOYSTICK"
1947 final_message="$final_message\n Joystick:\tNo"
1950 if test "$use_xrandr" = "yes"; then
1951 final_message="$final_message\n XRandR:\tYes"
1954 final_message="$final_message\n XRandR:\tNo"
1958 if test "$use_goom" = "yes"; then
1959 final_message="$final_message\n GOOM:\t\tYes"
1961 final_message="$final_message\n GOOM:\t\tNo"
1964 if test "$use_rsxs" = "yes"; then
1965 final_message="$final_message\n RSXS:\t\tYes"
1967 final_message="$final_message\n RSXS:\t\tNo"
1970 if test "$use_projectm" = "yes"; then
1971 final_message="$final_message\n ProjectM:\tYes"
1973 final_message="$final_message\n ProjectM:\tNo"
1976 if test "$use_skin_touched" = "yes"; then
1977 final_message="$final_message\n Skin Touched:\tYes"
1979 final_message="$final_message\n Skin Touched:\tNo"
1982 if test "$use_x11" = "yes"; then
1983 final_message="$final_message\n X11:\t\tYes"
1985 final_message="$final_message\n X11:\t\tNo"
1988 if test "$use_libbluray" = "yes"; then
1989 final_message="$final_message\n Bluray:\tYes"
1991 final_message="$final_message\n Bluray:\tNo"
1994 USE_TEXTUREPACKER_NATIVE=0
1995 if test "x$use_texturepacker" != "xno"; then
1996 final_message="$final_message\n TexturePacker:Yes"
1998 if test "x$use_texturepacker_native" = "xyes"; then
1999 USE_TEXTUREPACKER_NATIVE=1
2000 if [[ ! -d "$USE_TEXTUREPACKER_NATIVE_ROOT" ]]; then
2001 USE_TEXTUREPACKER_NATIVE_ROOT=
2005 final_message="$final_message\n TexturePacker:No"
2009 if test "$use_mid" = "yes"; then
2010 final_message="$final_message\n MID Support:\tYes"
2011 SDL_DEFINES="$SDL_DEFINES -DMID"
2013 final_message="$final_message\n MID Support:\tNo"
2018 if test "x$use_ccache" != "xno"; then
2019 AC_PATH_PROG(CCACHE,ccache,none)
2020 if test "$ac_cv_path_CCACHE" = "none"; then
2021 if test "x$use_ccache" = "xyes"; then
2022 AC_MSG_ERROR([ccache not found.]);
2024 AC_MSG_NOTICE([ccache not found. Falling back to default CC])
2025 final_message="$final_message\n ccache:\tNo"
2028 CC="$ac_cv_path_CCACHE $CC"
2029 CXX="$ac_cv_path_CCACHE $CXX"
2030 AC_MSG_NOTICE(enabling ccache)
2031 final_message="$final_message\n ccache:\tYes"
2034 final_message="$final_message\n ccache:\tNo"
2037 if test "$use_alsa" = "yes"; then
2038 final_message="$final_message\n ALSA Support:\tYes"
2040 final_message="$final_message\n ALSA Support:\tNo"
2043 if test "x$use_pulse" != "xno"; then
2044 XBMC_STANDALONE_SH_PULSE=tools/Linux/xbmc-standalone.sh.pulse
2045 final_message="$final_message\n PulseAudio:\tYes"
2047 XBMC_STANDALONE_SH_PULSE=/dev/null
2048 final_message="$final_message\n PulseAudio:\tNo"
2051 if test "$use_hal" = "yes"; then
2052 final_message="$final_message\n HAL Support:\tYes"
2054 final_message="$final_message\n HAL Support:\tNo"
2058 if test "$use_dvdcss" = "yes"; then
2059 AC_MSG_NOTICE($dvdcss_enabled)
2060 final_message="$final_message\n DVDCSS:\tYes"
2062 SKIP_CONFIG_DVDCSS=0
2063 DVDREAD_CFLAGS="-D_XBMC -DHAVE_DVDCSS_DVDCSS_H"
2065 AC_MSG_NOTICE($dvdcss_disabled)
2066 final_message="$final_message\n DVDCSS:\tNo"
2068 SKIP_CONFIG_DVDCSS=1
2069 DVDREAD_CFLAGS="-D_XBMC -UHAVE_DVDCSS_DVDCSS_H"
2071 if test "$host_vendor" = "apple"; then
2072 DVDREAD_CFLAGS="$DVDREAD_CFLAGS -D__DARWIN__"
2075 # Google Test Framework
2076 if test "$configure_gtest" = "yes"; then
2077 AC_MSG_NOTICE($gtest_enabled)
2078 final_message="$final_message\n Google Test Framework Configured:\tYes"
2082 AC_MSG_NOTICE($gtest_disabled)
2083 final_message="$final_message\n Google Test Framework Configured:\tNo"
2088 if test "$use_avahi" = "yes"; then
2089 final_message="$final_message\n Avahi:\tYes"
2091 final_message="$final_message\n Avahi:\tNo"
2094 if test "$HAVE_GIT" = "yes"; then
2095 GIT_REV=$(git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}')
2097 if test "$GIT_REV" = ""; then
2100 if test "$host_vendor" = "apple"; then
2101 echo "#define GIT_REV \"$GIT_REV\"" > git_revision.h
2103 SDL_DEFINES="$SDL_DEFINES -D'GIT_REV=\"$GIT_REV\"'"
2106 if test "$use_nonfree" = "yes"; then
2107 final_message="$final_message\n Non-free:\tYes"
2109 AC_DEFINE([HAVE_XBMC_NONFREE], [1], [Define to 1 to enable non-free components.])
2112 final_message="$final_message\n Non-free:\tNo"
2115 if test "$use_asap" = "yes"; then
2116 AC_CHECK_PROG(HAVE_GDC,gdc,"yes","no")
2117 if test "$HAVE_GDC" = "no"; then
2118 AC_MSG_ERROR($missing_program);
2120 AC_CHECK_PROG(HAVE_FPC,fpc,"yes","no")
2121 if test "$HAVE_FPC" = "no"; then
2122 AC_MSG_ERROR($missing_program);
2125 AC_DEFINE([USE_ASAP_CODEC], [1], [Define to 1 to enable ASAP codec.])
2126 final_message="$final_message\n ASAP Codec:\tYes"
2129 final_message="$final_message\n ASAP Codec:\tNo"
2132 if test "$use_mysql" = "yes"; then
2133 final_message="$final_message\n MySQL:\tYes"
2136 final_message="$final_message\n MySQL:\tNo"
2139 if test "$use_webserver" = "yes"; then
2140 final_message="$final_message\n Webserver:\tYes"
2143 final_message="$final_message\n Webserver:\tNo"
2147 if test "$use_librtmp" != "no"; then
2148 final_message="$final_message\n libRTMP support:\tYes"
2150 final_message="$final_message\n libRTMP support:\tNo"
2153 if test "x$use_samba" != "xno"; then
2154 final_message="$final_message\n libsmbclient support:\tYes"
2156 final_message="$final_message\n libsmbclient support:\tNo"
2159 if test "$use_libnfs" != "no"; then
2160 final_message="$final_message\n libnfs client support:Yes"
2162 final_message="$final_message\n libnfs client support:No"
2165 if test "x$use_libafpclient" != "xno"; then
2166 final_message="$final_message\n libafpclient support:\tYes"
2168 final_message="$final_message\n libafpclient support:\tNo"
2171 if test "$use_airplay" != "no"; then
2172 final_message="$final_message\n AirPlay support:\tYes"
2174 final_message="$final_message\n AirPLay support:\tNo"
2177 if test "x$use_airtunes" != "xno"; then
2178 final_message="$final_message\n AirTunes support:\tYes"
2180 final_message="$final_message\n AirTunes support:\tNo"
2183 if test "x$use_upnp" != "xno"; then
2184 final_message="$final_message\n UPnP support:\t\tYes"
2186 AC_DEFINE([USE_UPNP], [1], [Define to 1 to enable UPnP support.])
2189 final_message="$final_message\n UPnP support:\t\tNo"
2192 if test "$use_optical_drive" = "yes"; then
2193 final_message="$final_message\n Optical drive:\tYes"
2195 final_message="$final_message\n Optical drive:\tNo"
2198 if test "x$use_libudev" != "xno"; then
2199 final_message="$final_message\n libudev support:\tYes"
2201 final_message="$final_message\n libudev support:\tNo"
2204 if test "x$use_libusb" != "xno"; then
2205 final_message="$final_message\n libusb support:\tYes"
2207 final_message="$final_message\n libusb support:\tNo"
2210 if test "x$use_libcec" != "xno"; then
2211 final_message="$final_message\n libcec support:\tYes"
2212 if test "x$use_rpi_cec_api" != "xno"; then
2213 final_message="$final_message\n libcec RPi support:\tYes"
2215 final_message="$final_message\n libcec RPi support:\tNo"
2218 final_message="$final_message\n libcec support:\tNo"
2221 if test "x$use_libmp3lame" != "xno"; then
2222 final_message="$final_message\n libmp3lame support:\tYes"
2224 final_message="$final_message\n libmp3lame support:\tNo"
2227 if test "x$use_libvorbisenc" != "xno"; then
2228 final_message="$final_message\n libvorbisenc support:\tYes"
2230 final_message="$final_message\n libvorbisenc support:\tNo"
2233 if test "x$use_libcap" != "xno"; then
2234 final_message="$final_message\n libcap support:\tYes"
2236 final_message="$final_message\n libcap support:\tNo"
2239 if test "x$add_players" != "xno"; then
2240 final_message="$final_message\n additional players:\tYes"
2242 final_message="$final_message\n additional players:\tNo"
2245 ### External libraries messages
2247 if test "$use_external_ffmpeg" = "yes"; then
2248 final_message="$final_message\n External FFmpeg:\tYes"
2250 final_message="$final_message\n External FFmpeg:\tNo"
2253 if test "$host_vendor" = "apple" ; then
2254 # built internal but referenced as external, we link directly to them.
2255 # this MUST be the last thing before OUTPUT_FILES as they do not
2256 # exist until after we build FFMpeg.
2257 LIBS="$LIBS -L\$(abs_top_srcdir)/lib/ffmpeg/libavcodec -lavcodec"
2258 LIBS="$LIBS -L\$(abs_top_srcdir)/lib/ffmpeg/libavfilter -lavfilter"
2259 LIBS="$LIBS -L\$(abs_top_srcdir)/lib/ffmpeg/libswresample -lswresample"
2260 LIBS="$LIBS -L\$(abs_top_srcdir)/lib/ffmpeg/libavformat -lavformat"
2261 LIBS="$LIBS -L\$(abs_top_srcdir)/lib/ffmpeg/libavutil -lavutil"
2262 LIBS="$LIBS -L\$(abs_top_srcdir)/lib/ffmpeg/libpostproc -lpostproc"
2263 LIBS="$LIBS -L\$(abs_top_srcdir)/lib/ffmpeg/libswscale -lswscale"
2267 DISABLE_PVR_ADDON_CONFIG=1
2268 if [[ -f "pvr-addons/Makefile.am" ]]; then
2269 final_message="$final_message\n PVR add-ons:\t\tYes"
2271 DISABLE_PVR_ADDON_CONFIG=0
2273 final_message="$final_message\n PVR add-ons:\t\tNo"
2276 OUTPUT_FILES="Makefile \
2278 addons/skin.confluence/media/Makefile \
2280 xbmc/cdrip/Makefile \
2281 xbmc/cores/Makefile \
2282 xbmc/cores/VideoRenderers/Makefile \
2283 xbmc/cores/dvdplayer/Makefile \
2285 lib/libdvd/Makefile \
2286 xbmc/cores/DllLoader/Makefile \
2287 xbmc/cores/DllLoader/exports/Makefile \
2288 xbmc/cores/dvdplayer/DVDCodecs/Makefile \
2289 xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile \
2290 xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile \
2291 xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile \
2292 xbmc/cores/dvdplayer/DVDDemuxers/Makefile \
2293 xbmc/cores/dvdplayer/DVDSubtitles/Makefile \
2294 xbmc/cores/AudioEngine/Makefile \
2295 xbmc/cores/paplayer/Makefile \
2296 xbmc/cores/amlplayer/Makefile \
2297 xbmc/cores/omxplayer/Makefile \
2298 lib/timidity/Makefile \
2299 lib/xbadpcm/Makefile \
2301 lib/nosefart/Makefile \
2302 lib/libsidplay2/Makefile \
2303 lib/vgmstream/Makefile \
2304 lib/snesapu/SNES/SNESAPU/Makefile \
2305 lib/stsound/StSoundLibrary/Makefile \
2306 xbmc/cores/playercorefactory/Makefile \
2307 xbmc/music/karaoke/Makefile \
2309 xbmc/guilib/Makefile \
2310 xbmc/interfaces/Makefile \
2311 xbmc/network/Makefile \
2312 xbmc/network/upnp/Makefile \
2313 lib/libRTV/Makefile \
2314 lib/libexif/Makefile \
2315 lib/libXDAAP/Makefile \
2316 lib/cmyth/Makefile \
2317 lib/libhdhomerun/Makefile \
2318 lib/libsquish/Makefile \
2319 lib/cximage-6.0/Makefile \
2320 lib/addons/script.module.pil/Makefile \
2321 lib/libUPnP/Makefile \
2322 xbmc/DllPaths_generated.h \
2323 xbmc/DllPaths_generated_android.h \
2324 xbmc/freebsd/Makefile \
2325 xbmc/linux/Makefile \
2326 xbmc/filesystem/Makefile \
2327 xbmc/screensavers/rsxs-0.9/xbmc/Makefile \
2328 xbmc/visualizations/XBMCProjectM/Makefile \
2329 xbmc/visualizations/Goom/Makefile \
2330 xbmc/visualizations/OpenGLSpectrum/Makefile \
2331 xbmc/visualizations/WaveForm/Makefile \
2332 xbmc/visualizations/iTunes/Makefile \
2333 lib/addons/library.xbmc.addon/Makefile \
2334 lib/addons/library.xbmc.gui/Makefile \
2335 lib/addons/library.xbmc.pvr/Makefile \
2336 xbmc/visualizations/EGLHelpers/Makefile \
2337 tools/Linux/xbmc.sh \
2338 tools/Linux/xbmc-standalone.sh \
2339 tools/TexturePacker/Makefile \
2340 tools/EventClients/Clients/OSXRemote/Makefile \
2341 xbmc/peripherals/bus/Makefile \
2342 xbmc/peripherals/devices/Makefile \
2343 xbmc/android/activity/Makefile \
2344 xbmc/android/loader/Makefile \
2347 if test "$use_skin_touched" = "yes"; then
2348 OUTPUT_FILES="$OUTPUT_FILES addons/skin.touched/media/Makefile"
2351 OUTPUT_FILES="$OUTPUT_FILES \
2352 xbmc/interfaces/python/Makefile \
2353 xbmc/interfaces/python/test/Makefile"
2355 # Line below is used so we can use AM_INIT_AUTOMAKE. The corresponding
2356 # .dummy.am does nothing.
2357 AC_CONFIG_FILES([.dummy])
2359 AC_CONFIG_FILES([${OUTPUT_FILES}])
2360 OUTPUT_FILES="$OUTPUT_FILES \
2366 AC_SUBST(SDL_DEFINES)
2367 AC_SUBST(BUILD_DVDCSS)
2368 AC_SUBST(DISABLE_GOOM)
2369 AC_SUBST(DISABLE_RSXS)
2370 AC_SUBST(DISABLE_PROJECTM)
2371 AC_SUBST(USE_SKIN_TOUCHED)
2372 AC_SUBST(USE_EXTERNAL_FFMPEG)
2373 AC_SUBST(PYTHON_VERSION)
2374 AC_SUBST(OUTPUT_FILES)
2375 AC_SUBST(HAVE_XBMC_NONFREE)
2376 AC_SUBST(USE_ASAP_CODEC)
2377 AC_SUBST(LIBCURL_BASENAME)
2378 AC_SUBST(LIBFLAC_BASENAME)
2379 AC_SUBST(LIBVORBISFILE_BASENAME)
2380 AC_SUBST(LIBMODPLUG_BASENAME)
2381 AC_SUBST(LIBMAD_BASENAME)
2382 AC_SUBST(LIBOGG_BASENAME)
2383 AC_SUBST(LIBVORBISENC_BASENAME)
2384 AC_SUBST(LIBVORBIS_BASENAME)
2385 AC_SUBST(LIBASS_BASENAME)
2386 AC_SUBST(LIBMEPG2_BASENAME)
2387 AC_SUBST_FILE(XBMC_STANDALONE_SH_PULSE)
2388 AC_SUBST(USE_OPENGL)
2389 AC_SUBST(USE_OPENGLES)
2392 AC_SUBST(USE_CRYSTALHD)
2393 AC_SUBST(USE_LIBSMBCLIENT)
2394 AC_SUBST(USE_LIBNFS)
2395 AC_SUBST(USE_LIBAFPCLIENT)
2396 AC_SUBST(USE_AIRPLAY)
2398 AC_SUBST(USE_OPENMAX)
2400 AC_SUBST(USE_XRANDR)
2402 AC_SUBST(USE_TEXTUREPACKER)
2403 AC_SUBST(USE_TEXTUREPACKER_NATIVE)
2404 AC_SUBST(USE_TEXTUREPACKER_NATIVE_ROOT)
2405 AC_SUBST(USE_AIRTUNES)
2406 AC_SUBST(USE_LIBUDEV)
2407 AC_SUBST(USE_LIBUSB)
2408 AC_SUBST(USE_LIBCEC)
2409 AC_SUBST(USE_CEC_RPI_API)
2411 AC_SUBST(USE_WEB_SERVER)
2413 AC_SUBST(USE_OMXLIB)
2414 AC_SUBST(USE_ANDROID)
2415 AC_SUBST(GTEST_CONFIGURED)
2416 AC_SUBST(USE_DOXYGEN)
2417 AC_SUBST(USE_PVR_ADDONS)
2419 # pushd and popd are not available in other shells besides bash, so implement
2420 # our own pushd/popd functions
2425 if [[ -d "$dirname" ]] && [[ -x "$dirname" ]]; then
2427 XB_DIRSTACK="$dirname ${XB_DIRSTACK:-$PWD}"
2430 AC_MSG_ERROR(xb_pushd: unable to change to $dirname)
2435 if [[ -n "$XB_DIRSTACK" ]]; then
2436 XB_DIRSTACK="${XB_DIRSTACK#* }"
2437 cd "${XB_DIRSTACK%% *}"
2440 AC_MSG_ERROR(xb_popd: unable to go back to previous directory)
2444 # Function to run the configure scripts in our submodules
2445 # Consists of three paramaters, the path to the submodule, the configure command
2446 # with appropriate arguments, and a third parameter set to 1 if we are to skip
2447 # running the script, anything else if not.
2448 AC_DEFUN([XB_CONFIG_MODULE],[
2449 AC_CONFIG_COMMANDS_POST([
2450 if [[ $3 != "1" ]]; then
2451 if [[ -d $1 ]]; then
2454 if [[ $? -ne 0 ]]; then
2456 AC_MSG_ERROR([[Submodule $1 failed to configure]])
2461 AC_MSG_ERROR([[Submodule $1 does not exist]])
2464 AC_MSG_NOTICE([[Skipping configuration of submodule $1.]])
2469 XB_CONFIG_MODULE([lib/ffmpeg], [
2470 if test "$host_vendor" = "apple" ; then
2471 ffmpg_config="--target-os=$ffmpeg_target_os"
2472 # handle disables first, we do individual enables later
2473 ffmpg_config="$ffmpg_config --disable-muxers --disable-encoders"
2474 ffmpg_config="$ffmpg_config --disable-devices --disable-doc"
2475 ffmpg_config="$ffmpg_config --disable-ffplay --disable-ffmpeg"
2476 ffmpg_config="$ffmpg_config --disable-ffprobe --disable-ffserver"
2477 ffmpg_config="$ffmpg_config --disable-vda --disable-crystalhd"
2478 ffmpg_config="$ffmpg_config --disable-decoder=mpeg_xvmc"
2480 # handle conditional enables/disables
2481 if test "$use_debug" = "no"; then
2482 ffmpg_config="$ffmpg_config --disable-debug"
2484 if test "$use_cpu" != "no"; then
2485 ffmpg_config="$ffmpg_config --cpu=$use_cpu"
2487 if test "$use_arch" != "no"; then
2488 ffmpg_config="$ffmpg_config --arch=$use_arch --enable-cross-compile"
2490 if test "$use_arch" = "arm"; then
2491 ffmpg_config="$ffmpg_config --enable-pic"
2492 ffmpg_config="$ffmpg_config --disable-armv5te --disable-armv6t2"
2493 if test "$use_neon" = "yes"; then
2494 ffmpg_config="$ffmpg_config --enable-neon"
2496 ffmpg_config="$ffmpg_config --disable-neon"
2499 ffmpg_config="$ffmpg_config --disable-amd3dnow"
2501 if test "$use_ffmpeg_libvorbis" = "yes"; then
2502 ffmpg_config="$ffmpg_config --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis"
2504 ffmpg_config="$ffmpg_config --disable-libvorbis"
2507 # handle individual enables
2508 ffmpg_config="$ffmpg_config --enable-gpl"
2509 ffmpg_config="$ffmpg_config --enable-postproc"
2510 ffmpg_config="$ffmpg_config --enable-static --enable-pthreads"
2511 ffmpg_config="$ffmpg_config --enable-muxer=spdif --enable-muxer=adts"
2512 ffmpg_config="$ffmpg_config --enable-encoder=ac3 --enable-encoder=aac"
2513 ffmpg_config="$ffmpg_config --enable-protocol=http"
2514 ffmpg_config="$ffmpg_config --enable-runtime-cpudetect"
2516 # ffmpeg will not compile with llvm-gcc-4.2, use clang instead
2519 ffmpg_config="$ffmpg_config --cc=clang" ;;
2521 ffmpg_config="$ffmpg_config --cc=$CC" ;;
2524 # extra-cflags must be passed alone or it gets expanded wrong by the ffmpeg configure
2525 FFMPEG_EXTRACFLAGS="$CFLAGS $FFMPEG_EXTRACFLAGS -w -D_DARWIN_C_SOURCE -Dattribute_deprecated="
2527 ./configure --extra-cflags="$FFMPEG_EXTRACFLAGS" $ffmpg_config --as="$AS"
2529 # if using llvm-gcc-4.2 as assembler, -MMD is not enough to generate
2530 # dependency files in the right place, replace it with something that works
2533 sed -ie "s#AS_DEPFLAGS=-MMD#AS_DEPFLAGS=-MMD -MF \$(\@:.o=.d) -MT \$\@#" config.mak ;;
2536 # ffmpeg will use yasm found at ${prefix}/bin during configure
2537 # but then hardcodes 'yasm' in config.mak, fix it.
2538 sed -ie "s#YASM=yasm#YASM=${prefix}/bin/yasm#" config.mak
2539 sed -ie "s#YASMDEP=yasm#YASMDEP=${prefix}/bin/yasm#" config.mak
2540 sed -ie "s# -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 # #" config.mak
2545 LDFLAGS="$(echo "$LDFLAGS" | sed "s/-Wl,-Bsymbolic-functions//g")" \
2547 --extra-cflags="$PASSED_CFLAGS $FFMPEG_EXTRACFLAGS" \
2549 `if test "$use_debug" = "no"; then echo --disable-debug; fi` \
2550 `if test "$cross_compiling" = "yes"; then echo --enable-cross-compile; fi` \
2551 `if test "$use_arch" != "no"; then echo --arch=$use_arch; fi`\
2552 `if test "$use_cpu" != "no"; then echo --cpu=$use_cpu; fi`\
2553 `if test "$use_neon" = "yes"; then echo --enable-neon; else echo --disable-neon; fi`\
2554 --target-os=$ffmpeg_target_os \
2556 --enable-muxer=spdif \
2557 --enable-muxer=adts \
2558 --disable-encoders \
2559 --enable-encoder=ac3 \
2560 --enable-encoder=aac \
2561 `if test "$use_ffmpeg_libvorbis" = "yes"; then echo --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis; else echo --disable-libvorbis; fi` \
2562 --disable-decoder=mpeg_xvmc \
2566 --disable-ffserver \
2568 --disable-crystalhd \
2573 `if test "x$use_vdpau" != "xno"; then echo --enable-vdpau; else echo --disable-vdpau; fi` \
2574 `if test "x$use_vaapi" != "xno"; then echo --enable-vaapi; else echo --disable-vaapi; fi` \
2575 `if test "$use_optimizations" != "no"; then echo --enable-optimizations; else echo --disable-optimizations; fi` \
2576 --enable-protocol=http \
2578 --enable-runtime-cpudetect \
2579 `if test "$use_hardcoded_tables" = "yes"; then echo --enable-hardcoded-tables; else echo --disable-hardcoded-tables; fi`\
2580 `if test "$target_platform" = "target_android" && test "$host_cpu" = "i686"; then echo --disable-mmx; fi #workaround for gcc 4.6 bug` \
2581 `if test "$target_platform" = "target_android"; then echo "--custom-libname-with-major=\\$(SLIBPREF)\\$(FULLNAME)-\\$(LIBMAJOR)-${ARCH}\\$(SLIBSUF)"; \
2582 else echo "--custom-libname-with-major=\\$(FULLNAME)-\\$(LIBMAJOR)-${ARCH}\\$(SLIBSUF)"; fi` \
2583 `case $host_cpu in i?86*) echo --disable-pic ;; *) echo --enable-pic ;; esac` \
2585 sed -i -e "s#define HAVE_SYMVER 1#define HAVE_SYMVER 0#" config.h &&
2586 sed -i -e "s#define HAVE_SYMVER_GNU_ASM 1#define HAVE_SYMVER_GNU_ASM 0#" config.h
2588 ], [$USE_EXTERNAL_FFMPEG])
2590 XB_CONFIG_MODULE([lib/libdvd/libdvdcss], [
2595 --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2596 --host=$host_alias \
2597 --build=$build_alias \
2598 --target=$target_alias \
2602 ], [$SKIP_CONFIG_DVDCSS])
2604 XB_CONFIG_MODULE([lib/libdvd/libdvdread], [
2606 --extra-cflags="$CFLAGS $DVDREAD_CFLAGS -I`pwd`/../libdvdcss/src" \
2607 --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2608 --host=$host_alias \
2609 --build=$build_alias \
2610 --target=$target_alias \
2616 $MAKE dvdread-config &&
2617 mkdir -p `pwd`/../includes/dvdread
2618 cp `pwd`/../libdvdread/src/*.h `pwd`/../includes/dvdread
2621 XB_CONFIG_MODULE([lib/libdvd/libdvdnav], [
2623 --extra-cflags="$CFLAGS $DVDREAD_CFLAGS -I`pwd`/../includes" \
2624 --extra-ldflags="-L`pwd`/../libdvdread/obj" \
2625 --with-dvdread-config="`pwd`/../libdvdread/obj/dvdread-config" \
2626 --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2627 --host=$host_alias \
2628 --build=$build_alias \
2629 --target=$target_alias \
2635 XB_CONFIG_MODULE([xbmc/visualizations/XBMCProjectM/libprojectM],[
2637 rm -f CMakeCache.txt && \
2638 CC="$ORIGCC" CXX="$ORIGCXX" LDFLAGS="$LDFLAGS" cmake \
2639 -DCMAKE_BUILD_TYPE=None -DUSE_FTGL:BOOL=OFF \
2640 -DCMAKE_C_FLAGS:STRING="${CPPFLAGS} ${CFLAGS}" \
2641 -DCMAKE_CXX_FLAGS:STRING="${CPPFLAGS} ${CXXFLAGS}" \
2642 -DCMAKE_INSTALL_PREFIX="${prefix}" \
2643 -DCMAKE_INSTALL_LIBDIR:PATH="${libdir}" \
2644 -DINCLUDE_INSTALL_DIR:PATH="${includedir}" \
2645 -DLIB_INSTALL_DIR:PATH="${libdir}" \
2646 -DSYSCONF_INSTALL_DIR:PATH="${sysconfdir}" \
2647 -DSHARE_INSTALL_PREFIX:PATH="${datadir}" . &&
2648 if test "$host_vendor" = "apple" ; then
2649 # cmake has hardcoded paths to macports which bork our darwin depends cross/ppc, remove them
2650 sed -ie "s|-L/opt/local/lib| |" CMakeFiles/projectM.dir/link.txt
2651 sed -ie "s|-L/opt/local/lib| |" CMakeFiles/projectM.dir/flags.make
2652 sed -ie "s|-I/opt/local/include| |" CMakeFiles/projectM.dir/flags.make
2655 ], [$DISABLE_PROJECTM])
2657 XB_CONFIG_MODULE([xbmc/visualizations/Goom/goom2k4-0],[
2660 CXXFLAGS="$CXXFLAGS" \
2661 --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2662 --host=$host_alias \
2663 --build=$build_alias \
2664 --target=$target_alias \
2670 XB_CONFIG_MODULE([xbmc/screensavers/rsxs-0.9/], [
2675 CXXFLAGS="$CXXFLAGS" \
2676 `if test "$host_vendor" = "apple"; then echo --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib; fi` \
2677 --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2678 --host=$host_alias \
2679 --build=$build_alias \
2680 --target=$target_alias \
2681 --without-xscreensaver \
2684 --disable-fieldlines \
2688 --disable-hyperspace \
2691 if echo "$ARCH" | grep -q freebsd ; then
2692 sed -i.back "s;\(STDBOOL_H = \)stdbool.h;\1;" lib/Makefile
2696 XB_CONFIG_MODULE([lib/cpluff], [
2697 ./configure --disable-nls \
2698 --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2699 --host=$host_alias \
2700 --build=$build_alias \
2701 --target=$target_alias CFLAGS="$CFLAGS" CC="$CC" CXX="$CXX" LDFLAGS="$LDFLAGS" LIBS=""
2702 #LDFLAGS="$LDFLAGS -Wl,-read_only_relocs,suppress"
2705 XB_CONFIG_MODULE([lib/gtest], [
2710 --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
2711 --host=$host_alias \
2712 --build=$build_alias \
2713 --target=$target_alias \
2717 ], [$SKIP_CONFIG_GTEST])
2719 XB_CONFIG_MODULE([pvr-addons], [
2721 --prefix="${prefix}" \
2722 --host=$host_alias \
2723 --build=$build_alias \
2724 --target=$target_alias \
2728 CXXFLAGS="$CXXFLAGS"
2729 ], [$DISABLE_PVR_ADDON_CONFIG])
2733 final_message="$final_message\n prefix:\t$prefix\n$dashes"
2734 echo -e "$final_message\n"