]> git.sesse.net Git - vlc/blob - configure.in
* ./Makefile, ./mozilla/Makefile: make uninstall removes vlc-specific dirs.
[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/ps demux/mpeg/ts"
440 PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/mpeg_video/mpeg_video codec/lpcm/lpcm codec/spdif/spdif codec/spudec/spudec"
441 PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
442 PLUGINS="${PLUGINS} visualization/scope/scope"
443 PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
444
445 dnl
446 dnl  Accelerated modules
447 dnl
448 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"
449 MMXEXT_MODULES="misc/memcpy/memcpymmxext codec/mpeg_video/idct/idctmmxext codec/mpeg_video/motion/motionmmxext"
450 THREEDNOW_MODULES="misc/memcpy/memcpy3dn codec/a52old/imdct/imdct3dn codec/a52old/downmix/downmix3dn"
451 SSE_MODULES="codec/a52old/imdct/imdctsse codec/a52old/downmix/downmixsse"
452 ALTIVEC_MODULES="codec/mpeg_video/idct/idctaltivec codec/mpeg_video/motion/motionaltivec misc/memcpy/memcpyaltivec"
453
454 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
455     [ac_cv_mmx_inline],
456     [CFLAGS="${save_CFLAGS}"
457      AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
458                     ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
459 if test "x${ac_cv_mmx_inline}" != "xno"; then
460   ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
461 fi
462
463 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
464     [ac_cv_mmxext_inline],
465     [CFLAGS="${save_CFLAGS}"
466      AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
467                     ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
468 if test "x${ac_cv_mmxext_inline}" != "xno"; then
469   ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
470 fi
471
472 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
473     [ac_cv_3dnow_inline],
474     [CFLAGS="${save_CFLAGS}"
475      AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
476                     ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
477 if test "x${ac_cv_3dnow_inline}" != "xno"; then
478   AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
479   ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
480 fi
481
482 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
483     [ac_cv_sse_inline],
484     [CFLAGS="${save_CFLAGS}"
485      AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
486                     ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
487 if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
488   AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
489   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
490 fi
491
492 # don't try to grok AltiVec with native mingw32 it doesn't work right now
493 # we should be able to remove this test with future versions of mingw32
494 if test "x${SYS}" != "xmingw32"; then
495 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
496     [ac_cv_altivec_inline],
497     [CFLAGS="${save_CFLAGS}"
498      AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
499          ac_cv_altivec_inline=yes,
500          [CFLAGS="${save_CFLAGS} -Wa,-m7400"
501           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
502             [ac_cv_altivec_inline="-Wa,-m7400"],
503             ac_cv_altivec_inline=no)
504          ])])
505 if test "x${ac_cv_altivec_inline}" != "xno"; then
506   AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
507   if test "x${ac_cv_altivec_inline}" != "xyes"; then
508     idctaltivec_CFLAGS="${idctaltivec_CFLAGS} ${ac_cv_altivec_inline}"
509     motionaltivec_CFLAGS="${motionaltivec_CFLAGS} ${ac_cv_altivec_inline}"
510     memcpyaltivec_CFLAGS="${memcpyaltivec_CFLAGS} ${ac_cv_altivec_inline}"
511     vlc_CFLAGS="${vlc_CFLAGS} ${ac_cv_altivec_inline}"
512   fi
513   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
514 fi
515
516 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
517     [ac_cv_c_altivec],
518     [CFLAGS="${save_CFLAGS} -faltivec"
519      # Darwin test
520      AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
521         ac_cv_c_altivec=-faltivec, [
522         # Linux/PPC test
523         CFLAGS="${save_CFLAGS} ${idctaltivec_CFLAGS} -fvec"
524         AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
525             [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
526         ])
527      CFLAGS="${save_CFLAGS}"])
528 if test "x${ac_cv_c_altivec}" != "xno"; then
529   AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
530   idctaltivec_CFLAGS="${idctaltivec_CFLAGS} ${ac_cv_c_altivec}"
531   motionaltivec_CFLAGS="${motionaltivec_CFLAGS} ${ac_cv_c_altivec}"
532   memcpyaltivec_CFLAGS="${memcpyaltivec_CFLAGS} ${ac_cv_c_altivec}"
533   vlc_CFLAGS="${vlc_CFLAGS} ${ac_cv_c_altivec}"
534   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
535 fi
536
537 AC_CACHE_CHECK([if linker needs -framework vecLib],
538     [ac_cv_ld_altivec],
539     [LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
540      AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
541      LDFLAGS="${save_LDFLAGS}"
542     ])
543 if test "x${ac_cv_ld_altivec}" != "xno"; then
544   idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
545   motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
546   memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
547   vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
548 fi
549 fi # end if mingw32
550
551
552 AC_ARG_WITH(,[])
553 AC_ARG_WITH(,[Optimization options:])
554
555 dnl
556 dnl  Special arch tuning
557 dnl
558 AC_ARG_WITH(tuning,
559 [  --with-tuning=ARCH      enable special tuning for an architecture
560                           (default i686 on IA-32 and 750 on PPC)])
561 if test "x${with_tuning}" != "x"; then
562     TUNING="${with_tuning}"
563 else
564     if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xi486" -o "x${target_cpu}" = "xi386"; then TUNING="pentiumpro"
565     else
566         if test "x${target_cpu}" = "xpowerpc"; then TUNING="750"; fi
567     fi
568 fi
569
570 dnl
571 dnl  x86 accelerations
572 dnl
573 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
574 then
575     ARCH="${ARCH} mmx"
576     PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
577 fi
578
579 dnl
580 dnl  Enable/disable optimizations
581 dnl
582 AC_ARG_ENABLE(optimizations,
583 [  --disable-optimizations disable compiler optimizations (default enabled)],
584 [ if test "x${enable_optimizations}" = "xno"; then OPTIMS=0; fi ],
585 [ OPTIMS=1 ])
586
587 dnl
588 dnl  AltiVec acceleration
589 dnl
590 AC_ARG_ENABLE(altivec,
591 [  --disable-altivec       disable AltiVec optimizations (default enabled on PPC)],
592 [ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
593     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
594 [ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
595     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
596
597 dnl
598 dnl  Debugging mode
599 dnl
600 DEBUG=0
601 AC_ARG_ENABLE(debug,
602 [  --enable-debug          debug mode (default disabled)],
603 [ if test "x${enable_debug}" = "xyes"; then DEBUG=1; fi ])
604
605 dnl
606 dnl  Enable release-specific flags
607 dnl
608 RELEASE=0
609 AC_ARG_ENABLE(release,
610 [  --enable-release        activate extra optimizations (default disabled)],
611 [ if test "x${enable_release}" = "xyes"; then RELEASE=1; fi ],
612 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
613
614 dnl
615 dnl  Input plugins
616 dnl
617
618 AC_ARG_WITH(,[Input plugins:])
619
620 dnl
621 dnl  DVD module: optionally check for installed libdvdcss
622 dnl
623 AC_ARG_ENABLE(dvd,
624 [  --enable-dvd            DVD input module (default enabled)])
625 if test "x${enable_dvd}" != "xno"
626 then
627   AC_ARG_WITH(dvdcss, 
628   [    --with-dvdcss=PATH    libdvdcss headers and libraries])
629   AC_ARG_WITH(dvdcss-tree, 
630   [    --with-dvdcss-tree=PATH libdvdcss tree for static linking])
631   case "x${with_dvdcss}" in
632   x|xyes)
633     if test "x${with_dvdcss_tree}" = x
634     then
635       AC_CHECK_HEADERS(dvdcss/dvdcss.h,
636         [ PLUGINS="${PLUGINS} access/dvd/dvd"
637           dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
638         [ 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.])
639           AC_MSG_ERROR([cannot find libdvdcss headers]) ])
640     else
641       AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
642       real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
643       if test "x${real_dvdcss_tree}" = "x"
644       then
645         dnl  The given directory can't be found
646         AC_MSG_RESULT(no)
647         AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
648       fi
649       if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
650       then
651         dnl  Use a custom libdvdcss
652         AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
653         BUILTINS="${BUILTINS} access/dvd/dvd"
654         dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
655         dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
656       else
657         dnl  The given libdvdcss wasn't built
658         AC_MSG_RESULT(no)
659         AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
660       fi
661     fi
662   ;;
663   xno)
664     dnl  Compile without dvdcss (dlopen version, works only under Linux)
665     PLUGINS="${PLUGINS} access/dvd/dvd"
666     dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
667     dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
668   ;;
669   *)
670     AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
671     if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
672     then
673       dnl  Use ${with_dvdcss}/include/dvdcss/dvdcss.h
674       AC_MSG_RESULT(yes)
675       PLUGINS="${PLUGINS} access/dvd/dvd"
676       dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
677       dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
678     else
679       dnl  No libdvdcss could be found, sorry
680       AC_MSG_RESULT(no)
681       AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
682     fi
683   ;;
684   esac
685 fi
686
687 dnl
688 dnl dvdread module: check for libdvdread plugin
689 dnl
690 AC_ARG_ENABLE(dvdread,
691 [  --enable-dvdread        dvdread input module (default disabled)])
692 if test "x${enable_dvdread}" != "xno"
693 then
694   AC_ARG_WITH(dvdread, 
695   [    --with-dvdread=PATH   libdvdread headers and libraries])
696   if test "x${with_dvdread}" = "x"
697   then
698     test_LDFLAGS=""
699     test_CFLAGS=""
700   else
701     test_LDFLAGS="-L${with_dvdread}/lib"
702     test_CFLAGS="-I${with_dvdread}/include"
703   fi
704   CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
705   AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
706      AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
707         [void foo() { int i=DVD_VIDEO_LB_LEN; }],[
708           PLUGINS="${PLUGINS} access/dvdread/dvdread"
709           dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
710           dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
711         ],[
712           if test "x${enable_dvdread}" != "x"
713           then
714             AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
715           fi
716         ])
717   ],[
718     if test "x${enable_dvdread}" != "x"
719     then
720       if test "x${with_dvdread}" != "x"
721       then
722         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
723       else
724         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
725       fi
726     fi
727   ])
728   CPPFLAGS="$save_CPPFLAGS"
729 fi
730
731 dnl
732 dnl dvdplay module: check for libdvdplay
733 dnl
734 AC_ARG_ENABLE(dvdplay,
735 [  --enable-dvdplay        dvdplay input module (default disabled)])
736 if test "x$enable_dvdplay" != "xno"
737 then
738   AC_ARG_WITH(dvdplay, 
739   [    --with-dvdplay=PATH   libdvdplay headers and libraries])
740   if test "x$with_dvdplay" = x
741   then
742     test_LDFLAGS=""
743     test_CFLAGS=""
744   else
745     test_LDFLAGS="-L${with_dvdplay}/lib"
746     test_CFLAGS="-I${with_dvdplay}/include"
747   fi
748   CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
749   AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
750       PLUGINS="${PLUGINS} access/dvdplay/dvdplay"
751       dvdplay_LDFLAGS="${dvdplay_LDFLAGS} ${test_LDFLAGS} -ldvdplay -ldvdread"
752       dvdplay_CFLAGS="${dvdplay_CFLAGS} ${test_CFLAGS}"
753     ],[
754     if test "x$enable_dvdplay" != x
755     then
756       if test "x$with_dvdplay" != x
757       then
758         AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h in ${with_dvdplay}/include])
759       else
760         AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h])
761       fi
762     fi
763   ])
764   CPPFLAGS="${save_CPPFLAGS}"
765 fi
766
767
768 dnl
769 dnl  libdvbpsi ts demux
770 dnl
771 AC_ARG_ENABLE(dvbpsi,
772 [  --enable-dvbpsi        dvbpsi ts demux module (default disabled)])
773 if test "x${enable_dvbpsi}" != "xno"
774 then
775   AC_ARG_WITH(dvbpsi, 
776   [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
777   AC_ARG_WITH(dvbpsi,
778   [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
779   case "x${with_dvbpsi}" in
780   x|xyes)
781     if test "x${with_dvbpsi_tree}" = "x"
782     then
783       AC_CHECK_HEADERS(dvbpsi/dr.h,
784         [ PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
785           ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
786         [  AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
787     else
788       AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
789       real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
790       if test "x${real_dvbpsi_tree}" = "x"
791       then
792         dnl  The given directory can't be found
793         AC_MSG_RESULT(no)
794         AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
795       fi
796       if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
797       then
798         dnl  Use a custom libdvbpsi
799         AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
800         BUILTINS="${BUILTINS} demux/mpeg/ts_dvbpsi"
801         ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
802         ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
803       else
804         dnl  The given libdvbpsi wasn't built
805         AC_MSG_RESULT(no)
806         AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
807       fi
808     fi
809   ;;
810   xno)
811     dnl  Compile without dvbpsi (dlopen version, works only under Linux)
812   ;;
813   *)
814     AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
815     if test "x${with_dvbpsi}" = "x"
816     then
817       test_LDFLAGS=""
818       test_CFLAGS=""
819     else
820       test_LDFLAGS="-L${with_dvbpsi}/lib"
821       test_CFLAGS="-I${with_dvbpsi}/include"
822     fi
823     CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
824     AC_CHECK_HEADER([dvbpsi/dr.h],[
825       PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
826       ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
827       ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
828       ],[
829       if test "x${enable_dvbpsi}" != "x"
830       then
831         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])
832       fi
833     ])
834     CPPFLAGS="${save_CPPFLAGS}"
835   ;;
836   esac
837 fi
838
839 dnl
840 dnl  Video4Linux plugin
841 dnl
842 AC_ARG_ENABLE(v4l,
843   [  --enable-v4l            Video4Linux input support (default disabled)])
844 if test "x${enable_v4l}" = "xyes"
845 then
846   AC_CHECK_HEADERS(libv4l/v4l.h, [
847     PLUGINS="${PLUGINS} access/v4l/v4l"
848    ],[])
849 fi
850
851 dnl
852 dnl  VCD module
853 dnl
854 AC_ARG_ENABLE(vcd,
855   [  --enable-vcd            VCD support for Linux, FreeBSD and MacOS X (default enabled)])
856
857 if test "x${enable_vcd}" != "xno"
858 then
859   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
860     PLUGINS="${PLUGINS} access/vcd/vcd"
861   ])
862   
863   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
864     PLUGINS="${PLUGINS} access/vcd/vcd"
865     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
866   ])
867   
868   if test "x${SYS}" = "xbsdi"
869   then
870     PLUGINS="${PLUGINS} access/vcd/vcd"
871   fi
872
873   if test "x${SYS}" = "xdarwin"
874   then
875     # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
876     vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation" 
877   fi
878 fi
879
880 dnl
881 dnl  Satellite input module
882 dnl
883 AC_ARG_ENABLE(satellite,
884   [  --enable-satellite      satellite card support (default disabled)],
885   [ if test "x${enable_satellite}" = "xyes"
886     then
887       PLUGINS="${PLUGINS} access/satellite/satellite"
888     fi])
889
890 dnl
891 dnl  ipv6 plugin - not for QNX yet
892 dnl
893 if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
894 then
895   have_ipv6=0
896   AC_CHECK_FUNC(inet_pton,[have_ipv6=1],[
897     AC_CHECK_LIB(resolv,inet_pton,
898       [have_ipv6=1
899        ipv6_LDFLAGS="${ipv6_LDFLAGS} -lresolv"])
900   ])
901   AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
902   AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
903     [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=0])
904   if test x$have_ipv6 = x1; then
905     PLUGINS="${PLUGINS} misc/network/ipv6"
906   fi
907 fi
908 if test "x${SYS}" = "xmingw32"
909 then
910   AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
911   AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
912     PLUGINS="${PLUGINS} misc/network/ipv6"],[AC_MSG_RESULT(no)])
913 fi
914
915 dnl
916 dnl  AVI demux plugin
917 dnl
918 AC_ARG_ENABLE(avi,
919   [  --enable-avi            AVI demux module (default enabled)])
920 if test "x${enable_avi}" != "xno"
921 then
922   PLUGINS="${PLUGINS} demux/avi/avi"
923 fi
924
925 dnl
926 dnl  Codec plugins
927 dnl
928
929 AC_ARG_WITH(,[Codec plugins:])
930
931 dnl
932 dnl  mad plugin
933 dnl
934 AC_ARG_ENABLE(mad,
935   [  --enable-mad            libmad module (default disabled)])
936 if test "x${enable_mad}" = "xyes"
937 then
938   AC_ARG_WITH(mad,
939     [    --with-mad=PATH       path to libmad],[],[])
940   if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
941   then
942     mad_CFLAGS="${mad_CFLAGS} -I${with_mad}/include"
943     mad_LDFLAGS="${mad_LDFLAGS} -L${with_mad}/lib"
944   fi
945
946   AC_ARG_WITH(mad-tree,
947     [    --with-mad-tree=PATH  mad tree for static linking],[],[])
948   if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
949   then
950     real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
951     if test "x${real_mad_tree}" = "x"
952     then
953       dnl  The given directory can't be found
954       AC_MSG_RESULT(no)
955       AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
956     fi
957     dnl  Use a custom libmad
958     AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
959     if test -f ${real_mad_tree}/libmad/mad.h
960     then
961       AC_MSG_RESULT(yes)
962       mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
963       mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
964       LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
965       AC_CHECK_LIB(mad, mad_bit_init, [
966         BUILTINS="${BUILTINS} codec/mad/mad"
967         mad_LDFLAGS="${mad_LDFLAGS} -lmad"
968         ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
969       ],[])
970       LDFLAGS="${save_LDFLAGS}"
971     else
972       AC_MSG_RESULT(no)
973       AC_MSG_ERROR([the specified tree doesn't have mad.h])
974     fi
975   else
976     CFLAGS="${save_CFLAGS} ${mad_CFLAGS}"
977     LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
978     AC_CHECK_HEADERS(mad.h, ,
979       [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
980     AC_CHECK_LIB(mad, mad_bit_init, [
981       PLUGINS="${PLUGINS} codec/mad/mad"
982       mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
983       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
984     CFLAGS="${save_CFLAGS}"
985     LDFLAGS="${save_LDFLAGS}"
986   fi
987 fi
988
989 dnl
990 dnl  ffmpeg decoder plugin
991 dnl
992 AC_ARG_ENABLE(ffmpeg,
993 [  --enable-ffmpeg         ffmpeg codec (default disabled)])
994 if test "x${enable_ffmpeg}" = "xyes"
995 then
996   AC_ARG_WITH(ffmpeg,
997     [    --with-ffmpeg=PATH    path to ffmpeg installation],[],[])
998   if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
999   then
1000     ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${with_ffmpeg}/include/libffmpeg"
1001     ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L${with_ffmpeg}/lib"
1002   fi
1003
1004   dnl Add postprocessing modules
1005   PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_c"
1006   if test "x${ac_cv_mmx_inline}" != "xno"; then
1007     PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_mmx"
1008   fi
1009
1010   if test "x${ac_cv_mmxext_inline}" != "xno"; then
1011     PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_mmxext"
1012   fi
1013
1014
1015   AC_ARG_WITH(ffmpeg-tree, 
1016   [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1017   if test "x${with_ffmpeg_tree}" != "x"
1018   then
1019     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1020     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1021     if test "x${real_ffmpeg_tree}" = x
1022     then
1023       dnl  The given directory can't be found
1024       AC_MSG_RESULT(no)
1025       AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1026     fi
1027     if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1028     then
1029       dnl  Use a custom libffmpeg
1030       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1031       BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
1032       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
1033       ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
1034     else
1035       dnl  The given libavcodec wasn't built
1036       AC_MSG_RESULT(no)
1037       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1038     fi
1039   else
1040     CFLAGS="${save_CFLAGS} ${ffmpeg_CFLAGS}"
1041     LDFLAGS="${save_LDFLAGS} ${ffmpeg_LDFLAGS} -lm"
1042     AC_CHECK_LIB(avcodec, avcodec_init, [
1043       BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
1044       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
1045       [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1046     LDFLAGS="${save_LDFLAGS}"
1047     CFLAGS="${save_CFLAGS}"
1048   fi
1049 fi
1050
1051 dnl 
1052 dnl MP4 module 
1053 dnl 
1054 AC_ARG_ENABLE(mp4,
1055   [  --enable-mp4            MP4 demux module (default disabled)])
1056 if test "x${enable_mp4}" = "xyes"
1057 then
1058     AC_CHECK_HEADER(zlib.h,
1059         AC_CHECK_LIB(z, inflateEnd,
1060             [ PLUGINS="${PLUGINS} demux/mp4/mp4"
1061               mp4_LDFLAGS="${mp4_LDFLAGS} -lz" ], 
1062             [ AC_MSG_ERROR([cannot find zlib library...]) ]),
1063         [  AC_MSG_ERROR([cannot find zlib header...]) ])
1064 fi
1065
1066 dnl
1067 dnl  a52 AC3 decoder plugin
1068 dnl
1069 AC_ARG_ENABLE(a52,
1070   [  --enable-a52            AC3 support with liba52 (default enabled)])
1071 if test "x${enable_a52}" != "xno"
1072 then
1073   AC_ARG_WITH(a52-tree,
1074     [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
1075   if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1076   then
1077     real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1078     if test "x${real_a52_tree}" = "x"
1079     then
1080       dnl  The given directory can't be found
1081       AC_MSG_RESULT(no)
1082       AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1083     fi
1084     dnl  Use a custom a52dec
1085     AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1086     if test -f ${real_a52_tree}/include/a52.h
1087     then
1088       AC_MSG_RESULT(yes)
1089       a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
1090       a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
1091       LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
1092       AC_CHECK_LIB(a52, a52_free, [
1093         BUILTINS="${BUILTINS} codec/a52/a52"
1094         a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
1095         a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
1096         ],[
1097         if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1098         then
1099           AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1100         else
1101           AC_MSG_ERROR([the specified tree hasn't been compiled])
1102         fi
1103       ],[-lm])
1104       LDFLAGS="${save_LDFLAGS}"
1105     else
1106       AC_MSG_RESULT(no)
1107       AC_MSG_ERROR([the specified tree doesn't have a52.h])
1108     fi
1109   else dnl  no with args
1110     AC_CHECK_HEADERS(a52dec/a52.h, [
1111       AC_CHECK_LIB(a52, a52_free, [
1112         BUILTINS="${BUILTINS} codec/a52/a52"
1113         a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
1114         a52_CFLAGS="${a52_CFLAGS}"
1115       ],[],[-lm])
1116     ])
1117   fi
1118 fi
1119
1120 dnl
1121 dnl  cinepak plugin
1122 dnl
1123 AC_ARG_ENABLE(cinepak,
1124   [  --enable-cinepak        Cinepak decoder (default enabled)])
1125 if test "x${enable_cinepak}" != "xno"
1126 then
1127   PLUGINS="${PLUGINS} codec/cinepak/cinepak"
1128 fi
1129
1130 dnl
1131 dnl  ogg vorbis plugin
1132 dnl
1133 AC_ARG_ENABLE(vorbis,
1134   [  --enable-vorbis         Ogg/Vorbis decoder support (default enabled)])
1135 if test "x${enable_vorbis}" != "xno"
1136 then
1137   AC_CHECK_HEADERS(ogg/ogg.h, [
1138     dnl disabled for the moment
1139     #PLUGINS="${PLUGINS} demux/ogg/ogg codec/vorbis/vorbis"
1140     vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
1141    ],[])
1142 fi
1143
1144 dnl
1145 dnl  DV plugin
1146 dnl 
1147 AC_ARG_ENABLE(dv,
1148   [  --enable-dv             DV decoder support (default disabled)])
1149 if test "x${enable_dv}" = "xyes"
1150 then
1151   AC_CHECK_HEADERS(libdv/dv.h, [
1152     BUILTINS="${BUILTINS} codec/dv/dv"
1153     dv_LDFLAGS="${dv_LDFLAGS} -ldv"
1154    ],[])
1155 fi  
1156
1157 dnl
1158 dnl  Video plugins
1159 dnl
1160
1161 AC_ARG_WITH(,[Video plugins:])
1162
1163 dnl
1164 dnl  X11 module
1165 dnl  (enabled by default except on win32)
1166 dnl
1167 AC_ARG_ENABLE(x11,
1168   [  --enable-x11            X11 support (default enabled)])
1169 if test "x${enable_x11}" != "xno" &&
1170   (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1171   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1172   AC_CHECK_HEADERS(X11/Xlib.h, [
1173     PLUGINS="${PLUGINS} video_output/x11/x11"
1174     x11_LDFLAGS="${x11_LDFLAGS} -L${x_libraries} -lX11 -lXext"
1175     x11_CFLAGS="${x11_CFLAGS} -I${x_includes}"
1176   ])
1177   CPPFLAGS="${save_CPPFLAGS}"
1178 fi
1179
1180 dnl
1181 dnl  XVideo module
1182 dnl  (enabled by default except on win32)
1183 dnl
1184 AC_ARG_ENABLE(xvideo,
1185   [  --enable-xvideo         XVideo support (default enabled)])
1186 if test "x${enable_xvideo}" != "xno" &&
1187   (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1188   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1189   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1190     CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
1191     AC_CHECK_LIB(Xv_pic,XvPutImage,
1192       # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1193       PLUGINS="${PLUGINS} video_output/x11/xvideo"
1194       xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv_pic"
1195       xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1196       AC_CHECK_LIB(Xv,XvPutImage,
1197         # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1198         PLUGINS="${PLUGINS} video_output/x11/xvideo"
1199         xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv"
1200         xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1201         # Otherwise... well, do nothing.
1202         :
1203       )
1204     )
1205     CFLAGS="${save_CFLAGS}"
1206   ]
1207   CPPFLAGS="${save_CPPFLAGS}")
1208 fi
1209
1210 dnl
1211 dnl  SDL module
1212 dnl
1213 AC_ARG_ENABLE(sdl,
1214   [  --enable-sdl            SDL support (default enabled)])
1215 if test "x${enable_sdl}" != "xno"
1216 then
1217   SDL_PATH="${PATH}"
1218   AC_ARG_WITH(sdl-config-path,
1219     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1220     [ if test "x${with_sdl_config_path}" != "xno"
1221       then
1222         SDL_PATH="${with_sdl_config_path}:${PATH}"
1223       fi ])
1224   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1225   SDL_CONFIG="${SDL12_CONFIG}"
1226   SDL_HEADER="SDL12/SDL.h"
1227   if test "x${SDL_CONFIG}" = "xno"
1228   then
1229     AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1230     SDL_CONFIG=${SDL11_CONFIG}
1231     SDL_HEADER="SDL11/SDL.h"
1232   fi
1233   if test "x${SDL_CONFIG}" = "xno"
1234   then
1235     AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1236     SDL_HEADER="SDL/SDL.h"
1237   fi
1238   if test "x${SDL_CONFIG}" != "xno"
1239   then
1240     PLUGINS="${PLUGINS} video_output/sdl/sdl"
1241     sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
1242     sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1243     CPPFLAGS="${save_CPPFLAGS} ${sdl_CFLAGS}"
1244     AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1245       <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1246       [ AC_MSG_ERROR([The development package for SDL is not installed. 
1247 Please install it and try again. Alternatively you can also configure with 
1248 --disable-sdl.])
1249       ])
1250     CPPFLAGS="${save_CPPFLAGS}"
1251     if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1252     then
1253       AC_MSG_ERROR([The development package for SDL is not installed.
1254 Please install it and try again. Alternatively you can also configure with
1255 --disable-sdl.])
1256     fi
1257   elif test "x${enable_sdl}" =  "xyes"
1258   then
1259     AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1260 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1261     ])
1262   fi
1263 fi
1264
1265 dnl
1266 dnl  Windows DirectX module
1267 dnl
1268 AC_ARG_ENABLE(directx,
1269   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
1270 if test "x${enable_directx}" != "xno"
1271 then
1272   if test "x${SYS}" = "xmingw32"
1273   then
1274     AC_ARG_WITH(directx, 
1275     [    --with-directx=PATH   Win32 DirectX headers])
1276     if test "x${with_directx}" = "x"
1277     then
1278       AC_CHECK_HEADERS(ddraw.h,
1279       [ PLUGINS="${PLUGINS} video_output/directx/directx"
1280         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1281     else
1282       AC_MSG_CHECKING(for directX headers in ${with_directx})
1283       if test -f ${with_directx}/ddraw.h
1284       then
1285         PLUGINS="${PLUGINS} video_output/directx/directx"
1286         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32"
1287         directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
1288         AC_MSG_RESULT(yes)
1289       else
1290         AC_MSG_RESULT(no)
1291         AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1292       fi
1293     fi
1294   fi
1295 fi
1296
1297 dnl
1298 dnl  Linux framebuffer module
1299 dnl
1300 AC_ARG_ENABLE(fb,
1301   [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
1302     if test "x${enable_fb}" != "xno"
1303     then
1304       AC_CHECK_HEADERS(linux/fb.h, [
1305         PLUGINS="${PLUGINS} video_output/fb/fb"
1306       ])
1307     fi
1308
1309 dnl
1310 dnl  Linux MGA module
1311 dnl
1312 AC_ARG_ENABLE(mga,
1313   [  --enable-mga            Linux kernel Matrox support (default disabled)],
1314   [ if test "x${enable_mga}" = "xyes"
1315     then
1316       PLUGINS="${PLUGINS} video_output/mga/mga video_output/mga/xmga"
1317     fi ])
1318
1319 dnl
1320 dnl  GGI module
1321 dnl
1322 AC_ARG_ENABLE(ggi,
1323   [  --enable-ggi            GGI support (default disabled)])
1324 if test "x${enable_ggi}" = "xyes"
1325 then
1326   PLUGINS="${PLUGINS} video_output/ggi/ggi"
1327   ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
1328   AC_ARG_WITH(ggi,
1329     [    --with-ggi=PATH       path to libggi],
1330     [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1331       then
1332         CFLAGS_GGI="${CFLAGS_GGI} -I${with_ggi}/include"
1333         ggi_LDFLAGS="${ggi_LDFLAGS} -L${with_ggi}/lib"
1334       fi ])
1335 fi
1336
1337 dnl
1338 dnl  Glide module
1339 dnl
1340 AC_ARG_ENABLE(glide,
1341   [  --enable-glide          Glide (3dfx) support (default disabled)])
1342 if test "x${enable_glide}" = "xyes"
1343 then
1344   PLUGINS="${PLUGINS} video_output/glide/glide"
1345   glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
1346   glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
1347   AC_ARG_WITH(glide,
1348     [    --with-glide=PATH     path to libglide],
1349     [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1350       then
1351         glide_CFLAGS="${glide_CFLAGS} -I${with_glide}/include"
1352         glide_LDFLAGS="${glide_LDFLAGS} -L${with_glide}/lib"
1353       fi ])
1354 fi
1355
1356 dnl
1357 dnl  AA plugin
1358 dnl
1359 AC_ARG_ENABLE(aa,
1360   [  --enable-aa             aalib output (default disabled)])
1361 if test "x${enable_aa}" = "xyes"
1362 then
1363   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1364   if test "x${have_aa}" = "xtrue"
1365   then
1366     PLUGINS="${PLUGINS} video_output/aa/aa"
1367     aa_LDFLAGS="${aa_LDFLAGS} -laa"
1368   fi
1369 fi
1370
1371 dnl
1372 dnl  Audio plugins
1373 dnl
1374
1375 AC_ARG_WITH(,[Audio plugins:])
1376
1377 dnl
1378 dnl  OSS /dev/dsp module (enabled by default except on win32)
1379 dnl
1380 AC_ARG_ENABLE(dsp,
1381   [  --enable-dsp            Linux /dev/dsp support (enabled on Linux)])
1382
1383 if test "x${enable_dsp}" != "xno" &&
1384   (test "x${SYS}" != "xmingw32" || test "x${enable_dsp}" = "xyes")
1385 then
1386   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1387     PLUGINS="${PLUGINS} audio_output/dsp/dsp"
1388     AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
1389   ])
1390 fi
1391
1392 dnl
1393 dnl  Esound module
1394 dnl
1395 AC_ARG_ENABLE(esd,
1396   [  --enable-esd            Esound library support (default disabled)],
1397   [if test "x${enable_esd}" = "xyes"
1398    then
1399      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1400      if test "x${ESD_CONFIG}" != "xno"
1401      then
1402        PLUGINS="${PLUGINS} audio_output/esd/esd"
1403        esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1404        esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1405      fi
1406    fi])
1407
1408 dnl
1409 dnl  aRts module
1410 dnl
1411 AC_ARG_ENABLE(arts,
1412   [  --enable-arts           aRts sound server (default disabled)],
1413   [if test "x${enable_arts}" = "xyes"
1414    then
1415      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1416      if test "x${ARTS_CONFIG}" != "xno"
1417      then
1418        PLUGINS="${PLUGINS} audio_output/arts/arts"
1419        arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1420        arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1421      fi
1422    fi])
1423
1424 dnl
1425 dnl  ALSA module
1426 dnl
1427 AC_ARG_ENABLE(alsa,
1428   [  --enable-alsa           ALSA sound support for Linux (default disabled)],
1429   [if test "x${enable_alsa}" = "xyes"
1430    then
1431      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1432      if test "x${have_alsa}" = "xtrue"
1433      then
1434        PLUGINS="${PLUGINS} audio_output/alsa/alsa"
1435        alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1436      fi
1437    fi])
1438
1439 dnl
1440 dnl  win32 waveOut plugin
1441 dnl
1442 AC_ARG_ENABLE(waveout,
1443   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
1444 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
1445   then
1446     PLUGINS="${PLUGINS} audio_output/waveout/waveout"
1447     waveout_LDFLAGS="-lwinmm"
1448 fi
1449
1450 dnl
1451 dnl  Interface plugins
1452 dnl
1453
1454 AC_ARG_WITH(,[Interface plugins:])
1455
1456 dnl special case for BeOS
1457 if test "x${SYS}" = "xbeos"
1458 then
1459     PLUGINS="${PLUGINS} gui/beos/beos"
1460 fi
1461
1462 dnl
1463 dnl  Gtk+ module
1464 dnl
1465 AC_ARG_ENABLE(gtk,
1466   [  --enable-gtk            Gtk+ support (default enabled)])
1467 if test "x${enable_gtk}" != "xno"
1468 then
1469   GTK_PATH="${PATH}"
1470   AC_ARG_WITH(gtk-config-path,
1471     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1472     [ if test "x${with_gtk_config_path}" != "xno"
1473       then
1474         GTK_PATH="${with_gtk_config_path}:${PATH}"
1475       fi ])
1476   # look for gtk-config
1477   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1478   GTK_CONFIG=${GTK12_CONFIG}
1479   if test "x${GTK_CONFIG}" = "xno"
1480   then
1481     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1482   fi
1483   if test "x${GTK_CONFIG}" != "xno"
1484   then
1485     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1486     then
1487       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.])
1488     fi
1489     gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1490     gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1491     # now look for the gtk.h header
1492     CPPFLAGS="${save_CPPFLAGS} ${gtk_CFLAGS}"
1493     ac_cv_gtk_headers=yes
1494     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1495       ac_cv_gtk_headers=no
1496       echo "Cannot find gtk development headers."
1497     ])
1498     if test "x${ac_cv_gtk_headers}" = "xyes"
1499     then
1500       PLUGINS="${PLUGINS} gui/gtk/gtk"
1501       ALIASES="${ALIASES} gvlc"
1502     fi
1503     CPPFLAGS="${save_CPPFLAGS}"
1504   fi
1505 fi
1506
1507 dnl
1508 dnl  Familiar module uses Gtk+ library
1509 dnl
1510 AC_ARG_ENABLE(familiar,
1511   [  --enable-familiar       Familiar Gtk+ support (default disabled)])
1512 if test "x${enable_familiar}" = "xyes"
1513 then
1514   GTK_PATH="${PATH}"
1515   AC_ARG_WITH(gtk-config-path,
1516     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1517     [ if test "x${with_gtk_config_path}" != "xno"
1518       then
1519         GTK_PATH="${with_gtk_config_path}:${PATH}"
1520       fi ])
1521   # look for gtk-config
1522   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1523   GTK_CONFIG=${GTK12_CONFIG}
1524   if test "x${GTK_CONFIG}" = "xno"
1525   then
1526     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1527   fi
1528   if test "x${GTK_CONFIG}" != "xno"
1529   then
1530     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1531     then
1532       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.])
1533     fi
1534     familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1535     familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1536     # now look for the gtk.h header
1537     CPPFLAGS="${save_CPPFLAGS} ${familiar_CFLAGS}"
1538     ac_cv_gtk_headers=yes
1539     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1540       ac_cv_gtk_headers=no
1541       echo "Cannot find gtk development headers."
1542     ])
1543     if test "x${ac_cv_gtk_headers}" = "xyes"
1544     then
1545       PLUGINS="${PLUGINS} gui/familiar/familiar"
1546     fi
1547     CPPFLAGS="${save_CPPFLAGS}"
1548   fi
1549 fi
1550
1551 dnl
1552 dnl  Gnome module
1553 dnl
1554 AC_ARG_ENABLE(gnome,
1555   [  --enable-gnome          Gnome interface support (default disabled)],
1556   [if test "x${enable_gnome}" = "xyes"; then
1557     # look for gnome-config
1558     AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1559     if test -x ${GNOME_CONFIG}
1560     then
1561        gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1562        gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1563     fi
1564     # now look for the gnome.h header
1565     CPPFLAGS="${save_CPPFLAGS} ${gnome_CFLAGS}"
1566     AC_CHECK_HEADERS(gnome.h, [
1567       PLUGINS="${PLUGINS} gui/gtk/gnome"
1568       ALIASES="${ALIASES} gnome-vlc"
1569      ],[
1570       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1571 developement tools or remove the --enable-gnome option])
1572      ])
1573     CPPFLAGS="${save_CPPFLAGS}"
1574   fi])
1575
1576 dnl
1577 dnl  Qt module
1578 dnl
1579 AC_ARG_ENABLE(qt,
1580   [  --enable-qt             Qt interface support (default disabled)],
1581   [if test "x${enable_qt}" = "xyes"; then
1582      PLUGINS="${PLUGINS} gui/qt/qt"
1583      ALIASES="${ALIASES} qvlc"
1584      qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1585      qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1586      if test -x ${QTDIR}/bin/moc
1587      then
1588        MOC=${QTDIR}/bin/moc
1589      else
1590        MOC=moc
1591      fi
1592    fi])
1593
1594 dnl 
1595 dnl  KDE module
1596 dnl
1597 AC_ARG_ENABLE(kde,
1598   [  --enable-kde            KDE interface support (default disabled)],
1599   [if test "x${enable_kde}" = "xyes"; then
1600      PLUGINS="${PLUGINS} gui/kde/kde"
1601      ALIASES="${ALIASES} kvlc"
1602      kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1603      kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1604      kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1605      if test -x ${QTDIR}/bin/moc
1606      then
1607        MOC=${QTDIR}/bin/moc
1608      else
1609        MOC=moc
1610      fi
1611    fi])
1612
1613 dnl
1614 dnl  MacOS X module
1615 dnl
1616 AC_ARG_ENABLE(macosx,
1617   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
1618   [if test "x${enable_macosx}" = "xyes"
1619    then
1620      BUILTINS="${BUILTINS} gui/macosx/macosx"
1621      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1622    fi],
1623   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1624      BUILTINS="${BUILTINS} gui/macosx/macosx"
1625      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1626    )])
1627
1628 dnl
1629 dnl  QNX RTOS module
1630 dnl
1631 AC_ARG_ENABLE(qnx,
1632   [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
1633     if test "x${enable_qnx}" != "xno"
1634     then
1635       AC_CHECK_HEADERS(Ph.h, [
1636         PLUGINS="${PLUGINS} gui/qnx/qnx"
1637         qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1638       ])
1639     fi
1640
1641 dnl
1642 dnl  Windows native interface module, built with Borland C++ Builder
1643 dnl
1644 AC_ARG_ENABLE(intfwin,
1645 [  --enable-intfwin        Win32 interface support (default disabled)],
1646 [ if test "x${enable_intfwin}" != "xno"
1647   then
1648     AC_ARG_WITH(bcbuilder, 
1649     [    --with-bcbuilder=PATH Borland C++ Builder installation path])
1650     if test "x${with_bcbuilder}" != "x"
1651     then
1652       BCBUILDER="${with_bcbuilder}"
1653     fi
1654     PLUGINS="${PLUGINS} gui/win32/win32"
1655   fi ])
1656
1657 dnl
1658 dnl  ncurses module
1659 dnl
1660 AC_ARG_ENABLE(ncurses,
1661   [  --enable-ncurses        ncurses interface support (default disabled)],
1662   [if test "x${enable_ncurses}" = "xyes"; then
1663      PLUGINS="${PLUGINS} gui/ncurses/ncurses"
1664      ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1665    fi])
1666
1667 dnl
1668 dnl  XOSD plugin
1669 dnl
1670 AC_ARG_ENABLE(xosd,
1671   [  --enable-xosd           xosd interface support (default disabled)])
1672 if test "x${enable_xosd}" = "xyes"
1673 then
1674   AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
1675   if test "x${have_xosd}" = "xtrue"
1676   then
1677     PLUGINS="${PLUGINS} visualization/xosd/xosd"
1678     xosd_LDFLAGS="${xosd_LDFLAGS} -lxosd"
1679   fi
1680 fi
1681
1682 dnl
1683 dnl  Lirc plugin
1684 dnl
1685 AC_ARG_ENABLE(lirc,
1686   [  --enable-lirc           lirc support (default disabled)])
1687 if test "x${enable_lirc}" = "xyes"
1688 then
1689   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1690   if test "x${have_lirc}" = "xtrue"
1691   then
1692     PLUGINS="${PLUGINS} control/lirc/lirc"
1693     lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1694   fi
1695 fi
1696
1697 AC_ARG_WITH(,[Misc options:])
1698
1699 dnl
1700 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1701 dnl
1702 dnl  We give the user the opportunity to specify
1703 dnl  --with-words=big or --with-words=little ; otherwise, try to guess
1704 dnl
1705 AC_ARG_WITH(words,
1706   [  --with-words=endianness set endianness (big or little)])
1707   case "x${with_words}" in
1708     xbig)
1709       ac_cv_c_bigendian=yes
1710       ;;
1711     xlittle)
1712       ac_cv_c_bigendian=no
1713       ;;
1714     *)
1715       dnl  Try to guess endianness by matching patterns on a compiled
1716       dnl  binary, by looking for an ASCII or EBCDIC string
1717       AC_CACHE_CHECK([whether the byte order is big-endian],
1718         [ac_cv_c_bigendian],
1719         [ac_cv_c_bigendian="unknown"
1720         [cat >conftest.c <<EOF
1721         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1722         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1723         void _a(void) { char*s = (char*)am; s = (char *)ai; }
1724         short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1725         short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1726         void _e(void) { char*s = (char*)em; s = (char*)ei; }
1727         int main(void) { _a(); _e(); return 0; }
1728 EOF
1729         ]
1730         if test -f conftest.c
1731         then 
1732           if ${CC-cc} -c conftest.c -o conftest.o >config.log 2>&1 \
1733               && test -f conftest.o
1734           then
1735             if test "`strings conftest.o | grep BIGenDianSyS`"
1736             then
1737               ac_cv_c_bigendian="yes"
1738             fi
1739             if test "`strings conftest.o | grep LiTTleEnDian`"
1740             then
1741               ac_cv_c_bigendian="no"
1742             fi
1743           fi
1744         fi
1745       ])
1746       if test "x${ac_cv_c_bigendian}" = "xunknown"
1747       then
1748         AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1749       fi
1750       ;;
1751   esac
1752 dnl  Now we know what to use for endianness, just put it in the header
1753 if test "${ac_cv_c_bigendian}" = "yes"
1754 then
1755   AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1756 fi
1757
1758 dnl
1759 dnl  Profiling
1760 dnl
1761 PROFILING=0
1762
1763 GPROF=0
1764 AC_ARG_ENABLE(gprof,
1765 [  --enable-gprof          gprof profiling (default disabled)],
1766 [ if test "x${enable_gprof}" = "xyes"
1767   then
1768     GPROF=1
1769     PROFILING="gprof"
1770   fi
1771 ])
1772
1773 CPROF=0
1774 AC_ARG_ENABLE(cprof,
1775 [  --enable-cprof          cprof profiling (default disabled)],
1776 [ if test "x${enable_cprof}" = "xyes"
1777   then
1778     save_LDFLAGS="${save_LDFLAGS} -lcprof"; LDFLAGS="${save_LDFLAGS}"
1779     CPROF=1
1780     PROFILING="cprof"
1781   fi
1782 ])
1783
1784 dnl
1785 dnl  GNU portable threads
1786 dnl
1787 AC_ARG_ENABLE(pth,
1788   [  --enable-pth            GNU Pth support (default disabled)],
1789   [ if test "x${enable_pth}" = "xyes"; then
1790     AC_CHECK_LIB(pth,pth_init)
1791     AC_EGREP_HEADER(pth_init,pth.h,[
1792       AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1793                 Define if <pth.h> defines pth_init)
1794     THREAD_LIB="-lpth"
1795     fi])
1796 ])
1797
1798 dnl
1799 dnl  State Threads
1800 dnl
1801 AC_ARG_ENABLE(st,
1802   [  --enable-st             State Threads (default disabled)],
1803   [ if test "x${enable_st}" = "xyes"; then
1804     AC_CHECK_LIB(st,st_init)
1805     AC_EGREP_HEADER(st_init,st.h,[
1806       AC_DEFINE(ST_INIT_IN_ST_H, 1,
1807                 Define if <st.h> defines st_init)
1808     THREAD_LIB="-lst"
1809     fi])
1810 ])
1811
1812 vlc_LDFLAGS="${vlc_LDFLAGS} ${THREAD_LIB}"
1813 plugins_LDFLAGS="${plugins_LDFLAGS} ${THREAD_LIB}"
1814
1815 dnl
1816 dnl  Mozilla plugin
1817 dnl
1818 MOZILLA=0
1819 AC_ARG_ENABLE(mozilla,
1820   [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
1821 if test "x${enable_mozilla}" = "xyes"
1822 then
1823   AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
1824   if test "x${MOZILLA_CONFIG}" != "xno"
1825   then
1826     if test "x${SYS}" != "xmingw32"; then
1827       LDFLAGS="${save_LDFLAGS} -L${x_libraries}"
1828       AC_CHECK_LIB(Xt,XtStrings,[
1829         mozilla_LDFLAGS="${mozilla_LDFLAGS} -L${x_libraries} -lXt"
1830       ])
1831       LDFLAGS="${save_LDFLAGS}"
1832     fi
1833     MOZILLA=1
1834     mozilla_CFLAGS="${mozilla_CFLAGS} `${MOZILLA_CONFIG} --cflags plugin java --defines | xargs`"
1835     dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
1836     mozilla_LDFLAGS="${mozilla_LDFLAGS} `${MOZILLA_CONFIG} --libs | sed 's#-I\(.*\)/mozilla/\([^ ]*\)#-I\1/\2 -I\1/mozilla/\2#g'`"
1837   fi
1838 fi
1839
1840 dnl
1841 dnl  Plug-ins - this must be AT THE END
1842 dnl
1843 AC_ARG_ENABLE(plugins,
1844   [  --disable-plugins       make all plug-ins built-in (default plug-ins enabled)],
1845   [if test "x${enable_plugins}" = "xno"
1846    then
1847      BUILTINS="${BUILTINS} ${PLUGINS}"
1848      PLUGINS=
1849    fi])
1850
1851 dnl Automagically disable plug-ins if there is no system support for .so files
1852 dnl don't forget vlc-win32 still can load .so as plugins
1853 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
1854 then
1855   echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1856   echo "as built-in"
1857   BUILTINS="${BUILTINS} ${PLUGINS}"
1858   PLUGINS=
1859 fi
1860
1861 dnl
1862 dnl  Stuff used by the program
1863 dnl
1864 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc ${VERSION} ${CODENAME} Copyright 1996-2002 VideoLAN", [Simple version string])
1865 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
1866 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
1867
1868 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
1869 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
1870 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
1871
1872 DATA_PATH="${ac_tool_prefix}/share/videolan"
1873 AC_SUBST(DATA_PATH)
1874 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1875 AC_SUBST(PLUGIN_PATH)
1876
1877 dnl
1878 dnl  Restore *FLAGS
1879 dnl
1880 CPPFLAGS="${save_CPPFLAGS}"
1881 CFLAGS="${save_CFLAGS}"
1882 LDFLAGS="${save_LDFLAGS}"
1883
1884 dnl
1885 dnl  Create the vlc-config script
1886 dnl
1887 libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}"
1888 for i in ${BUILTINS} ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done
1889 AC_SUBST(libvlc_LDFLAGS)
1890
1891 dnl 
1892 dnl  Configuration is finished
1893 dnl
1894 AC_SUBST(SYS)
1895 AC_SUBST(ARCH)
1896 AC_SUBST(PLUGINS)
1897 AC_SUBST(BUILTINS)
1898 AC_SUBST(ALIASES)
1899 AC_SUBST(DEBUG)
1900 AC_SUBST(ASM)
1901 AC_SUBST(CPROF)
1902 AC_SUBST(GPROF)
1903 AC_SUBST(OPTIMS)
1904 AC_SUBST(TUNING)
1905 AC_SUBST(RELEASE)
1906 AC_SUBST(MOC)
1907 AC_SUBST(WINDRES)
1908 AC_SUBST(BCBUILDER)
1909 AC_SUBST(PACKAGE)
1910 AC_SUBST(VERSION)
1911 AC_SUBST(NEED_GETOPT)
1912 AC_SUBST(MOZILLA)
1913
1914 AC_SUBST(CFLAGS_OPTIM)
1915 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
1916 AC_SUBST(LDFLAGS)
1917
1918 AC_SUBST(vlc_CFLAGS)
1919 AC_SUBST(plugins_CFLAGS)
1920 AC_SUBST(builtins_CFLAGS)
1921 AC_SUBST(mozilla_CFLAGS)
1922
1923 AC_SUBST(a52_CFLAGS)
1924 AC_SUBST(arts_CFLAGS)
1925 AC_SUBST(i420_yuy2_mmx_CFLAGS)
1926 AC_SUBST(dvd_CFLAGS)
1927 AC_SUBST(dvdread_CFLAGS)
1928 AC_SUBST(dvdplay_CFLAGS)
1929 AC_SUBST(ts_dvbpsi_CFLAGS)
1930 AC_SUBST(directx_CFLAGS)
1931 AC_SUBST(esd_CFLAGS)
1932 AC_SUBST(familiar_CFLAGS)
1933 AC_SUBST(ffmpeg_CFLAGS)
1934 AC_SUBST(glide_CFLAGS)
1935 AC_SUBST(gnome_CFLAGS)
1936 AC_SUBST(gtk_CFLAGS)
1937 AC_SUBST(kde_CFLAGS)
1938 AC_SUBST(idctaltivec_CFLAGS)
1939 AC_SUBST(macosx_CFLAGS)
1940 AC_SUBST(mad_CFLAGS)
1941 AC_SUBST(memcpyaltivec_CFLAGS)
1942 AC_SUBST(motionaltivec_CFLAGS)
1943 AC_SUBST(qt_CFLAGS)
1944 AC_SUBST(sdl_CFLAGS)
1945 AC_SUBST(x11_CFLAGS)
1946 AC_SUBST(xvideo_CFLAGS)
1947
1948 AC_SUBST(vlc_LDFLAGS)
1949 AC_SUBST(plugins_LDFLAGS)
1950 AC_SUBST(builtins_LDFLAGS)
1951 AC_SUBST(mozilla_LDFLAGS)
1952
1953 AC_SUBST(a52_LDFLAGS)
1954 AC_SUBST(aa_LDFLAGS)
1955 AC_SUBST(alsa_LDFLAGS)
1956 AC_SUBST(arts_LDFLAGS)
1957 AC_SUBST(beos_LDFLAGS)
1958 AC_SUBST(i420_rgb_LDFLAGS)
1959 AC_SUBST(directx_LDFLAGS)
1960 AC_SUBST(dsp_LDFLAGS)
1961 AC_SUBST(dv_LDFLAGS)
1962 AC_SUBST(dvd_LDFLAGS)
1963 AC_SUBST(dvdread_LDFLAGS)
1964 AC_SUBST(dvdplay_LDFLAGS)
1965 AC_SUBST(ts_dvbpsi_LDFLAGS)
1966 AC_SUBST(esd_LDFLAGS)
1967 AC_SUBST(familiar_LDFLAGS)
1968 AC_SUBST(distort_LDFLAGS)
1969 AC_SUBST(ffmpeg_LDFLAGS)
1970 AC_SUBST(mp4_LDFLAGS)
1971 AC_SUBST(ggi_LDFLAGS)
1972 AC_SUBST(glide_LDFLAGS)
1973 AC_SUBST(gnome_LDFLAGS)
1974 AC_SUBST(gtk_LDFLAGS)
1975 AC_SUBST(http_LDFLAGS)
1976 AC_SUBST(idctaltivec_LDFLAGS)
1977 AC_SUBST(imdct_LDFLAGS)
1978 AC_SUBST(imdct3dn_LDFLAGS)
1979 AC_SUBST(imdctsse_LDFLAGS)
1980 AC_SUBST(ipv4_LDFLAGS)
1981 AC_SUBST(ipv6_LDFLAGS)
1982 AC_SUBST(kde_LDFLAGS)
1983 AC_SUBST(lirc_LDFLAGS)
1984 AC_SUBST(macosx_LDFLAGS)
1985 AC_SUBST(mad_LDFLAGS)
1986 AC_SUBST(memcpyaltivec_LDFLAGS)
1987 AC_SUBST(motionaltivec_LDFLAGS)
1988 AC_SUBST(ncurses_LDFLAGS)
1989 AC_SUBST(qnx_LDFLAGS)
1990 AC_SUBST(qt_LDFLAGS)
1991 AC_SUBST(rc_LDFLAGS)
1992 AC_SUBST(sdl_LDFLAGS)
1993 AC_SUBST(vcd_LDFLAGS)
1994 AC_SUBST(vorbis_LDFLAGS)
1995 AC_SUBST(waveout_LDFLAGS)
1996 AC_SUBST(x11_LDFLAGS)
1997 AC_SUBST(xvideo_LDFLAGS)
1998 AC_SUBST(xosd_LDFLAGS)
1999
2000 AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in vlc-config])
2001 chmod a+x vlc-config
2002
2003 echo "
2004 vlc configuration
2005 --------------------
2006 vlc version           : ${VERSION}
2007 system                : ${SYS}
2008 architecture          : ${ARCH}
2009 optimizations         : ${OPTIMS}
2010 tuning                : ${TUNING}
2011 debug mode            : ${DEBUG}
2012 release               : ${RELEASE}
2013 profiling             : ${PROFILING}
2014 need builtin getopt   : ${NEED_GETOPT}
2015 built-in modules      :${BUILTINS}
2016 plug-in modules       :${PLUGINS}
2017 mozilla plugin        : ${MOZILLA}
2018 vlc aliases           :${ALIASES}
2019
2020 You may now tune Makefile.opts at your convenience, for instance to choose
2021 which modules get compiled as plugins.
2022
2023 To build vlc and its plugins, type \`${VLC_MAKE}'.
2024 "
2025