]> git.sesse.net Git - vlc/blob - configure.in
Audio output 3. Expect major breakages.
[vlc] / configure.in
1 dnl Autoconf settings for vlc
2 AC_INIT(include/main.h)
3 AC_CONFIG_HEADER(include/defs.h)
4 AC_CANONICAL_SYSTEM
5
6 CONFIGURE_LINE="$0 $*"
7
8 PACKAGE="vlc"
9 VERSION="0.5.0-cvs"
10 CODENAME="Natalya"
11
12 dnl
13 dnl  Save *FLAGS
14 dnl
15 save_CPPFLAGS="${CPPFLAGS}"
16 save_CFLAGS="${CFLAGS}"
17 save_LDFLAGS="${LDFLAGS}"
18
19 dnl
20 dnl Check for tools
21 dnl
22 AC_PROG_MAKE_SET
23 AC_PROG_CC
24 AC_PROG_CPP
25
26 dnl Find the right ranlib, even when cross-compiling
27 AC_CHECK_TOOL(RANLIB, ranlib, :)
28 AC_CHECK_TOOL(STRIP, strip, :)
29
30 dnl
31 dnl Check for GNU make
32 dnl
33 AC_PATH_PROG(GMAKE, gmake, no)
34 if test "x${GMAKE}" = "xno"; then
35   AC_CACHE_CHECK([whether GNU make is installed],
36       [ac_cv_gmake],
37       [if make --version | grep -q -i gnu; then
38          ac_cv_gmake="yes"
39        else
40          echo "This software needs you to install GNU make to compile properly."
41          echo "You can get it from http://www.gnu.org/."
42          exit
43        fi])
44   VLC_MAKE="make"
45 else
46   VLC_MAKE="gmake"
47 fi
48
49 dnl Gettext stuff
50 ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
51
52 AC_DEFINE_UNQUOTED(VLC_PACKAGE, "${PACKAGE}", [Package name])
53 AC_DEFINE_UNQUOTED(VLC_VERSION, "${VERSION}", [Package version])
54 AM_GNU_GETTEXT
55
56 dnl AM_PROG_LIBTOOL
57 AC_PROG_INSTALL
58
59 dnl
60 dnl  Set default LDFLAGS
61 dnl
62 vlc_LDFLAGS="${LDFLAGS}"
63
64 dnl
65 dnl  Check the operating system
66 dnl
67 case "x${target_os}" in
68   x)
69     SYS=unknown
70     ;;
71   xlinux*)
72     SYS=linux
73     ;;
74   xbsdi*)
75     SYS=bsdi
76     save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
77     dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
78     vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
79     ;;
80   x*bsd*)
81     SYS="${target_os}"
82     save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
83     ;;
84   xdarwin*)
85     SYS=darwin
86     save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"; CFLAGS="${save_CFLAGS}"
87     vlc_LDFLAGS="${vlc_LDFLAGS} -all_load"
88     ;;
89   x*mingw32*)
90     SYS=mingw32
91     AC_CHECK_TOOL(WINDRES, windres, :)
92     save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"; CFLAGS="${save_CFLAGS}"
93     vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
94     vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
95     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
96     ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
97     http_LDFLAGS="${http_LDFLAGS} -lws2_32"
98     rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
99     ;;
100   x*nto*)
101     SYS=nto
102     x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
103     xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
104     ;;
105   xsolaris*)
106     SYS=solaris
107     ;;
108   xbeos)
109     SYS=beos
110     save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${save_CFLAGS}"
111     vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
112     plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
113     beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
114     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
115     ;;
116   x*)
117     SYS="${target_os}"
118     ;;
119 esac
120
121 dnl Flags for plugin compilation
122 if test "x${SYS}" = "xmingw32"
123 then
124   plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
125 else
126   plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
127   plugins_LDFLAGS="${plugins_LDFLAGS} -fPIC"
128 fi
129
130 dnl The -DSYS_FOO flag
131 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CFLAGS="${save_CFLAGS}"
132
133 dnl Check for system libs needed
134 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll strndup)
135
136 AC_CHECK_FUNC(connect,,[
137   AC_CHECK_LIB(socket,connect,
138     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
139     vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
140 )])
141 AC_CHECK_FUNC(send,,[
142   AC_CHECK_LIB(socket,send,
143     http_LDFLAGS="${http_LDFLAGS} -lsocket"
144 )])
145 AC_CHECK_FUNC(gethostbyname,,[
146   AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl")
147 ])
148 AC_CHECK_FUNC(gethostbyname,,[
149   AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
150 ])
151 have_nanosleep=0
152 AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
153   AC_CHECK_LIB(rt,nanosleep,
154     [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"; have_nanosleep=1],
155     [AC_CHECK_LIB(posix4,nanosleep,
156         [vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"; have_nanosleep=1])]
157   )
158 ])
159 if test x$have_nanosleep = x1; then
160   AC_DEFINE(HAVE_NANOSLEEP, 1,
161             Define if nanosleep is available.)
162 fi
163 # HP/UX port
164 AC_CHECK_LIB(rt,sem_init, [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"])
165
166 AC_CHECK_FUNC(inet_aton,,[
167   AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
168 ])
169 AC_CHECK_FUNC(textdomain,,[
170   AC_CHECK_LIB(intl,textdomain,
171     vlc_LDFLAGS="${vlc_LDFLAGS} -lintl"
172     plugins_LDFLAGS="${plugins_LDFLAGS} -lintl"
173   )
174 ])
175
176 dnl Check for getopt
177 NEED_GETOPT=0
178 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
179 [ # FreeBSD has a gnugetopt library for this:
180   AC_CHECK_LIB([gnugetopt],[getopt_long],
181     [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
182     [NEED_GETOPT=1])])
183
184 AC_TYPE_SIGNAL
185 AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
186 AC_CHECK_LIB(m,cos,
187   imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
188   filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
189 AC_CHECK_LIB(m,pow,
190   ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
191   imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
192   imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
193   imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
194   chroma_i420_rgb_LDFLAGS="${chroma_i420_rgb_LDFLAGS} -lm"
195 )
196
197 dnl Check for pthreads - borrowed from XMMS
198 THREAD_LIB=error
199 if test "x${THREAD_LIB}" = "xerror"; then
200   AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
201 fi
202 if test "x${THREAD_LIB}" = "xerror"; then
203   AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
204 fi
205 if test "x${THREAD_LIB}" = "xerror"; then
206   AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
207 fi
208 if test "x${THREAD_LIB}" = "xerror"; then
209   AC_CHECK_FUNC(pthread_mutex_lock)
210   THREAD_LIB=""
211 fi
212
213 dnl Check for cthreads under GNU/Hurd for instance
214 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
215
216 dnl Check for misc headers
217 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
218   AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
219             Define if <pthread.h> defines pthread_cond_t.)])
220 AC_EGREP_HEADER(pthread_once,pthread.h,[
221   AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
222             Define if <pthread.h> defines pthread_once.)])
223 AC_EGREP_HEADER(strncasecmp,strings.h,[
224   AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
225             Define if <strings.h> defines strncasecmp.)])
226
227 dnl Check for headers
228 AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
229 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
230 AC_CHECK_HEADERS(dlfcn.h image.h)
231 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
232 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
233 AC_CHECK_HEADERS(linux/version.h)
234
235 AC_HEADER_TIME
236
237 dnl Mac OS X and other OSes don't have declaration for nanosleep
238 AC_EGREP_HEADER(nanosleep,time.h,[
239   AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
240             Define if <time.h> defines nanosleep.)
241 ])
242
243 dnl Make sure we have timespecs
244 AC_EGREP_HEADER(timespec,sys/time.h,[
245   AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
246             Define if <sys/time.h> defines struct timespec.)
247 ])
248
249 dnl Check for threads library
250 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
251
252 dnl Default X headers and libraries
253 if test "x${x_includes}" = "xNONE"; then
254   x_includes="/usr/X11R6/include"
255 fi
256 if test "x${x_libraries}" = "xNONE"; then
257   x_libraries="/usr/X11R6/lib"
258 fi
259
260 dnl Check for DPMS
261 if test "x${SYS}" != "xmingw32"
262 then
263   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
264   AC_CHECK_HEADERS(X11/extensions/dpms.h, [
265     AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
266       AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
267                 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
268     ])
269   ])
270   CPPFLAGS="${save_CPPFLAGS}"
271 fi
272
273 dnl Check for ntohl, etc.
274 AC_CACHE_CHECK([for ntohl in sys/param.h],
275     [ac_cv_c_ntohl_sys_param_h],
276     [CFLAGS="${save_CFLAGS} -Wall -Werror"
277      AC_TRY_COMPILE([#include <sys/param.h>],
278         [void foo() { int meuh; ntohl(meuh); }],
279         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
280 if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
281     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
282 fi
283
284 dnl Check for inline function size limit
285 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
286     [ac_cv_c_inline_limit],
287     [CFLAGS="${save_CFLAGS} -finline-limit-30000"
288      AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
289 if test "x${ac_cv_c_inline_limit}" != "xno"; then
290     save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; CFLAGS="${save_CFLAGS}"
291 fi
292
293 dnl Check for -W or -w flags
294 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
295     [ac_cv_c_Wall_Winline],
296     [CFLAGS="-Wall -Winline ${save_CFLAGS}"
297      AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
298 if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
299     save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
300 else
301     AC_CACHE_CHECK([if \$CC accepts -wall -winline],
302         [ac_cv_c_wall_winline],
303         [CFLAGS="-wall -winline ${save_CFLAGS}"
304          AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
305     if test "x${ac_cv_c_wall_winline}" != "xno"; then
306         save_CFLAGS="-wall -winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
307     fi
308 fi
309
310 dnl Check for -pipe
311 AC_CACHE_CHECK([if \$CC accepts -pipe],
312     [ac_cv_c_pipe],
313     [CFLAGS="${save_CFLAGS} -pipe"
314      AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
315 if test "x${ac_cv_c_pipe}" != "xno"; then
316     save_CFLAGS="${save_CFLAGS} -pipe"; CFLAGS="${save_CFLAGS}"
317 fi
318
319 dnl Check for various optimization flags
320 AC_CACHE_CHECK([if \$CC accepts -O3],
321     [ac_cv_c_o3],
322     [CFLAGS="${save_CFLAGS} -O3"
323      AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
324 if test "x${ac_cv_c_o3}" != "xno"; then
325     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
326 else
327     AC_CACHE_CHECK([if \$CC accepts -O2],
328         [ac_cv_c_o2],
329         [CFLAGS="${save_CFLAGS} -O2"
330          AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
331     if test "x${ac_cv_c_o2}" != "xno"; then
332         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
333     else
334         AC_CACHE_CHECK([if \$CC accepts -O],
335             [ac_cv_c_o],
336             [CFLAGS="${save_CFLAGS} -O"
337              AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
338         if test "x${ac_cv_c_o}" != "xno"; then
339             CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
340         fi
341     fi
342 fi
343
344 dnl Check for -ffast-math
345 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
346     [ac_cv_c_fast_math],
347     [CFLAGS="${save_CFLAGS} -ffast-math"
348      AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
349 if test "x${ac_cv_c_fast_math}" != "xno"; then
350     CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
351 fi
352
353 dnl Check for -funroll-loops
354 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
355     [ac_cv_c_unroll_loops],
356     [CFLAGS="${save_CFLAGS} -funroll-loops"
357      AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
358 if test "x${ac_cv_c_unroll_loops}" != "xno"; then
359     CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
360 fi
361
362 dnl Check for -fomit-frame-pointer
363 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
364     [ac_cv_c_omit_frame_pointer],
365     [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
366      AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
367 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
368     CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
369     # this plugin does not compile without -fomit-frame-pointer, damn gcc!
370     i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
371 fi
372
373 dnl Check for Darwin plugin linking flags
374 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
375     [ac_cv_ld_darwin],
376     [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
377      AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
378 if test "x${ac_cv_ld_darwin}" != "xno"; then
379     plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
380 fi
381
382 dnl Check for standard plugin linking flags
383 AC_CACHE_CHECK([if \$CC accepts -shared],
384     [ac_cv_ld_plugins],
385     [CFLAGS="${save_CFLAGS} -shared"
386      AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
387 if test "x${ac_cv_ld_plugins}" != "xno"; then
388     plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
389 fi
390         
391 dnl Check for variadic macros
392 AC_CACHE_CHECK([for variadic cpp macros],
393     [ac_cv_cpp_variadic_macros],
394     [CFLAGS="${save_CFLAGS}"
395      AC_TRY_COMPILE(
396          [#include <stdio.h>
397           #define a(b,c...) printf(b,##c)],
398          [a("foo");a("%s","bar");a("%s%s","baz","quux");],
399          ac_cv_cpp_variadic_macros=yes,
400          ac_cv_cpp_variadic_macros=no)])
401 if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
402     AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
403 fi
404
405 dnl Checks for __attribute__(aligned()) directive
406 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
407     [ac_cv_c_attribute_aligned],
408     [ac_cv_c_attribute_aligned=0
409         CFLAGS="${save_CFLAGS} -Werror"
410     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
411         AC_TRY_COMPILE([],
412         [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
413         [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
414     done
415         CFLAGS="${save_CFLAGS}"])
416 if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
417     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
418         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
419 fi
420
421 dnl
422 dnl  Check the CPU
423 dnl
424 case "x${target_cpu}" in
425   x)
426     ARCH=unknown
427     ;;
428   *)
429     ARCH="${target_cpu}"
430     ;;
431 esac
432
433 dnl
434 dnl  default modules
435 dnl
436 BUILTINS="${BUILTINS}"
437 PLUGINS="${PLUGINS} misc/dummy/dummy misc/null/null"
438 PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file access/udp access/http misc/network/ipv4 misc/memcpy/memcpy"
439 PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts"
440 PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec"
441 #PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/lpcm/lpcm codec/spdif/spdif"
442 PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
443 PLUGINS="${PLUGINS} audio_mixer/trivial"
444 PLUGINS="${PLUGINS} audio_output/file"
445 #PLUGINS="${PLUGINS} visualization/scope/scope"
446 PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
447
448 dnl
449 dnl  Accelerated modules
450 dnl
451 MMX_MODULES="misc/memcpy/memcpymmx codec/mpeg_video/idct/idctmmx codec/mpeg_video/motion/motionmmx video_chroma/i420_rgb_mmx video_chroma/i420_yuy2_mmx video_chroma/i422_yuy2_mmx video_chroma/i420_ymga_mmx"
452 MMXEXT_MODULES="misc/memcpy/memcpymmxext codec/mpeg_video/idct/idctmmxext codec/mpeg_video/motion/motionmmxext"
453 THREEDNOW_MODULES="misc/memcpy/memcpy3dn codec/a52old/imdct/imdct3dn codec/a52old/downmix/downmix3dn"
454 SSE_MODULES="codec/a52old/imdct/imdctsse codec/a52old/downmix/downmixsse"
455 ALTIVEC_MODULES="codec/mpeg_video/idct/idctaltivec codec/mpeg_video/motion/motionaltivec misc/memcpy/memcpyaltivec"
456
457 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
458     [ac_cv_mmx_inline],
459     [CFLAGS="${save_CFLAGS}"
460      AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
461                     ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
462 if test "x${ac_cv_mmx_inline}" != "xno"; then
463   ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
464 fi
465
466 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
467     [ac_cv_mmxext_inline],
468     [CFLAGS="${save_CFLAGS}"
469      AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
470                     ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
471 if test "x${ac_cv_mmxext_inline}" != "xno"; then
472   ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
473 fi
474
475 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
476     [ac_cv_3dnow_inline],
477     [CFLAGS="${save_CFLAGS}"
478      AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
479                     ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
480 if test "x${ac_cv_3dnow_inline}" != "xno"; then
481   AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
482   ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
483 fi
484
485 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
486     [ac_cv_sse_inline],
487     [CFLAGS="${save_CFLAGS}"
488      AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
489                     ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
490 if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
491   AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
492   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
493 fi
494
495 # don't try to grok AltiVec with native mingw32 it doesn't work right now
496 # we should be able to remove this test with future versions of mingw32
497 if test "x${SYS}" != "xmingw32"; then
498 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
499     [ac_cv_altivec_inline],
500     [CFLAGS="${save_CFLAGS}"
501      AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
502          ac_cv_altivec_inline=yes,
503          [CFLAGS="${save_CFLAGS} -Wa,-m7400"
504           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
505             [ac_cv_altivec_inline="-Wa,-m7400"],
506             ac_cv_altivec_inline=no)
507          ])])
508 if test "x${ac_cv_altivec_inline}" != "xno"; then
509   AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
510   if test "x${ac_cv_altivec_inline}" != "xyes"; then
511     idctaltivec_CFLAGS="${idctaltivec_CFLAGS} ${ac_cv_altivec_inline}"
512     motionaltivec_CFLAGS="${motionaltivec_CFLAGS} ${ac_cv_altivec_inline}"
513     memcpyaltivec_CFLAGS="${memcpyaltivec_CFLAGS} ${ac_cv_altivec_inline}"
514     vlc_CFLAGS="${vlc_CFLAGS} ${ac_cv_altivec_inline}"
515   fi
516   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
517 fi
518
519 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
520     [ac_cv_c_altivec],
521     [CFLAGS="${save_CFLAGS} -faltivec"
522      # Darwin test
523      AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
524         ac_cv_c_altivec=-faltivec, [
525         # Linux/PPC test
526         CFLAGS="${save_CFLAGS} ${idctaltivec_CFLAGS} -fvec"
527         AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
528             [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
529         ])
530      CFLAGS="${save_CFLAGS}"])
531 if test "x${ac_cv_c_altivec}" != "xno"; then
532   AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
533   idctaltivec_CFLAGS="${idctaltivec_CFLAGS} ${ac_cv_c_altivec}"
534   motionaltivec_CFLAGS="${motionaltivec_CFLAGS} ${ac_cv_c_altivec}"
535   memcpyaltivec_CFLAGS="${memcpyaltivec_CFLAGS} ${ac_cv_c_altivec}"
536   vlc_CFLAGS="${vlc_CFLAGS} ${ac_cv_c_altivec}"
537   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
538 fi
539
540 AC_CACHE_CHECK([if linker needs -framework vecLib],
541     [ac_cv_ld_altivec],
542     [LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
543      AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
544      LDFLAGS="${save_LDFLAGS}"
545     ])
546 if test "x${ac_cv_ld_altivec}" != "xno"; then
547   idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
548   motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
549   memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
550   vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
551 fi
552 fi # end if mingw32
553
554
555 AC_ARG_WITH(,[])
556 AC_ARG_WITH(,[Optimization options:])
557
558 dnl
559 dnl  Special arch tuning
560 dnl
561 AC_ARG_WITH(tuning,
562 [  --with-tuning=ARCH      enable special tuning for an architecture
563                           (default i686 on IA-32 and 750 on PPC)])
564 if test "x${with_tuning}" != "x"; then
565     TUNING="${with_tuning}"
566 else
567     if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xi486" -o "x${target_cpu}" = "xi386"; then TUNING="pentiumpro"
568     else
569         if test "x${target_cpu}" = "xpowerpc"; then TUNING="750"; fi
570     fi
571 fi
572
573 dnl
574 dnl  x86 accelerations
575 dnl
576 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
577 then
578     ARCH="${ARCH} mmx"
579     PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
580 fi
581
582 dnl
583 dnl  Enable/disable optimizations
584 dnl
585 AC_ARG_ENABLE(optimizations,
586 [  --disable-optimizations disable compiler optimizations (default enabled)],
587 [ if test "x${enable_optimizations}" = "xno"; then OPTIMS=0; fi ],
588 [ OPTIMS=1 ])
589
590 dnl
591 dnl  AltiVec acceleration
592 dnl
593 AC_ARG_ENABLE(altivec,
594 [  --disable-altivec       disable AltiVec optimizations (default enabled on PPC)],
595 [ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
596     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
597 [ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
598     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
599
600 dnl
601 dnl  Debugging mode
602 dnl
603 DEBUG=0
604 AC_ARG_ENABLE(debug,
605 [  --enable-debug          debug mode (default disabled)],
606 [ if test "x${enable_debug}" = "xyes"; then DEBUG=1; fi ])
607
608 dnl
609 dnl  Enable release-specific flags
610 dnl
611 RELEASE=0
612 AC_ARG_ENABLE(release,
613 [  --enable-release        activate extra optimizations (default disabled)],
614 [ if test "x${enable_release}" = "xyes"; then RELEASE=1; fi ],
615 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
616
617 dnl
618 dnl  Input plugins
619 dnl
620
621 AC_ARG_WITH(,[Input plugins:])
622
623 dnl
624 dnl  DVD module: optionally check for installed libdvdcss
625 dnl
626 AC_ARG_ENABLE(dvd,
627 [  --enable-dvd            DVD input module (default enabled)])
628 if test "x${enable_dvd}" != "xno"
629 then
630   AC_ARG_WITH(dvdcss, 
631   [    --with-dvdcss=PATH    libdvdcss headers and libraries])
632   AC_ARG_WITH(dvdcss-tree, 
633   [    --with-dvdcss-tree=PATH libdvdcss tree for static linking])
634   case "x${with_dvdcss}" in
635   x|xyes)
636     if test "x${with_dvdcss_tree}" = x
637     then
638       AC_CHECK_HEADERS(dvdcss/dvdcss.h,
639         [ PLUGINS="${PLUGINS} access/dvd/dvd"
640           dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
641         [ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss=<path/where/libdvdcss/was/installed> for dynamic linking (recommended under Unix) or --with-dvdcss-tree=<path/where/libdvdcss/was/built> for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.])
642           AC_MSG_ERROR([cannot find libdvdcss headers]) ])
643     else
644       AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
645       real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
646       if test "x${real_dvdcss_tree}" = "x"
647       then
648         dnl  The given directory can't be found
649         AC_MSG_RESULT(no)
650         AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
651       fi
652       if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
653       then
654         dnl  Use a custom libdvdcss
655         AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
656         BUILTINS="${BUILTINS} access/dvd/dvd"
657         dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
658         dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
659       else
660         dnl  The given libdvdcss wasn't built
661         AC_MSG_RESULT(no)
662         AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
663       fi
664     fi
665   ;;
666   xno)
667     dnl  Compile without dvdcss (dlopen version, works only under Linux)
668     PLUGINS="${PLUGINS} access/dvd/dvd"
669     dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
670     dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
671   ;;
672   *)
673     AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
674     if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
675     then
676       dnl  Use ${with_dvdcss}/include/dvdcss/dvdcss.h
677       AC_MSG_RESULT(yes)
678       PLUGINS="${PLUGINS} access/dvd/dvd"
679       dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
680       dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
681     else
682       dnl  No libdvdcss could be found, sorry
683       AC_MSG_RESULT(no)
684       AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
685     fi
686   ;;
687   esac
688 fi
689
690 dnl
691 dnl dvdread module: check for libdvdread plugin
692 dnl
693 AC_ARG_ENABLE(dvdread,
694 [  --enable-dvdread        dvdread input module (default disabled)])
695 if test "x${enable_dvdread}" != "xno"
696 then
697   AC_ARG_WITH(dvdread, 
698   [    --with-dvdread=PATH   libdvdread headers and libraries])
699   if test "x${with_dvdread}" = "x"
700   then
701     test_LDFLAGS=""
702     test_CFLAGS=""
703   else
704     test_LDFLAGS="-L${with_dvdread}/lib"
705     test_CFLAGS="-I${with_dvdread}/include"
706   fi
707   CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
708   AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
709      AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
710         [void foo() { int i=DVD_VIDEO_LB_LEN; }],[
711           PLUGINS="${PLUGINS} access/dvdread/dvdread"
712           dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
713           dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
714         ],[
715           if test "x${enable_dvdread}" != "x"
716           then
717             AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
718           fi
719         ])
720   ],[
721     if test "x${enable_dvdread}" != "x"
722     then
723       if test "x${with_dvdread}" != "x"
724       then
725         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
726       else
727         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
728       fi
729     fi
730   ])
731   CPPFLAGS="$save_CPPFLAGS"
732 fi
733
734 dnl
735 dnl dvdplay module: check for libdvdplay
736 dnl
737 AC_ARG_ENABLE(dvdplay,
738 [  --enable-dvdplay        dvdplay input module (default disabled)])
739 if test "x$enable_dvdplay" != "xno"
740 then
741   AC_ARG_WITH(dvdplay, 
742   [    --with-dvdplay=PATH   libdvdplay headers and libraries])
743   if test "x$with_dvdplay" = x
744   then
745     test_LDFLAGS=""
746     test_CFLAGS=""
747   else
748     test_LDFLAGS="-L${with_dvdplay}/lib"
749     test_CFLAGS="-I${with_dvdplay}/include"
750   fi
751   CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
752   AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
753       PLUGINS="${PLUGINS} access/dvdplay/dvdplay"
754       dvdplay_LDFLAGS="${dvdplay_LDFLAGS} ${test_LDFLAGS} -ldvdplay -ldvdread"
755       dvdplay_CFLAGS="${dvdplay_CFLAGS} ${test_CFLAGS}"
756     ],[
757     if test "x$enable_dvdplay" != x
758     then
759       if test "x$with_dvdplay" != x
760       then
761         AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h in ${with_dvdplay}/include])
762       else
763         AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h])
764       fi
765     fi
766   ])
767   CPPFLAGS="${save_CPPFLAGS}"
768 fi
769
770
771 dnl
772 dnl  libdvbpsi ts demux
773 dnl
774 AC_ARG_ENABLE(dvbpsi,
775 [  --enable-dvbpsi        dvbpsi ts demux module (default disabled)])
776 if test "x${enable_dvbpsi}" != "xno"
777 then
778   AC_ARG_WITH(dvbpsi, 
779   [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
780   AC_ARG_WITH(dvbpsi,
781   [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
782   case "x${with_dvbpsi}" in
783   x|xyes)
784     if test "x${with_dvbpsi_tree}" = "x"
785     then
786       AC_CHECK_HEADERS(dvbpsi/dr.h,
787         [ PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
788           ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
789         [  AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
790     else
791       AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
792       real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
793       if test "x${real_dvbpsi_tree}" = "x"
794       then
795         dnl  The given directory can't be found
796         AC_MSG_RESULT(no)
797         AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
798       fi
799       if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
800       then
801         dnl  Use a custom libdvbpsi
802         AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
803         BUILTINS="${BUILTINS} demux/mpeg/ts_dvbpsi"
804         ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
805         ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
806       else
807         dnl  The given libdvbpsi wasn't built
808         AC_MSG_RESULT(no)
809         AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
810       fi
811     fi
812   ;;
813   xno)
814     dnl  Compile without dvbpsi
815   ;;
816   *)
817     AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
818     if test "x${with_dvbpsi}" = "x"
819     then
820       test_LDFLAGS=""
821       test_CFLAGS=""
822     else
823       test_LDFLAGS="-L${with_dvbpsi}/lib"
824       test_CFLAGS="-I${with_dvbpsi}/include"
825     fi
826     CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
827     AC_CHECK_HEADER([dvbpsi/dr.h],[
828       PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
829       ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
830       ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
831       ],[
832       if test "x${enable_dvbpsi}" != "x"
833       then
834         AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
835       fi
836     ])
837     CPPFLAGS="${save_CPPFLAGS}"
838   ;;
839   esac
840 fi
841
842 dnl
843 dnl  Video4Linux plugin
844 dnl
845 AC_ARG_ENABLE(v4l,
846   [  --enable-v4l            Video4Linux input support (default disabled)])
847 if test "x${enable_v4l}" = "xyes"
848 then
849   AC_CHECK_HEADERS(libv4l/v4l.h, [
850     PLUGINS="${PLUGINS} access/v4l/v4l"
851    ],[])
852 fi
853
854 dnl
855 dnl  VCD module
856 dnl
857 AC_ARG_ENABLE(vcd,
858   [  --enable-vcd            VCD support for Linux, FreeBSD and MacOS X (default enabled)])
859
860 if test "x${enable_vcd}" != "xno"
861 then
862   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
863     PLUGINS="${PLUGINS} access/vcd/vcd"
864   ])
865   
866   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
867     PLUGINS="${PLUGINS} access/vcd/vcd"
868     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
869   ])
870   
871   if test "x${SYS}" = "xbsdi"
872   then
873     PLUGINS="${PLUGINS} access/vcd/vcd"
874   fi
875
876   if test "x${SYS}" = "xdarwin"
877   then
878     # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
879     vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation" 
880   fi
881 fi
882
883 dnl
884 dnl  Satellite input module
885 dnl
886 AC_ARG_ENABLE(satellite,
887   [  --enable-satellite      satellite card support (default disabled)],
888   [ if test "x${enable_satellite}" = "xyes"
889     then
890       PLUGINS="${PLUGINS} access/satellite/satellite"
891     fi])
892
893 dnl
894 dnl  ipv6 plugin - not for QNX yet
895 dnl
896 if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
897 then
898   have_ipv6=0
899   AC_CHECK_FUNC(inet_pton,[have_ipv6=1],[
900     AC_CHECK_LIB(resolv,inet_pton,
901       [have_ipv6=1
902        ipv6_LDFLAGS="${ipv6_LDFLAGS} -lresolv"])
903   ])
904   AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
905   AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
906     [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=0])
907   if test x$have_ipv6 = x1; then
908     PLUGINS="${PLUGINS} misc/network/ipv6"
909   fi
910 fi
911 if test "x${SYS}" = "xmingw32"
912 then
913   AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
914   AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
915     PLUGINS="${PLUGINS} misc/network/ipv6"],[AC_MSG_RESULT(no)])
916 fi
917
918 dnl
919 dnl  AVI demux plugin
920 dnl
921 AC_ARG_ENABLE(avi,
922   [  --enable-avi            AVI demux module (default enabled)])
923 if test "x${enable_avi}" != "xno"
924 then
925   PLUGINS="${PLUGINS} demux/avi/avi"
926 fi
927
928 dnl
929 dnl  Codec plugins
930 dnl
931
932 AC_ARG_WITH(,[Codec plugins:])
933
934 dnl
935 dnl  mad plugin
936 dnl
937 AC_ARG_ENABLE(mad,
938   [  --enable-mad            libmad module (default disabled)])
939 if test "x${enable_mad}" = "xyes"
940 then
941   AC_ARG_WITH(mad,
942     [    --with-mad=PATH       path to libmad],[],[])
943   if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
944   then
945     mad_CFLAGS="${mad_CFLAGS} -I${with_mad}/include"
946     mad_LDFLAGS="${mad_LDFLAGS} -L${with_mad}/lib"
947   fi
948
949   AC_ARG_WITH(mad-tree,
950     [    --with-mad-tree=PATH  mad tree for static linking],[],[])
951   if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
952   then
953     real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
954     if test "x${real_mad_tree}" = "x"
955     then
956       dnl  The given directory can't be found
957       AC_MSG_RESULT(no)
958       AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
959     fi
960     dnl  Use a custom libmad
961     AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
962     if test -f ${real_mad_tree}/libmad/mad.h
963     then
964       AC_MSG_RESULT(yes)
965       mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
966       mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
967       LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
968       AC_CHECK_LIB(mad, mad_bit_init, [
969         #BUILTINS="${BUILTINS} codec/mad/mad"
970         mad_LDFLAGS="${mad_LDFLAGS} -lmad"
971         ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
972       ],[])
973       LDFLAGS="${save_LDFLAGS}"
974     else
975       AC_MSG_RESULT(no)
976       AC_MSG_ERROR([the specified tree doesn't have mad.h])
977     fi
978   else
979     CFLAGS="${save_CFLAGS} ${mad_CFLAGS}"
980     LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
981     AC_CHECK_HEADERS(mad.h, ,
982       [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
983     AC_CHECK_LIB(mad, mad_bit_init, [
984       #PLUGINS="${PLUGINS} codec/mad/mad"
985       mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
986       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
987     CFLAGS="${save_CFLAGS}"
988     LDFLAGS="${save_LDFLAGS}"
989   fi
990 fi
991
992 dnl
993 dnl  ffmpeg decoder plugin
994 dnl
995 AC_ARG_ENABLE(ffmpeg,
996 [  --enable-ffmpeg         ffmpeg codec (default disabled)])
997 if test "x${enable_ffmpeg}" = "xyes"
998 then
999   AC_ARG_WITH(ffmpeg,
1000     [    --with-ffmpeg=PATH    path to ffmpeg installation],[],[])
1001   if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1002   then
1003     ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${with_ffmpeg}/include/libffmpeg"
1004     ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L${with_ffmpeg}/lib"
1005   fi
1006
1007   dnl Add postprocessing modules
1008   PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_c"
1009   if test "x${ac_cv_mmx_inline}" != "xno"; then
1010     PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_mmx"
1011   fi
1012
1013   if test "x${ac_cv_mmxext_inline}" != "xno"; then
1014     PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_mmxext"
1015   fi
1016
1017
1018   AC_ARG_WITH(ffmpeg-tree, 
1019   [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1020   if test "x${with_ffmpeg_tree}" != "x"
1021   then
1022     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1023     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1024     if test "x${real_ffmpeg_tree}" = x
1025     then
1026       dnl  The given directory can't be found
1027       AC_MSG_RESULT(no)
1028       AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1029     fi
1030     if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1031     then
1032       dnl  Use a custom libffmpeg
1033       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1034       BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
1035       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
1036       ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
1037     else
1038       dnl  The given libavcodec wasn't built
1039       AC_MSG_RESULT(no)
1040       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1041     fi
1042   else
1043     CFLAGS="${save_CFLAGS} ${ffmpeg_CFLAGS}"
1044     LDFLAGS="${save_LDFLAGS} ${ffmpeg_LDFLAGS} -lm"
1045     AC_CHECK_LIB(avcodec, avcodec_init, [
1046       BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
1047       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
1048       [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1049     LDFLAGS="${save_LDFLAGS}"
1050     CFLAGS="${save_CFLAGS}"
1051   fi
1052 fi
1053
1054 dnl 
1055 dnl MP4 module 
1056 dnl 
1057 AC_ARG_ENABLE(mp4,
1058   [  --enable-mp4            MP4 demux module (default disabled)])
1059 if test "x${enable_mp4}" = "xyes"
1060 then
1061     AC_CHECK_HEADER(zlib.h,
1062         AC_CHECK_LIB(z, inflateEnd,
1063             [ PLUGINS="${PLUGINS} demux/mp4/mp4"
1064               mp4_LDFLAGS="${mp4_LDFLAGS} -lz" ], 
1065             [ AC_MSG_ERROR([cannot find zlib library...]) ]),
1066         [  AC_MSG_ERROR([cannot find zlib header...]) ])
1067 fi
1068
1069 dnl
1070 dnl  a52 AC3 decoder plugin
1071 dnl
1072 AC_ARG_ENABLE(a52,
1073   [  --enable-a52            A/52 support with liba52 (default enabled)])
1074 if test "x${enable_a52}" != "xno"
1075 then
1076   AC_ARG_WITH(a52, 
1077     [    --with-a52=PATH       a52 headers and libraries])
1078   AC_ARG_WITH(a52-tree,
1079     [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
1080   if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1081   then
1082     real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1083     if test "x${real_a52_tree}" = "x"
1084     then
1085       dnl  The given directory can't be found
1086       AC_MSG_RESULT(no)
1087       AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1088     fi
1089     dnl  Use a custom a52dec
1090     AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1091     if test -f ${real_a52_tree}/include/a52.h
1092     then
1093       AC_MSG_RESULT(yes)
1094       a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
1095       a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
1096       LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
1097       AC_CHECK_LIB(a52, a52_free, [
1098         BUILTINS="${BUILTINS} codec/a52/a52"
1099         a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
1100         a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
1101         ],[
1102         if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1103         then
1104           AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1105         else
1106           AC_MSG_ERROR([the specified tree hasn't been compiled])
1107         fi
1108       ],[-lm])
1109       LDFLAGS="${save_LDFLAGS}"
1110     else
1111       AC_MSG_RESULT(no)
1112       AC_MSG_ERROR([the specified tree doesn't have a52.h])
1113     fi
1114   else
1115     if test "x${with_a52}" = "x"
1116     then
1117       test_LDFLAGS=""
1118       test_CFLAGS=""
1119     else
1120       test_LDFLAGS="-L${with_a52}/lib"
1121       test_CFLAGS="-I${with_a52}/include"
1122     fi
1123     save_CPPFLAGS="${CPPFLAGS}"
1124     save_LDFLAGS="${LDFLAGS}"
1125     CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
1126     LDFLAGS="${save_LDFLAGS} ${test_LDFLAGS}"
1127     AC_CHECK_HEADERS(a52dec/a52.h, [
1128       AC_CHECK_LIB(a52, a52_free, [
1129         BUILTINS="${BUILTINS} codec/a52/a52"
1130         a52_LDFLAGS="${a52_LDFLAGS} ${test_LDFLAGS} -la52 -lm"
1131         a52_CFLAGS="${a52_CFLAGS} ${test_CFLAGS}"
1132       ],[
1133         if test "x${enable_dvbpsi}" != "x"
1134         then
1135           AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1136         fi
1137       ],[-lm])
1138     ])
1139     CPPFLAGS="${save_CPPFLAGS}"
1140     LDFLAGS="${save_LDFLAGS}"
1141   fi
1142 fi
1143
1144 dnl
1145 dnl  cinepak plugin
1146 dnl
1147 AC_ARG_ENABLE(cinepak,
1148   [  --enable-cinepak        Cinepak decoder (default enabled)])
1149 if test "x${enable_cinepak}" != "xno"
1150 then
1151   PLUGINS="${PLUGINS} codec/cinepak/cinepak"
1152 fi
1153
1154 dnl
1155 dnl  ogg vorbis plugin
1156 dnl
1157 AC_ARG_ENABLE(vorbis,
1158   [  --enable-vorbis         Ogg/Vorbis decoder support (default enabled)])
1159 if test "x${enable_vorbis}" != "xno"
1160 then
1161   AC_CHECK_HEADERS(ogg/ogg.h, [
1162     dnl disabled for the moment
1163     #PLUGINS="${PLUGINS} demux/ogg/ogg codec/vorbis/vorbis"
1164     vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
1165    ],[])
1166 fi
1167
1168 dnl
1169 dnl  DV plugin
1170 dnl 
1171 AC_ARG_ENABLE(dv,
1172   [  --enable-dv             DV decoder support (default disabled)])
1173 if test "x${enable_dv}" = "xyes"
1174 then
1175   AC_CHECK_HEADERS(libdv/dv.h, [
1176     BUILTINS="${BUILTINS} codec/dv/dv"
1177     dv_LDFLAGS="${dv_LDFLAGS} -ldv"
1178    ],[])
1179 fi  
1180
1181 dnl
1182 dnl  Video plugins
1183 dnl
1184
1185 AC_ARG_WITH(,[Video plugins:])
1186
1187 dnl
1188 dnl  X11 module
1189 dnl  (enabled by default except on win32)
1190 dnl
1191 AC_ARG_ENABLE(x11,
1192   [  --enable-x11            X11 support (default enabled)])
1193 if test "x${enable_x11}" != "xno" &&
1194   (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1195   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1196   AC_CHECK_HEADERS(X11/Xlib.h, [
1197     PLUGINS="${PLUGINS} video_output/x11/x11"
1198     x11_LDFLAGS="${x11_LDFLAGS} -L${x_libraries} -lX11 -lXext"
1199     x11_CFLAGS="${x11_CFLAGS} -I${x_includes}"
1200   ])
1201   CPPFLAGS="${save_CPPFLAGS}"
1202 fi
1203
1204 dnl
1205 dnl  XVideo module
1206 dnl  (enabled by default except on win32)
1207 dnl
1208 AC_ARG_ENABLE(xvideo,
1209   [  --enable-xvideo         XVideo support (default enabled)])
1210 if test "x${enable_xvideo}" != "xno" &&
1211   (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1212   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1213   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1214     CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
1215     AC_CHECK_LIB(Xv_pic,XvPutImage,
1216       # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1217       PLUGINS="${PLUGINS} video_output/x11/xvideo"
1218       xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv_pic"
1219       xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1220       AC_CHECK_LIB(Xv,XvPutImage,
1221         # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1222         PLUGINS="${PLUGINS} video_output/x11/xvideo"
1223         xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv"
1224         xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1225         # Otherwise... well, do nothing.
1226         :
1227       )
1228     )
1229     CFLAGS="${save_CFLAGS}"
1230   ]
1231   CPPFLAGS="${save_CPPFLAGS}")
1232 fi
1233
1234 dnl
1235 dnl  SDL module
1236 dnl
1237 AC_ARG_ENABLE(sdl,
1238   [  --enable-sdl            SDL support (default enabled)])
1239 if test "x${enable_sdl}" != "xno"
1240 then
1241   SDL_PATH="${PATH}"
1242   AC_ARG_WITH(sdl-config-path,
1243     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1244     [ if test "x${with_sdl_config_path}" != "xno"
1245       then
1246         SDL_PATH="${with_sdl_config_path}:${PATH}"
1247       fi ])
1248   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1249   SDL_CONFIG="${SDL12_CONFIG}"
1250   SDL_HEADER="SDL12/SDL.h"
1251   if test "x${SDL_CONFIG}" = "xno"
1252   then
1253     AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1254     SDL_CONFIG=${SDL11_CONFIG}
1255     SDL_HEADER="SDL11/SDL.h"
1256   fi
1257   if test "x${SDL_CONFIG}" = "xno"
1258   then
1259     AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1260     SDL_HEADER="SDL/SDL.h"
1261   fi
1262   if test "x${SDL_CONFIG}" != "xno"
1263   then
1264     PLUGINS="${PLUGINS} video_output/sdl/sdl"
1265     sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
1266     sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1267     CPPFLAGS="${save_CPPFLAGS} ${sdl_CFLAGS}"
1268     AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1269       <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1270       [ AC_MSG_ERROR([The development package for SDL is not installed. 
1271 Please install it and try again. Alternatively you can also configure with 
1272 --disable-sdl.])
1273       ])
1274     CPPFLAGS="${save_CPPFLAGS}"
1275     if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1276     then
1277       AC_MSG_ERROR([The development package for SDL is not installed.
1278 Please install it and try again. Alternatively you can also configure with
1279 --disable-sdl.])
1280     fi
1281   elif test "x${enable_sdl}" =  "xyes"
1282   then
1283     AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1284 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1285     ])
1286   fi
1287 fi
1288
1289 dnl
1290 dnl  Windows DirectX module
1291 dnl
1292 AC_ARG_ENABLE(directx,
1293   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
1294 if test "x${enable_directx}" != "xno"
1295 then
1296   if test "x${SYS}" = "xmingw32"
1297   then
1298     AC_ARG_WITH(directx, 
1299     [    --with-directx=PATH   Win32 DirectX headers])
1300     if test "x${with_directx}" = "x"
1301     then
1302       AC_CHECK_HEADERS(ddraw.h,
1303       [ PLUGINS="${PLUGINS} video_output/directx/directx"
1304         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1305     else
1306       AC_MSG_CHECKING(for directX headers in ${with_directx})
1307       if test -f ${with_directx}/ddraw.h
1308       then
1309         PLUGINS="${PLUGINS} video_output/directx/directx"
1310         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32"
1311         directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
1312         AC_MSG_RESULT(yes)
1313       else
1314         AC_MSG_RESULT(no)
1315         AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1316       fi
1317     fi
1318   fi
1319 fi
1320
1321 dnl
1322 dnl  Linux framebuffer module
1323 dnl
1324 AC_ARG_ENABLE(fb,
1325   [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
1326     if test "x${enable_fb}" != "xno"
1327     then
1328       AC_CHECK_HEADERS(linux/fb.h, [
1329         PLUGINS="${PLUGINS} video_output/fb/fb"
1330       ])
1331     fi
1332
1333 dnl
1334 dnl  Linux MGA module
1335 dnl
1336 AC_ARG_ENABLE(mga,
1337   [  --enable-mga            Linux kernel Matrox support (default disabled)],
1338   [ if test "x${enable_mga}" = "xyes"
1339     then
1340       PLUGINS="${PLUGINS} video_output/mga/mga video_output/mga/xmga"
1341     fi ])
1342
1343 dnl
1344 dnl  GGI module
1345 dnl
1346 AC_ARG_ENABLE(ggi,
1347   [  --enable-ggi            GGI support (default disabled)])
1348 if test "x${enable_ggi}" = "xyes"
1349 then
1350   PLUGINS="${PLUGINS} video_output/ggi/ggi"
1351   ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
1352   AC_ARG_WITH(ggi,
1353     [    --with-ggi=PATH       path to libggi],
1354     [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1355       then
1356         CFLAGS_GGI="${CFLAGS_GGI} -I${with_ggi}/include"
1357         ggi_LDFLAGS="${ggi_LDFLAGS} -L${with_ggi}/lib"
1358       fi ])
1359 fi
1360
1361 dnl
1362 dnl  Glide module
1363 dnl
1364 AC_ARG_ENABLE(glide,
1365   [  --enable-glide          Glide (3dfx) support (default disabled)])
1366 if test "x${enable_glide}" = "xyes"
1367 then
1368   PLUGINS="${PLUGINS} video_output/glide/glide"
1369   glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
1370   glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
1371   AC_ARG_WITH(glide,
1372     [    --with-glide=PATH     path to libglide],
1373     [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1374       then
1375         glide_CFLAGS="${glide_CFLAGS} -I${with_glide}/include"
1376         glide_LDFLAGS="${glide_LDFLAGS} -L${with_glide}/lib"
1377       fi ])
1378 fi
1379
1380 dnl
1381 dnl  AA plugin
1382 dnl
1383 AC_ARG_ENABLE(aa,
1384   [  --enable-aa             aalib output (default disabled)])
1385 if test "x${enable_aa}" = "xyes"
1386 then
1387   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1388   if test "x${have_aa}" = "xtrue"
1389   then
1390     PLUGINS="${PLUGINS} video_output/aa/aa"
1391     aa_LDFLAGS="${aa_LDFLAGS} -laa"
1392   fi
1393 fi
1394
1395 dnl
1396 dnl  Audio plugins
1397 dnl
1398
1399 AC_ARG_WITH(,[Audio plugins:])
1400
1401 dnl
1402 dnl  OSS /dev/dsp module (enabled by default except on win32)
1403 dnl
1404 AC_ARG_ENABLE(oss,
1405   [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
1406
1407 if test "x${enable_oss}" != "xno" &&
1408   (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1409 then
1410   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1411     #PLUGINS="${PLUGINS} audio_output/oss"
1412     AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
1413   ])
1414 fi
1415
1416 dnl
1417 dnl  Esound module
1418 dnl
1419 AC_ARG_ENABLE(esd,
1420   [  --enable-esd            Esound library support (default disabled)],
1421   [if test "x${enable_esd}" = "xyes"
1422    then
1423      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1424      if test "x${ESD_CONFIG}" != "xno"
1425      then
1426        #PLUGINS="${PLUGINS} audio_output/esd"
1427        esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1428        esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1429      fi
1430    fi])
1431
1432 dnl
1433 dnl  aRts module
1434 dnl
1435 AC_ARG_ENABLE(arts,
1436   [  --enable-arts           aRts sound server (default disabled)],
1437   [if test "x${enable_arts}" = "xyes"
1438    then
1439      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1440      if test "x${ARTS_CONFIG}" != "xno"
1441      then
1442        #PLUGINS="${PLUGINS} audio_output/arts"
1443        arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1444        arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1445      fi
1446    fi])
1447
1448 dnl
1449 dnl  ALSA module
1450 dnl
1451 AC_ARG_ENABLE(alsa,
1452   [  --enable-alsa           ALSA sound support for Linux (default disabled)],
1453   [if test "x${enable_alsa}" = "xyes"
1454    then
1455      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1456      if test "x${have_alsa}" = "xtrue"
1457      then
1458        #PLUGINS="${PLUGINS} audio_output/alsa"
1459        alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1460      fi
1461    fi])
1462
1463 dnl
1464 dnl  win32 waveOut plugin
1465 dnl
1466 AC_ARG_ENABLE(waveout,
1467   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
1468 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
1469   then
1470     #PLUGINS="${PLUGINS} audio_output/waveout"
1471     waveout_LDFLAGS="-lwinmm"
1472 fi
1473
1474 dnl
1475 dnl  Interface plugins
1476 dnl
1477
1478 AC_ARG_WITH(,[Interface plugins:])
1479
1480 dnl special case for BeOS
1481 if test "x${SYS}" = "xbeos"
1482 then
1483     PLUGINS="${PLUGINS} gui/beos/beos"
1484 fi
1485
1486 dnl
1487 dnl  Gtk+ module
1488 dnl
1489 AC_ARG_ENABLE(gtk,
1490   [  --enable-gtk            Gtk+ support (default enabled)])
1491 if test "x${enable_gtk}" != "xno"
1492 then
1493   GTK_PATH="${PATH}"
1494   AC_ARG_WITH(gtk-config-path,
1495     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1496     [ if test "x${with_gtk_config_path}" != "xno"
1497       then
1498         GTK_PATH="${with_gtk_config_path}:${PATH}"
1499       fi ])
1500   # look for gtk-config
1501   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1502   GTK_CONFIG=${GTK12_CONFIG}
1503   if test "x${GTK_CONFIG}" = "xno"
1504   then
1505     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1506   fi
1507   if test "x${GTK_CONFIG}" != "xno"
1508   then
1509     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1510     then
1511       AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk.])
1512     fi
1513     gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1514     gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1515     # now look for the gtk.h header
1516     CPPFLAGS="${save_CPPFLAGS} ${gtk_CFLAGS}"
1517     ac_cv_gtk_headers=yes
1518     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1519       ac_cv_gtk_headers=no
1520       echo "Cannot find gtk development headers."
1521     ])
1522     if test "x${ac_cv_gtk_headers}" = "xyes"
1523     then
1524       PLUGINS="${PLUGINS} gui/gtk/gtk"
1525       ALIASES="${ALIASES} gvlc"
1526     fi
1527     CPPFLAGS="${save_CPPFLAGS}"
1528   fi
1529 fi
1530
1531 dnl
1532 dnl  Familiar module uses Gtk+ library
1533 dnl
1534 AC_ARG_ENABLE(familiar,
1535   [  --enable-familiar       Familiar Gtk+ support (default disabled)])
1536 if test "x${enable_familiar}" = "xyes"
1537 then
1538   GTK_PATH="${PATH}"
1539   AC_ARG_WITH(gtk-config-path,
1540     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1541     [ if test "x${with_gtk_config_path}" != "xno"
1542       then
1543         GTK_PATH="${with_gtk_config_path}:${PATH}"
1544       fi ])
1545   # look for gtk-config
1546   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1547   GTK_CONFIG=${GTK12_CONFIG}
1548   if test "x${GTK_CONFIG}" = "xno"
1549   then
1550     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1551   fi
1552   if test "x${GTK_CONFIG}" != "xno"
1553   then
1554     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1555     then
1556       AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-familiar.])
1557     fi
1558     familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1559     familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1560     # now look for the gtk.h header
1561     CPPFLAGS="${save_CPPFLAGS} ${familiar_CFLAGS}"
1562     ac_cv_gtk_headers=yes
1563     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1564       ac_cv_gtk_headers=no
1565       echo "Cannot find gtk development headers."
1566     ])
1567     if test "x${ac_cv_gtk_headers}" = "xyes"
1568     then
1569       PLUGINS="${PLUGINS} gui/familiar/familiar"
1570     fi
1571     CPPFLAGS="${save_CPPFLAGS}"
1572   fi
1573 fi
1574
1575 dnl
1576 dnl  Gnome module
1577 dnl
1578 AC_ARG_ENABLE(gnome,
1579   [  --enable-gnome          Gnome interface support (default disabled)],
1580   [if test "x${enable_gnome}" = "xyes"; then
1581     # look for gnome-config
1582     AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1583     if test -x ${GNOME_CONFIG}
1584     then
1585        gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1586        gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1587     fi
1588     # now look for the gnome.h header
1589     CPPFLAGS="${save_CPPFLAGS} ${gnome_CFLAGS}"
1590     AC_CHECK_HEADERS(gnome.h, [
1591       PLUGINS="${PLUGINS} gui/gtk/gnome"
1592       ALIASES="${ALIASES} gnome-vlc"
1593      ],[
1594       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1595 developement tools or remove the --enable-gnome option])
1596      ])
1597     CPPFLAGS="${save_CPPFLAGS}"
1598   fi])
1599
1600 dnl
1601 dnl  Qt module
1602 dnl
1603 AC_ARG_ENABLE(qt,
1604   [  --enable-qt             Qt interface support (default disabled)],
1605   [if test "x${enable_qt}" = "xyes"; then
1606      PLUGINS="${PLUGINS} gui/qt/qt"
1607      ALIASES="${ALIASES} qvlc"
1608      qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1609      qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1610      if test -x ${QTDIR}/bin/moc
1611      then
1612        MOC=${QTDIR}/bin/moc
1613      else
1614        MOC=moc
1615      fi
1616    fi])
1617
1618 dnl 
1619 dnl  KDE module
1620 dnl
1621 AC_ARG_ENABLE(kde,
1622   [  --enable-kde            KDE interface support (default disabled)],
1623   [if test "x${enable_kde}" = "xyes"; then
1624      PLUGINS="${PLUGINS} gui/kde/kde"
1625      ALIASES="${ALIASES} kvlc"
1626      kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1627      kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1628      kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1629      if test -x ${QTDIR}/bin/moc
1630      then
1631        MOC=${QTDIR}/bin/moc
1632      else
1633        MOC=moc
1634      fi
1635    fi])
1636
1637 dnl
1638 dnl  MacOS X module
1639 dnl
1640 AC_ARG_ENABLE(macosx,
1641   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
1642   [if test "x${enable_macosx}" = "xyes"
1643    then
1644      BUILTINS="${BUILTINS} gui/macosx/macosx"
1645      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1646    fi],
1647   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1648      BUILTINS="${BUILTINS} gui/macosx/macosx"
1649      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1650    )])
1651
1652 dnl
1653 dnl  QNX RTOS module
1654 dnl
1655 AC_ARG_ENABLE(qnx,
1656   [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
1657     if test "x${enable_qnx}" != "xno"
1658     then
1659       AC_CHECK_HEADERS(Ph.h, [
1660         PLUGINS="${PLUGINS} gui/qnx/qnx"
1661         qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1662       ])
1663     fi
1664
1665 dnl
1666 dnl  Windows native interface module, built with Borland C++ Builder
1667 dnl
1668 AC_ARG_ENABLE(intfwin,
1669 [  --enable-intfwin        Win32 interface support (default disabled)],
1670 [ if test "x${enable_intfwin}" != "xno"
1671   then
1672     AC_ARG_WITH(bcbuilder, 
1673     [    --with-bcbuilder=PATH Borland C++ Builder installation path])
1674     if test "x${with_bcbuilder}" != "x"
1675     then
1676       BCBUILDER="${with_bcbuilder}"
1677     fi
1678     PLUGINS="${PLUGINS} gui/win32/win32"
1679   fi ])
1680
1681 dnl
1682 dnl  ncurses module
1683 dnl
1684 AC_ARG_ENABLE(ncurses,
1685   [  --enable-ncurses        ncurses interface support (default disabled)],
1686   [if test "x${enable_ncurses}" = "xyes"; then
1687      PLUGINS="${PLUGINS} gui/ncurses/ncurses"
1688      ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1689    fi])
1690
1691 dnl
1692 dnl  XOSD plugin
1693 dnl
1694 AC_ARG_ENABLE(xosd,
1695   [  --enable-xosd           xosd interface support (default disabled)])
1696 if test "x${enable_xosd}" = "xyes"
1697 then
1698   AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
1699   if test "x${have_xosd}" = "xtrue"
1700   then
1701     PLUGINS="${PLUGINS} visualization/xosd/xosd"
1702     xosd_LDFLAGS="${xosd_LDFLAGS} -lxosd"
1703   fi
1704 fi
1705
1706 dnl
1707 dnl  Lirc plugin
1708 dnl
1709 AC_ARG_ENABLE(lirc,
1710   [  --enable-lirc           lirc support (default disabled)])
1711 if test "x${enable_lirc}" = "xyes"
1712 then
1713   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1714   if test "x${have_lirc}" = "xtrue"
1715   then
1716     PLUGINS="${PLUGINS} control/lirc/lirc"
1717     lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1718   fi
1719 fi
1720
1721 AC_ARG_WITH(,[Misc options:])
1722
1723 dnl
1724 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1725 dnl
1726 dnl  We give the user the opportunity to specify
1727 dnl  --with-words=big or --with-words=little ; otherwise, try to guess
1728 dnl
1729 AC_ARG_WITH(words,
1730   [  --with-words=endianness set endianness (big or little)])
1731   case "x${with_words}" in
1732     xbig)
1733       ac_cv_c_bigendian=yes
1734       ;;
1735     xlittle)
1736       ac_cv_c_bigendian=no
1737       ;;
1738     *)
1739       dnl  Try to guess endianness by matching patterns on a compiled
1740       dnl  binary, by looking for an ASCII or EBCDIC string
1741       AC_CACHE_CHECK([whether the byte order is big-endian],
1742         [ac_cv_c_bigendian],
1743         [ac_cv_c_bigendian="unknown"
1744         [cat >conftest.c <<EOF
1745         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1746         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1747         void _a(void) { char*s = (char*)am; s = (char *)ai; }
1748         short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1749         short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1750         void _e(void) { char*s = (char*)em; s = (char*)ei; }
1751         int main(void) { _a(); _e(); return 0; }
1752 EOF
1753         ]
1754         if test -f conftest.c
1755         then 
1756           if ${CC-cc} -c conftest.c -o conftest.o >config.log 2>&1 \
1757               && test -f conftest.o
1758           then
1759             if test "`strings conftest.o | grep BIGenDianSyS`"
1760             then
1761               ac_cv_c_bigendian="yes"
1762             fi
1763             if test "`strings conftest.o | grep LiTTleEnDian`"
1764             then
1765               ac_cv_c_bigendian="no"
1766             fi
1767           fi
1768         fi
1769       ])
1770       if test "x${ac_cv_c_bigendian}" = "xunknown"
1771       then
1772         AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1773       fi
1774       ;;
1775   esac
1776 dnl  Now we know what to use for endianness, just put it in the header
1777 if test "${ac_cv_c_bigendian}" = "yes"
1778 then
1779   AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1780 fi
1781
1782 dnl
1783 dnl  Profiling
1784 dnl
1785 PROFILING=0
1786
1787 GPROF=0
1788 AC_ARG_ENABLE(gprof,
1789 [  --enable-gprof          gprof profiling (default disabled)],
1790 [ if test "x${enable_gprof}" = "xyes"
1791   then
1792     GPROF=1
1793     PROFILING="gprof"
1794   fi
1795 ])
1796
1797 CPROF=0
1798 AC_ARG_ENABLE(cprof,
1799 [  --enable-cprof          cprof profiling (default disabled)],
1800 [ if test "x${enable_cprof}" = "xyes"
1801   then
1802     save_LDFLAGS="${save_LDFLAGS} -lcprof"; LDFLAGS="${save_LDFLAGS}"
1803     CPROF=1
1804     PROFILING="cprof"
1805   fi
1806 ])
1807
1808 dnl
1809 dnl  GNU portable threads
1810 dnl
1811 AC_ARG_ENABLE(pth,
1812   [  --enable-pth            GNU Pth support (default disabled)],
1813   [ if test "x${enable_pth}" = "xyes"; then
1814     AC_CHECK_LIB(pth,pth_init)
1815     AC_EGREP_HEADER(pth_init,pth.h,[
1816       AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1817                 Define if <pth.h> defines pth_init)
1818     THREAD_LIB="-lpth"
1819     fi])
1820 ])
1821
1822 dnl
1823 dnl  State Threads
1824 dnl
1825 AC_ARG_ENABLE(st,
1826   [  --enable-st             State Threads (default disabled)],
1827   [ if test "x${enable_st}" = "xyes"; then
1828     AC_CHECK_LIB(st,st_init)
1829     AC_EGREP_HEADER(st_init,st.h,[
1830       AC_DEFINE(ST_INIT_IN_ST_H, 1,
1831                 Define if <st.h> defines st_init)
1832     THREAD_LIB="-lst"
1833     fi])
1834 ])
1835
1836 vlc_LDFLAGS="${vlc_LDFLAGS} ${THREAD_LIB}"
1837 plugins_LDFLAGS="${plugins_LDFLAGS} ${THREAD_LIB}"
1838
1839 dnl
1840 dnl  Mozilla plugin
1841 dnl
1842 MOZILLA=0
1843 AC_ARG_ENABLE(mozilla,
1844   [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
1845 if test "x${enable_mozilla}" = "xyes"
1846 then
1847   AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
1848   if test "x${MOZILLA_CONFIG}" != "xno"
1849   then
1850     if test "x${SYS}" != "xmingw32"; then
1851       LDFLAGS="${save_LDFLAGS} -L${x_libraries}"
1852       AC_CHECK_LIB(Xt,XtStrings,[
1853         mozilla_LDFLAGS="${mozilla_LDFLAGS} -L${x_libraries} -lXt"
1854       ])
1855       LDFLAGS="${save_LDFLAGS}"
1856     fi
1857     MOZILLA=1
1858     mozilla_CFLAGS="${mozilla_CFLAGS} `${MOZILLA_CONFIG} --cflags plugin java --defines | xargs`"
1859     dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
1860     mozilla_LDFLAGS="${mozilla_LDFLAGS} `${MOZILLA_CONFIG} --libs | sed 's#-I\(.*\)/mozilla/\([^ ]*\)#-I\1/\2 -I\1/mozilla/\2#g'`"
1861   fi
1862 fi
1863
1864 dnl
1865 dnl  Plug-ins - this must be AT THE END
1866 dnl
1867 AC_ARG_ENABLE(plugins,
1868   [  --disable-plugins       make all plug-ins built-in (default plug-ins enabled)],
1869   [if test "x${enable_plugins}" = "xno"
1870    then
1871      BUILTINS="${BUILTINS} ${PLUGINS}"
1872      PLUGINS=
1873    fi])
1874
1875 dnl Automagically disable plug-ins if there is no system support for .so files
1876 dnl don't forget vlc-win32 still can load .so as plugins
1877 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
1878 then
1879   echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1880   echo "as built-in"
1881   BUILTINS="${BUILTINS} ${PLUGINS}"
1882   PLUGINS=
1883 fi
1884
1885 dnl
1886 dnl  Stuff used by the program
1887 dnl
1888 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc ${VERSION} ${CODENAME} Copyright 1996-2002 VideoLAN", [Simple version string])
1889 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
1890 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
1891
1892 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
1893 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
1894 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
1895
1896 DATA_PATH="${ac_tool_prefix}/share/videolan"
1897 AC_SUBST(DATA_PATH)
1898 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1899 AC_SUBST(PLUGIN_PATH)
1900
1901 dnl
1902 dnl  Restore *FLAGS
1903 dnl
1904 CPPFLAGS="${save_CPPFLAGS}"
1905 CFLAGS="${save_CFLAGS}"
1906 LDFLAGS="${save_LDFLAGS}"
1907
1908 dnl
1909 dnl  Create the vlc-config script
1910 dnl
1911 libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}"
1912 for i in ${BUILTINS} ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done
1913 AC_SUBST(libvlc_LDFLAGS)
1914
1915 dnl 
1916 dnl  Configuration is finished
1917 dnl
1918 AC_SUBST(SYS)
1919 AC_SUBST(ARCH)
1920 AC_SUBST(PLUGINS)
1921 AC_SUBST(BUILTINS)
1922 AC_SUBST(ALIASES)
1923 AC_SUBST(DEBUG)
1924 AC_SUBST(ASM)
1925 AC_SUBST(CPROF)
1926 AC_SUBST(GPROF)
1927 AC_SUBST(OPTIMS)
1928 AC_SUBST(TUNING)
1929 AC_SUBST(RELEASE)
1930 AC_SUBST(MOC)
1931 AC_SUBST(WINDRES)
1932 AC_SUBST(BCBUILDER)
1933 AC_SUBST(PACKAGE)
1934 AC_SUBST(VERSION)
1935 AC_SUBST(NEED_GETOPT)
1936 AC_SUBST(MOZILLA)
1937
1938 AC_SUBST(CFLAGS_OPTIM)
1939 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
1940 AC_SUBST(LDFLAGS)
1941
1942 AC_SUBST(vlc_CFLAGS)
1943 AC_SUBST(plugins_CFLAGS)
1944 AC_SUBST(builtins_CFLAGS)
1945 AC_SUBST(mozilla_CFLAGS)
1946
1947 AC_SUBST(a52_CFLAGS)
1948 AC_SUBST(arts_CFLAGS)
1949 AC_SUBST(i420_yuy2_mmx_CFLAGS)
1950 AC_SUBST(dvd_CFLAGS)
1951 AC_SUBST(dvdread_CFLAGS)
1952 AC_SUBST(dvdplay_CFLAGS)
1953 AC_SUBST(ts_dvbpsi_CFLAGS)
1954 AC_SUBST(directx_CFLAGS)
1955 AC_SUBST(esd_CFLAGS)
1956 AC_SUBST(familiar_CFLAGS)
1957 AC_SUBST(ffmpeg_CFLAGS)
1958 AC_SUBST(glide_CFLAGS)
1959 AC_SUBST(gnome_CFLAGS)
1960 AC_SUBST(gtk_CFLAGS)
1961 AC_SUBST(kde_CFLAGS)
1962 AC_SUBST(idctaltivec_CFLAGS)
1963 AC_SUBST(macosx_CFLAGS)
1964 AC_SUBST(mad_CFLAGS)
1965 AC_SUBST(memcpyaltivec_CFLAGS)
1966 AC_SUBST(motionaltivec_CFLAGS)
1967 AC_SUBST(qt_CFLAGS)
1968 AC_SUBST(sdl_CFLAGS)
1969 AC_SUBST(x11_CFLAGS)
1970 AC_SUBST(xvideo_CFLAGS)
1971
1972 AC_SUBST(vlc_LDFLAGS)
1973 AC_SUBST(plugins_LDFLAGS)
1974 AC_SUBST(builtins_LDFLAGS)
1975 AC_SUBST(mozilla_LDFLAGS)
1976
1977 AC_SUBST(a52_LDFLAGS)
1978 AC_SUBST(aa_LDFLAGS)
1979 AC_SUBST(alsa_LDFLAGS)
1980 AC_SUBST(arts_LDFLAGS)
1981 AC_SUBST(beos_LDFLAGS)
1982 AC_SUBST(i420_rgb_LDFLAGS)
1983 AC_SUBST(directx_LDFLAGS)
1984 AC_SUBST(dsp_LDFLAGS)
1985 AC_SUBST(dv_LDFLAGS)
1986 AC_SUBST(dvd_LDFLAGS)
1987 AC_SUBST(dvdread_LDFLAGS)
1988 AC_SUBST(dvdplay_LDFLAGS)
1989 AC_SUBST(ts_dvbpsi_LDFLAGS)
1990 AC_SUBST(esd_LDFLAGS)
1991 AC_SUBST(familiar_LDFLAGS)
1992 AC_SUBST(distort_LDFLAGS)
1993 AC_SUBST(ffmpeg_LDFLAGS)
1994 AC_SUBST(mp4_LDFLAGS)
1995 AC_SUBST(ggi_LDFLAGS)
1996 AC_SUBST(glide_LDFLAGS)
1997 AC_SUBST(gnome_LDFLAGS)
1998 AC_SUBST(gtk_LDFLAGS)
1999 AC_SUBST(http_LDFLAGS)
2000 AC_SUBST(idctaltivec_LDFLAGS)
2001 AC_SUBST(imdct_LDFLAGS)
2002 AC_SUBST(imdct3dn_LDFLAGS)
2003 AC_SUBST(imdctsse_LDFLAGS)
2004 AC_SUBST(ipv4_LDFLAGS)
2005 AC_SUBST(ipv6_LDFLAGS)
2006 AC_SUBST(kde_LDFLAGS)
2007 AC_SUBST(lirc_LDFLAGS)
2008 AC_SUBST(macosx_LDFLAGS)
2009 AC_SUBST(mad_LDFLAGS)
2010 AC_SUBST(memcpyaltivec_LDFLAGS)
2011 AC_SUBST(motionaltivec_LDFLAGS)
2012 AC_SUBST(ncurses_LDFLAGS)
2013 AC_SUBST(qnx_LDFLAGS)
2014 AC_SUBST(qt_LDFLAGS)
2015 AC_SUBST(rc_LDFLAGS)
2016 AC_SUBST(sdl_LDFLAGS)
2017 AC_SUBST(vcd_LDFLAGS)
2018 AC_SUBST(vorbis_LDFLAGS)
2019 AC_SUBST(waveout_LDFLAGS)
2020 AC_SUBST(x11_LDFLAGS)
2021 AC_SUBST(xvideo_LDFLAGS)
2022 AC_SUBST(xosd_LDFLAGS)
2023
2024 AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in vlc-config])
2025 chmod a+x vlc-config
2026
2027 echo "
2028 vlc configuration
2029 --------------------
2030 vlc version           : ${VERSION}
2031 system                : ${SYS}
2032 architecture          : ${ARCH}
2033 optimizations         : ${OPTIMS}
2034 tuning                : ${TUNING}
2035 debug mode            : ${DEBUG}
2036 release               : ${RELEASE}
2037 profiling             : ${PROFILING}
2038 need builtin getopt   : ${NEED_GETOPT}
2039 built-in modules      :${BUILTINS}
2040 plug-in modules       :${PLUGINS}
2041 mozilla plugin        : ${MOZILLA}
2042 vlc aliases           :${ALIASES}
2043
2044 You may now tune Makefile.opts at your convenience, for instance to choose
2045 which modules get compiled as plugins.
2046
2047 To build vlc and its plugins, type \`${VLC_MAKE}'.
2048 "
2049