]> git.sesse.net Git - vlc/blob - configure.in
* S/PDIF output should now be working (untested, though).
[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 codec/spdif"
445 #PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/lpcm/lpcm"
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 audio_filter/converter/a52tospdif"
448 PLUGINS="${PLUGINS} audio_filter/resampler/trivial"
449 PLUGINS="${PLUGINS} audio_mixer/trivial audio_mixer/spdif"
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  faad decoder plugin
1062 dnl
1063 AC_ARG_ENABLE(faad,
1064 [  --enable-faad           faad codec (default disabled)])
1065 if test "x${enable_faad}" = "xyes"
1066 then
1067   AC_ARG_WITH(faad,
1068     [    --with-faad=PATH      path to faad installation],[],[])
1069   if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
1070   then
1071     faad_CFLAGS="${faad_CFLAGS} -I${with_faad}/include"
1072     faad_LDFLAGS="${faad_LDFLAGS} -L${with_faad}/lib"
1073   fi
1074   faad_LDFLAGS="${faad_LDFLAGS} -lm"
1075
1076   AC_ARG_WITH(faad-tree, 
1077   [    --with-faad-tree=PATH faad tree for static linking])
1078   if test "x${with_faad_tree}" != "x"
1079   then
1080     AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1081     real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1082     if test "x${real_faad_tree}" = x
1083     then
1084       dnl  The given directory can't be found
1085       AC_MSG_RESULT(no)
1086       AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1087     fi
1088     if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1089     then
1090       dnl  Use a custom faad
1091       AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1092       BUILTINS="${BUILTINS} codec/faad/faad"
1093       faad_LDFLAGS="${faad_LDFLAGS} ${real_faad_tree}/libfaad/.libs/libfaad.a"
1094       faad_CFLAGS="${faad_CFLAGS} -I${real_faad_tree}/include"
1095     else
1096       dnl  The given libfaad wasn't built
1097       AC_MSG_RESULT(no)
1098       AC_MSG_ERROR([cannot find ${real_faad_tree}/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1099     fi
1100   else
1101     CFLAGS="${save_CFLAGS} ${faad_CFLAGS}"
1102     LDFLAGS="${save_LDFLAGS} ${faad_LDFLAGS}"
1103     AC_CHECK_HEADERS(faad.h, ,
1104       [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1105     AC_CHECK_LIB(faad, faacDecOpen, [
1106       PLUGINS="${PLUGINS} codec/faad/faad"
1107       faad_LDFLAGS="${faad_LDFLAGS} -lfaad" ],
1108       [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1109     LDFLAGS="${save_LDFLAGS}"
1110     CFLAGS="${save_CFLAGS}"
1111   fi
1112 fi
1113
1114
1115
1116 dnl 
1117 dnl MP4 module 
1118 dnl 
1119 AC_ARG_ENABLE(mp4,
1120   [  --enable-mp4            MP4 demux module (default enabled)])
1121 if test "x${enable_mp4}" != "xno"
1122 then
1123
1124     PLUGINS="${PLUGINS} demux/mp4/mp4"
1125     AC_CHECK_HEADERS(zlib.h,
1126               [ mp4_LDFLAGS="${mp4_LDFLAGS} -lz" ] )
1127 fi
1128
1129 dnl
1130 dnl  a52 AC3 decoder plugin
1131 dnl
1132 AC_ARG_ENABLE(a52,
1133   [  --enable-a52            A/52 support with liba52 (default enabled)])
1134 if test "x${enable_a52}" != "xno"
1135 then
1136   AC_ARG_WITH(a52, 
1137     [    --with-a52=PATH       a52 headers and libraries])
1138   AC_ARG_WITH(a52-tree,
1139     [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
1140   if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1141   then
1142     real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1143     if test "x${real_a52_tree}" = "x"
1144     then
1145       dnl  The given directory can't be found
1146       AC_MSG_RESULT(no)
1147       AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1148     fi
1149     dnl  Use a custom a52dec
1150     AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1151     if test -f ${real_a52_tree}/include/a52.h
1152     then
1153       AC_MSG_RESULT(yes)
1154       a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
1155       a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
1156       LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
1157       AC_CHECK_LIB(a52, a52_free, [
1158         BUILTINS="${BUILTINS} codec/a52"
1159         a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
1160         a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
1161         ],[
1162         if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1163         then
1164           AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1165         else
1166           AC_MSG_ERROR([the specified tree hasn't been compiled])
1167         fi
1168       ],[-lm])
1169       LDFLAGS="${save_LDFLAGS}"
1170     else
1171       AC_MSG_RESULT(no)
1172       AC_MSG_ERROR([the specified tree doesn't have a52.h])
1173     fi
1174   else
1175     if test "x${with_a52}" = "x"
1176     then
1177       test_LDFLAGS=""
1178       test_CFLAGS=""
1179     else
1180       test_LDFLAGS="-L${with_a52}/lib"
1181       test_CFLAGS="-I${with_a52}/include"
1182     fi
1183     save_CPPFLAGS="${CPPFLAGS}"
1184     save_LDFLAGS="${LDFLAGS}"
1185     CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
1186     LDFLAGS="${save_LDFLAGS} ${test_LDFLAGS}"
1187     AC_CHECK_HEADERS(a52dec/a52.h, [
1188       AC_CHECK_LIB(a52, a52_free, [
1189         BUILTINS="${BUILTINS} codec/a52"
1190         a52_LDFLAGS="${a52_LDFLAGS} ${test_LDFLAGS} -la52 -lm"
1191         a52_CFLAGS="${a52_CFLAGS} ${test_CFLAGS}"
1192       ],[
1193         if test "x${enable_dvbpsi}" != "x"
1194         then
1195           AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1196         fi
1197       ],[-lm])
1198     ])
1199     CPPFLAGS="${save_CPPFLAGS}"
1200     LDFLAGS="${save_LDFLAGS}"
1201   fi
1202 fi
1203
1204 dnl
1205 dnl  cinepak plugin
1206 dnl
1207 AC_ARG_ENABLE(cinepak,
1208   [  --enable-cinepak        Cinepak decoder (default enabled)])
1209 if test "x${enable_cinepak}" != "xno"
1210 then
1211   PLUGINS="${PLUGINS} codec/cinepak/cinepak"
1212 fi
1213
1214 dnl
1215 dnl  ogg vorbis plugin
1216 dnl
1217 AC_ARG_ENABLE(vorbis,
1218   [  --enable-vorbis         Ogg/Vorbis decoder support (default enabled)])
1219 if test "x${enable_vorbis}" != "xno"
1220 then
1221   AC_CHECK_HEADERS(ogg/ogg.h, [
1222     dnl disabled for the moment
1223     #PLUGINS="${PLUGINS} demux/ogg/ogg codec/vorbis/vorbis"
1224     vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
1225    ],[])
1226 fi
1227
1228 dnl
1229 dnl  DV plugin
1230 dnl 
1231 AC_ARG_ENABLE(dv,
1232   [  --enable-dv             DV decoder support (default disabled)])
1233 if test "x${enable_dv}" = "xyes"
1234 then
1235   AC_CHECK_HEADERS(libdv/dv.h, [
1236     BUILTINS="${BUILTINS} codec/dv/dv"
1237     dv_LDFLAGS="${dv_LDFLAGS} -ldv"
1238    ],[])
1239 fi  
1240
1241 dnl
1242 dnl  Video plugins
1243 dnl
1244
1245 AC_ARG_WITH(,[Video plugins:])
1246
1247 dnl
1248 dnl  X11 module
1249 dnl  (enabled by default except on win32)
1250 dnl
1251 AC_ARG_ENABLE(x11,
1252   [  --enable-x11            X11 support (default enabled)])
1253 if test "x${enable_x11}" != "xno" &&
1254   (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1255   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1256   AC_CHECK_HEADERS(X11/Xlib.h, [
1257     PLUGINS="${PLUGINS} video_output/x11/x11"
1258     x11_LDFLAGS="${x11_LDFLAGS} -L${x_libraries} -lX11 -lXext"
1259     x11_CFLAGS="${x11_CFLAGS} -I${x_includes}"
1260   ])
1261   CPPFLAGS="${save_CPPFLAGS}"
1262 fi
1263
1264 dnl
1265 dnl  XVideo module
1266 dnl  (enabled by default except on win32)
1267 dnl
1268 AC_ARG_ENABLE(xvideo,
1269   [  --enable-xvideo         XVideo support (default enabled)])
1270 if test "x${enable_xvideo}" != "xno" &&
1271   (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1272   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1273   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1274     CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
1275     AC_CHECK_LIB(Xv_pic,XvPutImage,
1276       # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1277       PLUGINS="${PLUGINS} video_output/x11/xvideo"
1278       xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv_pic"
1279       xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1280       AC_CHECK_LIB(Xv,XvPutImage,
1281         # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1282         PLUGINS="${PLUGINS} video_output/x11/xvideo"
1283         xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv"
1284         xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1285         # Otherwise... well, do nothing.
1286         :
1287       )
1288     )
1289     CFLAGS="${save_CFLAGS}"
1290   ]
1291   CPPFLAGS="${save_CPPFLAGS}")
1292 fi
1293
1294 dnl
1295 dnl  SDL module
1296 dnl
1297 AC_ARG_ENABLE(sdl,
1298   [  --enable-sdl            SDL support (default enabled)])
1299 if test "x${enable_sdl}" != "xno"
1300 then
1301   SDL_PATH="${PATH}"
1302   AC_ARG_WITH(sdl-config-path,
1303     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1304     [ if test "x${with_sdl_config_path}" != "xno"
1305       then
1306         SDL_PATH="${with_sdl_config_path}:${PATH}"
1307       fi ])
1308   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1309   SDL_CONFIG="${SDL12_CONFIG}"
1310   SDL_HEADER="SDL12/SDL.h"
1311   if test "x${SDL_CONFIG}" = "xno"
1312   then
1313     AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1314     SDL_CONFIG=${SDL11_CONFIG}
1315     SDL_HEADER="SDL11/SDL.h"
1316   fi
1317   if test "x${SDL_CONFIG}" = "xno"
1318   then
1319     AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1320     SDL_HEADER="SDL/SDL.h"
1321   fi
1322   if test "x${SDL_CONFIG}" != "xno"
1323   then
1324     PLUGINS="${PLUGINS} video_output/sdl/sdl"
1325     sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
1326     sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1327     CPPFLAGS="${save_CPPFLAGS} ${sdl_CFLAGS}"
1328     AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1329       <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1330       [ AC_MSG_ERROR([The development package for SDL is not installed. 
1331 Please install it and try again. Alternatively you can also configure with 
1332 --disable-sdl.])
1333       ])
1334     CPPFLAGS="${save_CPPFLAGS}"
1335     if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1336     then
1337       AC_MSG_ERROR([The development package for SDL is not installed.
1338 Please install it and try again. Alternatively you can also configure with
1339 --disable-sdl.])
1340     fi
1341   elif test "x${enable_sdl}" =  "xyes"
1342   then
1343     AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1344 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1345     ])
1346   fi
1347 fi
1348
1349 dnl
1350 dnl  Windows DirectX module
1351 dnl
1352 AC_ARG_ENABLE(directx,
1353   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
1354 if test "x${enable_directx}" != "xno"
1355 then
1356   if test "x${SYS}" = "xmingw32"
1357   then
1358     AC_ARG_WITH(directx, 
1359     [    --with-directx=PATH   Win32 DirectX headers])
1360     if test "x${with_directx}" = "x"
1361     then
1362       AC_CHECK_HEADERS(ddraw.h,
1363       [ PLUGINS="${PLUGINS} video_output/directx/directx"
1364         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1365     else
1366       AC_MSG_CHECKING(for directX headers in ${with_directx})
1367       if test -f ${with_directx}/ddraw.h
1368       then
1369         PLUGINS="${PLUGINS} video_output/directx/directx"
1370         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32"
1371         directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
1372         AC_MSG_RESULT(yes)
1373       else
1374         AC_MSG_RESULT(no)
1375         AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1376       fi
1377     fi
1378   fi
1379 fi
1380
1381 dnl
1382 dnl  Linux framebuffer module
1383 dnl
1384 AC_ARG_ENABLE(fb,
1385   [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
1386     if test "x${enable_fb}" != "xno"
1387     then
1388       AC_CHECK_HEADERS(linux/fb.h, [
1389         PLUGINS="${PLUGINS} video_output/fb/fb"
1390       ])
1391     fi
1392
1393 dnl
1394 dnl  Linux MGA module
1395 dnl
1396 AC_ARG_ENABLE(mga,
1397   [  --enable-mga            Linux kernel Matrox support (default disabled)],
1398   [ if test "x${enable_mga}" = "xyes"
1399     then
1400       PLUGINS="${PLUGINS} video_output/mga/mga video_output/mga/xmga"
1401     fi ])
1402
1403 dnl
1404 dnl  GGI module
1405 dnl
1406 AC_ARG_ENABLE(ggi,
1407   [  --enable-ggi            GGI support (default disabled)])
1408 if test "x${enable_ggi}" = "xyes"
1409 then
1410   PLUGINS="${PLUGINS} video_output/ggi/ggi"
1411   ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
1412   AC_ARG_WITH(ggi,
1413     [    --with-ggi=PATH       path to libggi],
1414     [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1415       then
1416         CFLAGS_GGI="${CFLAGS_GGI} -I${with_ggi}/include"
1417         ggi_LDFLAGS="${ggi_LDFLAGS} -L${with_ggi}/lib"
1418       fi ])
1419 fi
1420
1421 dnl
1422 dnl  Glide module
1423 dnl
1424 AC_ARG_ENABLE(glide,
1425   [  --enable-glide          Glide (3dfx) support (default disabled)])
1426 if test "x${enable_glide}" = "xyes"
1427 then
1428   PLUGINS="${PLUGINS} video_output/glide/glide"
1429   glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
1430   glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
1431   AC_ARG_WITH(glide,
1432     [    --with-glide=PATH     path to libglide],
1433     [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1434       then
1435         glide_CFLAGS="${glide_CFLAGS} -I${with_glide}/include"
1436         glide_LDFLAGS="${glide_LDFLAGS} -L${with_glide}/lib"
1437       fi ])
1438 fi
1439
1440 dnl
1441 dnl  AA plugin
1442 dnl
1443 AC_ARG_ENABLE(aa,
1444   [  --enable-aa             aalib output (default disabled)])
1445 if test "x${enable_aa}" = "xyes"
1446 then
1447   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1448   if test "x${have_aa}" = "xtrue"
1449   then
1450     PLUGINS="${PLUGINS} video_output/aa/aa"
1451     aa_LDFLAGS="${aa_LDFLAGS} -laa"
1452   fi
1453 fi
1454
1455 dnl
1456 dnl  Audio plugins
1457 dnl
1458
1459 AC_ARG_WITH(,[Audio plugins:])
1460
1461 dnl
1462 dnl  OSS /dev/dsp module (enabled by default except on win32)
1463 dnl
1464 AC_ARG_ENABLE(oss,
1465   [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
1466
1467 if test "x${enable_oss}" != "xno" &&
1468   (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1469 then
1470   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1471     PLUGINS="${PLUGINS} audio_output/oss"
1472     AC_CHECK_LIB(ossaudio,main,oss_LDFLAGS="${oss_LDFLAGS} -lossaudio")
1473   ])
1474 fi
1475
1476 dnl
1477 dnl  Esound module
1478 dnl
1479 AC_ARG_ENABLE(esd,
1480   [  --enable-esd            Esound library support (default disabled)],
1481   [if test "x${enable_esd}" = "xyes"
1482    then
1483      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1484      if test "x${ESD_CONFIG}" != "xno"
1485      then
1486        #PLUGINS="${PLUGINS} audio_output/esd"
1487        esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1488        esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1489      fi
1490    fi])
1491
1492 dnl
1493 dnl  aRts module
1494 dnl
1495 AC_ARG_ENABLE(arts,
1496   [  --enable-arts           aRts sound server (default disabled)],
1497   [if test "x${enable_arts}" = "xyes"
1498    then
1499      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1500      if test "x${ARTS_CONFIG}" != "xno"
1501      then
1502        #PLUGINS="${PLUGINS} audio_output/arts"
1503        arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1504        arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1505      fi
1506    fi])
1507
1508 dnl
1509 dnl  ALSA module
1510 dnl
1511 AC_ARG_ENABLE(alsa,
1512   [  --enable-alsa           ALSA sound support for Linux (default disabled)],
1513   [if test "x${enable_alsa}" = "xyes"
1514    then
1515      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1516      if test "x${have_alsa}" = "xtrue"
1517      then
1518        #PLUGINS="${PLUGINS} audio_output/alsa"
1519        alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1520      fi
1521    fi])
1522
1523 dnl
1524 dnl  win32 waveOut plugin
1525 dnl
1526 AC_ARG_ENABLE(waveout,
1527   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
1528 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
1529   then
1530     PLUGINS="${PLUGINS} audio_output/waveout"
1531     waveout_LDFLAGS="-lwinmm"
1532 fi
1533
1534 dnl
1535 dnl  Interface plugins
1536 dnl
1537
1538 AC_ARG_WITH(,[Interface plugins:])
1539
1540 dnl special case for BeOS
1541 if test "x${SYS}" = "xbeos"
1542 then
1543     PLUGINS="${PLUGINS} gui/beos/beos"
1544 fi
1545
1546 dnl
1547 dnl  Gtk+ module
1548 dnl
1549 AC_ARG_ENABLE(gtk,
1550   [  --enable-gtk            Gtk+ support (default enabled)])
1551 if test "x${enable_gtk}" != "xno"
1552 then
1553   GTK_PATH="${PATH}"
1554   AC_ARG_WITH(gtk-config-path,
1555     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1556     [ if test "x${with_gtk_config_path}" != "xno"
1557       then
1558         GTK_PATH="${with_gtk_config_path}:${PATH}"
1559       fi ])
1560   # look for gtk-config
1561   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1562   GTK_CONFIG=${GTK12_CONFIG}
1563   if test "x${GTK_CONFIG}" = "xno"
1564   then
1565     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1566   fi
1567   if test "x${GTK_CONFIG}" != "xno"
1568   then
1569     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1570     then
1571       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.])
1572     fi
1573     gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1574     gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1575     # now look for the gtk.h header
1576     CPPFLAGS="${save_CPPFLAGS} ${gtk_CFLAGS}"
1577     ac_cv_gtk_headers=yes
1578     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1579       ac_cv_gtk_headers=no
1580       echo "Cannot find gtk development headers."
1581     ])
1582     if test "x${ac_cv_gtk_headers}" = "xyes"
1583     then
1584       PLUGINS="${PLUGINS} gui/gtk/gtk"
1585       ALIASES="${ALIASES} gvlc"
1586     fi
1587     CPPFLAGS="${save_CPPFLAGS}"
1588   fi
1589 fi
1590
1591 dnl
1592 dnl  Familiar module uses Gtk+ library
1593 dnl
1594 AC_ARG_ENABLE(familiar,
1595   [  --enable-familiar       Familiar Gtk+ support (default disabled)])
1596 if test "x${enable_familiar}" = "xyes"
1597 then
1598   GTK_PATH="${PATH}"
1599   AC_ARG_WITH(gtk-config-path,
1600     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1601     [ if test "x${with_gtk_config_path}" != "xno"
1602       then
1603         GTK_PATH="${with_gtk_config_path}:${PATH}"
1604       fi ])
1605   # look for gtk-config
1606   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1607   GTK_CONFIG=${GTK12_CONFIG}
1608   if test "x${GTK_CONFIG}" = "xno"
1609   then
1610     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1611   fi
1612   if test "x${GTK_CONFIG}" != "xno"
1613   then
1614     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1615     then
1616       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.])
1617     fi
1618     familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1619     familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1620     # now look for the gtk.h header
1621     CPPFLAGS="${save_CPPFLAGS} ${familiar_CFLAGS}"
1622     ac_cv_gtk_headers=yes
1623     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1624       ac_cv_gtk_headers=no
1625       echo "Cannot find gtk development headers."
1626     ])
1627     if test "x${ac_cv_gtk_headers}" = "xyes"
1628     then
1629       PLUGINS="${PLUGINS} gui/familiar/familiar"
1630     fi
1631     CPPFLAGS="${save_CPPFLAGS}"
1632   fi
1633 fi
1634
1635 dnl
1636 dnl  Gnome module
1637 dnl
1638 AC_ARG_ENABLE(gnome,
1639   [  --enable-gnome          Gnome interface support (default disabled)],
1640   [if test "x${enable_gnome}" = "xyes"; then
1641     # look for gnome-config
1642     AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1643     if test -x ${GNOME_CONFIG}
1644     then
1645        gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1646        gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1647     fi
1648     # now look for the gnome.h header
1649     CPPFLAGS="${save_CPPFLAGS} ${gnome_CFLAGS}"
1650     AC_CHECK_HEADERS(gnome.h, [
1651       PLUGINS="${PLUGINS} gui/gtk/gnome"
1652       ALIASES="${ALIASES} gnome-vlc"
1653      ],[
1654       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1655 developement tools or remove the --enable-gnome option])
1656      ])
1657     CPPFLAGS="${save_CPPFLAGS}"
1658   fi])
1659
1660 dnl
1661 dnl  Qt module
1662 dnl
1663 AC_ARG_ENABLE(qt,
1664   [  --enable-qt             Qt interface support (default disabled)],
1665   [if test "x${enable_qt}" = "xyes"; then
1666      PLUGINS="${PLUGINS} gui/qt/qt"
1667      ALIASES="${ALIASES} qvlc"
1668      qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1669      qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1670      if test -x ${QTDIR}/bin/moc
1671      then
1672        MOC=${QTDIR}/bin/moc
1673      else
1674        MOC=moc
1675      fi
1676    fi])
1677
1678 dnl 
1679 dnl  KDE module
1680 dnl
1681 AC_ARG_ENABLE(kde,
1682   [  --enable-kde            KDE interface support (default disabled)],
1683   [if test "x${enable_kde}" = "xyes"; then
1684      PLUGINS="${PLUGINS} gui/kde/kde"
1685      ALIASES="${ALIASES} kvlc"
1686      kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1687      kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1688      kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1689      if test -x ${QTDIR}/bin/moc
1690      then
1691        MOC=${QTDIR}/bin/moc
1692      else
1693        MOC=moc
1694      fi
1695    fi])
1696
1697 dnl
1698 dnl  Qt embedded module
1699 dnl
1700 AC_ARG_ENABLE(qte,
1701   [  --enable-qte            Qt embedded interface support (default disabled)],
1702   [if test "x${enable_qte}" = "xyes"; then
1703      PLUGINS="${PLUGINS} gui/qte/qte"
1704      qte_LDFLAGS="${qte_LDFLAGS} -lqte -L${QTEDIR}/lib"
1705      qte_CFLAGS="${qte_CFLAGS} -I/usr/include/qte -I${QTEDIR}/include"
1706      if test -x ${QTEDIR}/bin/moc
1707      then
1708        MOC=${QTEDIR}/bin/moc
1709      else
1710        MOC=moc
1711      fi
1712    fi])
1713
1714
1715 dnl
1716 dnl  MacOS X module
1717 dnl
1718 AC_ARG_ENABLE(macosx,
1719   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
1720   [if test "x${enable_macosx}" = "xyes"
1721    then
1722      BUILTINS="${BUILTINS} gui/macosx/macosx"
1723      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1724    fi],
1725   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1726      BUILTINS="${BUILTINS} gui/macosx/macosx"
1727      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1728    )])
1729
1730 dnl
1731 dnl  QNX RTOS module
1732 dnl
1733 AC_ARG_ENABLE(qnx,
1734   [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
1735     if test "x${enable_qnx}" != "xno"
1736     then
1737       AC_CHECK_HEADERS(Ph.h, [
1738         PLUGINS="${PLUGINS} gui/qnx/qnx"
1739         qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1740       ])
1741     fi
1742
1743 dnl
1744 dnl  Windows native interface module, built with Borland C++ Builder
1745 dnl
1746 AC_ARG_ENABLE(intfwin,
1747 [  --enable-intfwin        Win32 interface support (default disabled)],
1748 [ if test "x${enable_intfwin}" != "xno"
1749   then
1750     AC_ARG_WITH(bcbuilder, 
1751     [    --with-bcbuilder=PATH Borland C++ Builder installation path])
1752     if test "x${with_bcbuilder}" != "x"
1753     then
1754       BCBUILDER="${with_bcbuilder}"
1755     fi
1756     PLUGINS="${PLUGINS} gui/win32/win32"
1757   fi ])
1758
1759 dnl
1760 dnl  ncurses module
1761 dnl
1762 AC_ARG_ENABLE(ncurses,
1763   [  --enable-ncurses        ncurses interface support (default disabled)],
1764   [if test "x${enable_ncurses}" = "xyes"; then
1765      PLUGINS="${PLUGINS} gui/ncurses/ncurses"
1766      ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1767    fi])
1768
1769 dnl
1770 dnl  XOSD plugin
1771 dnl
1772 AC_ARG_ENABLE(xosd,
1773   [  --enable-xosd           xosd interface support (default disabled)])
1774 if test "x${enable_xosd}" = "xyes"
1775 then
1776   AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
1777   if test "x${have_xosd}" = "xtrue"
1778   then
1779     PLUGINS="${PLUGINS} visualization/xosd/xosd"
1780     xosd_LDFLAGS="${xosd_LDFLAGS} -lxosd"
1781   fi
1782 fi
1783
1784 dnl
1785 dnl  Lirc plugin
1786 dnl
1787 AC_ARG_ENABLE(lirc,
1788   [  --enable-lirc           lirc support (default disabled)])
1789 if test "x${enable_lirc}" = "xyes"
1790 then
1791   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1792   if test "x${have_lirc}" = "xtrue"
1793   then
1794     PLUGINS="${PLUGINS} control/lirc/lirc"
1795     lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1796   fi
1797 fi
1798
1799 AC_ARG_WITH(,[Misc options:])
1800
1801 dnl
1802 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1803 dnl
1804 dnl  We give the user the opportunity to specify
1805 dnl  --with-words=big or --with-words=little ; otherwise, try to guess
1806 dnl
1807 AC_ARG_WITH(words,
1808   [  --with-words=endianness set endianness (big or little)])
1809   case "x${with_words}" in
1810     xbig)
1811       ac_cv_c_bigendian=yes
1812       ;;
1813     xlittle)
1814       ac_cv_c_bigendian=no
1815       ;;
1816     *)
1817       dnl  Try to guess endianness by matching patterns on a compiled
1818       dnl  binary, by looking for an ASCII or EBCDIC string
1819       AC_CACHE_CHECK([whether the byte order is big-endian],
1820         [ac_cv_c_bigendian],
1821         [ac_cv_c_bigendian="unknown"
1822         [cat >conftest.c <<EOF
1823         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1824         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1825         void _a(void) { char*s = (char*)am; s = (char *)ai; }
1826         short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1827         short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1828         void _e(void) { char*s = (char*)em; s = (char*)ei; }
1829         int main(void) { _a(); _e(); return 0; }
1830 EOF
1831         ]
1832         if test -f conftest.c
1833         then 
1834           if ${CC-cc} -c conftest.c -o conftest.o >config.log 2>&1 \
1835               && test -f conftest.o
1836           then
1837             if test "`strings conftest.o | grep BIGenDianSyS`"
1838             then
1839               ac_cv_c_bigendian="yes"
1840             fi
1841             if test "`strings conftest.o | grep LiTTleEnDian`"
1842             then
1843               ac_cv_c_bigendian="no"
1844             fi
1845           fi
1846         fi
1847       ])
1848       if test "x${ac_cv_c_bigendian}" = "xunknown"
1849       then
1850         AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1851       fi
1852       ;;
1853   esac
1854 dnl  Now we know what to use for endianness, just put it in the header
1855 if test "${ac_cv_c_bigendian}" = "yes"
1856 then
1857   AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1858 fi
1859
1860 dnl
1861 dnl  Profiling
1862 dnl
1863 PROFILING=0
1864
1865 GPROF=0
1866 AC_ARG_ENABLE(gprof,
1867 [  --enable-gprof          gprof profiling (default disabled)],
1868 [ if test "x${enable_gprof}" = "xyes"
1869   then
1870     GPROF=1
1871     PROFILING="gprof"
1872   fi
1873 ])
1874
1875 CPROF=0
1876 AC_ARG_ENABLE(cprof,
1877 [  --enable-cprof          cprof profiling (default disabled)],
1878 [ if test "x${enable_cprof}" = "xyes"
1879   then
1880     save_LDFLAGS="${save_LDFLAGS} -lcprof"; LDFLAGS="${save_LDFLAGS}"
1881     CPROF=1
1882     PROFILING="cprof"
1883   fi
1884 ])
1885
1886 dnl
1887 dnl  GNU portable threads
1888 dnl
1889 AC_ARG_ENABLE(pth,
1890   [  --enable-pth            GNU Pth support (default disabled)],
1891   [ if test "x${enable_pth}" = "xyes"; then
1892     AC_CHECK_LIB(pth,pth_init)
1893     AC_EGREP_HEADER(pth_init,pth.h,[
1894       AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1895                 Define if <pth.h> defines pth_init)
1896     THREAD_LIB="-lpth"
1897     fi])
1898 ])
1899
1900 dnl
1901 dnl  State Threads
1902 dnl
1903 AC_ARG_ENABLE(st,
1904   [  --enable-st             State Threads (default disabled)],
1905   [ if test "x${enable_st}" = "xyes"; then
1906     AC_CHECK_LIB(st,st_init)
1907     AC_EGREP_HEADER(st_init,st.h,[
1908       AC_DEFINE(ST_INIT_IN_ST_H, 1,
1909                 Define if <st.h> defines st_init)
1910     THREAD_LIB="-lst"
1911     fi])
1912 ])
1913
1914 vlc_LDFLAGS="${vlc_LDFLAGS} ${THREAD_LIB}"
1915 plugins_LDFLAGS="${plugins_LDFLAGS} ${THREAD_LIB}"
1916
1917 dnl
1918 dnl  Mozilla plugin
1919 dnl
1920 MOZILLA=0
1921 AC_ARG_ENABLE(mozilla,
1922   [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
1923 if test "x${enable_mozilla}" = "xyes"
1924 then
1925   AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
1926   if test "x${MOZILLA_CONFIG}" != "xno"
1927   then
1928     if test "x${SYS}" != "xmingw32"; then
1929       LDFLAGS="${save_LDFLAGS} -L${x_libraries}"
1930       AC_CHECK_LIB(Xt,XtStrings,[
1931         mozilla_LDFLAGS="${mozilla_LDFLAGS} -L${x_libraries} -lXt"
1932       ])
1933       LDFLAGS="${save_LDFLAGS}"
1934     fi
1935     MOZILLA=1
1936     mozilla_CFLAGS="${mozilla_CFLAGS} `${MOZILLA_CONFIG} --cflags plugin java --defines | xargs`"
1937     dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
1938     mozilla_LDFLAGS="${mozilla_LDFLAGS} `${MOZILLA_CONFIG} --libs | sed 's#-I\(.*\)/mozilla/\([^ ]*\)#-I\1/\2 -I\1/mozilla/\2#g'`"
1939   fi
1940 fi
1941
1942 dnl
1943 dnl  Plug-ins - this must be AT THE END
1944 dnl
1945 AC_ARG_ENABLE(plugins,
1946   [  --disable-plugins       make all plug-ins built-in (default plug-ins enabled)],
1947   [if test "x${enable_plugins}" = "xno"
1948    then
1949      BUILTINS="${BUILTINS} ${PLUGINS}"
1950      PLUGINS=
1951    fi])
1952
1953 dnl Automagically disable plug-ins if there is no system support for .so files
1954 dnl don't forget vlc-win32 still can load .so as plugins
1955 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
1956 then
1957   echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1958   echo "as built-in"
1959   BUILTINS="${BUILTINS} ${PLUGINS}"
1960   PLUGINS=
1961 fi
1962
1963 dnl
1964 dnl  Stuff used by the program
1965 dnl
1966 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc ${VERSION} ${CODENAME} Copyright 1996-2002 VideoLAN", [Simple version string])
1967 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
1968 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
1969
1970 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
1971 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
1972 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
1973
1974 DATA_PATH="${ac_tool_prefix}/share/videolan"
1975 AC_SUBST(DATA_PATH)
1976 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1977 AC_SUBST(PLUGIN_PATH)
1978
1979 dnl
1980 dnl  Restore *FLAGS
1981 dnl
1982 CPPFLAGS="${save_CPPFLAGS}"
1983 CFLAGS="${save_CFLAGS}"
1984 LDFLAGS="${save_LDFLAGS}"
1985
1986 dnl
1987 dnl  Create the vlc-config script
1988 dnl
1989 libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}"
1990 for i in `echo ${BUILTINS} | sed -e 's#[^ ]*/##g'` ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done
1991 AC_SUBST(libvlc_LDFLAGS)
1992
1993 dnl 
1994 dnl  Configuration is finished
1995 dnl
1996 AC_SUBST(SYS)
1997 AC_SUBST(ARCH)
1998 AC_SUBST(PLUGINS)
1999 AC_SUBST(BUILTINS)
2000 AC_SUBST(ALIASES)
2001 AC_SUBST(DEBUG)
2002 AC_SUBST(ASM)
2003 AC_SUBST(CPROF)
2004 AC_SUBST(GPROF)
2005 AC_SUBST(OPTIMS)
2006 AC_SUBST(TUNING)
2007 AC_SUBST(RELEASE)
2008 AC_SUBST(MOC)
2009 AC_SUBST(WINDRES)
2010 AC_SUBST(BCBUILDER)
2011 AC_SUBST(PACKAGE)
2012 AC_SUBST(VERSION)
2013 AC_SUBST(NEED_GETOPT)
2014 AC_SUBST(MOZILLA)
2015
2016 AC_SUBST(CFLAGS_OPTIM)
2017 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
2018 AC_SUBST(LDFLAGS)
2019
2020 AC_SUBST(vlc_CFLAGS)
2021 AC_SUBST(plugins_CFLAGS)
2022 AC_SUBST(builtins_CFLAGS)
2023 AC_SUBST(mozilla_CFLAGS)
2024
2025 AC_SUBST(a52_CFLAGS)
2026 AC_SUBST(arts_CFLAGS)
2027 AC_SUBST(i420_yuy2_mmx_CFLAGS)
2028 AC_SUBST(dvd_CFLAGS)
2029 AC_SUBST(dvdread_CFLAGS)
2030 AC_SUBST(dvdplay_CFLAGS)
2031 AC_SUBST(ts_dvbpsi_CFLAGS)
2032 AC_SUBST(directx_CFLAGS)
2033 AC_SUBST(esd_CFLAGS)
2034 AC_SUBST(familiar_CFLAGS)
2035 AC_SUBST(faad_CFLAGS)
2036 AC_SUBST(ffmpeg_CFLAGS)
2037 AC_SUBST(glide_CFLAGS)
2038 AC_SUBST(gnome_CFLAGS)
2039 AC_SUBST(gtk_CFLAGS)
2040 AC_SUBST(kde_CFLAGS)
2041 AC_SUBST(idctaltivec_CFLAGS)
2042 AC_SUBST(macosx_CFLAGS)
2043 AC_SUBST(mad_CFLAGS)
2044 AC_SUBST(memcpyaltivec_CFLAGS)
2045 AC_SUBST(motionaltivec_CFLAGS)
2046 AC_SUBST(qt_CFLAGS)
2047 AC_SUBST(qte_CFLAGS)
2048 AC_SUBST(sdl_CFLAGS)
2049 AC_SUBST(x11_CFLAGS)
2050 AC_SUBST(xvideo_CFLAGS)
2051
2052 AC_SUBST(vlc_LDFLAGS)
2053 AC_SUBST(plugins_LDFLAGS)
2054 AC_SUBST(builtins_LDFLAGS)
2055 AC_SUBST(mozilla_LDFLAGS)
2056
2057 AC_SUBST(a52_LDFLAGS)
2058 AC_SUBST(aa_LDFLAGS)
2059 AC_SUBST(alsa_LDFLAGS)
2060 AC_SUBST(arts_LDFLAGS)
2061 AC_SUBST(beos_LDFLAGS)
2062 AC_SUBST(i420_rgb_LDFLAGS)
2063 AC_SUBST(directx_LDFLAGS)
2064 AC_SUBST(dv_LDFLAGS)
2065 AC_SUBST(dvd_LDFLAGS)
2066 AC_SUBST(dvdread_LDFLAGS)
2067 AC_SUBST(dvdplay_LDFLAGS)
2068 AC_SUBST(ts_dvbpsi_LDFLAGS)
2069 AC_SUBST(esd_LDFLAGS)
2070 AC_SUBST(familiar_LDFLAGS)
2071 AC_SUBST(distort_LDFLAGS)
2072 AC_SUBST(faad_LDFLAGS)
2073 AC_SUBST(ffmpeg_LDFLAGS)
2074 AC_SUBST(mp4_LDFLAGS)
2075 AC_SUBST(ggi_LDFLAGS)
2076 AC_SUBST(glide_LDFLAGS)
2077 AC_SUBST(gnome_LDFLAGS)
2078 AC_SUBST(gtk_LDFLAGS)
2079 AC_SUBST(http_LDFLAGS)
2080 AC_SUBST(idctaltivec_LDFLAGS)
2081 AC_SUBST(imdct_LDFLAGS)
2082 AC_SUBST(imdct3dn_LDFLAGS)
2083 AC_SUBST(imdctsse_LDFLAGS)
2084 AC_SUBST(ipv4_LDFLAGS)
2085 AC_SUBST(ipv6_LDFLAGS)
2086 AC_SUBST(kde_LDFLAGS)
2087 AC_SUBST(lirc_LDFLAGS)
2088 AC_SUBST(macosx_LDFLAGS)
2089 AC_SUBST(mad_LDFLAGS)
2090 AC_SUBST(memcpyaltivec_LDFLAGS)
2091 AC_SUBST(motionaltivec_LDFLAGS)
2092 AC_SUBST(ncurses_LDFLAGS)
2093 AC_SUBST(oss_LDFLAGS)
2094 AC_SUBST(qnx_LDFLAGS)
2095 AC_SUBST(qt_LDFLAGS)
2096 AC_SUBST(qte_LDFLAGS)
2097 AC_SUBST(rc_LDFLAGS)
2098 AC_SUBST(sdl_LDFLAGS)
2099 AC_SUBST(vcd_LDFLAGS)
2100 AC_SUBST(vorbis_LDFLAGS)
2101 AC_SUBST(waveout_LDFLAGS)
2102 AC_SUBST(x11_LDFLAGS)
2103 AC_SUBST(xvideo_LDFLAGS)
2104 AC_SUBST(xosd_LDFLAGS)
2105
2106 AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in vlc-config])
2107 chmod a+x vlc-config
2108
2109 echo "
2110 vlc configuration
2111 --------------------
2112 vlc version           : ${VERSION}
2113 system                : ${SYS}
2114 architecture          : ${ARCH}
2115 optimizations         : ${OPTIMS}
2116 tuning                : ${TUNING}
2117 debug mode            : ${DEBUG}
2118 release               : ${RELEASE}
2119 profiling             : ${PROFILING}
2120 need builtin getopt   : ${NEED_GETOPT}
2121 built-in modules      :${BUILTINS}
2122 plug-in modules       :${PLUGINS}
2123 mozilla plugin        : ${MOZILLA}
2124 vlc aliases           :${ALIASES}
2125
2126 You may now tune Makefile.opts at your convenience, for instance to choose
2127 which modules get compiled as plugins.
2128
2129 To build vlc and its plugins, type \`${VLC_MAKE}'.
2130 "
2131