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