bac6fca6bfa7d6b3f285643e2d3743b115b8220a
[vlc.git] / configure.ac
1 dnl Autoconf settings for vlc
2
3 AC_INIT(vlc,0.6.0)
4
5 CONFIGURE_LINE="$0 $*"
6 CODENAME="Trevelyan"
7
8 AC_PREREQ(2.50)
9 AC_CONFIG_SRCDIR(src/libvlc.c)
10 AC_CONFIG_AUX_DIR(autotools)
11 AC_CANONICAL_SYSTEM
12
13 dnl XXX: we don't put any flags here, because automake 1.5 doesn't support
14 dnl them. And we need the comma otherwize automake will choke on it.
15 AM_INIT_AUTOMAKE(vlc,0.6.0)
16 AM_CONFIG_HEADER(config.h)
17
18 dnl
19 dnl  Save *FLAGS
20 dnl
21 CPPFLAGS_save="${CPPFLAGS}"
22 CFLAGS_save="${CFLAGS}"
23 CXXFLAGS_save="${CXXFLAGS}"
24 OBJCFLAGS_save="${OBJCFLAGS}"
25 LDFLAGS_save="${LDFLAGS}"
26
27 dnl
28 dnl Check for tools
29 dnl
30 AC_PROG_CC
31 AM_PROG_CC_C_O
32 AC_PROG_CPP
33 AC_PROG_CXX
34 AC_PROG_MAKE_SET
35 AC_PROG_INSTALL
36
37 dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
38 dnl now otherwise it might be set in an obscure if statement.
39 AC_EGREP_CPP(foo,foo)
40
41 dnl AC_PROG_OBJC doesn't seem to exist, this is the KDE workaround
42 AC_MSG_CHECKING(for an Objective-C compiler)
43 OBJC="${CXX}"
44 AC_SUBST(OBJC)
45 OBJCFLAGS="${CXXFLAGS} -fgnu-runtime -fconstant-string-class=NSConstantString"
46 AC_SUBST(OBJCFLAGS)
47 dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
48 #OBJCDEPMODE="depmode=gcc3"
49 #AC_SUBST(OBJCDEPMODE)
50 _AM_DEPENDENCIES(OBJC)
51 AC_MSG_RESULT(not implemented yet)
52
53 dnl Find the right ranlib, even when cross-compiling
54 AC_CHECK_TOOL(RANLIB, ranlib, :)
55 AC_CHECK_TOOL(STRIP, strip, :)
56 AC_CHECK_TOOL(AR, ar, :)
57 AC_CHECK_TOOL(LD, ld, :)
58
59 dnl AM_PROG_LIBTOOL
60 AC_PROG_INSTALL
61
62 dnl Check for compiler properties
63 AC_C_CONST
64 AC_C_INLINE
65
66 dnl
67 dnl  Set default values
68 dnl
69 LDFLAGS_vlc="${LDFLAGS}"
70 LIBEXT=".so"
71
72 dnl
73 dnl  Check the operating system
74 dnl
75 case "${target_os}" in
76   "")
77     SYS=unknown
78     ;;
79   linux*)
80     SYS=linux
81     ;;
82   bsdi*)
83     SYS=bsdi
84     CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
85     LDFLAGS_dvd="${LDFLAGS_dvd} -ldvd"
86     LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvd"
87     LDFLAGS_vcd="${LDFLAGS_vcd} -ldvd"
88     LDFLAGS_cdda="${LDFLAGS_cdda} -ldvd"
89     ;;
90   *bsd*)
91     SYS="${target_os}"
92     CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
93     ;;
94   darwin*)
95     SYS=darwin
96     CFLAGS_save="${CFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; CFLAGS="${CFLAGS_save}"
97     CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; CXXFLAGS="${CXXFLAGS_save}"
98     OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; OBJCFLAGS="${OBJCFLAGS_save}"
99     LDFLAGS_vlc="${LDFLAGS_vlc} -all_load"
100     LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -all_load"
101     LIBEXT=".dylib"
102     ;;
103   *mingw32* | *cygwin*)
104     AC_CHECK_TOOL(WINDRES, windres, :)
105     LIBEXT=".dll"
106
107     case "${target_os}" in
108       *mingw32*)
109         SYS=mingw32
110         ;;
111       *cygwin*)
112         dnl Check if we are using the mno-cygwin mode in which case we are
113         dnl actually dealing with a mingw32 compiler.
114         AC_EGREP_CPP(yes,
115             [#ifdef WIN32
116              yes
117              #endif],
118             SYS=mingw32, SYS=cygwin)
119         ;;
120     esac
121
122     if test "${SYS}" = "mingw32"; then
123         # add ws2_32 for closesocket, select, recv
124         CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
125         CPPFLAGS="${CPPFLAGS_save}"
126         LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -lwinmm -mwindows"
127         LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
128         LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
129         LDFLAGS_access_http="${LDFLAGS_access_http} -lws2_32"
130         LDFLAGS_access_mms="${LDFLAGS_access_mms} -lws2_32"
131         LDFLAGS_access_udp="${LDFLAGS_access_udp} -lws2_32"
132         LDFLAGS_access_ftp="${LDFLAGS_access_ftp} -lws2_32"
133         LDFLAGS_access_output_udp="${LDFLAGS_access_output_udp} -lws2_32"
134         LDFLAGS_sap="${LDFLAGS_sap} -lws2_32"
135         LDFLAGS_slp="${LDFLAGS_slp} -lws2_32"
136         LDFLAGS_http="${LDFLAGS_http} -lws2_32"
137         LDFLAGS_httpd="${LDFLAGS_httpd} -lws2_32"
138     fi
139     ;;
140   *nto*)
141     SYS=nto
142     LDFLAGS_x11="${LDFLAGS_x11} -lsocket"
143     LDFLAGS_xvideo="${LDFLAGS_xvideo} -lsocket"
144     ;;
145   solaris*)
146     SYS=solaris
147     ;;
148   hpux*)
149     SYS=hpux
150     LIBEXT=".sl"
151     ;;
152   beos)
153     SYS=beos
154     CFLAGS_save="${CFLAGS_save} -Wno-multichar"; CFLAGS="${CFLAGS_save}"
155     CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar"; CXXFLAGS="${CXXFLAGS_save}"
156     LDFLAGS_vlc="${LDFLAGS_vlc} -lbe"
157     CXXFLAGS_beos="${CXXFLAGS_beos}"
158     LDFLAGS_beos="${LDFLAGS_beos} -lbe -lmedia -ltranslation -ltracker -lgame"
159     dnl Check if we have BONE (old net_server doesn't have libsocket.so)
160     AC_CHECK_LIB( socket, connect,
161         LDFLAGS_vlc="${LDFLAGS_vlc} -lsocket -lbind" 
162         LDFLAGS_access_mms="${LDFLAGS_access_mms} -lsocket -lbind"
163         LDFLAGS_ipv4="${LDFLAGS_ipv4} -lsocket -lbind"
164         LDFLAGS_httpd="${LDFLAGS_httpd} -lsocket -lbind" )
165     ;;
166   *)
167     SYS="${target_os}"
168     ;;
169 esac
170 AM_CONDITIONAL(HAVE_BEOS, test "${SYS}" = "beos")
171 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
172 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
173
174 dnl
175 dnl Gettext stuff
176 dnl
177 ALL_LINGUAS="de en_GB fr it ja no ru nl pl sv"
178 AM_GNU_GETTEXT_VERSION(0.11.5)
179 AM_GNU_GETTEXT
180 if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
181   AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
182   INCLUDES="${INCLUDES} -I\\\$(top_srcdir)/intl"
183 else
184   AC_CHECK_FUNCS(textdomain,,[
185     AC_CHECK_LIB(intl,textdomain,
186       LDFLAGS_vlc="${LDFLAGS_vlc} ${LIBINTL}",,
187       ${LIBINTL}
188     )
189   ])
190 fi
191 AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
192 XGETTEXT="${XGETTEXT} --keyword=_NS --keyword=_ANS"
193
194 AC_MSG_CHECKING(for suffix of libraries)
195 AC_MSG_RESULT(${LIBEXT})
196
197 dnl Check for the need to include the mingwex lib for mingw32
198 if test "${SYS}" = "mingw32"
199 then
200     AC_CHECK_LIB(mingwex,opendir,
201         AC_CHECK_LIB(mingw32,opendir,LDFLAGS_vlc="${LDFLAGS_vlc}",
202             [LDFLAGS_vlc="${LDFLAGS_vlc} -lmingwex"
203              LDFLAGS_gtk="${LDFLAGS_gtk} -lmingwex"])
204     )
205 fi
206
207 dnl Check for fnative-struct or mms-bitfields support for mingw32
208 if test "${SYS}" = "mingw32"
209 then
210     AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
211         [ac_cv_c_mms_bitfields],
212         [CFLAGS="${CFLAGS_save} -mms-bitfields"
213          AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
214     if test "${ac_cv_c_mms_bitfields}" != "no"; then
215         CFLAGS_save="${CFLAGS_save} -mms-bitfields";
216         CXXFLAGS_save="${CXXFLAGS_save} -mms-bitfields";
217     else
218         AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
219             [ac_cv_c_fnative_struct],
220             [CFLAGS="${CFLAGS_save} -fnative-struct"
221              AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
222         if test "${ac_cv_c_fnative_struct}" != "no"; then
223             CFLAGS_save="${CFLAGS_save} -fnative-struct";
224             CXXFLAGS_save="${CXXFLAGS_save} -fnative-struct";
225         fi
226     fi
227
228     CFLAGS="${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
229 fi
230
231 dnl Check for fvtable-thunks support for mingw32
232 if test "${SYS}" = "mingw32"
233 then
234 AC_LANG_PUSH(C++)
235     AC_CACHE_CHECK([if \$CXX accepts -fvtable-thunks],
236         [ac_cv_cxx_fvtable_thunks],
237         [CXXFLAGS="${CXXFLAGS_save} -Wall -Werror -fvtable-thunks"
238          AC_TRY_COMPILE([],,ac_cv_cxx_fvtable_thunks=yes,
239                         ac_cv_cxx_fvtable_thunks=no)])
240     if test "${ac_cv_cxx_fvtable_thunks}" = "yes"; then
241         CXXFLAGS_mingw32_special="-fvtable-thunks"
242     fi
243
244     CXXFLAGS_save="${CXXFLAGS_save} ${CXXFLAGS_mingw32_special}"
245     CXXFLAGS="${CXXFLAGS_save}"
246 AC_LANG_POP(C++)
247 fi
248
249 dnl Flags for plugin compilation
250 case "${SYS}" in
251   mingw32|cygwin)
252     CFLAGS_pics="${CFLAGS_pics} ${CFLAGS_mingw32_special}"
253     CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
254     OBJCFLAGS_pics="${OBJCFLAGS_pics} ${CFLAGS_mingw32_special}"
255     CFLAGS_plugins="${CFLAGS_plugins} ${CFLAGS_mingw32_special}"
256     CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
257     OBJCFLAGS_plugins="${OBJCFLAGS_plugins} ${CFLAGS_mingw32_special}"
258     ;;
259   *)
260     CFLAGS_pics="${CFLAGS_pics} -fPIC"
261     CXXFLAGS_pics="${CXXFLAGS_pics} -fPIC"
262     OBJCFLAGS_pics="${OBJCFLAGS_pics} -fPIC"
263     CFLAGS_plugins="${CFLAGS_plugins} -fPIC"
264     CXXFLAGS_plugins="${CXXFLAGS_plugins} -fPIC"
265     OBJCFLAGS_plugins="${OBJCFLAGS_plugins} -fPIC"
266     LDFLAGS_plugins="${LDFLAGS_plugins} -fPIC"
267     ;;
268 esac
269
270 dnl The -DSYS_FOO flag
271 CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
272
273 dnl Check for system libs needed
274 need_libc=false
275
276 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r)
277
278 dnl Check for usual libc functions
279 AC_CHECK_FUNCS(strdup strndup atof lseek)
280 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
281 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
282
283 AC_CHECK_FUNCS(connect,,[
284   AC_CHECK_LIB(socket,connect,
285     LDFLAGS_ipv4="${LDFLAGS_ipv4} -lsocket"
286     LDFLAGS_vlc="${LDFLAGS_vlc} -lsocket"
287 )])
288
289 AC_CHECK_FUNCS(send,,[
290   AC_CHECK_LIB(socket,send,
291     LDFLAGS_access_http="${LDFLAGS_access_http} -lsocket"
292     LDFLAGS_access_mms="${LDFLAGS_access_mms} -lsocket"
293     LDFLAGS_access_udp="${LDFLAGS_access_udp} -lsocket"
294     LDFLAGS_access_ftp="${LDFLAGS_access_ftp} -lsocket"
295     LDFLAGS_sap="${LDFLAGS_sap} -lsocket"
296     LDFLAGS_http="${LDFLAGS_http} -lsocket"
297     LDFLAGS_access_output_udp="${LDFLAGS_access_output_udp} -lsocket"
298 )])
299
300 AC_CHECK_FUNCS(gethostbyname,,[
301   AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lnsl" LDFLAGS_httpd="${LDFLAGS_httpd} -lnsl" LDFLAGS_vlc="${LDFLAGS_vlc} -lnsl",[
302     AC_CHECK_LIB(bind,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind" LDFLAGS_httpd="${LDFLAGS_httpd} -lbind")])
303 ])
304
305 dnl Check for socklen_t
306 AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
307   [AC_TRY_COMPILE(
308      [#include <sys/types.h>
309       #include <sys/socket.h>],
310      [socklen_t len = 42; return len;],
311      ac_cv_type_socklen_t=yes,
312      ac_cv_type_socklen_t=no)])
313 if test "${ac_cv_type_socklen_t}" != "no"; then
314   AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if <sys/socket.h> defines socklen_t.])
315 fi
316
317 dnl Check for va_copy
318 AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
319   AC_TRY_LINK(
320     [#include <stdarg.h>],
321     [va_list ap1, ap2; va_copy(ap1,ap2);],
322     [ac_cv_c_va_copy="yes"],
323     [ac_cv_c_va_copy="no"]))
324 if test "${ac_cv_c_va_copy}" = "yes"; then
325   AC_DEFINE(HAVE_VA_COPY, 1, [Define if <stdarg.h> defines va_copy.])
326 fi
327 AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy,
328   AC_TRY_LINK(
329     [#include <stdarg.h>],
330     [va_list ap1, ap2; __va_copy(ap1,ap2);],
331     [ac_cv_c___va_copy="yes"],
332     [ac_cv_c___va_copy="no"]))
333 if test "${ac_cv_c___va_copy}" = "yes"; then
334   AC_DEFINE(HAVE___VA_COPY, 1, [Define if <stdarg.h> defines __va_copy.])
335 fi
336
337 AC_CHECK_FUNCS(inet_aton,,[
338   AC_CHECK_LIB(resolv,inet_aton,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lresolv" LDFLAGS_httpd="${LDFLAGS_httpd} -lresolv")
339 ])
340
341 dnl Check for getopt
342 need_getopt=false
343 AC_CHECK_FUNCS(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
344 [ # FreeBSD has a gnugetopt library for this:
345   AC_CHECK_LIB([gnugetopt],[getopt_long],
346     [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LDFLAGS_vlc="${LDFLAGS_vlc} -lgnugetopt"],
347     [need_getopt=:])])
348 AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
349
350 if test "${SYS}" != "mingw32"; then
351 AC_TYPE_SIGNAL
352 AC_CHECK_LIB(dl,dlopen,LDFLAGS_vlc="${LDFLAGS_vlc} -ldl")
353 AC_CHECK_LIB(m,cos,
354   LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
355   LDFLAGS_adjust="${LDFLAGS_adjust} -lm"
356   LDFLAGS_distort="${LDFLAGS_distort} -lm"
357   LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -lm")
358 AC_CHECK_LIB(m,pow,
359   LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lm"
360   LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -lm"
361   LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
362   LDFLAGS_imdct3dn="${LDFLAGS_imdct3dn} -lm"
363   LDFLAGS_imdctsse="${LDFLAGS_imdctsse} -lm"
364   LDFLAGS_i420_rgb="${LDFLAGS_i420_rgb} -lm"
365   LDFLAGS_faad="${LDFLAGS_faad} -lm"
366 )
367 AC_CHECK_LIB(m,sqrt,
368   LDFLAGS_headphone_channel_mixer="${LDFLAGS_headphone_channel_mixer} -lm"
369 )
370 fi # end "${SYS}" != "mingw32"
371
372 if test "${SYS}" != "mingw32"; then
373 dnl Check for pthreads - borrowed from XMMS
374 THREAD_LIB=error
375 if test "${THREAD_LIB}" = "error"; then
376   AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
377 fi
378 if test "${THREAD_LIB}" = "error"; then
379   AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
380 fi
381 if test "${THREAD_LIB}" = "error"; then
382   AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
383 fi
384 if test "${THREAD_LIB}" = "error"; then
385   AC_CHECK_FUNCS(pthread_mutex_lock)
386   THREAD_LIB=""
387 fi
388
389 dnl Check for cthreads under GNU/Hurd for instance
390 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
391
392 dnl
393 dnl  GNU portable threads
394 dnl
395 AC_ARG_ENABLE(pth,
396   [  --enable-pth            GNU Pth support (default disabled)],
397   [ if test "${enable_pth}" = "yes"; then
398     AC_CHECK_LIB(pth,pth_init)
399     AC_MSG_CHECKING(for pth_init in pth.h)
400     AC_EGREP_HEADER(pth_init,pth.h,[
401       AC_MSG_RESULT(yes)
402       AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
403                 Define if <pth.h> defines pth_init)
404       THREAD_LIB="-lpth"
405     ],[
406       AC_MSG_RESULT(no)
407     ])
408     fi
409 ])
410
411 dnl
412 dnl  State Threads
413 dnl
414 AC_ARG_ENABLE(st,
415   [  --enable-st             State Threads (default disabled)],
416   [ if test "${enable_st}" = "yes"; then
417     AC_CHECK_LIB(st,st_init)
418     AC_MSG_CHECKING(for st_init in st.h)
419     AC_EGREP_HEADER(st_init,st.h,[
420       AC_MSG_RESULT(yes)
421       AC_DEFINE(ST_INIT_IN_ST_H, 1,
422                 Define if <st.h> defines st_init)
423       THREAD_LIB="-lst"
424     ],[
425       AC_MSG_RESULT(yes)
426     ])
427     fi
428 ])
429
430 LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
431 LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
432
433 dnl Don't link with rt when using GNU-pth
434 if test "${THREAD_LIB}" != "-lpth" && test "${THREAD_LIB}" != "-lst"; then
435   dnl HP/UX port
436   AC_CHECK_LIB(rt,sem_init, [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"])
437
438   have_nanosleep=false
439   AC_CHECK_FUNCS(nanosleep,have_nanosleep=:,[
440     AC_CHECK_LIB(rt,nanosleep,
441       [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"; have_nanosleep=:],
442       [AC_CHECK_LIB(posix4,nanosleep,
443           [LDFLAGS_vlc="${LDFLAGS_vlc} -lposix4"; have_nanosleep=:])]
444     )
445   ])
446   if ${have_nanosleep}; then
447     AC_DEFINE(HAVE_NANOSLEEP, 1,
448               Define if nanosleep is available.)
449   fi
450 fi
451
452 dnl Check for misc headers
453 AC_MSG_CHECKING(for pthread_cond_t in pthread.h)
454 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
455   AC_MSG_RESULT(yes)
456   AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
457             Define if <pthread.h> defines pthread_cond_t.)],[
458   AC_MSG_RESULT(no)])
459
460 AC_MSG_CHECKING(for pthread_once in pthread.h)
461 AC_EGREP_HEADER(pthread_once,pthread.h,[
462   AC_MSG_RESULT(yes)
463   AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
464             Define if <pthread.h> defines pthread_once.)],[
465   AC_MSG_RESULT(no)])
466 fi # end "${SYS}" != "mingw32"
467
468 AC_MSG_CHECKING(for strncasecmp in strings.h)
469 AC_EGREP_HEADER(strncasecmp,strings.h,[
470   AC_MSG_RESULT(yes)
471   AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
472             Define if <strings.h> defines strncasecmp.)],[
473   AC_MSG_RESULT(no)])
474
475 dnl Check for headers
476 AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
477 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
478 AC_CHECK_HEADERS(dlfcn.h image.h)
479 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
480 if test "${SYS}" != "mingw32"; then
481 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
482 AC_CHECK_HEADERS(linux/version.h)
483 fi # end "${SYS}" != "mingw32"
484
485 AC_HEADER_TIME
486
487 dnl Check for dirent
488 need_dirent=false
489 AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
490 AM_CONDITIONAL(BUILD_DIRENT, ${need_dirent})
491
492 dnl Mac OS X and other OSes don't have declaration for nanosleep
493 if test "${SYS}" != "mingw32"; then
494 AC_MSG_CHECKING(for nanosleep in time.h)
495 AC_EGREP_HEADER(nanosleep,time.h,[
496   AC_MSG_RESULT(yes)
497   AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
498             Define if <time.h> defines nanosleep.)
499 ],[
500   AC_MSG_RESULT(no)
501 ])
502 fi # end "${SYS}" != "mingw32"
503
504 dnl Make sure we have timespecs
505 AC_MSG_CHECKING(for timespec in sys/time.h)
506 AC_EGREP_HEADER(timespec,sys/time.h,[
507   AC_MSG_RESULT(yes)
508   AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
509             Define if <sys/time.h> defines struct timespec.)
510 ],[
511   AC_MSG_RESULT(no)
512 ])
513
514 dnl Check for threads library
515 if test "${SYS}" != "mingw32"; then
516 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
517 fi # end "${SYS}" != "mingw32"
518
519 dnl Default X headers and libraries
520 if test "${x_includes}" = "NONE"; then
521   x_includes="/usr/X11R6/include"
522 fi
523 if test "${x_libraries}" = "NONE"; then
524   x_libraries="/usr/X11R6/lib"
525 fi
526
527 dnl Build the gtk_main plugins?
528 NEED_GTK_MAIN=no
529 NEED_GNOME_MAIN=no
530 NEED_GTK2_MAIN=no
531 NEED_GNOME2_MAIN=no
532
533 dnl build the qte plugin ?
534 NEED_QTE_MAIN=no
535
536 dnl Check for ntohl, etc.
537 AC_CACHE_CHECK([for ntohl in sys/param.h],
538     [ac_cv_c_ntohl_sys_param_h],
539     [CFLAGS="${CFLAGS_save} -Wall -Werror"
540      AC_TRY_COMPILE([#include <sys/param.h>],
541         [void foo() { int meuh; ntohl(meuh); }],
542         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
543 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
544     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
545 fi
546
547 dnl Check for inline function size limit
548 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
549     [ac_cv_c_inline_limit],
550     [CFLAGS="${CFLAGS_save} -finline-limit-30000"
551      AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
552 if test "${ac_cv_c_inline_limit}" != "no"; then
553     CFLAGS_save="${CFLAGS_save} -finline-limit-30000"; CFLAGS="${CFLAGS_save}"
554     CXXFLAGS_save="${CXXFLAGS_save} -finline-limit-30000"; CXXFLAGS="${CXXFLAGS_save}"
555     OBJCFLAGS_save="${OBJCFLAGS_save} -finline-limit-30000"; OBJCFLAGS="${OBJCFLAGS_save}"
556 fi
557
558 # XXX: do this with an M4 macro?
559 #dnl Check for various -W flags
560 #for flag in "" all unreachable-code conversion sign-compare disabled-optimization
561 #do
562 #    AC_CACHE_CHECK([if \$CC accepts -W${flag}],
563 #        [ac_cv_c_W${flag}],
564 #        [CFLAGS="-W${flag} ${CFLAGS_save}"
565 #         AC_TRY_COMPILE([],,ac_cv_c_W${flag}=yes, ac_cv_c_W${flag}=no)])
566 #    if test "${ac_cv_c_W${flag}}" != "no"; then
567 #        CFLAGS_save="-W${flag} ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
568 #        CXXFLAGS_save="-W${flag} ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
569 #        OBJCFLAGS_save="-W${flag} ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
570 #    fi
571 #done
572
573 AC_CACHE_CHECK([if \$CC accepts -Wall],
574     [ac_cv_c_Wall],
575     [CFLAGS="-Wall ${CFLAGS_save}"
576      AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)])
577
578 AC_CACHE_CHECK([if \$CC accepts -Wconversion],
579     [ac_cv_c_Wconversion],
580     [CFLAGS="-Wconversion ${CFLAGS_save}"
581      AC_TRY_COMPILE([],,ac_cv_c_Wconversion=yes, ac_cv_c_Wconversion=no)])
582
583 AC_CACHE_CHECK([if \$CC accepts -Wunreachable-code],
584     [ac_cv_c_Wunreachable_code],
585     [CFLAGS="-Wunreachable-code ${CFLAGS_save}"
586      AC_TRY_COMPILE([],,ac_cv_c_Wunreachable_code=yes, ac_cv_c_Wunreachable_code=no)])
587
588 AC_CACHE_CHECK([if \$CC accepts -Wsign-compare],
589     [ac_cv_c_Wsign_compare],
590     [CFLAGS="-Wsign-compare ${CFLAGS_save}"
591      AC_TRY_COMPILE([],,ac_cv_c_Wsign_compare=yes, ac_cv_c_Wsign_compare=no)])
592
593 if test "${ac_cv_c_Wall}" != "no"; then
594     CFLAGS_save="-Wall ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
595     CXXFLAGS_save="-Wall ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
596     OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
597 fi
598
599 if test "${ac_cv_c_Wsign_compare}" != "no"; then
600     CFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
601     CXXFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
602     OBJCFLAGS_save="-Wsign-compare ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
603 fi
604
605 dnl Check for -pipe
606 AC_CACHE_CHECK([if \$CC accepts -pipe],
607     [ac_cv_c_pipe],
608     [CFLAGS="${CFLAGS_save} -pipe"
609      AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
610 if test "${ac_cv_c_pipe}" != "no"; then
611     CFLAGS_save="${CFLAGS_save} -pipe"; CFLAGS="${CFLAGS_save}"
612     CXXFLAGS_save="${CXXFLAGS_save} -pipe"; CXXFLAGS="${CXXFLAGS_save}"
613     OBJCFLAGS_save="${OBJCFLAGS_save} -pipe"; OBJCFLAGS="${OBJCFLAGS_save}"
614 fi
615
616 dnl Check for various optimization flags
617 AC_CACHE_CHECK([if \$CC accepts -O3],
618     [ac_cv_c_o3],
619     [CFLAGS="${CFLAGS_save} -O3"
620      AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
621 if test "${ac_cv_c_o3}" != "no"; then
622     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
623 fi
624
625 AC_CACHE_CHECK([if \$CC accepts -O2],
626     [ac_cv_c_o2],
627     [CFLAGS="${CFLAGS_save} -O2"
628      AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
629 if test "${ac_cv_c_o2}" != "no"; then
630     if test "${ac_cv_c_o3}" = "no"; then
631         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
632     fi
633     CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O2"
634 else
635     AC_CACHE_CHECK([if \$CC accepts -O],
636         [ac_cv_c_o],
637         [CFLAGS="${CFLAGS_save} -O"
638          AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
639     if test "${ac_cv_c_o}" != "no"; then
640         if test "${ac_cv_c_o3}" = "no"; then
641             CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
642         fi
643         CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O"
644     fi
645 fi
646
647 dnl Check for -ffast-math
648 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
649     [ac_cv_c_fast_math],
650     [CFLAGS="${CFLAGS_save} -ffast-math"
651      AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
652 if test "${ac_cv_c_fast_math}" != "no"; then
653     CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
654 fi
655
656 dnl Check for -funroll-loops
657 dnl Disabled on BeOS because BeOS' gcc is buggy and may crash with it
658 if test "${SYS}" != "beos"
659 then
660   AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
661       [ac_cv_c_unroll_loops],
662       [CFLAGS="${CFLAGS_save} -funroll-loops"
663        AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
664   if test "${ac_cv_c_unroll_loops}" != "no"; then
665       CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
666   fi
667 fi
668
669 dnl Check for -fomit-frame-pointer
670 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
671     [ac_cv_c_omit_frame_pointer],
672     [CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
673      AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
674 if test "${ac_cv_c_omit_frame_pointer}" != "no"; then
675     CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
676     # this plugin does not compile without -fomit-frame-pointer, damn gcc!
677     CFLAGS_i420_yuy2_mmx="${CFLAGS_i420_yuy2_mmx} -fomit-frame-pointer"
678 fi
679
680 dnl Check for -mdynamic-no-pic
681 AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
682     [ac_cv_c_dynamic_no_pic],
683     [CFLAGS="${CFLAGS_save} -mdynamic-no-pic"
684      AC_TRY_COMPILE([],,ac_cv_c_dynamic_no_pic=yes, ac_cv_c_dynamic_no_pic=no)])
685 if test "${ac_cv_c_dynamic_no_pic}" != "no"; then
686     CFLAGS_builtins="${CFLAGS_builtins} -mdynamic-no-pic"
687     CFLAGS_libvlc="${CFLAGS_libvlc} -mdynamic-no-pic"
688 fi
689
690 dnl Check for Darwin plugin linking flags
691 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
692     [ac_cv_ld_darwin],
693     [CFLAGS="${CFLAGS_save} -bundle -undefined error -lcc_dynamic"
694      AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
695 if test "${ac_cv_ld_darwin}" != "no"; then
696     LDFLAGS_plugins="${LDFLAGS_plugins} -bundle -undefined error -lcc_dynamic"
697 fi
698
699 dnl Check for standard plugin linking flags
700 dnl BeOS' gcc needs -nostart instead of -shared, even if -shared isn't harmful (just a warning)
701 if test "${SYS}" = "beos"; then
702     LDFLAGS_plugins="${LDFLAGS_plugins} -nostart"
703 else
704     AC_CACHE_CHECK([if \$CC accepts -shared],
705         [ac_cv_ld_plugins],
706         [CFLAGS="${CFLAGS_save} -shared"
707          AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
708     if test "${ac_cv_ld_plugins}" != "no"; then
709         LDFLAGS_plugins="${LDFLAGS_plugins} -shared"
710     fi
711 fi
712
713 dnl Check for variadic macros
714 AC_CACHE_CHECK([for variadic cpp macros],
715     [ac_cv_cpp_variadic_macros],
716     [CFLAGS="${CFLAGS_save}"
717      AC_TRY_COMPILE(
718          [#include <stdio.h>
719           #define a(b,c...) printf(b,##c)],
720          [a("foo");a("%s","bar");a("%s%s","baz","quux");],
721          ac_cv_cpp_variadic_macros=yes,
722          ac_cv_cpp_variadic_macros=no)])
723 if test "${ac_cv_cpp_variadic_macros}" != "no"; then
724     AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
725 fi
726
727 dnl Checks for __attribute__(aligned()) directive
728 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
729     [ac_cv_c_attribute_aligned],
730     [ac_cv_c_attribute_aligned=0
731         CFLAGS="${CFLAGS_save} -Werror"
732     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
733         AC_TRY_COMPILE([],
734         [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
735         [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
736     done
737         CFLAGS="${CFLAGS_save}"])
738 if test "${ac_cv_c_attribute_aligned}" != "0"; then
739     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
740         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
741 fi
742
743 dnl Checks for __attribute__(format()) directive
744 AC_CACHE_CHECK([__attribute__ ((format ())) support with function pointers],
745     [ac_cv_c_attribute_format],
746     [ac_cv_c_attribute_format=no
747         CFLAGS="${CFLAGS_save} -Werror"
748         AC_TRY_COMPILE([],
749         [static void (*pf_printf)(const char *, ...) __attribute__ ((format(printf,1,2)));(void)pf_printf;],
750         [ac_cv_c_attribute_format=yes])
751         CFLAGS="${CFLAGS_save}"])
752 if test "${ac_cv_c_attribute_format}" != "no"; then
753     AC_DEFINE(HAVE_ATTRIBUTE_FORMAT, 1, Support for __attribute__((format())) with function pointers)
754 fi
755
756 dnl
757 dnl  Check the CPU
758 dnl
759 case "${target_cpu}" in
760   "")
761     ARCH=unknown
762     ;;
763   *)
764     ARCH="${target_cpu}"
765     ;;
766 esac
767
768 case "${ARCH}" in
769   hppa64)
770     CFLAGS_mpeg_video_old="${CFLAGS_mpeg_video_old} -ffunction-sections"
771     ;;
772 esac
773
774 dnl
775 dnl  Enable profiling
776 dnl
777 AC_ARG_ENABLE(gprof,
778 [  --enable-gprof          gprof profiling (default disabled)])
779 AC_ARG_ENABLE(cprof,
780 [  --enable-cprof          cprof profiling (default disabled)])
781 AM_CONDITIONAL(GPROF, test "${enable_gprof}" = "yes")
782 AM_CONDITIONAL(CPROF, test "${enable_gprof}" = "yes")
783
784 dnl
785 dnl  default modules
786 dnl
787 #BUILTINS="${BUILTINS} mpeg_video_old idct idctclassic motion"
788 PLUGINS="${PLUGINS} dummy rc logger gestures memcpy"
789 PLUGINS="${PLUGINS} es audio m4v mpeg_system ps ts avi asf aac mp4 rawdv"
790 PLUGINS="${PLUGINS} spudec mpeg_audio lpcm a52 dts cinepak"
791 PLUGINS="${PLUGINS} deinterlace invert adjust wall transform distort clone crop motionblur"
792 PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif dtstospdif fixed32tofloat32 fixed32tos16 s16tofixed32 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32"
793 PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler bandlimited_resampler"
794 PLUGINS="${PLUGINS} trivial_channel_mixer headphone_channel_mixer"
795 PLUGINS="${PLUGINS} trivial_mixer spdif_mixer float32_mixer"
796 PLUGINS="${PLUGINS} aout_file"
797 #PLUGINS="${PLUGINS} scope"
798 PLUGINS="${PLUGINS} i420_rgb i420_yuy2 i422_yuy2 i420_ymga"
799 PLUGINS="${PLUGINS} id3 m3u"
800 PLUGINS="${PLUGINS} rawvideo"
801 PLUGINS="${PLUGINS} wav araw demuxdump demuxsub adpcm a52sys au"
802 PLUGINS="${PLUGINS} access_file access_udp access_http ipv4 access_mms"
803 PLUGINS="${PLUGINS} access_ftp access_directory sap httpd http"
804
805 dnl
806 dnl  Switch to enable a version of VLC where most modules will be builtin
807 dnl
808 AC_ARG_ENABLE(mostly-builtin,
809 [  --enable-mostly-builtin most modules will be built-in (default disabled)])
810 if test "${enable_mostly_builtin}" = "yes"; then
811   BUILTINS="${BUILTINS} ${PLUGINS}"
812   PLUGINS=""
813 fi
814
815 dnl
816 dnl Some plugins aren't useful on some platforms
817 dnl
818 if test "${SYS}" != "mingw32"; then
819     PLUGINS="${PLUGINS} screensaver"
820 fi
821
822 dnl
823 dnl  Accelerated modules
824 dnl
825 MMX_MODULES="memcpymmx i420_rgb_mmx i422_yuy2_mmx i420_ymga_mmx"
826 #MMX_MODULES="${MMX_MODULES} idctmmx motionmmx"
827 MMXEXT_MODULES="memcpymmxext"
828 #MMXEXT_MODULES="${MMXEXT_MODULES} idctmmxext motionmmxext"
829 THREEDNOW_MODULES="memcpy3dn"
830 SSE_MODULES=""
831 ALTIVEC_MODULES="memcpyaltivec"
832 #ALTIVEC_MODULES="${ALTIVEC_MODULES} idctaltivec motionaltivec"
833
834 if test "${enable_gprof}" != "yes"
835 then
836   MMX_MODULES="${MMX_MODULES} i420_yuy2_mmx"
837 fi
838
839 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
840     [ac_cv_mmx_inline],
841     [CFLAGS="${CFLAGS_save}"
842      AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
843                     ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
844 if test "${ac_cv_mmx_inline}" != "no"; then
845   ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
846 fi
847
848 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
849     [ac_cv_mmxext_inline],
850     [CFLAGS="${CFLAGS_save}"
851      AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
852                     ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
853 if test "${ac_cv_mmxext_inline}" != "no"; then
854   ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
855 fi
856
857 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
858     [ac_cv_3dnow_inline],
859     [CFLAGS="${CFLAGS_save}"
860      AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
861                     ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
862 if test "${ac_cv_3dnow_inline}" != "no"; then
863   AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
864   ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
865 fi
866
867 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
868     [ac_cv_sse_inline],
869     [CFLAGS="${CFLAGS_save}"
870      AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
871                     ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
872 if test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "mingw32"; then
873   AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
874   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
875 fi
876
877 if test "${SYS}" != "mingw32"; then
878 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
879     [ac_cv_altivec_inline],
880     [CFLAGS="${CFLAGS_save}"
881      AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
882          ac_cv_altivec_inline=yes,
883          [CFLAGS="${CFLAGS_save} -Wa,-m7400"
884           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
885             [ac_cv_altivec_inline="-Wa,-m7400"],
886             ac_cv_altivec_inline=no)
887          ])])
888 if test "${ac_cv_altivec_inline}" != "no"; then
889   AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
890   if test "${ac_cv_altivec_inline}" != "yes"; then
891     CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_altivec_inline}"
892     CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_altivec_inline}"
893     CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_altivec_inline}"
894     CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_altivec_inline}"
895   fi
896   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
897 fi
898
899 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
900     [ac_cv_c_altivec],
901     [CFLAGS="${CFLAGS_save} -faltivec"
902      # Darwin test
903      AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
904         ac_cv_c_altivec=-faltivec, [
905         # Linux/PPC test
906         CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -fvec"
907         AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
908             [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
909         ])
910      CFLAGS="${CFLAGS_save}"])
911 if test "${ac_cv_c_altivec}" != "no"; then
912   AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
913   CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_c_altivec}"
914   CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_c_altivec}"
915   CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_c_altivec}"
916   CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_c_altivec}"
917   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
918 fi
919
920 AC_CACHE_CHECK([if linker needs -framework vecLib],
921     [ac_cv_ld_altivec],
922     [LDFLAGS="${LDFLAGS_vlc} -framework vecLib"
923      AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
924      LDFLAGS="${LDFLAGS_save}"
925     ])
926 if test "${ac_cv_ld_altivec}" != "no"; then
927   LDFLAGS_idctaltivec="${LDFLAGS_idctaltivec} -framework vecLib"
928   LDFLAGS_motionaltivec="${LDFLAGS_motionaltivec} -framework vecLib"
929   LDFLAGS_memcpyaltivec="${LDFLAGS_memcpyaltivec} -framework vecLib"
930   LDFLAGS_vlc="${LDFLAGS_vlc} -framework vecLib"
931 fi
932 fi # end "${SYS}" != "mingw32"
933
934 AC_ARG_WITH(,[])
935 AC_ARG_WITH(,[Optimization options:])
936
937 dnl
938 dnl  Special arch tuning
939 dnl
940 AC_ARG_WITH(tuning,
941 [  --with-tuning=ARCH      enable special tuning for an architecture
942                           (default i686 on IA-32 and 750 on PPC)])
943 if test "${with_tuning}" != ""; then
944     if test "${target_cpu}" = "powerpc"; then
945         CFLAGS_TUNING="-mtune=${with_tuning}"
946     else
947         CFLAGS_TUNING="-mcpu=${with_tuning}"
948     fi
949 else
950     if test "${target_cpu}" = "i686" -o "${target_cpu}" = "i586" -o "${target_cpu}" = "i486" -o "${target_cpu}" = "i386"; then CFLAGS_TUNING="-mcpu=pentiumpro"
951     else
952         if test "${target_cpu}" = "powerpc"; then CFLAGS_TUNING="-mtune=750"; fi
953     fi
954 fi
955
956 dnl
957 dnl  x86 accelerations
958 dnl
959 if test "${target_cpu}" = "i686" -o "${target_cpu}" = "i586" -o "${target_cpu}" = "x86" -o "${target_cpu}" = "i386"
960 then
961     ARCH="${ARCH} mmx"
962     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
963 fi
964
965 dnl
966 dnl  Enable/disable optimizations
967 dnl
968 AC_ARG_ENABLE(optimizations,
969 [  --disable-optimizations disable compiler optimizations (default enabled)])
970 AM_CONDITIONAL(OPTIM, test "${enable_optimizations}" != "no")
971
972 dnl
973 dnl  AltiVec acceleration
974 dnl
975 AC_ARG_ENABLE(altivec,
976 [  --disable-altivec       disable AltiVec optimizations (default enabled on PPC)],
977 [ if test "${enable_altivec}" = "yes"; then ARCH="${ARCH} altivec";
978     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
979 [ if test "${target_cpu}" = "powerpc"; then ARCH="${ARCH} altivec";
980     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
981
982 dnl
983 dnl  Debugging mode
984 dnl
985 AC_ARG_ENABLE(debug,
986 [  --enable-debug          debug mode (default disabled)])
987 AM_CONDITIONAL(DEBUG, test "${enable_debug}" = "yes")
988
989 dnl
990 dnl  Enable release-specific flags
991 dnl
992 AC_ARG_ENABLE(release,
993 [  --enable-release        activate extra optimizations (default disabled)])
994 AM_CONDITIONAL(RELEASE, test "${enable_release}" = "yes")
995
996 dnl
997 dnl Stream output
998 dnl
999 AC_ARG_ENABLE(sout,
1000   [  --enable-sout           Stream output modules (default enabled)])
1001 if test "${enable_sout}" != "no"
1002 then
1003   PLUGINS="${PLUGINS} access_output_dummy access_output_udp access_output_file access_output_http"
1004   PLUGINS="${PLUGINS} mux_ts mux_ps mux_avi mux_dummy"
1005   PLUGINS="${PLUGINS} packetizer_mpegaudio packetizer_mpegvideo packetizer_a52"
1006   PLUGINS="${PLUGINS} packetizer_mpeg4video packetizer_mpeg4audio"
1007   PLUGINS="${PLUGINS} packetizer_copy"
1008
1009   PLUGINS="${PLUGINS} stream_out_dummy stream_out_standard stream_out_es"
1010   PLUGINS="${PLUGINS} stream_out_duplicate stream_out_display"
1011
1012   dnl Ogg and vorbis are handled in their respective section
1013 fi
1014
1015
1016 dnl
1017 dnl  Input plugins
1018 dnl
1019
1020 AC_ARG_WITH(,[Input plugins:])
1021
1022 dnl
1023 dnl  DVD module: optionally check for installed libdvdcss
1024 dnl
1025 AC_ARG_ENABLE(dvd,
1026 [  --enable-dvd            DVD input module (default enabled)])
1027 if test "${enable_dvd}" != "no"
1028 then
1029   AC_ARG_WITH(dvdcss,
1030   [    --with-dvdcss=PATH    libdvdcss headers and libraries])
1031   AC_ARG_WITH(dvdcss-tree,
1032   [    --with-dvdcss-tree=PATH libdvdcss tree for static linking])
1033   case "${with_dvdcss}" in
1034   ""|yes)
1035     if test "${with_dvdcss_tree}" = ""
1036     then
1037       AC_CHECK_HEADERS(dvdcss/dvdcss.h,
1038         [ PLUGINS="${PLUGINS} dvd"
1039           LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss"
1040           LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvdcss" ],
1041         [ 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.])
1042           AC_MSG_ERROR([cannot find libdvdcss headers]) ])
1043     else
1044       AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
1045       real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
1046       if test "${real_dvdcss_tree}" = ""
1047       then
1048         dnl  The given directory can't be found
1049         AC_MSG_RESULT(no)
1050         AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
1051       fi
1052       if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
1053       then
1054         dnl  Use a custom libdvdcss
1055         AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
1056         BUILTINS="${BUILTINS} dvd"
1057         LDFLAGS_dvd="${LDFLAGS_dvd} -L${real_dvdcss_tree}/src/.libs -ldvdcss"
1058         LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${real_dvdcss_tree}/src/.libs -ldvdcss"
1059         CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${real_dvdcss_tree}/src"
1060       else
1061         dnl  The given libdvdcss wasn't built
1062         AC_MSG_RESULT(no)
1063         AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
1064       fi
1065     fi
1066   ;;
1067   no)
1068     dnl  Compile without dvdcss (dlopen version, works only under Linux)
1069     PLUGINS="${PLUGINS} dvd"
1070     CPPFLAGS_dvd="${CPPFLAGS_dvd} -DGOD_DAMN_DMCA"
1071     LDFLAGS_dvd="${LDFLAGS_dvd} -ldl"
1072   ;;
1073   *)
1074     AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
1075     if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
1076     then
1077       dnl  Use ${with_dvdcss}/include/dvdcss/dvdcss.h
1078       AC_MSG_RESULT(yes)
1079       PLUGINS="${PLUGINS} dvd"
1080       LDFLAGS_dvd="${LDFLAGS_dvd} -L${with_dvdcss}/lib -ldvdcss"
1081       LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${with_dvdcss}/lib -ldvdcss"
1082       CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${with_dvdcss}/include"
1083     else
1084       dnl  No libdvdcss could be found, sorry
1085       AC_MSG_RESULT(no)
1086       AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
1087     fi
1088   ;;
1089   esac
1090 fi
1091
1092 dnl
1093 dnl dvdread module: check for libdvdread
1094 dnl
1095 AC_ARG_ENABLE(dvdread,
1096 [  --enable-dvdread        dvdread input module (default disabled)])
1097 if test "${enable_dvdread}" != "no"
1098 then
1099   AC_ARG_WITH(dvdread,
1100   [    --with-dvdread=PATH    libdvdread headers and libraries])
1101   AC_ARG_WITH(dvdread-tree,
1102   [    --with-dvdread-tree=PATH libdvdread tree for static linking])
1103   if test "${with_dvdread}" = ""
1104   then
1105     if test "${with_dvdread_tree}" = ""
1106     then
1107       AC_CHECK_HEADERS(dvdread/dvd_reader.h,
1108         [ PLUGINS="${PLUGINS} dvdread"
1109           LDFLAGS_dvdread="${LDFLAGS_dvdread} -ldvdread ${LDFLAGS_dvdcss}" ],
1110         [ if test "${enable_dvdread}" != ""
1111           then
1112             AC_MSG_WARN([Please get libdvdread from http://www.dtek.chalmers.se/groups/dvd/downloads.shtml])
1113             AC_MSG_ERROR([cannot find libdvdread headers])
1114           fi ])
1115     else
1116       AC_MSG_CHECKING(for libdvdread.a in ${with_dvdread_tree})
1117       real_dvdread_tree="`cd ${with_dvdread_tree} 2>/dev/null && pwd`"
1118       if test "${real_dvdread_tree}" = ""
1119       then
1120         dnl  The given directory can't be found
1121         AC_MSG_RESULT(no)
1122         AC_MSG_ERROR([cannot cd to ${with_dvdread_tree}])
1123       fi
1124       if test -f "${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
1125       then
1126         dnl  Use a custom libdvdread
1127         AC_MSG_RESULT(${real_dvdread_tree}/dvdread/.libs/libdvdread.a)
1128         BUILTINS="${BUILTINS} dvdread"
1129         LDFLAGS_dvdread="${LDFLAGS_dvdread} -L${real_dvdread_tree}/dvdread/.libs -ldvdread ${LDFLAGS_dvdcss}"
1130         CPPFLAGS_dvdread="${CPPFLAGS_dvdread} -I${real_dvdread_tree}"
1131       else
1132         dnl  The given libdvdread wasn't built
1133         AC_MSG_RESULT(no)
1134         AC_MSG_ERROR([cannot find ${real_dvdread_tree}/dvdread/.libs/libdvdread.a, make sure you compiled libdvdread in ${with_dvdread_tree}])
1135       fi
1136     fi
1137   else
1138     AC_MSG_CHECKING(for dvdread headers in ${with_dvdread})
1139     if test -f ${with_dvdread}/include/dvdread/dvd_reader.h
1140     then
1141       dnl  Use ${with_dvdread}/include/dvdread/dvd_reader.h
1142       AC_MSG_RESULT(yes)
1143       PLUGINS="${PLUGINS} dvdread"
1144       LDFLAGS_dvdread="${LDFLAGS_dvdread} -L${with_dvdread}/lib -ldvdread ${LDFLAGS_dvdcss}"
1145       CPPFLAGS_dvdread="${CPPFLAGS_dvdread} -I${with_dvdread}/include"
1146     else
1147       dnl  No libdvdread could be found, sorry
1148       AC_MSG_RESULT(no)
1149       AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
1150     fi
1151   fi
1152 fi
1153
1154 dnl
1155 dnl dvdplay module: check for libdvdplay
1156 dnl
1157 AC_ARG_ENABLE(dvdplay,
1158 [  --enable-dvdplay        dvdplay input module (default enabled)])
1159 if test "${enable_dvdplay}" != "no"
1160 then
1161   AC_ARG_WITH(dvdplay,
1162   [    --with-dvdplay=PATH    libdvdplay headers and libraries])
1163   AC_ARG_WITH(dvdplay-tree,
1164   [    --with-dvdplay-tree=PATH libdvdplay tree for static linking])
1165   if test "${with_dvdplay}" = ""
1166   then
1167     if test "${with_dvdplay_tree}" = ""
1168     then
1169       AC_CHECK_HEADERS(dvdplay/dvdplay.h,
1170         [ PLUGINS="${PLUGINS} dvdplay"
1171           LDFLAGS_dvdplay="${LDFLAGS_dvdplay} -ldvdplay ${LDFLAGS_dvdread} ${LDFLAGS_dvdcss}"
1172           CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread}" ],
1173         [ if test "${enable_dvdplay}" != ""
1174           then
1175             AC_MSG_WARN([Please get libdvdplay from http://www.videolan.org/.])
1176             AC_MSG_ERROR([cannot find libdvdplay headers])
1177           fi ])
1178     else
1179       AC_MSG_CHECKING(for libdvdplay.a in ${with_dvdplay_tree})
1180       real_dvdplay_tree="`cd ${with_dvdplay_tree} 2>/dev/null && pwd`"
1181       if test "${real_dvdplay_tree}" = ""
1182       then
1183         dnl  The given directory can't be found
1184         AC_MSG_RESULT(no)
1185         AC_MSG_ERROR([cannot cd to ${with_dvdplay_tree}])
1186       fi
1187       if test -f "${real_dvdplay_tree}/src/.libs/libdvdplay.a"
1188       then
1189         dnl  Use a custom libdvdplay
1190         AC_MSG_RESULT(${real_dvdplay_tree}/src/.libs/libdvdplay.a)
1191         BUILTINS="${BUILTINS} dvdplay"
1192         LDFLAGS_dvdplay="${LDFLAGS_dvdplay} -L${real_dvdplay_tree}/src/.libs -ldvdplay ${LDFLAGS_dvdread} ${LDFLAGS_dvdcss}"
1193         CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread} -I${real_dvdplay_tree}/src"
1194       else
1195         dnl  The given libdvdplay wasn't built
1196         AC_MSG_RESULT(no)
1197         AC_MSG_ERROR([cannot find ${real_dvdplay_tree}/src/.libs/libdvdplay.a, make sure you compiled libdvdplay in ${with_dvdplay_tree}])
1198       fi
1199     fi
1200   else
1201     AC_MSG_CHECKING(for dvdplay headers in ${with_dvdplay})
1202     if test -f ${with_dvdplay}/include/dvdplay/dvdplay.h
1203     then
1204       dnl  Use ${with_dvdplay}/include/dvdplay/dvdplay.h
1205       AC_MSG_RESULT(yes)
1206       PLUGINS="${PLUGINS} dvdplay"
1207       LDFLAGS_dvdplay="${LDFLAGS_dvdplay} -L${with_dvdplay}/lib -ldvdplay ${LDFLAGS_dvdread} ${LDFLAGS_dvdcss}"
1208       CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread} -I${with_dvdplay}/include"
1209     else
1210       dnl  No libdvdplay could be found, sorry
1211       AC_MSG_RESULT(no)
1212       AC_MSG_ERROR([cannot find ${with_dvdplay}/include/dvdplay/dvdplay.h])
1213     fi
1214   fi
1215 fi
1216
1217 dnl
1218 dnl  libdvbpsi ts demux/mux
1219 dnl
1220 AC_ARG_ENABLE(dvbpsi,
1221 [  --enable-dvbpsi         dvbpsi ts mux and demux module (default enabled)])
1222 if test "${enable_dvbpsi}" != "no"
1223 then
1224   AC_ARG_WITH(dvbpsi,
1225   [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
1226   AC_ARG_WITH(dvbpsi,
1227   [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
1228   case "${with_dvbpsi}" in
1229   ""|yes)
1230     if test "${with_dvbpsi_tree}" = ""
1231     then
1232       AC_CHECK_HEADERS(dvbpsi/dr.h,
1233         [ PLUGINS="${PLUGINS} ts_dvbpsi"
1234           LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} -ldvbpsi" 
1235           PLUGINS="${PLUGINS} mux_ts_dvbpsi"
1236           LDFLAGS_mux_ts_dvbpsi="${LDFLAGS_mux_ts_dvbpsi} -ldvbpsi" ],
1237         [  AC_MSG_WARN([cannot find libdvbpsi headers]) ],
1238         [#if defined( HAVE_STDINT_H )
1239 #   include <stdint.h>
1240 #elif defined( HAVE_INTTYPES_H )
1241 #   include <inttypes.h>
1242 #endif
1243 #include <dvbpsi/dvbpsi.h>
1244 #include <dvbpsi/descriptor.h>
1245 #include <dvbpsi/pat.h>
1246 #include <dvbpsi/pmt.h>])
1247     else
1248       AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
1249       real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
1250       if test "${real_dvbpsi_tree}" = ""
1251       then
1252         dnl  The given directory can't be found
1253         AC_MSG_RESULT(no)
1254         AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
1255       fi
1256       if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
1257       then
1258         dnl  Use a custom libdvbpsi
1259         AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
1260         BUILTINS="${BUILTINS} ts_dvbpsi"
1261         LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} -L${real_dvbpsi_tree}/src/.libs -ldvbpsi"
1262         CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} -I${real_dvbpsi_tree}/src"
1263
1264         BUILTINS="${BUILTINS} mux_ts_dvbpsi"
1265         LDFLAGS_mux_ts_dvbpsi="${LDFLAGS_mux_ts_dvbpsi} -L${real_dvbpsi_tree}/src/.libs -ldvbpsi"
1266         CPPFLAGS_mux_ts_dvbpsi="${CPPFLAGS_mux_ts_dvbpsi} -I${real_dvbpsi_tree}/src"
1267
1268       else
1269         dnl  The given libdvbpsi wasn't built
1270         AC_MSG_RESULT(no)
1271         AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
1272       fi
1273     fi
1274   ;;
1275   no)
1276     dnl  Compile without dvbpsi
1277   ;;
1278   *)
1279     AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
1280     if test "${with_dvbpsi}" = ""
1281     then
1282       LDFLAGS_test=""
1283       CPPFLAGS_test=""
1284     else
1285       LDFLAGS_test="-L${with_dvbpsi}/lib"
1286       CPPFLAGS_test="-I${with_dvbpsi}/include"
1287     fi
1288     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1289     AC_CHECK_HEADER([dvbpsi/dr.h],[
1290       PLUGINS="${PLUGINS} ts_dvbpsi"
1291       LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${LDFLAGS_test} -ldvbpsi"
1292       CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} ${CPPFLAGS_test}"
1293       PLUGINS="${PLUGINS} mux_ts_dvbpsi"
1294       LDFLAGS_mux_ts_dvbpsi="${LDFLAGS_mux_ts_dvbpsi} ${LDFLAGS_test} -ldvbpsi"
1295       CPPFLAGS_mux_ts_dvbpsi="${CPPFLAGS_mux_ts_dvbpsi} ${CPPFLAGS_test}"
1296
1297       ],[
1298       if test "${enable_dvbpsi}" != ""
1299       then
1300         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])
1301       fi
1302     ])
1303     CPPFLAGS="${CPPFLAGS_save}"
1304   ;;
1305   esac
1306 fi
1307
1308 dnl
1309 dnl  Video4Linux plugin
1310 dnl
1311 AC_ARG_ENABLE(v4l,
1312   [  --enable-v4l            Video4Linux input support (default disabled)])
1313 if test "${enable_v4l}" = "yes"
1314 then
1315   AC_CHECK_HEADERS(linux/videodev.h, [
1316     PLUGINS="${PLUGINS} v4l"
1317    ],[])
1318 fi
1319
1320 dnl
1321 dnl  special access module for Hauppauge PVR cards
1322 dnl
1323 AC_ARG_ENABLE(pvr,
1324   [  --enable-pvr            PVR cards access module (default disabled)])
1325 if test "${enable_pvr}" = "yes"
1326 then
1327   PLUGINS="${PLUGINS} pvr"
1328 fi
1329
1330 dnl
1331 dnl  VCD module
1332 dnl
1333 AC_ARG_ENABLE(vcd,
1334   [  --enable-vcd            VCD support for Linux, FreeBSD, MacOS X and Win32 (default enabled)])
1335
1336 if test "${enable_vcd}" != "no"
1337 then
1338   AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1339   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1340     AC_MSG_RESULT(yes)
1341     PLUGINS="${PLUGINS} vcd cdda"
1342   ],[
1343     AC_MSG_RESULT(no)
1344   ])
1345
1346   AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1347   AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1348     AC_MSG_RESULT(yes)
1349     PLUGINS="${PLUGINS} vcd cdda"
1350     AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1351   ],[
1352     AC_MSG_RESULT(no)
1353   ])
1354
1355   AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1356   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1357     AC_MSG_RESULT(yes)
1358     PLUGINS="${PLUGINS} vcd cdda"
1359     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1360   ],[
1361     AC_MSG_RESULT(no)
1362   ])
1363
1364   if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32"
1365   then
1366     PLUGINS="${PLUGINS} vcd cdda"
1367   fi
1368
1369   if test "${SYS}" = "darwin"
1370   then
1371     PLUGINS="${PLUGINS} vcd cdda"
1372     LDFLAGS_vcd="${LDFLAGS_vcd} -framework IOKit -framework CoreFoundation"
1373     LDFLAGS_cdda="${LDFLAGS_cdda} -framework IOKit -framework CoreFoundation"
1374   fi
1375 fi
1376
1377 dnl
1378 dnl  Satellite input module
1379 dnl
1380 AC_ARG_ENABLE(satellite,
1381   [  --enable-satellite      satellite card support (default disabled)],
1382   [ if test "${enable_satellite}" = "yes"
1383     then
1384       PLUGINS="${PLUGINS} satellite"
1385     fi])
1386
1387 dnl
1388 dnl  ipv6 plugin - not for QNX yet
1389 dnl
1390 if test "${SYS}" != "nto" && test "${SYS}" != "mingw32"
1391 then
1392   have_ipv6=false
1393   AC_CHECK_FUNCS(inet_pton,[have_ipv6=:],[
1394     AC_CHECK_LIB(resolv,inet_pton,
1395       [have_ipv6=:
1396        LDFLAGS_ipv6="${LDFLAGS_ipv6} -lresolv"])
1397   ])
1398   AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
1399   AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
1400     [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=false])
1401   if ${have_ipv6}; then
1402     PLUGINS="${PLUGINS} ipv6"
1403   fi
1404 fi
1405 if test "${SYS}" = "mingw32"
1406 then
1407   AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
1408   AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
1409     PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
1410 fi
1411
1412 dnl
1413 dnl  ogg demux plugin
1414 dnl
1415 AC_ARG_ENABLE(ogg,
1416   [  --enable-ogg            Ogg demux support (default enabled)])
1417 if test "${enable_ogg}" != "no"
1418 then
1419   AC_CHECK_HEADERS(ogg/ogg.h, [
1420     AC_CHECK_LIB( ogg, oggpack_read, [
1421       PLUGINS="${PLUGINS} ogg"
1422       LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
1423       AC_CHECK_LIB( ogg, oggpackB_read, [
1424         CPPFLAGS_ogg="${CPPFLAGS_ogg} -DHAVE_OGGPACKB"])
1425       PLUGINS="${PLUGINS} mux_ogg"
1426       LDFLAGS_mux_ogg="${LDFLAGS_mux_ogg} -logg"])
1427    ],[])
1428 fi
1429
1430 dnl
1431 dnl  matroska demux plugin
1432 dnl
1433 AC_ARG_ENABLE(mkv,
1434   [  --enable-mkv            Matroska demux support (default disabled)])
1435 if test "${enable_mkv}" = "yes"
1436 then
1437 AC_LANG_PUSH(C++)
1438   dnl matroska headers include ebml headers directly... pouah that stinks
1439   AC_CHECK_HEADERS(EbmlVersion.h matroska/KaxVersion.h, [
1440     PLUGINS="${PLUGINS} mkv"
1441     CXXFLAGS_mkv="${CXXFLAGS_mkv}"
1442     LDFLAGS_mkv="${LDFLAGS_mkv} -lmatroska -lebml"
1443    ],[])
1444 AC_LANG_POP(C++)
1445 fi
1446
1447 dnl
1448 dnl  Codec plugins
1449 dnl
1450
1451 AC_ARG_WITH(,[Codec plugins:])
1452
1453 dnl
1454 dnl  mad plugin
1455 dnl
1456 AC_ARG_ENABLE(mad,
1457   [  --enable-mad            libmad module (default enabled)])
1458 if test "${enable_mad}" != "no"
1459 then
1460   AC_ARG_WITH(mad,
1461     [    --with-mad=PATH       path to libmad],[],[])
1462   if test "${with_mad}" != "no" -a "${with_mad}" != ""
1463   then
1464     CPPFLAGS_mpgatofixed32="${CPPFLAGS_mpgatofixed32} -I${with_mad}/include"
1465     LDFLAGS_mpgatofixed32="${LDFLAGS_mpgatofixed32} -L${with_mad}/lib"
1466   fi
1467
1468   AC_ARG_WITH(mad-tree,
1469     [    --with-mad-tree=PATH  mad tree for static linking],[],[])
1470   if test "${with_mad_tree}" != "no" -a "${with_mad_tree}" != ""
1471   then
1472     real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
1473     if test "${real_mad_tree}" = ""
1474     then
1475       dnl  The given directory can't be found
1476       AC_MSG_RESULT(no)
1477       AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
1478     fi
1479     dnl  Use a custom libmad
1480     AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
1481     if test -f ${real_mad_tree}/libmad/mad.h
1482     then
1483       AC_MSG_RESULT(yes)
1484       CPPFLAGS_mpgatofixed32="${CPPFLAGS_mpgatofixed32} -I${real_mad_tree}/libmad"
1485       LDFLAGS_mpgatofixed32="${LDFLAGS_mpgatofixed32} -L${real_mad_tree}/libmad/.libs"
1486       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mpgatofixed32}"
1487       AC_CHECK_LIB(mad, mad_bit_init, [
1488         BUILTINS="${BUILTINS} mpgatofixed32"
1489         LDFLAGS_mpgatofixed32="${LDFLAGS_mpgatofixed32} -lmad"
1490         ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
1491       ],[])
1492       LDFLAGS="${LDFLAGS_save}"
1493     else
1494       AC_MSG_RESULT(no)
1495       AC_MSG_ERROR([the specified tree doesn't have mad.h])
1496     fi
1497   else
1498     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mpgatofixed32}"
1499     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mpgatofixed32}"
1500     AC_CHECK_HEADERS(mad.h, ,
1501       [ AC_MSG_ERROR([Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin.]) ])
1502     AC_CHECK_LIB(mad, mad_bit_init, [
1503       PLUGINS="${PLUGINS} mpgatofixed32"
1504       LDFLAGS_mpgatofixed32="${LDFLAGS_mpgatofixed32} -lmad" ],
1505       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1506     CPPFLAGS="${CPPFLAGS_save}"
1507     LDFLAGS="${LDFLAGS_save}"
1508   fi
1509 fi
1510
1511 dnl
1512 dnl   libid3tag support
1513 dnl
1514 AC_CHECK_HEADERS(id3tag.h, [
1515   AC_CHECK_HEADERS(zlib.h, [
1516     LDFLAGS_id3tag="${LDFLAGS_id3tag} -lid3tag -lz"
1517     PLUGINS="${PLUGINS} id3tag"]) ])
1518
1519 dnl
1520 dnl  ffmpeg decoder plugin
1521 dnl
1522 AC_ARG_ENABLE(ffmpeg,
1523 [  --enable-ffmpeg         ffmpeg codec (default enabled)])
1524 if test "${enable_ffmpeg}" != "no"
1525 then
1526   AC_ARG_WITH(ffmpeg-tree,
1527     [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1528
1529   dnl
1530   dnl test for !(--with-ffmpeg-tree)
1531   dnl
1532   if test "${with_ffmpeg_tree}" == "no" -o "${with_ffmpeg_tree}" == "";then
1533     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
1534     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
1535     AC_CHECK_HEADERS(ffmpeg/avcodec.h postproc/postprocess.h)
1536     AC_CHECK_LIB(avcodec, avcodec_init, [
1537       BUILTINS="${BUILTINS} ffmpeg stream_out_transcode"
1538       LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec"
1539       dnl  XXX: we don't link with -lavcodec a 2nd time because the OS X
1540       dnl       linker would miserably barf on multiple definitions.
1541       LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode}" ],
1542        [ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (cvs version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ])
1543     LDFLAGS="${LDFLAGS_save}"
1544     CPPFLAGS="${CPPFLAGS_save}"
1545   fi
1546
1547   dnl
1548   dnl test for --with-ffmpeg-tree
1549   dnl
1550   if test "${with_ffmpeg_tree}" != "no" -a "${with_ffmpeg_tree}" != "";then
1551     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1552     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1553     if test "${real_ffmpeg_tree}" = ""; then
1554       dnl  The given directory can't be found
1555       AC_MSG_RESULT(no)
1556       AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1557     fi
1558     if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
1559       dnl  Use a custom libffmpeg
1560       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1561       BUILTINS="${BUILTINS} ffmpeg stream_out_transcode"
1562       LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${real_ffmpeg_tree}/libavcodec -lavcodec"
1563       CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${real_ffmpeg_tree}/libavcodec"
1564
1565       dnl  XXX: we don't link with -lavcodec a 2nd time because the OS X
1566       dnl       linker would miserably barf on multiple definitions.
1567       LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -L${real_ffmpeg_tree}/libavcodec"
1568       CPPFLAGS_stream_out_transcode="${CPPFLAGS_stream_out_transcode} -I${real_ffmpeg_tree}/libavcodec"
1569     else
1570       dnl  The given libavcodec wasn't built
1571       AC_MSG_RESULT(no)
1572       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1573     fi
1574   fi
1575
1576   dnl Duplicate the ffmpeg CPPFLAGS and LDFLAGS for the encoder
1577   CPPFLAGS_encoder_ffmpeg="${CPPFLAGS_ffmpeg}"
1578   dnl XXX: we don't link with -lavcodec blah blah blah
1579   #LDFLAGS_encoder_ffmpeg="${LDFLAGS_ffmpeg}"
1580 fi
1581
1582 dnl
1583 dnl  faad decoder plugin
1584 dnl
1585 AC_ARG_ENABLE(faad,
1586 [  --enable-faad           faad codec (default disabled)])
1587 if test "${enable_faad}" = "yes"
1588 then
1589   AC_ARG_WITH(faad-tree,
1590   [    --with-faad-tree=PATH faad tree for static linking])
1591   if test "${with_faad_tree}" != ""
1592   then
1593     AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1594     real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1595     if test "${real_faad_tree}" = ""
1596     then
1597       dnl  The given directory can't be found
1598       AC_MSG_RESULT(no)
1599       AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1600     fi
1601     if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1602     then
1603       dnl  Use a custom faad
1604       AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1605       BUILTINS="${BUILTINS} faad"
1606       LDFLAGS_faad="${LDFLAGS_faad} -L${real_faad_tree}/libfaad/.libs -lfaad"
1607       CPPFLAGS_faad="${CPPFLAGS_faad} -I${real_faad_tree}/include"
1608       CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
1609       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1610       AC_TRY_COMPILE([#include <faad.h>],
1611         [faacDecHandle a; faacDecFrameInfo *b; unsigned char *c;
1612          unsigned long d; faacDecDecode(a,b,c,d);],
1613         [], [AC_DEFINE(HAVE_OLD_FAAD2, 1, Define if FAAD2 < 1.2)])
1614       LDFLAGS="${LDFLAGS_save}"
1615       CPPFLAGS="${CPPFLAGS_save}"
1616     else
1617       dnl  The given libfaad wasn't built
1618       AC_MSG_RESULT(no)
1619       AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1620     fi
1621   else
1622     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
1623     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1624     AC_CHECK_HEADERS(faad.h, ,
1625       [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1626     AC_CHECK_LIB(faad, faacDecOpen, [
1627       PLUGINS="${PLUGINS} faad"
1628       LDFLAGS_faad="${LDFLAGS_faad} -lfaad"
1629       AC_TRY_COMPILE([#include <faad.h>],
1630         [faacDecHandle a; faacDecFrameInfo *b; unsigned char *c;
1631          unsigned long d; faacDecDecode(a,b,c,d);],
1632         [], [AC_DEFINE(HAVE_OLD_FAAD2, 1, Define if FAAD2 < 1.2)]) ],
1633       [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1634     LDFLAGS="${LDFLAGS_save}"
1635     CPPFLAGS="${CPPFLAGS_save}"
1636   fi
1637 fi
1638
1639
1640 dnl
1641 dnl  xvid decoder plugin
1642 dnl
1643 AC_ARG_ENABLE(xvid,
1644 [  --enable-xvid           xvid codec (default disabled)])
1645 if test "${enable_xvid}" = "yes"
1646 then
1647   AC_ARG_WITH(xvid,
1648     [    --with-xvid=PATH      path to xvid installation],[],[])
1649   if test "${with_xvid}" != "no" -a "${with_xvid}" != ""
1650   then
1651     CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${with_xvid}/include"
1652     LDFLAGS_xvid="${LDFLAGS_xvid} -L${with_xvid}/lib"
1653   fi
1654   LDFLAGS_xvid="${LDFLAGS_xvid}"
1655
1656   AC_ARG_WITH(xvid-tree,
1657   [    --with-xvid-tree=PATH xvid tree for static linking])
1658   if test "${with_xvid_tree}" != ""
1659   then
1660     AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
1661     real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
1662     if test "${real_xvid_tree}" = ""
1663     then
1664       dnl  The given directory can't be found
1665       AC_MSG_RESULT(no)
1666       AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
1667     fi
1668     if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
1669     then
1670       dnl  Use a custom xvid
1671       AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
1672       BUILTINS="${BUILTINS} xvid"
1673       LDFLAGS_xvid="${LDFLAGS_xvid} -L${real_xvid_tree}/build/generic -lxvidcore"
1674       CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${real_xvid_tree}/src"
1675     else
1676       dnl  The given libxvidcore wasn't built
1677       AC_MSG_RESULT(no)
1678       AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
1679     fi
1680   else
1681     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
1682     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
1683     AC_CHECK_HEADERS(xvid.h, ,
1684       [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
1685     AC_CHECK_LIB(xvidcore, xvid_init, [
1686       PLUGINS="${PLUGINS} xvid"
1687       LDFLAGS_xvid="${LDFLAGS_xvid} -lxvidcore" ],
1688       [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
1689     LDFLAGS="${LDFLAGS_save}"
1690     CPPFLAGS="${CPPFLAGS_save}"
1691   fi
1692
1693   dnl Duplicate the xvid CPPFLAGS and LDFLAGS for the encoder
1694   LDFLAGS_encoder_xvid=${LDFLAGS_xvid}
1695   CPPFLAGS_encoder_xvid=${CPPFLAGS_xvid}
1696 fi
1697
1698 dnl
1699 dnl  QuickTime plugin
1700 dnl
1701 AC_ARG_ENABLE(quicktime,
1702   [  --enable-quicktime      QuickTime module (default enabled on MacOS X)])
1703 if test "${enable_quicktime}" != "no" &&
1704   (test "${SYS}" = "darwin" || test "${enable_quicktime}" = "yes")
1705 then
1706   AC_CHECK_HEADERS(QuickTime/QuickTime.h,
1707     [ BUILTINS="${BUILTINS} quicktime"
1708       LDFLAGS_quicktime="${LDFLAGS_quicktime} -framework QuickTime -framework Carbon"
1709     ], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
1710 fi
1711
1712 dnl
1713 dnl MP4 module
1714 dnl
1715 AC_CHECK_HEADERS(zlib.h, [
1716   LDFLAGS_mp4="${LDFLAGS_mp4} -lz"
1717   LDFLAGS_skins="${LDFLAGS_skins} -lz"
1718   LDFLAGS_basic_skins="${LDFLAGS_basic_skins} -lz"
1719 ] )
1720
1721
1722 dnl
1723 dnl skins module
1724 dnl
1725 AC_CHECK_HEADERS(libtar.h, [
1726   LDFLAGS_skins="${LDFLAGS_skins} -ltar"
1727   LDFLAGS_basic_skins="${LDFLAGS_basic_skins} -ltar"
1728 ] )
1729
1730
1731
1732 dnl
1733 dnl  a52 AC3 decoder plugin
1734 dnl
1735 AC_ARG_ENABLE(a52,
1736   [  --enable-a52            A/52 support with liba52 (default enabled)])
1737 if test "${enable_a52}" != "no"
1738 then
1739   AC_ARG_WITH(a52,
1740     [    --with-a52=PATH       a52 headers and libraries])
1741   AC_ARG_WITH(a52-tree,
1742     [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
1743   if test "${with_a52_tree}" != "no" -a "${with_a52_tree}" != ""
1744   then
1745     real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1746     if test "${real_a52_tree}" = ""
1747     then
1748       dnl  The given directory can't be found
1749       AC_MSG_RESULT(no)
1750       AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1751     fi
1752     dnl  Use a custom a52dec
1753     AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1754     if test -f ${real_a52_tree}/include/a52.h
1755     then
1756       AC_MSG_RESULT(yes)
1757       CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -I${real_a52_tree}"
1758       LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -L${real_a52_tree}/liba52/.libs"
1759       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_a52tofloat32}"
1760       AC_CHECK_LIB(a52, a52_free, [
1761         BUILTINS="${BUILTINS} a52tofloat32"
1762         LDFLAGS_a52tofloat32="-la52 ${LDFLAGS_a52tofloat32}"
1763         CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -DUSE_A52DEC_TREE"
1764         ],[
1765         if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1766         then
1767           AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1768         else
1769           AC_MSG_ERROR([the specified tree hasn't been compiled])
1770         fi
1771       ])
1772       LDFLAGS="${LDFLAGS_save}"
1773     else
1774       AC_MSG_RESULT(no)
1775       AC_MSG_ERROR([the specified tree doesn't have a52.h])
1776     fi
1777   else
1778     if test "${with_a52}" = ""
1779     then
1780       LDFLAGS_test=""
1781       CPPFLAGS_test=""
1782     else
1783       LDFLAGS_test="-L${with_a52}/lib"
1784       CPPFLAGS_test="-I${with_a52}/include"
1785     fi
1786     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
1787     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test} ${LDFLAGS_a52tofloat32}"
1788     AC_CHECK_HEADERS(a52dec/a52.h, [
1789       AC_CHECK_LIB(a52, a52_free, [
1790         PLUGINS="${PLUGINS} a52tofloat32"
1791         LDFLAGS_a52tofloat32="${LDFLAGS_test} -la52 ${LDFLAGS_a52tofloat32}"
1792         CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} ${CPPFLAGS_test}"
1793       ],[
1794         AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
1795       ])
1796     ])
1797     CPPFLAGS="${CPPFLAGS_save}"
1798     LDFLAGS="${LDFLAGS_save}"
1799   fi
1800 fi
1801
1802 dnl
1803 dnl  DV plugin
1804 dnl
1805 AC_ARG_ENABLE(dv,
1806   [  --enable-dv             DV decoder support (deprecated in favor of ffmpeg) (default disabled)])
1807 if test "${enable_dv}" = "yes"
1808 then
1809   AC_CHECK_HEADERS(libdv/dv.h, [
1810     PLUGINS="${PLUGINS} dv"
1811     LDFLAGS_dv="${LDFLAGS_dv} -ldv"
1812    ],[])
1813 fi
1814
1815 dnl
1816 dnl  Flac plugin
1817 dnl
1818 AC_ARG_ENABLE(flac,
1819   [  --enable-flac           flac decoder support (default disabled)])
1820 if test "${enable_flac}" = "yes"
1821 then
1822   AC_CHECK_HEADERS(FLAC/stream_decoder.h, [
1823     PLUGINS="${PLUGINS} flac flacdec"
1824     LDFLAGS_flacdec="${LDFLAGS_flacdec} -lFLAC"
1825    ],[])
1826 fi
1827
1828 dnl
1829 dnl  Libmpeg2 plugin
1830 dnl
1831 AC_ARG_ENABLE(libmpeg2,
1832   [  --enable-libmpeg2       libmpeg2 decoder support (default enabled)])
1833 if test "${enable_libmpeg2}" != "no"
1834 then
1835   AC_ARG_WITH(libmpeg2-tree,
1836   [    --with-libmpeg2-tree=PATH libmpeg2 tree for static linking])
1837   if test "${with_libmpeg2_tree}" != ""
1838   then
1839     AC_MSG_CHECKING(for libmpeg2.a in ${with_libmpeg2_tree})
1840     real_libmpeg2_tree="`cd ${with_libmpeg2_tree} 2>/dev/null && pwd`"
1841     if test "${real_libmpeg2_tree}" = ""
1842     then
1843       dnl  The given directory can't be found
1844       AC_MSG_RESULT(no)
1845       AC_MSG_ERROR([cannot cd to ${with_libmpeg2_tree}])
1846     fi
1847     if test -f "${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a"
1848     then
1849       dnl  Use a custom libmpeg2
1850       AC_MSG_RESULT(${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a)
1851       PLUGINS="${PLUGINS} libmpeg2"
1852       LDFLAGS_libmpeg2="${LDFLAGS_libmpeg2} -L${real_libmpeg2_tree}/libmpeg2/.libs -lmpeg2"
1853       CFLAGS_libmpeg2="${CFLAGS_libmpeg2} -I${real_libmpeg2_tree}/include"
1854       eval "`cd ${real_libmpeg2_tree}/include && ln -sf . mpeg2dec 2>/dev/null`"
1855     else
1856       dnl  The given libmpeg2 wasn't built
1857       AC_MSG_RESULT(no)
1858       AC_MSG_ERROR([cannot find ${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a, make sure you compiled libmpeg2 in ${with_libmpeg2_tree}])
1859     fi
1860   else
1861     AC_CHECK_HEADERS(mpeg2dec/mpeg2.h, [
1862       AC_MSG_CHECKING(for libmpeg2 version >= 0.3.2)
1863       AC_EGREP_CPP(yes,
1864         [#include <mpeg2dec/mpeg2.h>
1865          #ifdef MPEG2_RELEASE
1866          #if MPEG2_RELEASE >= MPEG2_VERSION(0,3,2)
1867          yes
1868          #endif
1869          #endif],
1870         [AC_MSG_RESULT([yes])
1871           PLUGINS="${PLUGINS} libmpeg2"
1872           LDFLAGS_libmpeg2="${LDFLAGS_libmpeg2} -lmpeg2"],
1873         [AC_MSG_RESULT([no])
1874           AC_MSG_ERROR([Your libmpeg2 is too old (you need the cvs version): you may get a more recent one from http://libmpeg2.sf.net/. Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])])],
1875
1876       [AC_MSG_ERROR([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ (you need the cvs version). Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])]
1877     )
1878   fi
1879 fi
1880
1881 dnl
1882 dnl  Vorbis plugin
1883 dnl
1884 AC_ARG_ENABLE(vorbis,
1885   [  --enable-vorbis         Vorbis decoder support (default enabled)])
1886 if test "${enable_vorbis}" != "no"
1887 then
1888   AC_CHECK_HEADERS(vorbis/codec.h, [
1889     PLUGINS="${PLUGINS} vorbis"
1890     LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
1891     if test "${enable_sout}" != "no"; then
1892       PLUGINS="${PLUGINS} packetizer_vorbis"
1893       LDFLAGS_packetizer_vorbis="${LDFLAGS_packetizer_vorbis} -lvorbis -logg"
1894     fi ],[])
1895 fi
1896
1897 dnl
1898 dnl  Tremor plugin
1899 dnl
1900 AC_ARG_ENABLE(tremor,
1901   [  --enable-tremor         Tremor decoder support (default disabled)])
1902 if test "${enable_tremor}" = "yes"
1903 then
1904   AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
1905     PLUGINS="${PLUGINS} tremor"
1906     LDFLAGS_tremor="${LDFLAGS_tremor} -lvorbisidec -logg"
1907    ],[])
1908 fi
1909
1910 dnl
1911 dnl  tarkin decoder plugin
1912 dnl
1913 AC_ARG_ENABLE(tarkin,
1914 [  --enable-tarkin         experimental tarkin codec (default disabled)])
1915 if test "${enable_tarkin}" = "yes"
1916 then
1917   AC_ARG_WITH(tarkin-tree,
1918   [    --with-tarkin-tree=PATH tarkin tree for static linking])
1919   if test "${with_tarkin_tree}" != ""
1920   then
1921     AC_MSG_CHECKING(for tarkin.o in ${with_tarkin_tree})
1922     real_tarkin_tree="`cd ${with_tarkin_tree} 2>/dev/null && pwd`"
1923     if test -f "${real_tarkin_tree}/tarkin.o"
1924     then
1925       BUILTINS="${BUILTINS} tarkin"
1926       CPPFLAGS_tarkin="${CPPFLAGS_tarkin} -I${real_tarkin_tree}"
1927       LDFLAGS_tarkin="${LDFLAGS_tarkin} ${real_tarkin_tree}/mem.o ${real_tarkin_tree}/pnm.o ${real_tarkin_tree}/wavelet.o ${real_tarkin_tree}/wavelet_xform.o ${real_tarkin_tree}/wavelet_coeff.o ${real_tarkin_tree}/yuv.o ${real_tarkin_tree}/tarkin.o ${real_tarkin_tree}/info.o -logg"
1928       AC_MSG_RESULT(yes)
1929     else
1930       dnl  The given tarkin tree wasn't built
1931       AC_MSG_RESULT(no)
1932       AC_MSG_ERROR([cannot find ${real_tarkin_tree}/tarkin.o,
1933                     make sure you compiled tarkin in ${with_tarkin_tree}])
1934     fi
1935   fi
1936 fi
1937
1938 dnl
1939 dnl  theora decoder plugin
1940 dnl
1941 AC_ARG_ENABLE(theora,
1942 [  --enable-theora         experimental theora codec (default disabled)])
1943 if test "${enable_theora}" = "yes"
1944 then
1945   AC_CHECK_HEADERS(theora/theora.h, [
1946     AC_CHECK_LIB(theora, theora_granule_time, [
1947       BUILTINS="${BUILTINS} theora"
1948       LDFLAGS_theora="${LDFLAGS_theora} -ltheora -logg" ],[
1949       AC_MSG_ERROR([libtheora doesn't appear to be installed on you system.
1950 You also need to check that you have a libogg posterior to the 1.0 release.])],
1951       [-logg])
1952   ])
1953 fi
1954
1955 dnl
1956 dnl  Video plugins
1957 dnl
1958
1959 AC_ARG_WITH(,[Video plugins:])
1960
1961 dnl Check for DPMS
1962 if test "${SYS}" != "mingw32"
1963 then
1964   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1965   AC_CHECK_HEADERS(X11/extensions/dpms.h, [
1966     AC_MSG_CHECKING(for DPMSInfo in X11/extensions/dpms.h)
1967     AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
1968       AC_MSG_RESULT(yes)
1969       AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
1970                 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
1971     ],[
1972       AC_MSG_RESULT(no)
1973     ])
1974   ],,[
1975     #include <X11/Xlib.h>
1976   ])
1977   CPPFLAGS="${CPPFLAGS_save}"
1978 fi
1979
1980 dnl
1981 dnl  X11 module
1982 dnl  (enabled by default except on win32)
1983 dnl
1984 AC_ARG_ENABLE(x11,
1985   [  --enable-x11            X11 support (default enabled)])
1986 if test "${enable_x11}" != "no" &&
1987   (test "${SYS}" != "mingw32" || test "${enable_x11}" = "yes"); then
1988   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1989   AC_CHECK_HEADERS(X11/Xlib.h, [
1990     PLUGINS="${PLUGINS} x11"
1991     LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
1992     CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
1993     AC_CHECK_HEADERS(X11/extensions/Xinerama.h, [
1994       CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
1995       AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
1996         AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
1997         LDFLAGS_x11="${LDFLAGS_x11} -lXinerama")
1998       CFLAGS="${CFLAGS_save}"
1999     ])
2000   ])
2001   CPPFLAGS="${CPPFLAGS_save}"
2002 fi
2003
2004 dnl
2005 dnl  XVideo module
2006 dnl  (enabled by default except on win32)
2007 dnl
2008 AC_ARG_ENABLE(xvideo,
2009   [  --enable-xvideo         XVideo support (default enabled)])
2010 if test "${enable_xvideo}" != "no" &&
2011   (test "${SYS}" != "mingw32" || test "${enable_xvideo}" = "yes"); then
2012   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2013   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
2014     CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
2015     AC_CHECK_LIB(Xv_pic,XvPutImage,
2016       # We have Xv_pic, that's good, we can build an xvideo.so plugin !
2017       PLUGINS="${PLUGINS} xvideo"
2018       LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv_pic"
2019       CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
2020       AC_CHECK_LIB(Xv,XvPutImage,
2021         # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
2022         PLUGINS="${PLUGINS} xvideo"
2023         LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv"
2024         CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
2025         # Otherwise... well, do nothing.
2026         :
2027       )
2028     )
2029     AC_CHECK_HEADERS(X11/extensions/Xinerama.h, [
2030       AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
2031         AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
2032         LDFLAGS_xvideo="${LDFLAGS_xvideo} -lXinerama")
2033     ])
2034     CFLAGS="${CFLAGS_save}"
2035   ]
2036   CPPFLAGS="${CPPFLAGS_save}")
2037 fi
2038
2039 dnl
2040 dnl  SDL module
2041 dnl
2042 AC_ARG_ENABLE(sdl,
2043   [  --enable-sdl            SDL support (default enabled)])
2044 if test "${enable_sdl}" != "no"
2045 then
2046   SDL_PATH="${PATH}"
2047   AC_ARG_WITH(sdl-config-path,
2048     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
2049     [ if test "${with_sdl_config_path}" != "no"
2050       then
2051         SDL_PATH="${with_sdl_config_path}:${PATH}"
2052       fi ])
2053   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
2054   SDL_CONFIG="${SDL12_CONFIG}"
2055   SDL_HEADER="SDL12/SDL.h"
2056   if test "${SDL_CONFIG}" = "no"
2057   then
2058     AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
2059     SDL_CONFIG=${SDL11_CONFIG}
2060     SDL_HEADER="SDL11/SDL.h"
2061   fi
2062   if test "${SDL_CONFIG}" = "no"
2063   then
2064     AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
2065     SDL_HEADER="SDL/SDL.h"
2066   fi
2067   # check for cross-compiling
2068   SDL_PREFIX=
2069   AC_ARG_WITH(sdl-prefix,
2070     [    --with-sdl-prefix=PATH path to libsdl (needed for cross-compiling),
2071                                e.g use as:
2072                                --with-sdl-prefix=/usr/local/arm/2.95.3/arm-linux/usr)],[],[])
2073   if test "${with_sdl_prefix}" != "no" -a "${with_sdl_prefix}" != ""
2074   then
2075     SDL_PREFIX="--prefix=${with_sdl_prefix}"
2076   fi
2077   if test "${SDL_CONFIG}" != "no"
2078   then
2079     PLUGINS="${PLUGINS} vout_sdl aout_sdl"
2080     CFLAGS_vout_sdl="${CFLAGS_vout_sdl} `${SDL_CONFIG} ${SDL_PREFIX} --cflags | sed 's,SDL,,'`"
2081     LDFLAGS_vout_sdl="${LDFLAGS_vout_sdl} `${SDL_CONFIG} ${SDL_PREFIX} --libs | sed 's,-rdynamic,,'`"
2082     CFLAGS_aout_sdl="${CFLAGS_aout_sdl} `${SDL_CONFIG} ${SDL_PREFIX} --cflags | sed 's,SDL,,'`"
2083     LDFLAGS_aout_sdl="${LDFLAGS_aout_sdl} `${SDL_CONFIG} ${SDL_PREFIX} --libs | sed 's,-rdynamic,,'`"
2084     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
2085     AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
2086       <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
2087       [ AC_CHECK_HEADERS(SDL.h, AC_DEFINE(SDL_INCLUDE_FILE, <SDL.h>,
2088           As a last resort we also test for SDL.h presence),
2089       [ AC_MSG_ERROR([The development package for SDL is not installed.
2090 Please install it and try again. Alternatively you can also configure with
2091 --disable-sdl.])
2092       ])])
2093     CPPFLAGS="${CPPFLAGS_save}"
2094     if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
2095     then
2096       AC_MSG_ERROR([The development package for SDL is not installed.
2097 Please install it and try again. Alternatively you can also configure with
2098 --disable-sdl.])
2099     fi
2100   elif test "${enable_sdl}" =  "yes"
2101   then
2102     AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
2103 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
2104     ])
2105   fi
2106 fi
2107
2108 dnl
2109 dnl  freetype module
2110 dnl
2111 AC_ARG_ENABLE(freetype,
2112   [  --enable-freetype       freetype support (default enabled)])
2113 if test "${enable_freetype}" != "no"
2114 then
2115   FREETYPE_PATH="${PATH}"
2116   AC_ARG_WITH(freetype-config-path,
2117     [    --with-freetype-config-path=PATH freetype-config path (default search in \$PATH)],
2118     [ if test "${with_freetype_config_path}" != "no"
2119       then
2120         FREETYPE_PATH="${with_freetype_config_path}:${PATH}"
2121       fi ])
2122   AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no, ${FREETYPE_PATH})
2123
2124   if test "${FREETYPE_CONFIG}" != "no"
2125   then
2126     PLUGINS="${PLUGINS} osdtext"
2127     CFLAGS_osdtext="${CFLAGS_osdtext} `${FREETYPE_CONFIG} --cflags`"
2128     LDFLAGS_osdtext="${LDFLAGS_osdtext} `${FREETYPE_CONFIG} --libs`"
2129     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_freetype}"
2130   elif test "${enable_freetype}" =  "yes"
2131   then
2132     AC_MSG_ERROR([I couldn't find the freetype package. You can download libfreetype2
2133 from http://www.freetype.org/, or configure with --disable-freetype. Have a nice day.
2134     ])
2135   fi
2136 fi
2137
2138 dnl
2139 dnl  Qt Embedded module
2140 dnl  (disabled by default)
2141 dnl
2142 AC_ARG_ENABLE(qte,
2143   [  --enable-qte            QT Embedded support (default disabled)])
2144 if test "${enable_qte}" = "yes"
2145 then
2146   AC_ARG_WITH(qte,
2147   [    --with-qte=PATH       Qt Embedded headers and libraries])
2148   if test "${with_qte}" != "no" -a "${with_qte}" != ""
2149   then
2150     LDFLAGS_qte="${LDFLAGS_qte} -L${with_qte}/lib `echo -L${with_qte}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte"
2151     CPPFLAGS_qte="${CPPFLAGS_qte} -I${with_qte}/include `echo -I${with_qte}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti"
2152   else
2153     LDFLAGS_qte="${LDFLAGS_qte} -L${QTDIR}/lib `echo -L${QTDIR}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte"
2154     CPPFLAGS_qte="${CPPFLAGS_qte} -I${QTDIR}/include `echo -I${QTDIR}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti"
2155   fi
2156   PLUGINS="${PLUGINS} qte"
2157   NEED_QTE_MAIN=yes
2158   CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_qte}"
2159   AC_CHECK_HEADERS(qt.h jpeglib.h, ,[
2160     AC_MSG_ERROR([echo "Cannot find QT Embedded development headers."])
2161   ] )
2162   CPPFLAGS="${CPPFLAGS_save}"
2163 fi
2164
2165 dnl
2166 dnl  Windows DirectX module
2167 dnl
2168 AC_ARG_ENABLE(directx,
2169   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
2170 if test "${enable_directx}" != "no"
2171 then
2172   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
2173   then
2174     AC_ARG_WITH(directx,
2175     [    --with-directx=PATH   Win32 DirectX headers])
2176     if test "${with_directx}" = ""
2177     then
2178       AC_CHECK_HEADERS(ddraw.h,
2179       [ PLUGINS="${PLUGINS} vout_directx aout_directx"
2180         LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32" ])
2181     else
2182       AC_MSG_CHECKING(for directX headers in ${with_directx})
2183       if test -f ${with_directx}/ddraw.h
2184       then
2185         PLUGINS="${PLUGINS} vout_directx aout_directx"
2186         LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32"
2187         CPPFLAGS_vout_directx="${CPPFLAGS_vout_directx} -I${with_directx}"
2188         CPPFLAGS_aout_directx="${CPPFLAGS_aout_directx} -I${with_directx}"
2189         AC_MSG_RESULT(yes)
2190       else
2191         AC_MSG_RESULT(no)
2192         AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
2193       fi
2194     fi
2195   fi
2196 fi
2197
2198 dnl
2199 dnl  Linux framebuffer module
2200 dnl
2201 AC_ARG_ENABLE(fb,
2202   [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
2203     if test "${enable_fb}" != "no"
2204     then
2205       AC_CHECK_HEADERS(linux/fb.h, [
2206         PLUGINS="${PLUGINS} fb"
2207       ])
2208     fi
2209
2210 dnl
2211 dnl  Linux MGA module
2212 dnl
2213 AC_ARG_ENABLE(mga,
2214   [  --enable-mga            Linux kernel Matrox support (default disabled)],
2215   [ if test "${enable_mga}" = "yes"
2216     then
2217       PLUGINS="${PLUGINS} mga xmga"
2218     fi ])
2219
2220 dnl
2221 dnl  SVGAlib module
2222 dnl
2223 AC_ARG_ENABLE(svgalib,
2224   [  --enable-svgalib        SVGAlib support (default disabled)])
2225 if test "${enable_svgalib}" = "yes"
2226 then
2227   PLUGINS="${PLUGINS} svgalib"
2228   LDFLAGS_svgalib="${LDFLAGS_svgalib} -lvgagl -lvga"
2229 fi
2230
2231 dnl
2232 dnl  GGI module
2233 dnl
2234 AC_ARG_ENABLE(ggi,
2235   [  --enable-ggi            GGI support (default disabled)])
2236 if test "${enable_ggi}" = "yes"
2237 then
2238   PLUGINS="${PLUGINS} ggi"
2239   LDFLAGS_ggi="${LDFLAGS_ggi} -lggi"
2240   AC_ARG_WITH(ggi,
2241     [    --with-ggi=PATH       path to libggi],
2242     [ if test "${with_ggi}" != "no" -a "${with_ggi}" != ""
2243       then
2244         CPPFLAGS_ggi="${CPPFLAGS_ggi} -I${with_ggi}/include"
2245         LDFLAGS_ggi="${LDFLAGS_ggi} -L${with_ggi}/lib"
2246       fi ])
2247 fi
2248
2249 dnl
2250 dnl  Glide module
2251 dnl
2252 AC_ARG_ENABLE(glide,
2253   [  --enable-glide          Glide (3dfx) support (default disabled)])
2254 if test "${enable_glide}" = "yes"
2255 then
2256   PLUGINS="${PLUGINS} glide"
2257   LDFLAGS_glide="${LDFLAGS_glide} -lglide2x -lm"
2258   CPPFLAGS_glide="${CPPFLAGS_glide} -I/usr/include/glide"
2259   AC_ARG_WITH(glide,
2260     [    --with-glide=PATH     path to libglide],
2261     [ if test "${with_glide}" != "no" -a "${with_glide}" != ""
2262       then
2263         CPPFLAGS_glide="${CPPFLAGS_glide} -I${with_glide}/include"
2264         LDFLAGS_glide="${LDFLAGS_glide} -L${with_glide}/lib"
2265       fi ])
2266 fi
2267
2268 dnl
2269 dnl  AA plugin
2270 dnl
2271 AC_ARG_ENABLE(aa,
2272   [  --enable-aa             aalib output (default disabled)])
2273 if test "${enable_aa}" = "yes"
2274 then
2275   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
2276   if test "${have_aa}" = "true"
2277   then
2278     PLUGINS="${PLUGINS} aa"
2279     LDFLAGS_aa="${LDFLAGS_aa} -laa"
2280   fi
2281 fi
2282
2283 dnl
2284 dnl  win32 GDI plugin
2285 dnl
2286 AC_ARG_ENABLE(wingdi,
2287   [  --enable-wingdi         Win32 GDI module (default enabled on Win32)])
2288 if test "${enable_wingdi}" != "no"; then
2289   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2290     PLUGINS="${PLUGINS} wingdi"
2291     LDFLAGS_wingdi="${LDFLAGS_wingdi} -lgdi32"
2292   fi
2293 fi
2294
2295 dnl
2296 dnl  Audio plugins
2297 dnl
2298
2299 AC_ARG_WITH(,[Audio plugins:])
2300
2301 dnl
2302 dnl  OSS /dev/dsp module (enabled by default except on win32)
2303 dnl
2304 AC_ARG_ENABLE(oss,
2305   [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
2306
2307 if test "${enable_oss}" != "no" &&
2308   (test "${SYS}" != "mingw32" || test "${enable_oss}" = "yes")
2309 then
2310   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
2311     PLUGINS="${PLUGINS} oss"
2312     AC_CHECK_LIB(ossaudio,main,LDFLAGS_oss="${LDFLAGS_oss} -lossaudio")
2313   ])
2314 fi
2315
2316 dnl
2317 dnl  Esound module
2318 dnl
2319 AC_ARG_ENABLE(esd,
2320   [  --enable-esd            Esound library support (default disabled)],
2321   [if test "${enable_esd}" = "yes"
2322    then
2323      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
2324      if test "${ESD_CONFIG}" != "no"
2325      then
2326        PLUGINS="${PLUGINS} esd"
2327        CFLAGS_esd="${CFLAGS_esd} `${ESD_CONFIG} --cflags`"
2328        LDFLAGS_esd="${LDFLAGS_esd} `${ESD_CONFIG} --libs`"
2329      fi
2330    fi])
2331
2332 dnl
2333 dnl  aRts module
2334 dnl
2335 AC_ARG_ENABLE(arts,
2336   [  --enable-arts           aRts sound server (default disabled)],
2337   [if test "${enable_arts}" = "yes"
2338    then
2339      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
2340      if test "${ARTS_CONFIG}" != "no"
2341      then
2342        PLUGINS="${PLUGINS} arts"
2343        CFLAGS_arts="${CFLAGS_arts} `${ARTS_CONFIG} --cflags`"
2344        LDFLAGS_arts="${LDFLAGS_arts} `${ARTS_CONFIG} --libs `"
2345      fi
2346    fi])
2347
2348 dnl
2349 dnl  ALSA module
2350 dnl
2351 AC_ARG_ENABLE(alsa,
2352   [  --enable-alsa           ALSA sound support for Linux (default disabled)],
2353   [if test "${enable_alsa}" = "yes"
2354    then
2355      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
2356      if test "${have_alsa}" = "true"
2357      then
2358        AC_TRY_COMPILE([#define ALSA_PCM_NEW_HW_PARAMS_API
2359                        #define ALSA_PCM_NEW_SW_PARAMS_API
2360                        #include <alsa/asoundlib.h>],
2361           [void foo() { snd_pcm_hw_params_get_period_time(0,0,0); }],
2362            AC_DEFINE(HAVE_ALSA_NEW_API, 1, Define if ALSA is at least rc4))
2363        PLUGINS="${PLUGINS} alsa"
2364        LDFLAGS_alsa="${LDFLAGS_alsa} -lasound -lm -ldl"
2365      else
2366        AC_MSG_ERROR([Could not find ALSA development headers])
2367      fi
2368    fi])
2369
2370 dnl
2371 dnl  win32 waveOut plugin
2372 dnl
2373 AC_ARG_ENABLE(waveout,
2374   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
2375 if test "${enable_waveout}" != "no"; then
2376   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2377     PLUGINS="${PLUGINS} waveout"
2378     LDFLAGS_waveout="-lwinmm"
2379   fi
2380 fi
2381
2382 dnl
2383 dnl  CoreAudio plugin
2384 dnl
2385 AC_ARG_ENABLE(coreaudio,
2386   [  --enable-coreaudio      CoreAudio module (default enabled on MacOS X)])
2387 if test "${enable_coreaudio}" != "no" &&
2388   (test "${SYS}" = "darwin" || test "${enable_coreaudio}" = "yes")
2389 then
2390   AC_CHECK_HEADERS(CoreAudio/CoreAudio.h, 
2391     [ BUILTINS="${BUILTINS} coreaudio"
2392       LDFLAGS_coreaudio="${LDFLAGS_coreaudio} -framework CoreAudio"
2393       AC_MSG_CHECKING(for kAudioConverterPrimeMethod in AudioToolbox/AudioConverter.h)
2394       AC_EGREP_HEADER(kAudioConverterPrimeMethod,AudioToolbox/AudioConverter.h,[
2395         AC_MSG_RESULT(yes)
2396         PLUGINS="${PLUGINS} coreaudio_resampler"
2397         LDFLAGS_coreaudio_resampler="${LDFLAGS_coreaudio_resampler} -framework AudioToolbox"
2398       ],[ AC_MSG_RESULT(no) ])
2399     ], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
2400 fi
2401
2402 dnl
2403 dnl  Interface plugins
2404 dnl
2405
2406 AC_ARG_WITH(,[Interface plugins:])
2407
2408 dnl special case for BeOS
2409 if test "${SYS}" = "beos"
2410 then
2411     PLUGINS="${PLUGINS} beos"
2412 fi
2413
2414 dnl
2415 dnl Skins module
2416 dnl
2417 AC_ARG_ENABLE(skins,
2418   [  --enable-skins          Skins interface module (default enabled on Win32)])
2419 if test "${enable_skins}" != "no"; then
2420   WXWINDOWS_PATH="${PATH}"
2421   AC_ARG_WITH(skins-wx-config-path,
2422     [    --with-skins-wx-config-path=PATH wx-config path for the skins plugin (default search in \$PATH)],
2423     [ if test "${with_skins_wx_config_path}" != "no"
2424       then
2425         WXWINDOWS_PATH="${with_skins_wx_config_path}:${PATH}"
2426       fi ])
2427   # look for wx-config
2428   AC_PATH_PROG(WX_CONFIG_SKINS, wx-config, no, ${WXWINDOWS_PATH})
2429   if test "${WX_CONFIG_SKINS}" != "no"
2430   then
2431     if expr 2.3.0 \> `${WX_CONFIG_SKINS} --version` >/dev/null
2432     then
2433       AC_MSG_ERROR([Your development package for wxWindows is too old, you need at least version 2.3.0. Please upgrade and try again. Alternatively you can also configure with --disable-skins.])
2434     fi
2435     CPPFLAGS_skins="${CPPFLAGS_skins} `${WX_CONFIG_SKINS} --cxxflags` -DWX_SKINS"
2436     LDFLAGS_skins="${LDFLAGS_skins} `${WX_CONFIG_SKINS} --libs`"
2437   fi
2438
2439   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2440     PLUGINS="${PLUGINS} skins"
2441     CPPFLAGS_skins="${CPPFLAGS_skins} -U_OFF_T_ -U_off_t -Imodules/gui/skins"
2442     CXXFLAGS_skins="${CXXFLAGS_skins} -O2 -fno-rtti"
2443     LDFLAGS_skins="${LDFLAGS_skins} -loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32"
2444   else
2445     if test "${enable_skins}" = "yes"; then
2446       IMLIB2_PATH="${PATH}"
2447       AC_PATH_PROG(IMLIB2_CONFIG_SKINS, imlib2-config, no, ${IMLIB2_PATH})
2448       if test "${IMLIB2_CONFIG_SKINS}" = "no"; then
2449         AC_MSG_ERROR([Couldn't find the imlib2 package. You can download imlib2 from http://enlightenment.org/, or configure with --disable-skins.])
2450       fi
2451
2452       PLUGINS="${PLUGINS} skins"
2453       CPPFLAGS_skins="${CPPFLAGS_skins} -Imodules/gui/skins -I${x_includes} `${IMLIB2_CONFIG_SKINS} --cflags` -DX11_SKINS"
2454       CXXFLAGS_skins="${CXXFLAGS_skins} -O2 -fno-rtti"
2455       LDFLAGS_skins="${LDFLAGS_skins} -L${x_libraries} -lXext -lX11 `${IMLIB2_CONFIG_SKINS} --libs`"
2456       PLUGINS="${PLUGINS} skins"
2457     fi
2458   fi
2459 fi
2460
2461 dnl
2462 dnl Basic skins module (i.e. without wxWindows dialogs)
2463 dnl
2464 AC_ARG_ENABLE(basic-skins,
2465   [  --enable-basic-skins    Skins interface module without wxWindows dialogs (default disabled)])
2466 if test "${enable_basic_skins}" = "yes"; then
2467   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2468
2469     CPPFLAGS_basic_skins="${CPPFLAGS_basic_skins} -U_OFF_T_ -U_off_t -Imodules/gui/skins"
2470     CXXFLAGS_basic_skins="${CXXFLAGS_basic_skins} -O2 -fno-rtti"
2471     LDFLAGS_basic_skins="${LDFLAGS_basic_skins} -loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32"
2472
2473   else
2474     IMLIB2_PATH="${PATH}"
2475     AC_PATH_PROG(IMLIB2_CONFIG_SKINS, imlib2-config, no, ${IMLIB2_PATH})
2476     if test "${IMLIB2_CONFIG_SKINS}" = "no"; then
2477     AC_MSG_ERROR([Couldn't find the imlib2 package. You can download imlib2 from http://enlightenment.org/, or configure with --disable-basic-skins.])
2478     fi
2479
2480     CPPFLAGS_basic_skins="${CPPFLAGS_basic_skins} -Imodules/gui/skins -I${x_includes} `${IMLIB2_CONFIG_SKINS} --cflags` -DX11_SKINS"
2481     CXXFLAGS_basic_skins="${CXXFLAGS_basic_skins} -O2 -fno-rtti"
2482     LDFLAGS_basic_skins="${LDFLAGS_basic_skins} -L${x_libraries} -lXext -lX11 `${IMLIB2_CONFIG_SKINS} --libs`"
2483   fi
2484
2485   PLUGINS="${PLUGINS} basic_skins"
2486 fi
2487
2488 dnl
2489 dnl  Gtk+ module
2490 dnl
2491 AC_ARG_ENABLE(gtk,
2492   [  --enable-gtk            Gtk+ support (default enabled)])
2493 if test "${enable_gtk}" != "no"
2494 then
2495   GTK_PATH="${PATH}"
2496   AC_ARG_WITH(gtk-config-path,
2497     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
2498     [ if test "${with_gtk_config_path}" != "no"
2499       then
2500         GTK_PATH="${with_gtk_config_path}:${PATH}"
2501       fi ])
2502   # look for gtk-config
2503   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
2504   GTK_CONFIG=${GTK12_CONFIG}
2505   if test "${GTK_CONFIG}" = "no"
2506   then
2507     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
2508   fi
2509   if test "${GTK_CONFIG}" != "no"
2510   then
2511     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
2512     then
2513       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.])
2514     fi
2515     if test "${SYS}" != "mingw32"; then
2516       CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk gthread`"
2517       LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
2518     else
2519       CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk`"
2520       LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
2521     fi
2522     # now look for the gtk.h header
2523     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
2524     ac_cv_gtk_headers=yes
2525     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
2526       ac_cv_gtk_headers=no
2527       echo "Cannot find gtk development headers."
2528     ])
2529     if test "${ac_cv_gtk_headers}" = "yes"
2530     then
2531       PLUGINS="${PLUGINS} gtk"
2532       if test "${SYS}" != "mingw32"; then
2533         NEED_GTK_MAIN=yes
2534       fi
2535       ALIASES="${ALIASES} gvlc"
2536     fi
2537     CPPFLAGS="${CPPFLAGS_save}"
2538   fi
2539 fi
2540
2541 dnl
2542 dnl  Gtk+2 module
2543 dnl
2544 AC_ARG_ENABLE(gtk2,
2545   [  --enable-gtk2           Gtk2 support (default disabled)])
2546 if test "${enable_gtk2}" = "yes"
2547 then
2548   PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0, gthread-2.0])
2549   CFLAGS_gtk2="${CFLAGS_gtk2} ${GTK2_CFLAGS}"
2550   LDFLAGS_gtk2="${LDFLAGS_gtk2} ${GTK2_LIBS}"
2551   PLUGINS="${PLUGINS} gtk2"
2552   if test "${SYS}" != "mingw32"; then
2553     NEED_GTK2_MAIN=yes
2554   fi
2555 fi
2556
2557 dnl
2558 dnl  Familiar module uses Gtk+ library
2559 dnl
2560 AC_ARG_ENABLE(familiar,
2561   [  --enable-familiar       Familiar Gtk+ support (default disabled)])
2562 if test "${enable_familiar}" = "yes"
2563 then
2564   GTK_PATH="${PATH}"
2565   AC_ARG_WITH(gtk-config-path,
2566     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
2567     [ if test "${with_gtk_config_path}" != "no"
2568       then
2569         GTK_PATH="${with_gtk_config_path}:${PATH}"
2570       fi ])
2571   # look for gtk-config
2572   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
2573   GTK_CONFIG=${GTK12_CONFIG}
2574   if test "${GTK_CONFIG}" = "no"
2575   then
2576     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
2577   fi
2578   # check for cross-compiling
2579   GTK_PREFIX=
2580   AC_ARG_WITH(gtk-prefix,
2581     [    --with-gtk-prefix=PATH path to libgtk (needed for cross-compiling),
2582                           e.g use as:
2583                           --with-gtk-prefix=/usr/local/arm/2.95.3/arm-linux/usr)],[],[])
2584   if test "${with_gtk_prefix}" != "no" -a "${with_gtk_prefix}" != ""
2585   then
2586     GTK_PREFIX="--prefix=${with_gtk_prefix}"
2587   fi
2588   if test "${GTK_CONFIG}" != "no"
2589   then
2590     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
2591     then
2592       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.])
2593     fi
2594     CFLAGS_familiar="${CFLAGS_familiar} `${GTK_CONFIG} ${GTK_PREFIX} --cflags gtk gthread`"
2595     LDFLAGS_familiar="${LDFLAGS_familiar} `${GTK_CONFIG} ${GTK_PREFIX} --libs gtk gthread | sed 's,-rdynamic,,'`"
2596     # now look for the gtk.h header
2597     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar}"
2598     ac_cv_gtk_headers=yes
2599     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
2600       ac_cv_gtk_headers=no
2601       echo "Cannot find gtk development headers."
2602     ])
2603     if test "${ac_cv_gtk_headers}" = "yes"
2604     then
2605       PLUGINS="${PLUGINS} familiar"
2606     fi
2607     CPPFLAGS="${CPPFLAGS_save}"
2608
2609     # now look for gpe support
2610     AC_ARG_WITH(gpe-prefix,
2611     [    --with-gpe-prefix=PATH gpe installation path prefix (default search in \$PATH)],[],[])
2612     if test "${with_gpe_prefix}" != "no"  -a "${with_gpe_prefix}" != ""
2613     then
2614       CFLAGS_gpe="-I${with_gpe_prefix}/include"
2615       LDFLAGS_gpe="-lXi -lgdk_pixbuf -L${with_gpe_prefix}/lib -lgpewidget"
2616       # now look for gpe/init.h header file
2617       CFLAGS_save="${CFLAGS}"
2618       LDFLAGS_save="${LDFLAGS}"
2619       CFLAGS="${CFLAGS_familiar} ${CFLAGS_gpe}"
2620       LDFLAGS="${LDFLAGS_familiar} ${LDFLAGS_gpe}"
2621       CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar} ${CFLAGS_gpe}"
2622       ac_cv_gpe_headers=yes
2623       AC_CHECK_HEADERS(gpe/init.h, ,
2624         [ ac_cv_gpe_headers=no
2625           AC_MSG_ERROR([Cannot find development headers for libgpewidget...]) ])
2626       CFLAGS="${CFLAGS_save}"
2627       LDFLAGS="${LDFLAG_save}"
2628       if test "${ac_cv_gpe_headers}" = "yes"
2629       then
2630         CFLAGS_familiar="${CFLAGS_familiar} ${CFLAGS_gpe}"
2631         LDFLAGS_familiar="${LDFLAGS_familiar} ${LDFLAGS_gpe}"
2632       fi
2633     else
2634           NEED_GTK_MAIN=yes
2635     fi # end gpe support
2636   fi # end gtk+ support
2637 fi
2638
2639 dnl
2640 dnl  Gnome module
2641 dnl
2642 AC_ARG_ENABLE(gnome,
2643   [  --enable-gnome          Gnome interface support (default disabled)],
2644   [if test "${enable_gnome}" = "yes"; then
2645     # look for gnome-config
2646     AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
2647     if test -x ${GNOME_CONFIG}
2648     then
2649        CFLAGS_gnome="${CFLAGS_gnome} `${GNOME_CONFIG} --cflags gtk gnomeui`"
2650        LDFLAGS_gnome="${LDFLAGS_gnome} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
2651     fi
2652     # now look for the gnome.h header
2653     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
2654     AC_CHECK_HEADERS(gnome.h, [
2655       PLUGINS="${PLUGINS} gnome"
2656       NEED_GTK_MAIN=yes
2657       NEED_GNOME_MAIN=yes
2658       ALIASES="${ALIASES} gnome-vlc"
2659       dnl We need this because of some moronic gnomesupport.h flavours
2660       AC_MSG_CHECKING(for strndup in gnome.h)
2661       AC_EGREP_HEADER(strndup,gnome.h,[
2662         AC_MSG_RESULT(yes)
2663         AC_DEFINE(STRNDUP_IN_GNOME_H, 1,
2664                   Define if <gnome.h> defines strndup.)],[
2665         AC_MSG_RESULT(no)])
2666      ],[
2667       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
2668 developement tools or remove the --enable-gnome option])
2669      ])
2670     CPPFLAGS="${CPPFLAGS_save}"
2671   fi])
2672
2673 dnl
2674 dnl  Gnome2 module
2675 dnl
2676 AC_ARG_ENABLE(gnome2,
2677   [  --enable-gnome2         Gnome2 support (default disabled)])
2678 if test "${enable_gnome2}" = "yes"
2679 then
2680   PKG_CHECK_MODULES(GNOME2, [libgnomeui-2.0])
2681   CFLAGS_gnome2="${CFLAGS_gnome2} ${GNOME2_CFLAGS}"
2682   LDFLAGS_gnome2="${LDFLAGS_gnome2} ${GNOME2_LIBS}"
2683   PLUGINS="${PLUGINS} gnome2"
2684   if test "${SYS}" != "mingw32"; then
2685     NEED_GNOME2_MAIN=yes
2686   fi
2687 fi
2688
2689 dnl
2690 dnl  wxWindows module
2691 dnl
2692 AC_ARG_ENABLE(wxwindows,
2693   [  --enable-wxwindows      wxWindows support (default enabled)])
2694 if test "${enable_wxwindows}" != "no"
2695 then
2696   WXWINDOWS_PATH="${PATH}"
2697   AC_ARG_WITH(wx-config-path,
2698     [    --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
2699     [ if test "${with_wx_config_path}" != "no"
2700       then
2701         WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
2702       fi ])
2703   # look for wx-config
2704   AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
2705   if test "${WX_CONFIG}" != "no"
2706   then
2707     if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
2708     then
2709       AC_MSG_ERROR([Your development package for wxWindows is too old, you need at least version 2.3.0. Please upgrade and try again. Alternatively you can also configure with --disable-wxwindows.])
2710     fi
2711     CXXFLAGS_wxwindows="${CXXFLAGS_wxwindows} `${WX_CONFIG} --cxxflags`"
2712     LDFLAGS_wxwindows="${LDFLAGS_wxwindows} `${WX_CONFIG} --libs`"
2713     # now look for the wxprec.h header
2714     CPPFLAGS="${CPPFLAGS_save} ${CXXFLAGS_wxwindows}"
2715     ac_cv_wx_headers=yes
2716     AC_CHECK_HEADERS(wx/wxprec.h, , [
2717       ac_cv_wx_headers=no
2718       echo "Cannot find wxWindows development headers."
2719     ])
2720     if test "${ac_cv_wx_headers}" = "yes"
2721     then
2722       PLUGINS="${PLUGINS} wxwindows"
2723       ALIASES="${ALIASES} wxvlc"
2724     fi
2725     CPPFLAGS="${CPPFLAGS_save}"
2726   fi
2727 fi
2728
2729 dnl
2730 dnl  Qt module
2731 dnl
2732 AC_ARG_ENABLE(qt,
2733   [  --enable-qt             Qt interface support (default disabled)],
2734   [if test "${enable_qt}" = "yes"; then
2735      PLUGINS="${PLUGINS} qt"
2736      ALIASES="${ALIASES} qvlc"
2737      LDFLAGS_qt="${LDFLAGS_qt} -L${QTDIR}/lib"
2738      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_qt}"
2739      AC_CHECK_LIB(qt-mt,main,[
2740        LDFLAGS_qt="${LDFLAGS_qt} -lqt-mt"
2741      ],[
2742        AC_CHECK_LIB(qt,main,[
2743          LDFLAGS_qt="${LDFLAGS_qt} -lqt"
2744        ])
2745      ])
2746      LDFLAGS="${LDFLAGS_save}"
2747      CPPFLAGS_qt="${CPPFLAGS_qt} -I/usr/include/qt3 -I/usr/include/qt -I${QTDIR}/include"
2748      if test -x ${QTDIR}/bin/moc
2749      then
2750        MOC=${QTDIR}/bin/moc
2751      else
2752        MOC=moc
2753      fi
2754    fi])
2755
2756 dnl
2757 dnl  KDE module
2758 dnl
2759 AC_ARG_ENABLE(kde,
2760   [  --enable-kde            KDE interface support (default disabled)],
2761   [if test "${enable_kde}" = "yes"; then
2762      PLUGINS="${PLUGINS} kde"
2763      ALIASES="${ALIASES} kvlc"
2764      LDFLAGS_kde="${LDFLAGS_kde} -L${KDEDIR}/lib"
2765      dnl Check for -lkfile (only in KDE 2) or -lkdeui -lkio (KDE 3)
2766      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
2767      AC_CHECK_LIB(kfile,main,[
2768        LDFLAGS_kde="${LDFLAGS_kde} -lkfile"
2769      ])
2770      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
2771      AC_CHECK_LIB(kdeui,main,[
2772        LDFLAGS_kde="${LDFLAGS_kde} -lkdeui"
2773      ])
2774      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
2775      AC_CHECK_LIB(kio,main,[
2776        LDFLAGS_kde="${LDFLAGS_kde} -lkio"
2777      ])
2778      LDFLAGS="${LDFLAGS_save}"
2779      CPPFLAGS_kde="${CPPFLAGS_kde} -I/usr/include/kde -I/usr/include/qt3 -I/usr/include/qt"
2780      CPPFLAGS_kde="${CPPFLAGS_kde} -I${KDEDIR}/include -I${QTDIR}/include"
2781      if test -x ${QTDIR}/bin/moc
2782      then
2783        MOC=${QTDIR}/bin/moc
2784      else
2785        MOC=moc
2786      fi
2787    fi])
2788
2789 dnl
2790 dnl  Opie QT embedded module
2791 dnl
2792 AC_ARG_ENABLE(opie,
2793   [  --enable-opie           Qt embedded interface support (default disabled)],
2794   [if test "${enable_opie}" = "yes"; then
2795      AC_ARG_WITH(qte,
2796      [    --with-qte=PATH       Qt Embedded headers and libraries])
2797      if test "${with_qte}" != "no" -a "${with_qte}" != ""
2798      then
2799        LDFLAGS_qte="-L${with_qte}/lib `echo -L${with_qte}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte"
2800        CPPFLAGS_qte="-I${with_qte}/include `echo -I${with_qte}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti"
2801      else
2802        LDFLAGS_qte="-L${QTDIR}/lib `echo -L${QTDIR}/lib | sed 's,opt/QtPalmtop,usr,'`"
2803        CPPFLAGS_qte="-I${QTDIR}/include `echo -I${QTDIR}/include | sed 's,opt/QtPalmtop,usr,'`"
2804      fi
2805      CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_qte}"
2806      AC_CHECK_HEADERS(qt.h jpeglib.h, ,[
2807        AC_MSG_ERROR([echo "Cannot find QT Embedded development headers."])
2808      ] )
2809      CPPFLAGS="${CPPFLAGS_save}"
2810
2811      PLUGINS="${PLUGINS} opie"
2812      NEED_QTE_MAIN=yes
2813      LDFLAGS_opie="${LDFLAGS_opie} -lqpe ${LDFLAGS_qte}"
2814      CPPFLAGS_opie="${CPPFLAGS_opie} ${CPPFLAGS_qte}"
2815      if test "${with_qte}" != "no" -a "${with_qte}" != ""
2816      then
2817        MOC=${with_qte}/bin/moc
2818      else
2819        MOC=${QTDIR}/bin/moc
2820      fi
2821    fi])
2822
2823 dnl
2824 dnl  MacOS X module
2825 dnl
2826 AC_ARG_ENABLE(macosx,
2827   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
2828   [if test "${enable_macosx}" = "yes"
2829    then
2830      BUILTINS="${BUILTINS} macosx"
2831      LDFLAGS_macosx="${LDFLAGS_macosx} -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
2832    fi],
2833   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
2834      BUILTINS="${BUILTINS} macosx"
2835      LDFLAGS_macosx="${LDFLAGS_macosx} -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
2836    )])
2837
2838 dnl
2839 dnl  QNX RTOS module
2840 dnl
2841 AC_ARG_ENABLE(qnx,
2842   [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
2843     if test "${enable_qnx}" != "no"
2844     then
2845       AC_CHECK_HEADERS(Ph.h, [
2846         PLUGINS="${PLUGINS} qnx"
2847         LDFLAGS_qnx="${LDFLAGS_qnx} -lasound -lph"
2848       ])
2849     fi
2850
2851 dnl
2852 dnl  ncurses module
2853 dnl
2854 AC_ARG_ENABLE(ncurses,
2855   [  --enable-ncurses        ncurses interface support (default disabled)],
2856   [if test "${enable_ncurses}" = "yes"; then
2857      PLUGINS="${PLUGINS} ncurses"
2858      LDFLAGS_ncurses="${LDFLAGS_ncurses} -lncurses"
2859    fi])
2860
2861 dnl
2862 dnl  XOSD plugin
2863 dnl
2864 AC_ARG_ENABLE(xosd,
2865   [  --enable-xosd           xosd interface support (default disabled)])
2866 if test "${enable_xosd}" = "yes"
2867 then
2868   AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
2869   AC_CHECK_LIB(xosd,xosd_set_offset,
2870       AC_DEFINE(HAVE_XOSD_VERSION_1, 1, Define if <xosd.h> is 1.0.x),
2871     AC_CHECK_LIB(xosd,xosd_set_horizontal_offset,
2872         AC_DEFINE(HAVE_XOSD_VERSION_2, 1, Define if <xosd.h> is 2.0.x),
2873       AC_TRY_COMPILE([#include <xosd.h>],
2874          [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
2875           AC_DEFINE(HAVE_XOSD_VERSION_0, 1, Define if <xosd.h> is pre-1.0.0))))
2876   if test "${have_xosd}" = "true"
2877   then
2878     PLUGINS="${PLUGINS} xosd"
2879     LDFLAGS_xosd="${LDFLAGS_xosd} -lxosd"
2880   fi
2881 fi
2882
2883 dnl
2884 dnl  SLP access plugin
2885 dnl
2886 AC_ARG_ENABLE(slp,
2887   [  --enable-slp            SLP service discovery support (default enabled)])
2888 if test "${enable_slp}" != "no"
2889 then
2890   AC_ARG_WITH(slp,
2891   [    --with-slp=PATH       libslp headers and libraries])
2892   if test "${with_slp}" = ""
2893   then
2894     AC_CHECK_HEADER(slp.h, have_slp="true", have_slp="false")
2895     if test "${have_slp}" = "true"
2896     then
2897       PLUGINS="${PLUGINS} slp"
2898       LDFLAGS_slp="-lslp ${LDFLAGS_slp}"
2899     fi
2900   else
2901     AC_MSG_CHECKING(for slp headers in ${with_slp})
2902     if test -f ${with_slp}/slp.h
2903     then
2904       dnl  Use ${with_slp}/libslp/slp.h
2905       AC_MSG_RESULT(yes)
2906       PLUGINS="${PLUGINS} slp"
2907       LDFLAGS_slp="-L${with_slp} -lslp ${LDFLAGS_slp}"
2908       CPPFLAGS_slp="${CPPFLAGS_slp} -I${with_slp}"
2909     else
2910       dnl  No libslp could be found, sorry
2911       AC_MSG_RESULT(no)
2912       AC_MSG_ERROR([cannot find ${with_slp}/slp.h])
2913     fi
2914   fi
2915 fi
2916
2917 dnl
2918 dnl  Lirc plugin
2919 dnl
2920 AC_ARG_ENABLE(lirc,
2921   [  --enable-lirc           lirc support (default disabled)])
2922 if test "${enable_lirc}" = "yes"
2923 then
2924   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
2925   if test "${have_lirc}" = "true"
2926   then
2927     PLUGINS="${PLUGINS} lirc"
2928     LDFLAGS_lirc="${LDFLAGS_lirc} -llirc_client"
2929   fi
2930 fi
2931
2932 AC_ARG_WITH(,[Misc options:])
2933
2934 dnl
2935 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
2936 dnl
2937 dnl  We give the user the opportunity to specify
2938 dnl  --with-words=big or --with-words=little ; otherwise, try to guess
2939 dnl
2940 AC_ARG_WITH(words,
2941   [  --with-words=endianness set endianness (big or little)])
2942   case "${with_words}" in
2943     big)
2944       ac_cv_c_bigendian=yes
2945       ;;
2946     little)
2947       ac_cv_c_bigendian=no
2948       ;;
2949     *)
2950       dnl  Try to guess endianness by matching patterns on a compiled
2951       dnl  binary, by looking for an ASCII or EBCDIC string
2952       AC_CACHE_CHECK([whether the byte order is big-endian],
2953         [ac_cv_c_bigendian],
2954         [ac_cv_c_bigendian="unknown"
2955         [cat >conftest.c <<EOF
2956         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
2957         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
2958         void _a(void) { char*s = (char*)am; s = (char *)ai; }
2959         short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
2960         short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
2961         void _e(void) { char*s = (char*)em; s = (char*)ei; }
2962         int main(void) { _a(); _e(); return 0; }
2963 EOF
2964         ]
2965         if test -f conftest.c
2966         then
2967           if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
2968               && test -f conftest.o
2969           then
2970             if test "`strings conftest.o | grep BIGenDianSyS`"
2971             then
2972               ac_cv_c_bigendian="yes"
2973             fi
2974             if test "`strings conftest.o | grep LiTTleEnDian`"
2975             then
2976               ac_cv_c_bigendian="no"
2977             fi
2978           fi
2979         fi
2980       ])
2981       if test "${ac_cv_c_bigendian}" = "unknown"
2982       then
2983         AC_MSG_ERROR([Could not guess endianness, please use --with-words])
2984       fi
2985       ;;
2986   esac
2987 dnl  Now we know what to use for endianness, just put it in the header
2988 if test "${ac_cv_c_bigendian}" = "yes"
2989 then
2990   AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
2991 fi
2992
2993 dnl
2994 dnl  Mozilla plugin
2995 dnl
2996 mozilla=false
2997 AC_ARG_ENABLE(mozilla,
2998   [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
2999 if test "${enable_mozilla}" = "yes"
3000 then
3001   AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
3002   if test "${MOZILLA_CONFIG}" != "no"
3003   then
3004     if test "${SYS}" != "mingw32"; then
3005       LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
3006       AC_CHECK_LIB(Xt,XtStrings,[
3007         LDFLAGS_mozilla="${LDFLAGS_mozilla} -L${x_libraries} -lXt"
3008       ])
3009       LDFLAGS="${LDFLAGS_save}"
3010     fi
3011     mozilla=:
3012     dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
3013     [CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
3014     #[CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java --defines | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
3015     LDFLAGS_mozilla="${LDFLAGS_mozilla} `${MOZILLA_CONFIG} --libs plugin xpcom`"
3016     dnl Not necessarily in ${PATH}
3017     if test "${XPIDL}" = "" -o ! -x "${XPIDL}"
3018     then
3019       XPIDL="/usr/lib/mozilla/xpidl"
3020     fi
3021   fi
3022 fi
3023 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
3024
3025 dnl
3026 dnl  test plugins
3027 dnl
3028 AC_ARG_ENABLE(testsuite,
3029   [  --enable-testsuite      build test modules (default disabled)])
3030 if test "${enable_testsuite}" = "yes"
3031 then
3032   TESTS="test1 test2 test3 test4"
3033
3034   dnl  we define those so that bootstrap sets the right linker
3035   CXXFLAGS_test2="${CXXFLAGS_test2}"
3036   OBJCFLAGS_test3="${OBJCFLAGS_test3}"
3037   dnl  this one is needed until automake knows what to do
3038   LDFLAGS_test3="${LDFLAGS_test3} -lobjc"
3039
3040   PLUGINS="${PLUGINS} ${TESTS}"
3041   #BUILTINS="${BUILTINS} ${TESTS}"
3042 fi
3043
3044 dnl
3045 dnl  gtk_main plugin
3046 dnl
3047 if test "${NEED_GTK_MAIN}" != "no"
3048 then
3049     PLUGINS="${PLUGINS} gtk_main"
3050     CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN"
3051     CFLAGS_familiar="${CFLAGS_familiar} -DNEED_GTK_MAIN"
3052     CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
3053     LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
3054 fi
3055
3056 if test "${NEED_GNOME_MAIN}" != "no"
3057 then
3058     PLUGINS="${PLUGINS} gnome_main"
3059     CFLAGS_gnome_main="${CFLAGS_gnome_main} ${CFLAGS_gtk} ${CFLAGS_familiar} ${CFLAGS_gnome}"
3060     LDFLAGS_gnome_main="${LDFLAGS_gnome_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar} ${LDFLAGS_gnome}"
3061 fi
3062
3063 if test "${NEED_GTK2_MAIN}" != "no"
3064 then
3065     PLUGINS="${PLUGINS} gtk2_main"
3066     CFLAGS_gtk2="${CFLAGS_gtk2} -DNEED_GTK2_MAIN"
3067     CFLAGS_gtk2_main="${CFLAGS_gtk2_main} ${CFLAGS_gtk2}"
3068     LDFLAGS_gtk2_main="${LDFLAGS_gtk2_main} ${LDFLAGS_gtk2}"
3069 fi
3070
3071 if test "${NEED_GNOME2_MAIN}" != "no"
3072 then
3073     PLUGINS="${PLUGINS} gnome2_main"
3074     CFLAGS_gnome2_main="${CFLAGS_gnome2_main} ${CFLAGS_gtk2} ${CFLAGS_gnome2}"
3075     LDFLAGS_gnome2_main="${LDFLAGS_gnome2_main} ${LDFLAGS_gtk2} ${LDFLAGS_gnome2}"
3076 fi
3077
3078 dnl
3079 dnl  qte_main plugin
3080 dnl
3081 if test "${NEED_QTE_MAIN}" != "no"
3082 then
3083     PLUGINS="${PLUGINS} qte_main"
3084     CPPFLAGS_qte="${CPPFLAGS_qte} -DNEED_QTE_MAIN"
3085     CPPFLAGS_opie="${CPPFLAGS_opie} -DNEED_QTE_MAIN"
3086     CFLAGS_vout_sdl="${CFLAGS_vout_sdl} -DNEED_QTE_MAIN"
3087     CPPFLAGS_qte_main="${CFLAGS_qte_main} ${CPPFLAGS_qte}"
3088     LDFLAGS_qte_main="${LDFLAGS_qte_main} ${LDFLAGS_qte}"
3089 fi
3090
3091
3092 dnl
3093 dnl  Plugin and builtin checks
3094 dnl
3095 builtin_support=false
3096 plugin_support=:
3097
3098 dnl Support for plugins - this must be AT THE END
3099 AC_ARG_ENABLE(plugins,
3100   [  --disable-plugins       make all plugins built-in (default plugins enabled)],
3101   [if test "${enable_plugins}" = "no"
3102    then
3103      plugin_support=false
3104    fi])
3105
3106 dnl Automagically disable plugins if there is no system support for
3107 dnl dynamically loadable files (.so, .dll, .dylib).
3108 dnl don't forget vlc-win32 still can load .dll as plugins
3109 if test "${ac_cv_header_dlfcn_h}" = "no" -a "${ac_cv_header_image_h}" = "no" -a "${SYS}" != "mingw32"
3110 then
3111   echo "*** Your system doesn't have plugin support. All plugins will be built"
3112   echo "statically."
3113   plugin_support=false
3114 fi
3115
3116 dnl Export automake variables
3117 if ${plugin_support}
3118 then
3119   for plugin in `echo ${PLUGINS}`
3120   do
3121     eval "${plugin}_p=yes"
3122   done
3123 else
3124   BUILTINS="${BUILTINS} ${PLUGINS}"
3125   PLUGINS=
3126 fi
3127 AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
3128
3129 [if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
3130 then
3131   builtin_support=:
3132   for builtin in `echo ${BUILTINS}`
3133   do
3134     eval "${builtin}_b=yes"
3135   done
3136 fi]
3137 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
3138
3139 dnl Import substitution variables generated by bootstrap
3140 VLC_VARIABLES()
3141
3142 dnl
3143 dnl  Stuff used by the program
3144 dnl
3145 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
3146 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VLC media player - version ${VERSION} ${CODENAME} - (c) 1996-2003 VideoLAN", [Copyright string])
3147 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
3148
3149 VLC_SYMBOL="`echo ${VERSION} | sed -e 'y/.-/__/'`"
3150 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
3151 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
3152 AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])
3153
3154 DATA_PATH="${ac_tool_prefix}/share/vlc"
3155 AC_SUBST(DATA_PATH)
3156 PLUGIN_PATH="${ac_tool_prefix}/lib/vlc"
3157 AC_SUBST(PLUGIN_PATH)
3158
3159 dnl
3160 dnl  Restore *FLAGS
3161 dnl
3162 CPPFLAGS="${CPPFLAGS_save}"
3163 CFLAGS="${CFLAGS_save}"
3164 CXXFLAGS="${CXXFLAGS_save}"
3165 OBJCFLAGS="${OBJCFLAGS_save}"
3166 LDFLAGS="${LDFLAGS_save}"
3167
3168 dnl
3169 dnl  Fool automake (see Makefile.am)
3170 dnl
3171 AUTOMAKE_SUCKS="\$(L_builtin) \$(LDFLAGS_builtin)"
3172 AC_SUBST(AUTOMAKE_SUCKS)
3173
3174 dnl
3175 dnl  Create the vlc-config script
3176 dnl
3177 LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtins}"
3178 for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
3179
3180 dnl
3181 dnl  Configuration is finished
3182 dnl
3183 AC_SUBST(SYS)
3184 AC_SUBST(ARCH)
3185 AC_SUBST(PLUGINS)
3186 AC_SUBST(BUILTINS)
3187 AC_SUBST(ALIASES)
3188 AC_SUBST(ASM)
3189 AC_SUBST(MOC)
3190 AC_SUBST(WINDRES)
3191 AC_SUBST(XPIDL)
3192 AC_SUBST(LIBEXT)
3193 AC_SUBST(INCLUDES)
3194 AC_SUBST(ALL_LINGUAS)
3195
3196 AC_SUBST(CFLAGS_TUNING)
3197 AC_SUBST(CFLAGS_OPTIM)
3198 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
3199 AC_SUBST(CFLAGS_NOOPTIM)
3200 AC_SUBST(LDFLAGS)
3201
3202 AC_SUBST(CFLAGS_vlc)
3203 AC_SUBST(CFLAGS_pics)
3204 AC_SUBST(CXXFLAGS_pics)
3205 AC_SUBST(CFLAGS_plugins)
3206 AC_SUBST(CXXFLAGS_plugins)
3207 AC_SUBST(CFLAGS_builtins)
3208 AC_SUBST(CPPFLAGS_mozilla)
3209
3210 AC_SUBST(LDFLAGS_vlc)
3211 AC_SUBST(LDFLAGS_libvlc)
3212 AC_SUBST(LDFLAGS_plugins)
3213 AC_SUBST(LDFLAGS_builtins)
3214 AC_SUBST(LDFLAGS_mozilla)
3215
3216 AC_OUTPUT([
3217   Makefile
3218   autotools/Makefile
3219   debian/Makefile
3220   doc/Makefile
3221   intl/Makefile
3222   ipkg/Makefile
3223   lib/Makefile
3224   m4/Makefile
3225   modules/Makefile
3226   po/Makefile.in
3227   share/Makefile
3228   src/Makefile
3229   vlc-config
3230 ],[
3231   chmod a+x vlc-config
3232 ])
3233
3234 printf "
3235 vlc configuration
3236 --------------------
3237 vlc version           : ${VERSION}
3238 system                : ${SYS}
3239 architecture          : ${ARCH}
3240 build flavour         : "
3241 test "${DEBUG_TRUE}" = "" && printf "debug "
3242 test "${CPROF_TRUE}" = "" && printf "cprof "
3243 test "${GPROF_TRUE}" = "" && printf "gprof "
3244 test "${OPTIM_TRUE}" = "" && printf "optim "
3245 test "${RELEASE_TRUE}" = "" && printf "release " || printf "devel "
3246 echo "
3247 vlc aliases           :${ALIASES}
3248
3249 To build vlc and its plugins, type \`make'.
3250 "
3251