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