force undef _POSIX_C_SOURCE/_XOPEN_SOURCE/_XOPEN_SOURCE_EXTENDED under darwin10
[xbmc:xbmc.git] / 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", 9.04, http://xbmc.org/trac/)
6 AC_CONFIG_HEADERS([config.h])
7 AH_TOP([#pragma once])
8
9 # Ensure config.guess and config.sub exist and is executable
10 # Also install latest version of these files if available
11 AC_MSG_NOTICE([Ensuring config.guess and config.sub exist and is executable])
12 test -f config.guess && chmod a+x config.guess
13 if [[ -x /usr/share/misc/config.guess ]] && \
14     [[ $($PWD/config.guess -t | sed 's/-//g') -lt \
15     $(/usr/share/misc/config.guess -t | sed 's/-//g') ]]; then
16     cp -f /usr/share/misc/config.guess config.guess
17 fi
18 test -f config.sub && chmod a+x config.sub
19 if [[ -x /usr/share/misc/config.sub ]] && \
20     [[ $($PWD/config.sub -t | sed 's/-//g') -lt \
21     $(/usr/share/misc/config.sub -t | sed 's/-//g') ]]; then
22     cp -f /usr/share/misc/config.sub config.sub
23 fi
24
25 AC_CANONICAL_HOST
26
27 # General message strings
28 configure_debug="ERROR: this is a configure debug statement"
29 missing_library="Could not find a required library. Please see the README for your platform."
30 missing_headers="Could not find some required headers. Please see the README for your platform."
31 missing_program="Could not find a required program. Please see the README for your platform."
32 xrandr_not_found="== Could not find libXRandR. SDL will be used for resolution support. =="
33 xrandr_disabled="== XRandR support disabled. SDL will be used for resolution support. =="
34 pulse_not_found="== Could not find libpulse. PulseAudio support disabled. =="
35 pulse_disabled="== PulseAudio support manually disabled. =="
36 faac_not_found="== Could not find libfaac. FAAC support disabled. =="
37 faac_disabled="== FAAC support manually disabled. =="
38 dvdcss_enabled="== DVDCSS support enabled. =="
39 dvdcss_disabled="== DVDCSS support disabled. =="
40 avahi_not_found="== Could not find libavahi-common or libavahi-client. Avahi support disabled. =="
41 avahi_disabled="== Avahi support disabled. =="
42 vdpau_not_found="== Could not find libvdpau. VDPAU support disabled. =="
43 vdpau_disabled="== VDPAU support manually disabled. =="
44
45 # External library message strings
46 external_libraries_enabled="== Use of all supported external libraries enabled. =="
47 external_libraries_disabled="== Use of all supported external libraries disabled. =="
48 external_ffmpeg_enabled="== Use of external ffmpeg enabled. =="
49 external_ffmpeg_disabled="== Use of external ffmpeg disabled. =="
50 external_libmad_enabled="== Use of external libmad enabled. =="
51 external_libmad_disabled="== Use of external libmad disabled. =="
52 external_liba52_enabled="== Use of external liba52 enabled. =="
53 external_liba52_disabled="== Use of external liba52 disabled. =="
54 external_libdts_enabled="== Use of external libdts enabled. =="
55 external_libdts_disabled="== Use of external libdts disabled. =="
56 external_libfaad_enabled="== Use of external libfaad enabled. =="
57 external_libfaad_disabled="== Use of external libfaad disabled. =="
58 external_libmpeg2_enabled="== Use of external libmpeg2 enabled. =="
59 external_libmpeg2_disabled="== Use of external libmpeg2 disabled. =="
60 external_libass_enabled="== Use of external libass enabled. =="
61 external_libass_disabled="== Use of external libass disabled. =="
62 external_libvorbis_enabled="== Use of external libvorbis enabled. =="
63 external_libvorbis_disabled="== Use of external libvorbis disabled. =="
64 external_libogg_enabled="== Use of external libogg enabled. =="
65 external_libogg_disabled="== Use of external libogg disabled. =="
66 external_libmpcdec_enabled="== Use of external libmpcdec enabled. =="
67 external_libmpcdec_disabled="== Use of external libmpcdec disabled. =="
68 external_libflac_enabled="== Use of external libflac enabled. =="
69 external_libflac_disabled="== Use of external libflac disabled. =="
70 external_libwavpack_enabled="== Use of external libwavpack enabled. =="
71 external_libwavpack_disabled="== Use of external libwavpack disabled. =="
72 external_python_enabled="== Use of external python enabled. =="
73 external_python_disabled="== Use of external python disabled. =="
74 ffmpeg_vdpau_not_supported="== External ffmpeg doesn't support VDPAU. VDPAU support disabled. =="
75
76 case $host in
77     i*86*-linux-gnu*)
78        ARCH="i486-linux"
79        ;;
80     x86_64-*-linux-gnu*)
81        ARCH="x86_64-linux"
82        ;;
83     i386-apple-darwin*)
84        ARCH="x86-osx"
85        AC_SUBST(ARCH_DEFINES, "-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk")
86        ;;
87     powerpc-apple-darwin*)
88        ARCH="powerpc-osx"
89        AC_SUBST(ARCH_DEFINES, "-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk")
90        ;;
91     powerpc-*-linux-gnu*)
92        ARCH="powerpc-linux"
93        AC_SUBST(ARCH_DEFINES, "-D_POWERPC")
94        ;;
95     powerpc64-*-linux-gnu*)
96        ARCH="powerpc64-linux"
97        AC_SUBST(ARCH_DEFINES, "-D_POWERPC64")
98        ;;
99     *)
100        AC_MSG_ERROR(unsupported host ($host))
101 esac
102 AC_SUBST([ARCH])
103
104 AC_ARG_ENABLE([debug],
105             [AS_HELP_STRING([--enable-debug],
106                [enable debugging information (default is yes)])],
107             [use_debug=$enableval],
108             [use_debug=yes])
109
110 AC_ARG_ENABLE([optimizations],
111             [AS_HELP_STRING([--enable-optimizations],
112                [enable optimization (default is yes)])],
113             [use_optimizations=$enableval],
114             [use_optimizations=yes])
115
116 AC_ARG_ENABLE([gl],
117             [AS_HELP_STRING([--enable-gl],
118                [enable OpenGL rendering (default is yes)])],
119             [use_gl=$enableval],
120             [use_gl=yes])
121
122 AC_ARG_ENABLE([vdpau],
123             [AS_HELP_STRING([--enable-vdpau],
124                [enable VDPAU decoding (default is yes)])],
125             [use_vdpau=$enableval],
126             [use_vdpau=yes])
127
128 AC_ARG_ENABLE([profiling],
129             [AS_HELP_STRING([--enable-profiling],
130                [enable gprof profiling (default is no)])],
131             [use_profiling=$enableval],
132             [use_profiling=no])
133
134 AC_ARG_ENABLE([joystick],
135             [AS_HELP_STRING([--enable-joystick],
136                [enable SDL joystick support (default is yes)])],
137             [use_joystick=$enableval],
138             [use_joystick=yes])
139
140 AC_ARG_ENABLE([xrandr],
141             [AS_HELP_STRING([--enable-xrandr],
142                [enable XRandR support (default is yes)])],
143             [use_xrandr=$enableval],
144             [use_xrandr=yes])
145
146 AC_PATH_PROG(CCACHE,ccache,none)
147 AC_ARG_ENABLE([ccache],
148             [AS_HELP_STRING([--enable-ccache],
149                [enable building with ccache feature (default is yes if ccache is installed)])],
150             [use_ccache=$enableval],
151             [use_ccache=yes])
152
153 AC_ARG_ENABLE([pulse],
154             [AS_HELP_STRING([--enable-pulse],
155                [enable PulseAudio support (default is yes)])],
156             [use_pulse=$enableval],
157             [use_pulse=yes])
158
159 AC_ARG_ENABLE([faac],
160             [AS_HELP_STRING([--enable-faac],
161                [enable FAAC support (default is yes)])],
162             [use_faac=$enableval],
163             [use_faac=yes])
164
165 AC_ARG_ENABLE([dvdcss],
166             [AS_HELP_STRING([--enable-dvdcss],
167                [enable DVDCSS support (default is yes)])],
168             [use_dvdcss=$enableval],
169             [use_dvdcss=yes])
170
171 AC_ARG_ENABLE([mid],
172             [AS_HELP_STRING([--enable-mid],
173                [enable MID support (default is no)])],
174             [use_mid=$enableval],
175             [use_mid=no])
176 AC_ARG_ENABLE([avahi],
177              [AS_HELP_STRING([--disable-avahi],
178                 [disable Avahi support (default is enabled if libavahi-common and libavahi-client is found)])],
179              [use_avahi=$enableval],
180              [use_avahi=yes])
181
182 ### External libraries options
183 AC_ARG_ENABLE([external-libraries],
184             [AS_HELP_STRING([--enable-external-libraries],
185             [enable use of all supported external libraries (default is no) 'Linux only'])],
186             [use_external_libraries=$enableval],
187             [use_external_libraries=no])
188
189 AC_ARG_ENABLE([external-ffmpeg],
190             [AS_HELP_STRING([--enable-external-ffmpeg],
191             [enable use of external ffmpeg libraries (default is no) 'Linux only'])],
192             [use_external_ffmpeg=$enableval],
193             [use_external_ffmpeg=no])
194
195 AC_ARG_ENABLE([external-libmad],
196             [AS_HELP_STRING([--enable-external-libmad],
197             [enable use of external libmad library (default is no) 'Linux only'])],
198             [use_external_libmad=$enableval],
199             [use_external_libmad=no])
200
201 AC_ARG_ENABLE([external-liba52],
202             [AS_HELP_STRING([--enable-external-liba52],
203             [enable use of external liba52 library (default is no) 'Linux only'])],
204             [use_external_liba52=$enableval],
205             [use_external_liba52=no])
206
207 AC_ARG_ENABLE([external-libdts],
208             [AS_HELP_STRING([--enable-external-libdts],
209             [enable use of external libdts library (default is no) 'Linux only'])],
210             [use_external_libdts=$enableval],
211             [use_external_libdts=no])
212
213 AC_ARG_ENABLE([external-libfaad],
214             [AS_HELP_STRING([--enable-external-libfaad],
215             [enable use of external libfaad library (default is no) 'Linux only'])],
216             [use_external_libfaad=$enableval],
217             [use_external_libfaad=no])
218
219 AC_ARG_ENABLE([external-libmpeg2],
220             [AS_HELP_STRING([--enable-external-libmpeg2],
221             [enable use of external libmpeg2 library (default is no) 'Linux only'])],
222             [use_external_libmpeg2=$enableval],
223             [use_external_libmpeg2=no])
224
225 AC_ARG_ENABLE([external-libass],
226             [AS_HELP_STRING([--enable-external-libass],
227             [enable use of external libass library (default is no) 'Linux only'])],
228             [use_external_libass=$enableval],
229             [use_external_libass=no])
230
231 AC_ARG_ENABLE([external-libvorbis],
232             [AS_HELP_STRING([--enable-external-libvorbis],
233             [enable use of external libvorbis library (default is no) 'Linux only'])],
234             [use_external_libvorbis=$enableval],
235             [use_external_libvorbis=no])
236
237 AC_ARG_ENABLE([external-libogg],
238             [AS_HELP_STRING([--enable-external-libogg],
239             [enable use of external libogg library (default is no) 'Linux only'])],
240             [use_external_libogg=$enableval],
241             [use_external_libogg=no])
242
243 AC_ARG_ENABLE([external-libmpcdec],
244             [AS_HELP_STRING([--enable-external-libmpcdec],
245             [enable use of external libmpcdec library (default is no) 'Linux only'])],
246             [use_external_libmpcdec=$enableval],
247             [use_external_libmpcdec=no])
248
249 AC_ARG_ENABLE([external-libflac],
250             [AS_HELP_STRING([--enable-external-libflac],
251             [enable use of external libflac library (default is no) 'Linux only'])],
252             [use_external_libflac=$enableval],
253             [use_external_libflac=no])
254
255 AC_ARG_ENABLE([external-libwavpack],
256             [AS_HELP_STRING([--enable-external-libwavpack],
257             [enable use of external libwavpack library (default is no) 'Linux only'])],
258             [use_external_libwavpack=$enableval],
259             [use_external_libwavpack=no])
260
261 AC_ARG_ENABLE([external-python],
262             [AS_HELP_STRING([--enable-external-python],
263             [enable use of external python library (default is no) 'Linux only'])],
264             [use_external_python=$enableval],
265             [use_external_python=no])
266
267 ### End of external library options
268
269 # PCRE is a requirement
270 use_pcre="yes"
271
272 # Checks for programs.
273 PASSED_CXXFLAGS=$CXXFLAGS # Hack to override autoconf default values
274 AC_PROG_CXX
275 CXXFLAGS=$PASSED_CXXFLAGS
276 PASSED_CFLAGS=$CFLAGS # Hack to override autoconf default values
277 AC_PROG_CC
278 CFLAGS=$PASSED_CFLAGS
279 AC_PROG_AWK
280 AC_PROG_LN_S
281 AC_PROG_MAKE_SET
282
283 # platform specific flags
284 if test "$host_vendor" = "apple" ; then
285   AC_SUBST(MACOSX_DEPLOYMENT_TARGET, "10.4")
286   # need these in CFLAGS/CXXFLAGS so AC_CHECK_LIB works
287   CFLAGS="$CFLAGS -I/opt/local/include"
288   CFLAGS="$CFLAGS -I/opt/local/include/freetype2"
289   CFLAGS="$CFLAGS -I/opt/local/include/mysql5"
290   CXXFLAGS="$CXXFLAGS -I/opt/local/include"
291   CXXFLAGS="$CXXFLAGS -I/opt/local/include/freetype2"
292   CXXFLAGS="$CXXFLAGS -I/opt/local/include/mysql5"
293   # standard xbmc paths
294   INCLUDES="$INCLUDES -I."
295   INCLUDES="$INCLUDES -I\$(abs_top_srcdir)/xbmc"
296   INCLUDES="$INCLUDES -I\$(abs_top_srcdir)/xbmc/lib"
297   INCLUDES="$INCLUDES -I\$(abs_top_srcdir)/xbmc/osx"
298   INCLUDES="$INCLUDES -I/opt/local/include"
299   INCLUDES="$INCLUDES -I/opt/local/include/freetype2"
300   INCLUDES="$INCLUDES -I/opt/local/include/mysql5"
301   LDFLAGS="$LDFLAGS -mmacosx-version-min=10.4"
302   LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
303   LDFLAGS="$LDFLAGS -framework IOKit"
304   LDFLAGS="$LDFLAGS -framework Cocoa"
305   LDFLAGS="$LDFLAGS -framework OpenGL"
306   LDFLAGS="$LDFLAGS -framework AppKit"
307   LDFLAGS="$LDFLAGS -framework Carbon"
308   LDFLAGS="$LDFLAGS -framework CoreAudio"
309   LDFLAGS="$LDFLAGS -framework QuickTime"
310   LDFLAGS="$LDFLAGS -framework AudioUnit"
311   LDFLAGS="$LDFLAGS -framework Foundation"
312   LDFLAGS="$LDFLAGS -framework CoreServices"
313   LDFLAGS="$LDFLAGS -framework CoreVideo"
314   LDFLAGS="$LDFLAGS -framework CoreAudio"
315   LDFLAGS="$LDFLAGS -framework AudioToolbox"
316   LDFLAGS="$LDFLAGS -framework CoreFoundation"
317   LDFLAGS="$LDFLAGS -framework DiskArbitration"
318   LDFLAGS="$LDFLAGS -framework ApplicationServices"
319   LDFLAGS="$LDFLAGS -L/opt/local/lib"
320   LDFLAGS="$LDFLAGS -L/opt/local/lib/mysql5/mysql"
321   LDFLAGS="$LDFLAGS -L/opt/local/lib/samba3"
322 fi
323
324 # Add top source directory for all builds so we can use config.h
325 INCLUDES="$INCLUDES -I\$(abs_top_srcdir)"
326
327 # Checks for boost headers using CXX instead of CC
328 AC_LANG_PUSH([C++])
329 AC_CHECK_HEADER([boost/shared_ptr.hpp],, AC_MSG_ERROR($missing_library))
330 AC_LANG_POP([C++])
331
332 # Checks for platforms libraries.
333 if test "$use_gl" = "yes"; then
334   if test "$host_vendor" = "apple" ; then
335     # linking to OpenGL.framework instead of libGL, libGLU
336     AC_CHECK_LIB([GLEW],    [main],, AC_MSG_ERROR($missing_library))
337   else
338     AC_CHECK_LIB([GL],      [main],, AC_MSG_ERROR($missing_library))
339     AC_CHECK_LIB([GLEW],    [main],, AC_MSG_ERROR($missing_library))
340     AC_CHECK_LIB([GLU],     [main],, AC_MSG_ERROR($missing_library))
341   fi
342 else
343   AC_MSG_RESULT(== WARNING: OpenGL support is disabled. XBMC will run VERY slow. ==)
344   AC_CHECK_LIB([SDL_gfx], [main])
345 fi
346
347
348 # platform independent libraries
349 AC_CHECK_HEADER([mad.h],,            AC_MSG_ERROR($missing_library))
350 AC_CHECK_HEADER([jpeglib.h],,        AC_MSG_ERROR($missing_library))
351 AC_CHECK_HEADER([samplerate.h],,     AC_MSG_ERROR($missing_library))
352 AC_CHECK_LIB([mad],         [main],, AC_MSG_ERROR($missing_library))
353 AC_CHECK_LIB([ogg],         [main],, AC_MSG_ERROR($missing_library))
354 AC_CHECK_LIB([vorbis],      [main],, AC_MSG_ERROR($missing_library))
355 AC_CHECK_LIB([vorbisenc],   [main],, AC_MSG_ERROR($missing_library))
356 AC_CHECK_LIB([vorbisfile],  [main],, AC_MSG_ERROR($missing_library))
357 AC_CHECK_LIB([freetype],    [main],, AC_MSG_ERROR($missing_library))
358 AC_CHECK_LIB([fontconfig],  [main],, AC_MSG_ERROR($missing_library))
359 AC_CHECK_LIB([bz2],         [main],, AC_MSG_ERROR($missing_library))
360 AC_CHECK_LIB([fribidi],     [main],, AC_MSG_ERROR($missing_library))
361 AC_CHECK_LIB([sqlite3],     [main],, AC_MSG_ERROR($missing_library))
362 AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
363 AC_CHECK_LIB([asound],      [main])           # check for asound, fedora
364 AC_CHECK_LIB([rt],          [clock_gettime])  # check for rt, required for clock_gettime
365 AC_CHECK_LIB([png12],       [main],, AC_MSG_ERROR($missing_library)) # check for cximage
366 AC_CHECK_LIB([jpeg],        [main],, AC_MSG_ERROR($missing_library)) # check for cximage
367 AC_CHECK_LIB([pcre],        [main],, AC_MSG_ERROR($missing_library))
368 AC_CHECK_LIB([pthread],     [main],, AC_MSG_ERROR($missing_library))
369 AC_CHECK_LIB([lzo2],        [main],, AC_MSG_ERROR($missing_library))
370 AC_CHECK_LIB([cdio],        [main],, AC_MSG_ERROR($missing_library))
371 AC_CHECK_LIB([samplerate],  [main],, AC_MSG_ERROR($missing_library))
372 AC_CHECK_LIB([z],           [main],, AC_MSG_ERROR($missing_library))
373 # platform dependent libraries
374 if test "$host_vendor" = "apple" ; then
375   AC_CHECK_LIB([iconv],     [main],, AC_MSG_ERROR($missing_library))
376   AC_CHECK_LIB([smbclient], [main],, AC_MSG_ERROR($missing_library))
377   AC_CHECK_LIB([mms],       [main],, AC_MSG_ERROR($missing_library))
378 else
379   AC_CHECK_LIB([smbclient], [main],, AC_MSG_ERROR($missing_library))
380   AC_CHECK_LIB([SDL],       [main],, AC_MSG_ERROR($missing_library))
381   AC_CHECK_LIB([SDL_mixer], [main],, AC_MSG_ERROR($missing_library))
382   AC_CHECK_LIB([dl],        [main],, AC_MSG_ERROR($missing_library))
383   AC_CHECK_LIB([resolv],    [main],, AC_MSG_ERROR($missing_library))
384   AC_CHECK_LIB([enca],      [main],, AC_MSG_ERROR($missing_library))
385   AC_CHECK_LIB([jasper],    [main],, AC_MSG_ERROR($missing_library)) # check for cximage
386   AC_CHECK_LIB([mms],       [main],, AC_MSG_ERROR($missing_library))
387   AC_CHECK_LIB([Xt],        [main],, AC_MSG_ERROR($missing_library))
388   AC_CHECK_LIB([Xtst],      [main],, AC_MSG_ERROR($missing_library))
389   AC_CHECK_LIB([Xmu],       [main],, AC_MSG_ERROR($missing_library))
390   AC_CHECK_LIB([Xinerama],  [main],, AC_MSG_ERROR($missing_library))
391   AC_CHECK_LIB([curl],      [main],, AC_MSG_ERROR($missing_library))
392   AC_CHECK_LIB([dbus-1],    [main],, AC_MSG_ERROR($missing_library))
393   AC_CHECK_LIB([hal-storage], [main],, AC_MSG_ERROR($missing_library))
394   PKG_CHECK_MODULES([HAL], [hal], [INCLUDES+=" $HAL_CFLAGS"], AC_MSG_ERROR([$missing_library]))
395 fi
396
397 # PulseAudio
398 if test "$host_vendor" = "apple" ; then
399   use_pulse="no"
400   AC_MSG_RESULT($pulse_disabled)
401 else
402   if test "$use_pulse" = "yes"; then
403     AC_CHECK_LIB([pulse], [main], 
404       LIBS=" -lpulse $LIBS";INCLUDES="$INCLUDES -DHAS_PULSEAUDIO",
405       use_pulse=no;AC_MSG_RESULT($pulse_not_found))
406   else
407     AC_MSG_RESULT($pulse_disabled)
408   fi
409 fi
410
411 # FAAC
412 if test "$host_vendor" = "apple" ; then
413   use_faac="no"
414   AC_MSG_RESULT($faac_disabled)
415 else
416   if test "$use_faac" = "yes"; then
417     AC_CHECK_LIB([faac], [main],,
418       use_faac=no;AC_MSG_RESULT($faac_not_found))
419   else
420     AC_MSG_RESULT($faac_disabled)
421   fi
422 fi
423
424 # avahi
425 if test "$host_vendor" = "apple" ; then
426   use_avahi="no"
427   AC_MSG_RESULT($avahi_disabled)
428 else
429   if test "$use_avahi" = "yes"; then
430     AC_CHECK_LIB([avahi-common], [main], 
431       LIBS=" -lavahi-common $LIBS";,
432       use_avahi=no;AC_MSG_RESULT($avahi_not_found))
433         if test "$use_avahi" = "yes"; then
434                 #either both libs or none
435         AC_CHECK_LIB([avahi-client], [main], 
436               LIBS=" -lavahi-client $LIBS";INCLUDES="$INCLUDES -DHAS_AVAHI",
437               use_avahi=no;AC_MSG_RESULT($avahi_not_found))
438         fi
439     else
440      AC_MSG_RESULT($avahi_disabled)
441    fi
442 fi
443  
444
445 # XRandR
446 if test "$host_vendor" = "apple" ; then
447   use_xrandr="no"
448   AC_MSG_RESULT($xrandr_disabled)
449 else
450   if test "$use_xrandr" = "yes" ; then
451     AC_CHECK_LIB([Xrandr], [main],, 
452       use_xrandr="no";AC_MSG_RESULT($xrandr_not_found))
453   else
454     AC_MSG_RESULT($xrandr_disabled)
455   fi
456 fi
457
458 ### External libraries checks
459 if test "$use_external_libraries" = "yes"; then
460   AC_MSG_NOTICE($external_libraries_enabled)
461   USE_EXTERNAL_LIBRARIES=1
462   AC_DEFINE([USE_EXTERNAL_LIBRARIES], [1], [Whether to use external libraries.])
463 else
464   AC_MSG_NOTICE($external_libraries_disabled)
465   USE_EXTERNAL_LIBRARIES=0
466 fi
467
468 # External FFmpeg
469 if test "$use_external_libraries" = "yes" || test "$use_external_ffmpeg" = "yes"; then
470   AC_CHECK_LIB([avcodec],          [main],, AC_MSG_ERROR($missing_library))
471   AC_CHECK_LIB([avformat],         [main],, AC_MSG_ERROR($missing_library))
472   AC_CHECK_LIB([avutil],           [main],, AC_MSG_ERROR($missing_library))
473   AC_CHECK_LIB([postproc],         [main],, AC_MSG_ERROR($missing_library))
474   AC_CHECK_LIB([swscale],          [main],, AC_MSG_ERROR($missing_library))
475
476   # Determine whether AVPacket and relevant functions are defined in libavformat
477   # or libavcodec
478   AC_CHECK_LIB([avcodec], [av_free_packet],
479   [AC_MSG_NOTICE(== AVPacket and relevant functions defined in libavcodec. ==)],
480   [AC_MSG_NOTICE(== AVPacket and relevant functions defined in libavformat. ==)
481    AC_DEFINE([AVPACKET_IN_AVFORMAT], [1], [Whether AVPacket is in libavformat.])])
482
483   # Possible places the ffmpeg headers may be
484   AC_CHECK_HEADERS([libavcodec/avcodec.h libavformat/avformat.h libavutil/avutil.h libpostproc/postprocess.h libswscale/swscale.h],,
485   [AC_CHECK_HEADERS([ffmpeg/avcodec.h ffmpeg/avformat.h ffmpeg/avutil.h postproc/postprocess.h ffmpeg/swscale.h],,
486   [AC_MSG_ERROR($missing_headers)])])
487
488   # We'll support the use of rgb2rgb.h if it exists.
489   AC_CHECK_HEADERS([libswscale/rgb2rgb.h],,)
490   AC_CHECK_HEADERS([ffmpeg/rgb2rgb.h],,)
491
492   AC_MSG_NOTICE($external_ffmpeg_enabled)
493   USE_EXTERNAL_FFMPEG=1
494   AC_DEFINE([USE_EXTERNAL_FFMPEG], [1], [Whether to use external FFmpeg libraries.])
495
496   # Disable vdpau support if external libavcodec doesn't have it
497   AC_CHECK_LIB([avcodec], [ff_vdpau_vc1_decode_picture],,
498     use_vdpau=no;AC_MSG_RESULT($ffmpeg_vdpau_not_supported))
499 else
500   AC_MSG_NOTICE($external_ffmpeg_disabled)
501   USE_EXTERNAL_FFMPEG=0
502 fi
503
504 # External libmad
505 if test "$use_external_libraries" = "yes" || test "$use_external_libmad" = "yes"; then
506   AC_CHECK_LIB([mad],          [main],, AC_MSG_ERROR($missing_library))
507
508   AC_MSG_NOTICE($external_libmad_enabled)
509   USE_EXTERNAL_LIBMAD=1
510   AC_DEFINE([USE_EXTERNAL_LIBMAD], [1], [Whether to use external libmad library.])
511 else
512   AC_MSG_NOTICE($external_libmad_disabled)
513   USE_EXTERNAL_LIBMAD=0
514 fi
515
516 # External liba52
517 if test "$use_external_libraries" = "yes" || test "$use_external_liba52" = "yes"; then
518   AC_CHECK_LIB([a52],          [main],, AC_MSG_ERROR($missing_library))
519
520   AC_MSG_NOTICE($external_liba52_enabled)
521   USE_EXTERNAL_LIBA52=1
522   AC_DEFINE([USE_EXTERNAL_LIBA52], [1], [Whether to use external liba52 library.])
523 else
524   AC_MSG_NOTICE($external_liba52_disabled)
525   USE_EXTERNAL_LIBA52=0
526 fi
527
528 # External libdts
529 if test "$use_external_libraries" = "yes" || test "$use_external_libdts" = "yes"; then
530   AC_CHECK_LIB([dts],          [main],, AC_MSG_ERROR($missing_library))
531
532   AC_MSG_NOTICE($external_libdts_enabled)
533   USE_EXTERNAL_LIBDTS=1
534   AC_DEFINE([USE_EXTERNAL_LIBDTS], [1], [Whether to use external libdts library.])
535 else
536   AC_MSG_NOTICE($external_libdts_disabled)
537   USE_EXTERNAL_LIBDTS=0
538 fi
539
540 # External libfaad
541 if test "$use_external_libraries" = "yes" || test "$use_external_libfaad" = "yes"; then
542   AC_CHECK_LIB([faad],          [main],, AC_MSG_ERROR($missing_library))
543   # mp4ff is not included in Gentoo packages, which is why external libfaad
544   # support has to be explicitely enabled
545   AC_CHECK_LIB([mp4ff],          [main],, AC_MSG_ERROR($missing_library))
546
547   # Test for the NeAACDecInitDRM function in libfaad as well
548   AC_CHECK_LIB([faad],          [NeAACDecInitDRM],
549     [AC_DEFINE([HAVE_LIBFAAD_NEAACDECINITDRM], [1], [Whether NeAACDecInitDRM function exists in libfaad library.])],)
550
551   AC_LANG_PUSH(C++)
552   AC_MSG_CHECKING([whether we have the Debian or Ubuntu < 2.7 FAAD ABI])
553   AC_COMPILE_IFELSE(
554     AC_LANG_PROGRAM([#include <neaacdec.h>], [char* x = NeAACDecGetErrorMessage(0)]),
555     AC_MSG_RESULT(no),
556     [
557       AC_DEFINE([HAVE_LIBFAAD_DEBIAN_ABI], [1],
558         [Whether we have the Debian or Ubuntu < 2.7 FAAD ABI])
559       AC_MSG_RESULT(yes)
560     ]
561   )
562   AC_LANG_POP()
563
564   AC_MSG_NOTICE($external_libfaad_enabled)
565   USE_EXTERNAL_LIBFAAD=1
566   AC_DEFINE([USE_EXTERNAL_LIBFAAD], [1], [Whether to use external libfaad library.])
567 else
568   AC_MSG_NOTICE($external_libfaad_disabled)
569   USE_EXTERNAL_LIBFAAD=0
570 fi
571
572 # External libmpeg2
573 if test "$use_external_libraries" = "yes" || test "$use_external_libmpeg2" = "yes"; then
574   AC_CHECK_LIB([mpeg2],          [main],, AC_MSG_ERROR($missing_library))
575   AC_CHECK_LIB([mpeg2convert],          [main],, AC_MSG_ERROR($missing_library))
576
577   AC_MSG_NOTICE($external_libmpeg2_enabled)
578   USE_EXTERNAL_LIBMPEG2=1
579   AC_DEFINE([USE_EXTERNAL_LIBMPEG2], [1], [Whether to use external libmpeg2 library.])
580 else
581   AC_MSG_NOTICE($external_libmpeg2_disabled)
582   USE_EXTERNAL_LIBMPEG2=0
583 fi
584
585 # External libass
586 if test "$use_external_libraries" = "yes" || test "$use_external_libass" = "yes"; then
587   # We need libass >= 0.9.7.
588   AC_CHECK_LIB([ass], [ass_set_message_cb],
589   [AC_CHECK_LIB([ass], [main],,)
590   AC_MSG_NOTICE($external_libass_enabled)
591   USE_EXTERNAL_LIBASS=1
592    AC_DEFINE([USE_EXTERNAL_LIBASS], [1], [Whether to use external libass library.])],
593   [AC_MSG_WARN(== Need libass >= 0.9.7. Disabling external libass. ==)
594    USE_EXTERNAL_LIBASS=0])
595 else
596   AC_MSG_NOTICE($external_libass_disabled)
597   USE_EXTERNAL_LIBASS=0
598 fi
599
600 # External libvorbis
601 if test "$use_external_libraries" = "yes" || test "$use_external_libvorbis" = "yes"; then
602   AC_MSG_NOTICE($external_libvorbis_enabled)
603   USE_EXTERNAL_LIBVORBIS=1
604   AC_DEFINE([USE_EXTERNAL_LIBVORBIS], [1], [Whether to use external libvorbis library.])
605 else
606   AC_MSG_NOTICE($external_libvorbis_disabled)
607   USE_EXTERNAL_LIBVORBIS=0
608 fi
609
610 # External libogg
611 if test "$use_external_libraries" = "yes" || test "$use_external_libogg" = "yes"; then
612   AC_MSG_NOTICE($external_libogg_enabled)
613   USE_EXTERNAL_LIBOGG=1
614   AC_DEFINE([USE_EXTERNAL_LIBOGG], [1], [Whether to use external libogg library.])
615 else
616   AC_MSG_NOTICE($external_libogg_disabled)
617   USE_EXTERNAL_LIBOGG=0
618 fi
619
620 # External libmpcdec
621 if test "$use_external_libraries" = "yes" || test "$use_external_libmpcdec" = "yes"; then
622   AC_CHECK_LIB([mpcdec],          [main],, AC_MSG_ERROR($missing_library))
623
624   AC_MSG_NOTICE($external_libmpcdec_enabled)
625   USE_EXTERNAL_LIBMPCDEC=1
626   AC_DEFINE([USE_EXTERNAL_LIBMPCDEC], [1], [Whether to use external libmpcdec library.])
627 else
628   AC_MSG_NOTICE($external_libmpcdec_disabled)
629   USE_EXTERNAL_LIBMPCDEC=0
630 fi
631
632 # External libflac
633 if test "$use_external_libraries" = "yes" || test "$use_external_libflac" = "yes"; then
634   AC_CHECK_LIB([FLAC],          [main],, AC_MSG_ERROR($missing_library))
635
636   AC_MSG_NOTICE($external_libflac_enabled)
637   USE_EXTERNAL_LIBFLAC=1
638   AC_DEFINE([USE_EXTERNAL_LIBFLAC], [1], [Whether to use external libflac library.])
639 else
640   AC_MSG_NOTICE($external_libflac_disabled)
641   USE_EXTERNAL_LIBFLAC=0
642 fi
643
644 # External libwavpack
645 if test "$use_external_libraries" = "yes" || test "$use_external_libwavpack" = "yes"; then
646   AC_CHECK_LIB([wavpack],          [main],, AC_MSG_ERROR($missing_library))
647
648   AC_MSG_NOTICE($external_libwavpack_enabled)
649   USE_EXTERNAL_LIBWAVPACK=1
650   AC_DEFINE([USE_EXTERNAL_LIBWAVPACK], [1], [Whether to use external libwavpack library.])
651 else
652   AC_MSG_NOTICE($external_libwavpack_disabled)
653   USE_EXTERNAL_LIBWAVPACK=0
654 fi
655
656 # External Python
657 if test "$use_external_libraries" = "yes" || test "$use_external_python" = "yes" || \
658   $(test "$host_cpu" = "powerpc" && test "$host_vendor" != "apple"); then
659   AC_CHECK_LIB([python2.6], [main],,
660   [AC_CHECK_LIB([python2.5], [main],,
661   [AC_CHECK_LIB([python2.4], [main],,
662   [AC_MSG_ERROR($missing_library)] )] )] )
663
664   # Test again, but this time just set some variables we need in Makefiles
665   AC_CHECK_LIB([python2.6], [main],[USE_PYTHON2_6=1],
666   [AC_CHECK_LIB([python2.5], [main],[USE_PYTHON2_5=1],
667   [AC_CHECK_LIB([python2.4], [main],[USE_PYTHON2_4=1],
668   [AC_MSG_ERROR($missing_library)] )] )] )
669
670   AC_MSG_NOTICE($external_python_enabled)
671   test "$USE_PYTHON2_6" && AC_MSG_NOTICE([Using Python 2.6])
672   test "$USE_PYTHON2_5" && AC_MSG_NOTICE([Using Python 2.5])
673   test "$USE_PYTHON2_4" && AC_MSG_NOTICE([Using Python 2.4])
674   USE_EXTERNAL_PYTHON=1
675   AC_DEFINE([USE_EXTERNAL_PYTHON], [1], [Whether to use external python library.])
676 else
677   AC_MSG_NOTICE($external_python_disabled)
678   USE_EXTERNAL_PYTHON=0
679
680   # We'll need zip in this case.
681   AC_CHECK_PROG(HAVE_ZIP,zip,"yes","no",)
682   if test "$HAVE_ZIP" = "no" ; then
683     AC_MSG_ERROR($missing_program)
684   fi
685 fi
686
687 # VDPAU
688 if test "$host_vendor" = "apple" ; then
689   use_vdpau="no"
690   AC_MSG_NOTICE($vdpau_disabled)
691 else
692   if test "$use_vdpau" = "yes"; then
693     AC_CHECK_HEADER([vdpau/vdpau.h],AC_DEFINE([HAVE_LIBVDPAU], [], [Define to 1 if you have the 'vdpau' library (-lvdpau).]),
694       use_vdpau=no;AC_MSG_RESULT($vdpau_not_found))
695   else
696     AC_MSG_NOTICE($vdpau_disabled)
697   fi
698 fi
699
700 # platform specific bin utilities
701 if test "$host_vendor" != "apple" ; then
702   AC_CHECK_PROG(HAVE_GAWK,gawk,"yes","no",)
703   if test "$HAVE_GAWK" = "no" ; then
704     AC_MSG_ERROR($missing_program)
705   fi
706 fi
707
708 AC_CHECK_PROG(HAVE_CMAKE,cmake,"yes","no",)
709 if test "$HAVE_CMAKE" = "no" ; then
710   AC_MSG_ERROR($missing_program)
711 fi
712
713 AC_CHECK_PROG(HAVE_GPERF,gperf,"yes","no",)
714 if test "$HAVE_GPERF" = "no" ; then
715   AC_MSG_ERROR($missing_program)
716 fi
717
718 AC_CHECK_PROG(HAVE_UNZIP,unzip,"yes","no",)
719 if test "$HAVE_UNZIP" = "no" ; then
720   AC_MSG_ERROR($missing_program)
721 fi
722
723 if test "$ARCH" != "x86_64-linux"; then
724   AC_CHECK_PROG(HAVE_NASM,nasm,"yes","no",)
725   if test "$HAVE_NASM" = "no" ; then
726     AC_MSG_ERROR($missing_program)
727   fi
728 fi
729
730 # Checks for header files.
731 AC_HEADER_DIRENT
732 AC_HEADER_STDC
733 AC_HEADER_SYS_WAIT
734 AC_CHECK_HEADERS([lzo/lzo1.h])
735 AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h limits.h locale.h \
736   malloc.h memory.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h \
737   strings.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h \
738   sys/time.h sys/timeb.h sys/vfs.h termios.h unistd.h utime.h wchar.h wctype.h])
739
740 # Checks for typedefs, structures, and compiler characteristics.
741 AC_HEADER_STAT
742 AC_HEADER_STDBOOL
743 AC_C_CONST
744 AC_TYPE_UID_T
745 AC_C_INLINE
746 AC_TYPE_INT8_T
747 AC_TYPE_INT16_T
748 AC_TYPE_INT32_T
749 AC_TYPE_INT64_T
750 AC_TYPE_MODE_T
751 AC_TYPE_OFF_T
752 AC_TYPE_PID_T
753 AC_C_RESTRICT
754 AC_TYPE_SIZE_T
755 AC_TYPE_SSIZE_T
756 AC_CHECK_MEMBERS([struct stat.st_rdev])
757 AC_HEADER_TIME
758 AC_STRUCT_TM
759 AC_TYPE_UINT8_T
760 AC_TYPE_UINT16_T
761 AC_TYPE_UINT32_T
762 AC_TYPE_UINT64_T
763 AC_C_BIGENDIAN
764
765 # Checks for library functions.
766 AC_FUNC_ALLOCA
767 AC_FUNC_CHOWN
768 AC_FUNC_CLOSEDIR_VOID
769 AC_FUNC_ERROR_AT_LINE
770 AC_FUNC_FSEEKO
771 AC_PROG_GCC_TRADITIONAL
772 AC_FUNC_LSTAT
773 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
774 AC_FUNC_MEMCMP
775 AC_FUNC_MKTIME
776 AC_FUNC_MMAP
777 # Boxee is apparently having compile problems
778 # if HAVE_REALLOC is defined.  Sort this later.
779 #AC_FUNC_REALLOC
780 AC_FUNC_SELECT_ARGTYPES
781 AC_FUNC_SETVBUF_REVERSED
782 AC_TYPE_SIGNAL
783 AC_FUNC_STAT
784 AC_FUNC_STRCOLL
785 AC_FUNC_STRFTIME
786 AC_FUNC_STRTOD
787 AC_FUNC_UTIME_NULL
788 AC_FUNC_VPRINTF
789 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])
790
791 # Check for various sizes
792 AC_CHECK_SIZEOF([int])
793
794 dashes="------------------------"
795 final_message="\n  XBMC Configuration:"
796 final_message="\n$dashes$final_message\n$dashes"
797
798 if test "$use_debug" = "yes"; then
799   final_message="$final_message\n  Debugging:\tYes"
800   if test "$use_profiling" = "yes"; then
801     final_message="$final_message\n  Profiling:\tYes"
802     DEBUG_FLAGS="-g -pg -D_DEBUG -Wall"
803   else
804     final_message="$final_message\n  Profiling:\tNo"
805     DEBUG_FLAGS="-g -D_DEBUG -Wall"
806   fi
807 else
808   final_message="$final_message\n  Debugging:\tNo"
809   if test "$use_profiling" = "yes"; then
810     final_message="$final_message\n  Profiling:\tYes"
811     DEBUG_FLAGS="-pg -DNDEBUG=1"
812   else
813     final_message="$final_message\n  Profiling:\tNo"
814     DEBUG_FLAGS="-DNDEBUG=1"
815   fi
816 fi
817
818 if test "$use_optimizations" = "yes"; then
819   final_message="$final_message\n  Optimization:\tYes"
820   CXXFLAGS="$CXXFLAGS -O2"
821   CFLAGS="$CFLAGS -O2"
822 else
823   final_message="$final_message\n  Optimization:\tNo"
824 fi
825
826 if test "$use_gl" = "yes"; then
827   final_message="$final_message\n  OpenGL:\tYes"
828   SDL_DEFINES=""
829 else
830   final_message="$final_message\n  OpenGL:\tNo (Very Slow)"
831   SDL_DEFINES="-DHAS_SDL_2D"
832 fi
833
834 if test "$use_vdpau" = "yes"; then
835   final_message="$final_message\n  VDPAU:\tYes"
836 else
837   final_message="$final_message\n  VDPAU:\tNo"
838 fi
839
840 if test "$use_joystick" = "yes"; then
841   final_message="$final_message\n  Joystick:\tYes"
842   SDL_DEFINES="$SDL_DEFINES -DHAS_SDL_JOYSTICK"
843 else
844   final_message="$final_message\n  Joystick:\tNo"
845 fi
846
847 if test "$use_xrandr" = "yes"; then
848   final_message="$final_message\n  XRandR:\tYes"
849   SDL_DEFINES="$SDL_DEFINES -DHAS_XRANDR"
850 else
851   final_message="$final_message\n  XRandR:\tNo"
852 fi
853
854 if test "$use_pcre" = "yes"; then
855   final_message="$final_message\n  PCRE Support:\tYes"
856   SDL_DEFINES="$SDL_DEFINES -DHAS_PCRE"
857 else
858   final_message="$final_message\n  PCRE Support:\tNo"
859 fi
860
861 if test "$use_mid" = "yes"; then
862   final_message="$final_message\n  MID Support:\tYes"
863   SDL_DEFINES="$SDL_DEFINES -DMID"
864 else
865   final_message="$final_message\n  MID Support:\tNo"
866 fi
867
868 if test -d "/usr/include/lzo"; then
869   INCLUDES="$INCLUDES -I/usr/include/lzo"
870 else
871   INCLUDES="$INCLUDES"
872 fi
873
874 if test "$use_ccache" = "yes"; then
875   if test "$ac_cv_path_CCACHE" = "none"; then
876      echo "ccache not found. Falling back to default CC"
877      final_message="$final_message\n  ccache:\tNo"
878   else
879     CC="$ac_cv_path_CCACHE $CC"
880     CXX="$ac_cv_path_CCACHE $CXX"
881     AC_MSG_NOTICE(enabling ccache)
882     final_message="$final_message\n  ccache:\tYes"
883   fi
884 else
885   final_message="$final_message\n  ccache:\tNo"
886 fi
887
888 if test "$use_pulse" = "yes"; then
889   final_message="$final_message\n  PulseAudio:\tYes"
890 else
891   final_message="$final_message\n  PulseAudio:\tNo"
892 fi
893
894 if test "$use_faac" = "yes"; then
895   final_message="$final_message\n  FAAC:\t\tYes"
896 else
897   final_message="$final_message\n  FAAC:\t\tNo"
898 fi
899
900 # DVDCSS
901 if test "$use_dvdcss" = "yes"; then
902   AC_MSG_NOTICE($dvdcss_enabled)
903   final_message="$final_message\n  DVDCSS:\tYes"
904   BUILD_DVDCSS=1
905   SKIP_CONFIG_DVDCSS=0
906   DVDREAD_CFLAGS="-D_XBMC -DHAVE_DVDCSS_DVDCSS_H"
907 else
908   AC_MSG_NOTICE($dvdcss_disabled)
909   final_message="$final_message\n  DVDCSS:\tNo"
910   BUILD_DVDCSS=0
911   SKIP_CONFIG_DVDCSS=1
912   DVDREAD_CFLAGS="-D_XBMC -UHAVE_DVDCSS_DVDCSS_H"
913 fi
914 if test "$use_avahi" = "yes"; then
915   final_message="$final_message\n  Avahi:\tYes"
916 else
917   final_message="$final_message\n  Avahi:\tNo"
918 fi
919
920 if test -n "$SVN_REV" -a "$SVN_REV" != "" ; then
921   SDL_DEFINES="$SDL_DEFINES -D'SVN_REV=\"$SVN_REV\"'"
922 elif test "$host_vendor" = "apple"; then
923   AC_CHECK_PROG(HAVE_SVNVERSION,svnversion,"yes","no",)
924   if test "$HAVE_SVNVERSION" = "no" ; then
925     AC_MSG_WARN([svnversion not found. No SVN_REV in builds!])
926     echo "#define SVN_REV" > svn_revision.h
927   else
928         SVN_REVISION=$(svnversion -n .)
929         echo "#define SVN_REV \"$SVN_REVISION\"" > svn_revision.h
930   fi
931 elif test -x "/usr/bin/svnversion" ; then
932   SDL_DEFINES="$SDL_DEFINES -D'SVN_REV=\"$(svnversion -n .)\"'"
933 fi
934
935 ### External libraries messages
936 if test "$use_external_libraries" = "yes"; then
937   final_message="$final_message\n  External Libraries:\tYes"
938 else
939   final_message="$final_message\n  External Libraries:\tNo"
940   if test "$use_external_ffmpeg" = "yes"; then
941     final_message="$final_message\n  External FFmpeg:\tYes"
942   else
943     final_message="$final_message\n  External FFmpeg:\tNo"
944   fi
945   if test "$use_external_libmad" = "yes"; then
946     final_message="$final_message\n  External libmad:\tYes"
947   else
948     final_message="$final_message\n  External libmad:\tNo"
949   fi
950   if test "$use_external_liba52" = "yes"; then
951     final_message="$final_message\n  External liba52:\tYes"
952   else
953     final_message="$final_message\n  External liba52:\tNo"
954   fi
955   if test "$use_external_libdts" = "yes"; then
956     final_message="$final_message\n  External libdts:\tYes"
957   else
958     final_message="$final_message\n  External libdts:\tNo"
959   fi
960   if test "$use_external_libfaad" = "yes"; then
961     final_message="$final_message\n  External libfaad:\tYes"
962   else
963     final_message="$final_message\n  External libfaad:\tNo"
964   fi
965   if test "$use_external_libmpeg2" = "yes"; then
966     final_message="$final_message\n  External libmpeg2:\tYes"
967   else
968     final_message="$final_message\n  External libmpeg2:\tNo"
969   fi
970   if test "$use_external_libass" = "yes"; then
971     final_message="$final_message\n  External libass:\tYes"
972   else
973     final_message="$final_message\n  External libass:\tNo"
974   fi
975   if test "$use_external_libvorbis" = "yes"; then
976     final_message="$final_message\n  External libvorbis:\tYes"
977   else
978     final_message="$final_message\n  External libvorbis:\tNo"
979   fi
980   if test "$use_external_libogg" = "yes"; then
981     final_message="$final_message\n  External libogg:\tYes"
982   else
983     final_message="$final_message\n  External libogg:\tNo"
984   fi
985   if test "$use_external_libmpcdec" = "yes"; then
986     final_message="$final_message\n  External libmpcdec:\tYes"
987   else
988     final_message="$final_message\n  External libmpcdec:\tNo"
989   fi
990   if test "$use_external_libflac" = "yes"; then
991     final_message="$final_message\n  External libflac:\tYes"
992   else
993     final_message="$final_message\n  External libflac:\tNo"
994   fi
995   if test "$use_external_libwavpack" = "yes"; then
996     final_message="$final_message\n  External libwavpack:\tYes"
997   else
998     final_message="$final_message\n  External libwavpack:\tNo"
999   fi
1000   if test "$use_external_python" = "yes"; then
1001     final_message="$final_message\n  External Python:\tYes"
1002   else
1003     final_message="$final_message\n  External Python:\tNo"
1004   fi
1005 fi
1006
1007 OUTPUT_FILES="Makefile \
1008              Makefile.include \
1009              xbmc/cores/dvdplayer/Codecs/Makefile \
1010              xbmc/cores/dvdplayer/Codecs/libdvd/Makefile \
1011              xbmc/cores/AudioRenderers/Makefile \
1012              xbmc/cores/paplayer/Makefile \
1013              xbmc/cores/paplayer/MACDll/Makefile \
1014              xbmc/cores/paplayer/timidity/Makefile \
1015              xbmc/cores/paplayer/AACCodec/Makefile \
1016              xbmc/cores/paplayer/AC3Codec/Makefile \
1017              xbmc/cores/paplayer/ADPCMCodec/Makefile \
1018              xbmc/cores/paplayer/FLACCodec/Makefile \
1019              xbmc/cores/paplayer/ModuleCodec/Makefile \
1020              xbmc/cores/paplayer/GYMCodec/Makefile \
1021              xbmc/cores/paplayer/MPCCodec/xbmc/Makefile \
1022              xbmc/cores/paplayer/NSFCodec/Makefile \
1023              xbmc/cores/paplayer/SIDCodec/Makefile \
1024              xbmc/cores/paplayer/vgmstream/Makefile \
1025              xbmc/cores/paplayer/SPCCodec/SNES/SNESAPU/Makefile \
1026              xbmc/cores/paplayer/vorbisfile/Makefile \
1027              xbmc/cores/paplayer/WavPackCodec/Makefile \
1028              xbmc/cores/paplayer/YMCodec/StSoundLibrary/Makefile \
1029              guilib/common/Makefile \
1030              xbmc/lib/libass/xbmc/Makefile \
1031              xbmc/lib/libXBMS/Makefile \
1032              xbmc/lib/libRTV/Makefile \
1033              xbmc/lib/libexif/Makefile \
1034              xbmc/lib/libXDAAP/Makefile \
1035              xbmc/lib/libhdhomerun/Makefile \
1036              xbmc/lib/libGoAhead/Makefile \
1037              xbmc/lib/libshout/Makefile \
1038              xbmc/lib/libid3tag/Makefile \
1039              xbmc/lib/cximage-6.0/Makefile \
1040              xbmc/lib/libPython/linux/Makefile \
1041              xbmc/lib/libUPnP/Makefile \
1042              xbmc/DllPaths_generated.h \
1043              xbmc/linux/Makefile \
1044              xbmc/screensavers/Makefile \
1045              xbmc/screensavers/rsxs-0.9/xbmc/Makefile \
1046              xbmc/visualizations/XBMCProjectM/Makefile \
1047              xbmc/visualizations/Goom/Makefile \
1048              xbmc/visualizations/OpenGLSpectrum/Makefile \
1049              xbmc/visualizations/WaveForm/Makefile \
1050              xbmc/visualizations/iTunes/Makefile \
1051              tools/Linux/xbmc.sh \
1052              tools/XBMCTex/Makefile \
1053              tools/EventClients/Clients/OSXRemote/Makefile"
1054 AC_CONFIG_FILES([${OUTPUT_FILES}])
1055 AC_SUBST(CFLAGS)
1056 AC_SUBST(CXXFLAGS)
1057 AC_SUBST(INCLUDES)
1058 AC_SUBST(LDFLAGS)
1059 AC_SUBST(DEBUG_FLAGS)
1060 AC_SUBST(SDL_DEFINES)
1061 AC_SUBST(BUILD_DVDCSS)
1062 AC_SUBST(USE_EXTERNAL_LIBRARIES)
1063 AC_SUBST(USE_EXTERNAL_FFMPEG)
1064 AC_SUBST(USE_EXTERNAL_LIBMAD)
1065 AC_SUBST(USE_EXTERNAL_LIBA52)
1066 AC_SUBST(USE_EXTERNAL_LIBDTS)
1067 AC_SUBST(USE_EXTERNAL_LIBFAAD)
1068 AC_SUBST(USE_EXTERNAL_LIBMPEG2)
1069 AC_SUBST(USE_EXTERNAL_LIBASS)
1070 AC_SUBST(USE_EXTERNAL_LIBVORBIS)
1071 AC_SUBST(USE_EXTERNAL_LIBOGG)
1072 AC_SUBST(USE_EXTERNAL_LIBMPCDEC)
1073 AC_SUBST(USE_EXTERNAL_LIBFLAC)
1074 AC_SUBST(USE_EXTERNAL_LIBWAVPACK)
1075 AC_SUBST(USE_EXTERNAL_PYTHON)
1076 AC_SUBST(USE_PYTHON2_6)
1077 AC_SUBST(USE_PYTHON2_5)
1078 AC_SUBST(USE_PYTHON2_4)
1079 AC_SUBST(OUTPUT_FILES)
1080 # Function to run the configure scripts in our submodules
1081 # Consists of three paramaters, the path to the submodule, the configure command
1082 # with appropriate arguments, and a third parameter set to 1 if we are to skip
1083 # running the script, anything else if not.
1084 AC_DEFUN([XB_CONFIG_MODULE],[
1085 AC_CONFIG_COMMANDS_POST([
1086 if [[ $3 != "1" ]]; then
1087     if [[ -d $1 ]]; then
1088         pushd $1
1089         $2
1090         if [[ $? -ne 0 ]]; then
1091             popd
1092             AC_MSG_ERROR([[Submodule $1 failed to configure]])
1093         else
1094             popd
1095         fi
1096     else
1097         AC_MSG_ERROR([[Submodule $1 doesn't exist]])
1098     fi
1099 else
1100     AC_MSG_NOTICE([[Skipping configuration of submodule $1.]])
1101 fi
1102 ])
1103 ])
1104
1105 XB_CONFIG_MODULE([xbmc/lib/libPython/Python], [
1106   if test "$host_vendor" = "apple" ; then
1107     ./configure \
1108       --enable-ipv6 \
1109       --enable-unicode=ucs4 \
1110       --without-cxx \
1111       --enable-shared \
1112       --without-pymalloc \
1113       LDFLAGS="-L/opt/local/lib" \
1114       OPT="-Wno-deprecated-declarations -I/opt/local/include" \
1115       MACOSX_DEPLOYMENT_TARGET=10.4 &&
1116     sed -i bak -e "s/define HAVE_GETC_UNLOCKED 1/undef HAVE_GETC_UNLOCKED/" pyconfig.h && 
1117     sed -i bak -e "s/define HAVE_FSEEKO 1/undef HAVE_FSEEKO/" pyconfig.h &&
1118     sed -i bak -e "s/define HAVE_FTELLO 1/undef HAVE_FTELLO/" pyconfig.h &&
1119     sed -i bak -e "s/define HAVE_FTRUNCATE 1/undef HAVE_FTRUNCATE/" pyconfig.h &&
1120     sed -i bak -e "s/define HAVE_FPATHCONF 1/undef HAVE_FPATHCONF/" pyconfig.h &&
1121     sed -i bak -e "s/define HAVE_FSYNC 1/undef HAVE_FSYNC/" pyconfig.h &&
1122     sed -i bak -e "s/define HAVE_FCHDIR 1/undef HAVE_FCHDIR/" pyconfig.h &&
1123     sed -i bak -e "s/define _POSIX_C_SOURCE 200112L/undef _POSIX_C_SOURCE/" pyconfig.h &&
1124     sed -i bak -e "s/define _XOPEN_SOURCE 600/undef _XOPEN_SOURCE/" pyconfig.h &&
1125     sed -i bak -e "s/define _XOPEN_SOURCE_EXTENDED 1/undef _XOPEN_SOURCE_EXTENDED/" pyconfig.h &&
1126     cp pyconfig.h Include       
1127   else
1128     ./configure \
1129       --enable-ipv6 \
1130       --enable-unicode=ucs4 \
1131       --without-cxx \
1132       --enable-shared \
1133       --without-pymalloc \
1134       --prefix=`pwd`/../linux/python-lib CFLAGS=-fPIC &&
1135     sed -i -e "s/define HAVE_GETC_UNLOCKED 1/undef HAVE_GETC_UNLOCKED/" pyconfig.h &&
1136     cp pyconfig.h Include
1137   fi
1138 ], [$USE_EXTERNAL_PYTHON])
1139
1140 XB_CONFIG_MODULE([xbmc/cores/paplayer/MPCCodec], [
1141   if test "$host_vendor" = "apple" ; then
1142     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \    
1143     ./configure MACOSX_DEPLOYMENT_TARGET=10.4
1144   else
1145     ./configure
1146   fi
1147 ], [$USE_EXTERNAL_LIBMPCDEC])
1148
1149 XB_CONFIG_MODULE([xbmc/cores/paplayer/FLACCodec/flac-1.2.1], [
1150   if test "$host_vendor" = "apple" ; then
1151     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \    
1152     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 -C \
1153       --with-pic \
1154       --disable-asm-optimizations \
1155       --disable-xmms-plugin \
1156       --disable-cpplibs \
1157       CC="$CC" \
1158       CXX="$CXX"
1159   else
1160     ./configure -C \
1161       --with-pic \
1162       --disable-asm-optimizations \
1163       --disable-xmms-plugin \
1164       --disable-cpplibs \
1165       CC="$CC" \
1166       CXX="$CXX"
1167   fi
1168 ], [$USE_EXTERNAL_LIBFLAC])
1169
1170 XB_CONFIG_MODULE([xbmc/cores/paplayer/vorbisfile/libvorbis], [
1171   if test "$host_vendor" = "apple" ; then
1172     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1173     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 --with-pic
1174   else
1175     ./configure --with-pic
1176   fi
1177 ], [$USE_EXTERNAL_LIBVORBIS])
1178
1179 XB_CONFIG_MODULE([xbmc/cores/paplayer/vorbisfile/ogg], [
1180   if test "$host_vendor" = "apple" ; then
1181     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1182     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 --with-pic
1183   else
1184     ./configure --with-pic
1185   fi
1186 ], [$USE_EXTERNAL_LIBOGG])
1187
1188 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/ffmpeg], [
1189   if test "$host_vendor" = "apple" ; then
1190     ./configure \
1191       --extra-cflags="-w -D_DARWIN_C_SOURCE -D_XBOX -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
1192       --disable-static \
1193       `if test "$use_debug" = "no"; then echo --disable-debug; fi` \
1194       --disable-muxers \
1195       --disable-encoders \
1196       --disable-devices \
1197       --disable-ffplay \
1198       --disable-ffserver \
1199       --disable-ffmpeg \
1200       --enable-shared \
1201       --disable-ipv6 \
1202       --disable-decoder=mpeg_xvmc \
1203       --enable-postproc \
1204       --enable-gpl \
1205       --enable-protocol=http \
1206       --enable-pthreads \
1207       --cc="$CC" &&
1208     sed -i "" -e "s#YASM=yasm#YASM=/opt/local/bin/yasm#" config.mak &&
1209     sed -i "" -e "s# -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 # #" config.mak &&
1210     sed -i "" -e "s#libswscale_VERSION_MAJOR=0#libswscale_VERSION_MAJOR=0.7.1#" config.mak &&
1211     sed -i "" -e "s#libavfilter_VERSION_MAJOR=0#libavfilter_VERSION_MAJOR=0.4.0#" config.mak
1212
1213   else
1214     ./configure \
1215       --extra-cflags="-D_XBOX" \
1216       --disable-static \
1217       --disable-ipv6 \
1218       `if test "$use_debug" = "no"; then echo --disable-debug; fi` \
1219       --disable-muxers \
1220       --disable-encoders \
1221       --disable-decoder=mpeg_xvmc \
1222       --disable-devices \
1223       --disable-ffplay \
1224       --disable-ffserver \
1225       --disable-ffmpeg \
1226       --enable-shared \
1227       --enable-postproc \
1228       --enable-gpl \
1229       `if test "$use_vdpau" = "yes"; then echo --enable-vdpau; fi` \
1230       `if test "$use_external_libfaad" = "yes"; then echo --enable-libfaad; fi` \
1231       --enable-protocol=http \
1232       --enable-pthreads \
1233       --cc="$CC"
1234   fi
1235 ], [$USE_EXTERNAL_FFMPEG])
1236
1237 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/libdts], [
1238   if test "$host_vendor" = "apple" ; then
1239     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1240     LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1241     ./configure \
1242       --disable-oss \
1243       --disable-solaris-audio \
1244       --disable-al-audio \
1245       --disable-win
1246   else
1247     ./configure \
1248       --disable-oss \
1249       --disable-solaris-audio \
1250       --disable-al-audio \
1251       --disable-win \
1252       CFLAGS="-fPIC"
1253   fi
1254 ], [$USE_EXTERNAL_LIBDTS])
1255
1256 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/libdvd/libdvdcss], [
1257   if test "$host_vendor" = "apple" ; then
1258     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 \
1259     CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1260       --disable-doc \
1261       --enable-static \
1262       --with-pic
1263   else
1264     ./configure \
1265       --disable-doc \
1266       --enable-static \
1267       --with-pic
1268   fi
1269 ], [$SKIP_CONFIG_DVDCSS])
1270
1271 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/libdvd/libdvdread], [
1272   if test "$host_vendor" = "apple" ; then
1273     ./configure2 MACOSX_DEPLOYMENT_TARGET=10.4 \
1274       --extra-cflags="$DVDREAD_CFLAGS -D__DARWIN__ -fPIC -DPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -I`pwd`/../libdvdcss/src" \
1275       --enable-static \
1276       --disable-shared \
1277       --cc="$CC" &&
1278     make dvdread-config &&
1279     mkdir -p `pwd`/../includes/dvdread
1280     cp `pwd`/../libdvdread/src/*.h `pwd`/../includes/dvdread
1281   else
1282     ./configure2 \
1283       --extra-cflags="$DVDREAD_CFLAGS -fPIC -DPIC -I`pwd`/../libdvdcss/src" \
1284       --enable-static \
1285       --disable-shared \
1286       --cc="$CC" &&
1287     make dvdread-config &&
1288     mkdir -p `pwd`/../includes/dvdread
1289     cp `pwd`/../libdvdread/src/*.h `pwd`/../includes/dvdread
1290   fi
1291
1292 ], [0])
1293
1294 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/libdvd/libdvdnav], [
1295   if test "$host_vendor" = "apple" ; then
1296     ./configure2 MACOSX_DEPLOYMENT_TARGET=10.4 \
1297       --extra-cflags="$DVDREAD_CFLAGS -fPIC -DPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -I`pwd`/../includes" \
1298       --extra-ldflags="-L`pwd`/../libdvdread/obj" \
1299       --with-dvdread-config="`pwd`/../libdvdread/obj/dvdread-config" \
1300       --enable-static \
1301       --disable-shared \
1302       --cc="$CC"
1303   else
1304     ./configure2 \
1305       --extra-cflags="$DVDREAD_CFLAGS -fPIC -DPIC -I`pwd`/../includes" \
1306       --extra-ldflags="-L`pwd`/../libdvdread/obj" \
1307       --with-dvdread-config="`pwd`/../libdvdread/obj/dvdread-config" \
1308       --enable-static \
1309       --disable-shared \
1310       --cc="$CC"
1311   fi
1312 ], [0])
1313
1314 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/libfaad2], [
1315   if test "$host_vendor" = "apple" ; then
1316     CFLAGS="-O3 -fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1317     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 \
1318       --with-pic \
1319       --with-mp4v2
1320   else
1321     ./configure \
1322       --with-pic \
1323       --with-mp4v2 \
1324       CFLAGS="-O3"
1325   fi
1326 ], [$USE_EXTERNAL_LIBFAAD])
1327
1328 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/liba52], [
1329   if test "$host_vendor" = "apple" ; then
1330     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1331     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 \
1332       --with-pic \
1333       --disable-static \
1334       --enable-shared \
1335       --disable-oss \
1336       --disable-solaris-audio \
1337       --disable-win \
1338       --disable-al-audio
1339   else
1340     ./configure \
1341       --with-pic \
1342       --disable-static \
1343       --enable-shared \
1344       --disable-oss \
1345       --disable-solaris-audio \
1346       --disable-win \
1347       --disable-al-audio \
1348       CFLAGS=-fPIC
1349   fi
1350 ], [$USE_EXTERNAL_LIBA52])
1351
1352 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/libmpeg2], [
1353   if test "$host_vendor" = "apple" ; then
1354     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1355     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 \
1356       --with-pic \
1357       --disable-static \
1358       --enable-shared \
1359       --disable-directx \
1360       --disable-sdl \
1361       --without-x
1362   else
1363     ./configure \
1364       --with-pic \
1365       --disable-static \
1366       --enable-shared \
1367       --disable-directx \
1368       --disable-sdl \
1369       --without-x
1370   fi
1371 ], [$USE_EXTERNAL_LIBMPEG2])
1372
1373 XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/libmad], [
1374   if test "$host_vendor" = "apple" ; then
1375     CFLAGS="-fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1376     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 \
1377       --with-pic 
1378   else
1379     ./configure \
1380       --with-pic
1381   fi
1382 ], [$USE_EXTERNAL_LIBMAD])
1383
1384 XB_CONFIG_MODULE([xbmc/lib/cximage-6.0/zlib], [
1385   if test "$host_vendor" = "apple" ; then
1386     export MACOSX_DEPLOYMENT_TARGET=10.4
1387     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1388     ./configure
1389   fi
1390 ], [0])
1391
1392 XB_CONFIG_MODULE([xbmc/lib/libass], [
1393   if test "$host_vendor" = "apple" ; then
1394     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1395     ./configure MACOSX_DEPLOYMENT_TARGET=10.4
1396   else
1397     CFLAGS="$CFLAGS -fPIC" \
1398     ./configure
1399   fi
1400 ], [$USE_EXTERNAL_LIBASS])
1401
1402 XB_CONFIG_MODULE([xbmc/lib/libid3tag/libid3tag],[
1403   if test "$host_vendor" = "apple" ; then
1404     CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -fno-common" \
1405     CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -fno-common" \
1406     ./configure MACOSX_DEPLOYMENT_TARGET=10.4 \
1407       --disable-static \
1408       --disable-debugging \
1409       --with-pic
1410   else
1411     CFLAGS=-O3 \
1412     ./configure \
1413       --disable-static \
1414       --disable-debugging \
1415       --with-pic
1416   fi
1417 ], [0])
1418
1419 XB_CONFIG_MODULE([xbmc/visualizations/XBMCProjectM/libprojectM],[
1420   if test "$host_vendor" = "apple" ; then
1421     rm -f CMakeCache.txt && CC="" CXX=""  cmake -D CMAKE_C_FLAGS:STRING="-fno-common" -D CMAKE_CXX_FLAGS:STRING="-fno-common" -D CMAKE_BUILD_TYPE:STRING=RelWithDebInfo -D USE_FTGL:BOOL=OFF .
1422   else
1423     rm -f CMakeCache.txt && CC="" CXX=""  cmake -D CMAKE_BUILD_TYPE:STRING=RelWithDebInfo -D USE_FTGL:BOOL=OFF .
1424   fi
1425 ], [0])
1426
1427 XB_CONFIG_MODULE([xbmc/visualizations/Goom/goom2k4-0],[
1428   if test "$host_vendor" = "apple" ; then
1429     ./configure \
1430       CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1431       CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"\
1432       --disable-shared \
1433       --enable-static \
1434       --with-pic
1435
1436   else
1437     ./configure  \
1438       --disable-shared \
1439       --enable-static \
1440       --with-pic
1441
1442   fi
1443 ], [0])
1444
1445 XB_CONFIG_MODULE([xbmc/screensavers/rsxs-0.9/], [
1446   if test "$host_vendor" = "apple" ; then
1447     ./configure \
1448       CFLAGS="-fPIC -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1449       CXXFLAGS="-fPIC -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
1450       LDFLAGS="-L/opt/local/lib" \
1451       LIBS="-lz" \
1452       --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib \
1453       --without-xscreensaver \
1454       --disable-sound \
1455       --disable-cyclone \
1456       --disable-fieldlines \
1457       --disable-flocks \
1458       --disable-flux \
1459       --disable-helios \
1460       --disable-hyperspace \
1461       --disable-lattice \
1462       --disable-skyrocket
1463   else
1464     ./configure \
1465       CFLAGS="-fPIC" \ 
1466       CXXFLAGS="-fPIC" \
1467       --without-xscreensaver \
1468       --disable-sound \
1469       --disable-cyclone \
1470       --disable-fieldlines \
1471       --disable-flocks \
1472       --disable-flux \
1473       --disable-helios \
1474       --disable-hyperspace \
1475       --disable-lattice \
1476       --disable-skyrocket
1477   fi
1478 ], [0])
1479
1480 AC_OUTPUT
1481
1482 final_message="$final_message\n  prefix:\t$prefix\n$dashes"
1483 echo -e "$final_message\n"