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