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