]> git.sesse.net Git - vlc/blob - configure.in
e78061d9906f225fdc9ea6904b5586d06b874219
[vlc] / configure.in
1 dnl Autoconf settings for vlc
2 AC_INIT(include/main.h)
3 AC_CONFIG_HEADER(include/defs.h)
4 AC_CANONICAL_SYSTEM
5
6 PACKAGE="vlc"
7 VERSION="0.3.1"
8 CODENAME=Ourumov
9
10 dnl Save CFLAGS and LDFLAGS
11 save_CFLAGS="${CFLAGS}"
12 save_CPPFLAGS="${CPPFLAGS}"
13 save_LDFLAGS="${LDFLAGS}"
14
15 dnl Check for tools
16 AC_PROG_MAKE_SET
17 AC_PROG_CC
18 AC_PROG_CPP
19
20 dnl Find the right ranlib, even when cross-compiling
21 AC_CHECK_TOOL(RANLIB, ranlib, :)
22 AC_CHECK_TOOL(STRIP, strip, :)
23
24 dnl Check for GNU make
25 AC_PATH_PROG(GMAKE, gmake, no)
26 if test "x$GMAKE" = "xno"; then
27   AC_CACHE_CHECK([whether GNU make is installed],
28       [ac_cv_gmake],
29       [if make --version | grep -q -i gnu; then
30          ac_cv_gmake="yes"
31        else
32          echo "This software needs you to install GNU make to compile properly."
33          echo "You can get it from http://www.gnu.org/."
34          exit
35        fi])
36   VLC_MAKE="make"
37 else
38   VLC_MAKE="gmake"
39 fi
40
41 dnl Gettext stuff
42 ALL_LINGUAS="de en_GB fr ja no ru nl"
43
44 AC_DEFINE_UNQUOTED(VLC_PACKAGE, "$PACKAGE", [Package name])
45 AC_DEFINE_UNQUOTED(VLC_VERSION, "$VERSION", [Package version])
46 AM_GNU_GETTEXT
47
48 dnl AM_PROG_LIBTOOL
49 AC_PROG_INSTALL
50
51 dnl
52 dnl  Check the operating system
53 dnl
54 case x"${target_os}" in
55   x)
56     SYS=unknown
57     ;;
58   xlinux*)
59     SYS=linux
60     ;;
61   xbsdi*)
62     SYS=bsdi
63     save_CFLAGS="${save_CFLAGS} -pthread"
64     dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
65     vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
66     ;;
67   x*bsd*)
68     SYS="${target_os}"
69     save_CFLAGS="${save_CFLAGS} -pthread"
70     ;;
71   xdarwin*)
72     SYS=darwin
73     save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"
74     ;;
75   x*mingw32*)
76     SYS=mingw32
77     AC_CHECK_TOOL(WINDRES, windres, :)
78     save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"
79     vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
80     vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
81     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
82     rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
83     ;;
84   x*nto*)
85     SYS=nto
86     x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
87     xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
88     ;;
89   xbeos)
90     SYS=beos
91     save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"
92     vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
93     plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
94     beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
95     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
96     ;;
97   x*)
98     SYS="${target_os}"
99     ;;
100 esac
101
102 dnl Flags for plugin compilation
103 if test x"${SYS}" = xmingw32
104 then
105   plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
106 else
107   plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
108 fi
109
110 dnl The -DSYS_FOO flag
111 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
112
113 dnl Check for system libs needed
114 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
115
116 AC_CHECK_FUNC(connect,,[
117   AC_CHECK_LIB(socket,connect,
118     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
119     vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
120 )])
121 AC_CHECK_FUNC(gethostbyname,,[
122   AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl")
123 ])
124 AC_CHECK_FUNC(gethostbyname,,[
125   AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
126 ])
127 AC_CHECK_FUNC(nanosleep,,[
128   AC_CHECK_LIB(rt,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lrt",[
129     AC_CHECK_LIB(posix4,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4")
130   ])
131 ])
132 AC_CHECK_FUNC(inet_aton,,[
133   AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
134 ])
135 AC_CHECK_FUNC(textdomain,,[
136   AC_CHECK_LIB(intl,textdomain,save_LDFLAGS="${save_LDFLAGS} -lintl")
137 ])
138
139 dnl Check for getopt
140 NEED_GETOPT=0
141 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
142 [ # FreeBSD has a gnugetopt library for this:
143   AC_CHECK_LIB([gnugetopt],[getopt_long],
144     [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
145     [NEED_GETOPT=1])])
146
147 AC_TYPE_SIGNAL
148 AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
149 AC_CHECK_LIB(m,cos,
150   imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
151   filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
152 AC_CHECK_LIB(m,pow,
153   imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
154   imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
155   imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
156   chroma_i420_rgb_LDFLAGS="${chroma_i420_rgb_LDFLAGS} -lm"
157 )
158
159 dnl Check for pthreads - borrowed from XMMS
160 THREAD_LIB=error
161 if test "x${THREAD_LIB}" = xerror; then
162   AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
163 fi
164 if test "x${THREAD_LIB}" = xerror; then
165   AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
166 fi
167 if test "x${THREAD_LIB}" = xerror; then
168   AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
169 fi
170 if test "x${THREAD_LIB}" = xerror; then
171   AC_CHECK_FUNC(pthread_attr_init)
172   THREAD_LIB=""
173 fi
174
175 dnl Check for cthreads under GNU/Hurd for instance
176 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
177
178 dnl Check for misc headers
179 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
180   AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
181             Define if <pthread.h> defines pthread_cond_t.)])
182 AC_EGREP_HEADER(strncasecmp,strings.h,[
183   AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
184             Define if <strings.h> defines strncasecmp.)])
185
186 dnl Check for headers
187 AC_CHECK_HEADERS(getopt.h strings.h)
188 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
189 AC_CHECK_HEADERS(dlfcn.h image.h)
190 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
191 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
192 AC_CHECK_HEADERS(linux/version.h)
193
194 AC_HEADER_TIME
195
196 dnl Check for threads library
197 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
198
199 dnl Check for DPMS
200 if test x$SYS != xmingw32
201 then
202   if test x$x_includes = xNONE; then
203     x_includes=/usr/X11R6/include
204   fi
205   if test x$x_libraries = xNONE; then
206     x_libraries=/usr/X11R6/lib
207   fi
208   CPPFLAGS="$save_CPPFLAGS -I$x_includes"
209   AC_CHECK_HEADERS(X11/extensions/dpms.h, [
210     AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
211       AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
212                 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
213     ])
214   ])
215   CPPFLAGS="$save_CPPFLAGS"
216 fi
217
218 dnl Check for ntohl, etc.
219 AC_CACHE_CHECK([for ntohl in sys/param.h],
220     [ac_cv_c_ntohl_sys_param_h],
221     [CFLAGS="${save_CFLAGS} -Wall -Werror"
222      AC_TRY_COMPILE([#include <sys/param.h>],
223         [void foo() { int meuh; ntohl(meuh); }],
224         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
225 if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
226     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
227 fi
228
229 dnl Check for inline function size limit
230 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
231     [ac_cv_c_inline_limit],
232     [CFLAGS="${save_CFLAGS} -finline-limit-30000"
233      AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
234 if test x"$ac_cv_c_inline_limit" != x"no"; then
235     save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
236 fi
237
238 dnl Check for -W or -w flags
239 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
240     [ac_cv_c_Wall_Winline],
241     [CFLAGS="${save_CFLAGS} -Wall -Winline"
242      AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
243 if test x"$ac_cv_c_Wall_Winline" != x"no"; then
244     save_CFLAGS="${save_CFLAGS} -Wall -Winline"
245 else
246     AC_CACHE_CHECK([if \$CC accepts -wall -winline],
247         [ac_cv_c_wall_winline],
248         [CFLAGS="${save_CFLAGS} -wall -winline"
249          AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
250     if test x"$ac_cv_c_wall_winline" != x"no"; then
251         save_CFLAGS="${save_CFLAGS} -wall -winline"
252     fi
253 fi
254
255 dnl Check for -pipe
256 AC_CACHE_CHECK([if \$CC accepts -pipe],
257     [ac_cv_c_pipe],
258     [CFLAGS="${save_CFLAGS} -pipe"
259      AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
260 if test x"$ac_cv_c_pipe" != x"no"; then
261     save_CFLAGS="${save_CFLAGS} -pipe"
262 fi
263
264 dnl Check for various optimization flags
265 AC_CACHE_CHECK([if \$CC accepts -O3],
266     [ac_cv_c_o3],
267     [CFLAGS="${save_CFLAGS} -O3"
268      AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
269 if test x"$ac_cv_c_o3" != x"no"; then
270     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
271 else
272     AC_CACHE_CHECK([if \$CC accepts -O2],
273         [ac_cv_c_o2],
274         [CFLAGS="${save_CFLAGS} -O2"
275          AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
276     if test x"$ac_cv_c_o2" != x"no"; then
277         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
278     else
279         AC_CACHE_CHECK([if \$CC accepts -O],
280             [ac_cv_c_o],
281             [CFLAGS="${save_CFLAGS} -O"
282              AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
283         if test x"$ac_cv_c_o" != x"no"; then
284             CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
285         fi
286     fi
287 fi
288
289 dnl Check for -ffast-math
290 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
291     [ac_cv_c_fast_math],
292     [CFLAGS="${save_CFLAGS} -ffast-math"
293      AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
294 if test x"$ac_cv_c_fast_math" != x"no"; then
295     CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
296 fi
297
298 dnl Check for -funroll-loops
299 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
300     [ac_cv_c_unroll_loops],
301     [CFLAGS="${save_CFLAGS} -funroll-loops"
302      AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
303 if test x"$ac_cv_c_unroll_loops" != x"no"; then
304     CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
305 fi
306
307 dnl Check for -fomit-frame-pointer
308 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
309     [ac_cv_c_omit_frame_pointer],
310     [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
311      AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
312 if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
313     CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
314 fi
315
316 dnl Check for Darwin plugin linking flags
317 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
318     [ac_cv_ld_darwin],
319     [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
320      AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
321 if test x"$ac_cv_ld_darwin" != x"no"; then
322     plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
323 fi
324
325 dnl Check for standard plugin linking flags
326 AC_CACHE_CHECK([if \$CC accepts -shared],
327     [ac_cv_ld_plugins],
328     [CFLAGS="${save_CFLAGS} -shared"
329      AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
330 if test x"$ac_cv_ld_plugins" != x"no"; then
331     plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
332 fi
333         
334 dnl Checks for __attribute__(aligned()) directive
335 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
336     [ac_cv_c_attribute_aligned],
337     [ac_cv_c_attribute_aligned=0
338         CFLAGS="${save_CFLAGS} -Werror"
339     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
340         AC_TRY_COMPILE([],
341         [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
342         [ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
343     done])
344 if test x"$ac_cv_c_attribute_aligned" != x"0"; then
345     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
346         [$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
347 fi
348
349 dnl End of the bizarre compilation tests
350 CFLAGS="${save_CFLAGS}"
351 CPPFLAGS="${save_CPPFLAGS}"
352 LDFLAGS="${save_LDFLAGS}"
353
354 dnl Check for boolean_t
355 AC_CACHE_CHECK([for boolean_t in sys/types.h],
356     [ac_cv_c_boolean_t_sys_types_h],
357     [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
358      ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
359 if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
360     AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
361 fi
362
363 AC_CACHE_CHECK([for boolean_t in pthread.h],
364     [ac_cv_c_boolean_t_pthread_h],
365     [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
366      ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
367 if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
368     AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
369 fi
370
371 AC_CACHE_CHECK([for boolean_t in cthreads.h],
372     [ac_cv_c_boolean_t_cthreads_h],
373     [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
374      ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
375 if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
376     AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
377 fi
378
379 dnl
380 dnl  Check the CPU
381 dnl
382 case x"${target_cpu}" in
383   x)
384     ARCH=unknown
385     ;;
386   *)
387     ARCH="${target_cpu}"
388     ;;
389 esac
390
391 dnl
392 dnl  default modules
393 dnl
394 BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
395 PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
396
397 dnl
398 dnl  Accelerated modules
399 dnl
400 MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
401 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
402 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
403 SSE_MODULES="imdctsse downmixsse"
404 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
405
406 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
407     [ac_cv_mmx_inline],
408     [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
409                     ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
410 if test x"$ac_cv_mmx_inline" != x"no"; then
411   ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
412 fi
413
414 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
415     [ac_cv_mmxext_inline],
416     [AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
417                     ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
418 if test x"$ac_cv_mmxext_inline" != x"no"; then
419   ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
420 fi
421
422 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
423     [ac_cv_3dnow_inline],
424     [AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
425                     ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
426 if test x"$ac_cv_3dnow_inline" != x"no"; then
427   AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
428   ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
429 fi
430
431 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
432     [ac_cv_sse_inline],
433     [AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
434                     ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
435 if test x"$ac_cv_sse_inline" != x"no" -a x$SYS != xmingw32; then
436   AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
437   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
438 fi
439
440 # don't try to grok altivec with native mingw32 it doesn't work right now
441 # we should be able to remove this test with future versions of mingw32
442 if test x$SYS != xmingw32; then
443 AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
444     [ac_cv_altivec_inline],
445     [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
446          ac_cv_altivec_inline=yes,
447          [save_CFLAGS=$CFLAGS
448           CFLAGS="$CFLAGS -Wa,-m7400"
449           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
450             [ac_cv_altivec_inline="-Wa,-m7400"],
451             ac_cv_altivec_inline=no)
452           CFLAGS=$save_CFLAGS
453          ])])
454 if test x"$ac_cv_altivec_inline" != x"no"; then
455   AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
456   if test x"$ac_cv_altivec_inline" != x"yes"; then
457     idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_altivec_inline"
458     motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_altivec_inline"
459     memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_altivec_inline"
460     vlc_CFLAGS="$vlc_CFLAGS $ac_cv_altivec_inline"
461   fi
462   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
463 fi
464
465 AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
466     [ac_cv_c_altivec],
467     [save_CFLAGS=$CFLAGS
468      CFLAGS="$CFLAGS -faltivec"
469      # Darwin test
470      AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
471         ac_cv_c_altivec=-faltivec, [
472         # Linux/PPC test
473         CFLAGS="$save_CFLAGS $idctaltivec_CFLAGS -fvec"
474         AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
475             [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
476         ])
477      CFLAGS=$save_CFLAGS
478     ])
479 if test x"$ac_cv_c_altivec" != x"no"; then
480   AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
481   idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_c_altivec"
482   motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_c_altivec"
483   memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_c_altivec"
484   vlc_CFLAGS="$vlc_CFLAGS $ac_cv_c_altivec"
485   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
486 fi
487
488 AC_CACHE_CHECK([if linker needs -framework vecLib],
489     [ac_cv_ld_altivec],
490     [save_LDFLAGS=$LDFLAGS
491      LDFLAGS="$LDFLAGS -framework vecLib"
492      AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
493      LDFLAGS=$save_LDFLAGS
494     ])
495 if test x"$ac_cv_ld_altivec" != x"no"; then
496   idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
497   motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
498   memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
499   vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
500 fi
501 fi # end if mingw32
502
503
504 AC_ARG_WITH(,[])
505 AC_ARG_WITH(,[Optimization options:])
506
507 dnl
508 dnl  Special arch tuning
509 dnl
510 AC_ARG_WITH(tuning,
511 [  --with-tuning=ARCH      enable special tuning for an architecture
512                           (default i686 on IA-32 and 750 on PPC)])
513 if test "x$with_tuning" != "x"; then
514     TUNING="$with_tuning"
515 else
516     if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
517     else
518         if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
519     fi
520 fi
521
522 dnl
523 dnl  x86 accelerations
524 dnl
525 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
526 then
527     ARCH="${ARCH} mmx"
528     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
529 fi
530
531 dnl
532 dnl  Enable/disable optimizations
533 dnl
534 AC_ARG_ENABLE(optimizations,
535 [  --disable-optimizations disable compiler optimizations (default enabled)],
536 [ if test x$enable_optimizations = xno; then OPTIMS=0; fi ],
537 [ OPTIMS=1 ])
538
539 dnl
540 dnl  AltiVec acceleration
541 dnl
542 AC_ARG_ENABLE(altivec,
543 [  --disable-altivec       disable altivec optimizations (default enabled on PPC)],
544 [ if test x$enable_altivec = xyes; then ARCH="${ARCH} altivec";
545     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
546 [ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
547     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
548
549 dnl
550 dnl  Debugging mode
551 dnl
552 DEBUG=0
553 AC_ARG_ENABLE(debug,
554 [  --enable-debug          debug mode (default disabled)],
555 [ if test x$enable_debug = xyes; then DEBUG=1; fi ])
556
557 dnl
558 dnl  Enable release-specific flags
559 dnl
560 RELEASE=0
561 AC_ARG_ENABLE(release,
562 [  --enable-release        activate extra optimizations (default disabled)],
563 [ if test x$enable_release = xyes; then RELEASE=1; fi ],
564 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
565
566 dnl
567 dnl  Input plugins
568 dnl
569
570 AC_ARG_WITH(,[Input plugins:])
571
572 dnl
573 dnl  DVD module: optionally check for installed libdvdcss
574 dnl
575 AC_ARG_ENABLE(dvd,
576 [  --enable-dvd            DVD input module (default enabled)])
577 if test "x$enable_dvd" != "xno"
578 then
579   AC_ARG_WITH(dvdcss, 
580   [    --with-dvdcss=PATH    libdvdcss headers and libraries])
581   AC_ARG_WITH(dvdcss-tree, 
582   [    --with-dvdcss-tree=PATH libdvdcss tree for static linking])
583   case "x$with_dvdcss" in
584   x|xyes)
585     if test "x$with_dvdcss_tree" = x
586     then
587       AC_CHECK_HEADERS(dvdcss/dvdcss.h,
588         [ PLUGINS="${PLUGINS} dvd"
589           dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
590         [ 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.])
591           AC_MSG_ERROR([cannot find libdvdcss headers]) ])
592     else
593       AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
594       real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
595       if test "x$real_dvdcss_tree" = x
596       then
597         dnl  The given directory can't be found
598         AC_MSG_RESULT(no)
599         AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
600       fi
601       if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
602       then
603         dnl  Use a custom libdvdcss
604         AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
605         BUILTINS="${BUILTINS} dvd"
606         dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
607         dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
608       else
609         dnl  The given libdvdcss wasn't built
610         AC_MSG_RESULT(no)
611         AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
612       fi
613     fi
614   ;;
615   xno)
616     dnl  Compile without dvdcss (dlopen version, works only under Linux)
617     PLUGINS="${PLUGINS} dvd"
618     dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
619     dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
620   ;;
621   *)
622     AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
623     if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
624     then
625       dnl  Use ${with_dvdcss}/include/dvdcss/dvdcss.h
626       AC_MSG_RESULT(yes)
627       PLUGINS="${PLUGINS} dvd"
628       dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
629       dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
630     else
631       dnl  No libdvdcss could be found, sorry
632       AC_MSG_RESULT(no)
633       AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
634     fi
635   ;;
636   esac
637 fi
638
639 dnl
640 dnl dvdread module: check for libdvdread plugin
641 dnl
642 AC_ARG_ENABLE(dvdread,
643 [  --enable-dvdread        dvdread input module (default disabled)])
644 if test "x$enable_dvdread" != "xno"
645 then
646   AC_ARG_WITH(dvdread, 
647   [    --with-dvdread=PATH   libdvdread headers and libraries])
648   if test "x$with_dvdread" = x
649   then
650     test_LDFLAGS=""
651     test_CFLAGS=""
652   else
653     test_LDFLAGS="-L${with_dvdread}/lib"
654     test_CFLAGS="-I${with_dvdread}/include"
655   fi
656   CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
657   AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
658      AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
659         [void foo() { int i=DVD_VIDEO_LB_LEN; }],[
660           PLUGINS="${PLUGINS} dvdread"
661           dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
662           dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
663         ],[
664           if test "x$enable_dvdread" != x
665           then
666             AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
667           fi
668         ])
669   ],[
670     if test "x$enable_dvdread" != x
671     then
672       if test "x$with_dvdread" != x
673       then
674         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
675       else
676         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
677       fi
678     fi
679   ])
680   CPPFLAGS="$save_CPPFLAGS"
681 fi
682
683 dnl
684 dnl  libdvbpsi ts demux
685 dnl
686 AC_ARG_ENABLE(dvbpsi,
687 [  --enable-dvbpsi        dvbpsi ts demux module (default disabled)])
688 if test "x$enable_dvbpsi" != "xno"
689 then
690   if test "x$with_dvbpsi" = x
691   then
692     test_LDFLAGS=""
693     test_CFLAGS=""
694   else
695     test_LDFLAGS="-L${with_dvbpsi}/lib"
696     test_CFLAGS="-I${with_dvbpsi}/include"
697   fi
698   CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
699   AC_CHECK_HEADER([dvbpsi/dvbpsi.h],[
700     PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
701     mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
702     mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
703     ],[
704     if test "x$enable_dvbpsi" != x
705     then
706       AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org])
707     fi
708   ])
709   CPPFLAGS="$save_CPPFLAGS"
710 fi
711  
712 dnl
713 dnl  VCD module
714 dnl
715 AC_ARG_ENABLE(vcd,
716   [  --enable-vcd            VCD support for Linux and MacOS X (default enabled)])
717
718 if test x$enable_vcd != xno
719 then
720   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
721     PLUGINS="${PLUGINS} vcd"
722   ])
723
724   if test "x${SYS}" = "xbsdi"
725   then
726     PLUGINS="${PLUGINS} vcd"
727   fi
728
729   if test "x${SYS}" = "xdarwin"
730   then
731     PLUGINS="${PLUGINS} vcd"
732     vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation" 
733   fi
734 fi
735
736 dnl
737 dnl  Satellite input module
738 dnl
739 AC_ARG_ENABLE(satellite,
740   [  --enable-satellite      satellite card support (default disabled)],
741   [ if test x$enable_satellite = xyes
742     then
743       PLUGINS="${PLUGINS} satellite"
744     fi])
745
746 dnl
747 dnl  ipv6 plugin
748 dnl
749 AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
750
751 dnl
752 dnl  AVI demux plugin
753 dnl
754 AC_ARG_ENABLE(avi,
755   [  --enable-avi            AVI demux module (default enabled)])
756 if test x$enable_avi != xno
757 then
758   PLUGINS="${PLUGINS} avi"
759 fi
760
761 dnl
762 dnl  Codec plugins
763 dnl
764
765 AC_ARG_WITH(,[Codec plugins:])
766
767 dnl
768 dnl  mad plugin
769 dnl
770 AC_ARG_ENABLE(mad,
771   [  --enable-mad            libmad module (default disabled)])
772 if test x$enable_mad = xyes
773 then
774   PLUGINS="${PLUGINS} mad"
775   mad_LDFLAGS="${mad_LDFLAGS} -lmad"
776   AC_ARG_WITH(mad,
777     [    --with-mad=PATH       path to libmad],
778     [ if test "x$with_mad" != "xno" -a "x$with_mad" != "x"
779       then
780         mad_CFLAGS="${mad_CFLAGS} -I$with_mad/include"
781         mad_LDFLAGS="${mad_LDFLAGS} -L$with_mad/lib"
782       fi ])
783   save_CFLAGS=$CFLAGS
784   save_LDFLAGS=$LDFLAGS
785   CFLAGS="$CFLAGS $mad_CFLAGS"
786   LDFLAGS="$LDFLAGS $mad_LDFLAGS"
787   AC_CHECK_HEADERS(mad.h, ,
788   [ echo "Cannot find development headers for libmad..."
789     exit 1
790   ])
791   AC_CHECK_LIB(mad, mad_bit_init, ,
792   [ echo "Cannot find libmad library..."
793     exit 1
794   ])
795   CFLAGS=$save_CFLAGS
796   LDFLAGS=$save_LDFLAGS
797 fi
798
799 dnl
800 dnl  ffmpeg decoder plugin
801 dnl
802 AC_ARG_ENABLE(ffmpeg,
803 [  --enable-ffmpeg         ffmpeg codec (default disabled)])
804 if test "x$enable_ffmpeg" = "xyes"
805 then
806   AC_ARG_WITH(ffmpeg-tree, 
807   [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
808   if test "x$with_ffmpeg_tree" = x
809   then
810     AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a])
811   else
812     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
813     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
814     if test "x$real_ffmpeg_tree" = x
815     then
816       dnl  The given directory can't be found
817       AC_MSG_RESULT(no)
818       AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
819     fi
820     if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
821     then
822       dnl  Use a custom libffmpeg
823       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
824       BUILTINS="${BUILTINS} ffmpeg"
825       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
826       ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
827     else
828       dnl  The given libavcodec wasn't built
829       AC_MSG_RESULT(no)
830       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
831     fi
832   fi
833 fi
834
835
836 dnl special case for BeOS
837 if test x$SYS = xbeos
838 then
839     PLUGINS="${PLUGINS} beos"
840 fi
841
842 dnl
843 dnl  a52 AC3 decoder plugin
844 dnl
845 AC_ARG_ENABLE(a52,
846   [  --enable-a52            AC3 support with liba52 (default enabled)])
847 if test "x$enable_a52" != "xno" -a x$SYS != xmingw32
848   then
849     AC_CHECK_HEADERS(a52dec/a52.h, [
850       BUILTINS="${BUILTINS} a52"
851       a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
852      ],[])
853 fi
854
855 dnl
856 dnl  ogg vorbis plugin
857 dnl
858 AC_ARG_ENABLE(vorbis,
859   [  --enable-vorbis         Ogg/Vorbis decoder support (default enabled)])
860 if test "x$enable_vorbis" != "xno"
861 then
862   AC_CHECK_HEADERS(ogg/ogg.h, [
863     dnl disabled for the moment
864     #PLUGINS="${PLUGINS} vorbis"
865     vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
866    ],[])
867 fi
868
869 dnl
870 dnl  Video plugins
871 dnl
872
873 AC_ARG_WITH(,[Video plugins:])
874
875 dnl
876 dnl  X11 module
877 dnl  (enabled by default except on win32)
878 dnl
879 AC_ARG_ENABLE(x11,
880   [  --enable-x11            X11 support (default enabled)])
881 if test x$enable_x11 != xno &&
882   (test x$SYS != xmingw32 || test x$enable_x11 = xyes); then
883   if test x$x_includes = xNONE; then
884     x_includes=/usr/X11R6/include
885   fi
886   if test x$x_libraries = xNONE; then
887     x_libraries=/usr/X11R6/lib
888   fi
889   CPPFLAGS="$save_CPPFLAGS -I$x_includes"
890   AC_CHECK_HEADERS(X11/Xlib.h, [
891     PLUGINS="${PLUGINS} x11"
892     x11_LDFLAGS="${x11_LDFLAGS} -L$x_libraries -lX11 -lXext"
893     x11_CFLAGS="${x11_CFLAGS} -I$x_includes"
894   ])
895   CPPFLAGS="$save_CPPFLAGS"
896 fi
897
898 dnl
899 dnl  XVideo module
900 dnl  (enabled by default except on win32)
901 dnl
902 AC_ARG_ENABLE(xvideo,
903   [  --enable-xvideo         XVideo support (default enabled)])
904 if test x$enable_xvideo != xno &&
905   (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); then
906   if test x$x_includes = xNONE; then
907     x_includes=/usr/X11R6/include
908   fi
909   if test x$x_libraries = xNONE; then
910     x_libraries=/usr/X11R6/lib
911   fi
912   save_CPPFLAGS=$CPPFLAGS
913   CPPFLAGS="$save_CPPFLAGS -I$x_includes"
914   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
915     save_CFLAGS=$CFLAGS
916     CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
917     AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
918       # We have Xv_pic, that's good, we can build an xvideo.so plugin !
919       PLUGINS="${PLUGINS} xvideo"
920       xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv_pic"
921       xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes",
922       # We don't have Xv_pic, let's make xvideo.a as builtin
923       BUILTINS="${BUILTINS} xvideo"
924       xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv"
925       xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes")
926     CFLAGS="$save_CFLAGS"
927   ]
928   CPPFLAGS="$save_CPPFLAGS")
929 fi
930
931 dnl
932 dnl  SDL module
933 dnl
934 AC_ARG_ENABLE(sdl,
935   [  --enable-sdl            SDL support (default enabled)])
936 if test "x$enable_sdl" != "xno"
937 then
938   SDL_PATH=$PATH
939   AC_ARG_WITH(sdl-config-path,
940     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
941     [ if test "x$with_sdl" != "xno"
942       then
943         SDL_PATH="$with_sdl:$PATH"
944       fi ])
945   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
946   SDL_CONFIG=${SDL12_CONFIG}
947   SDL_HEADER="SDL12/SDL.h"
948   if test x${SDL_CONFIG} = xno
949   then
950     AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
951     SDL_CONFIG=${SDL11_CONFIG}
952     SDL_HEADER="SDL11/SDL.h"
953   fi
954   if test x${SDL_CONFIG} = xno
955   then
956     AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
957     SDL_HEADER="SDL/SDL.h"
958   fi
959   if test x${SDL_CONFIG} != xno
960   then
961     PLUGINS="${PLUGINS} sdl"
962     sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
963     sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
964     CPPFLAGS="$save_CPPFLAGS $sdl_CFLAGS"
965     AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
966       <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
967       [ AC_MSG_ERROR([The development package for SDL is not installed. 
968 Please install it and try again. Alternatively you can also configure with 
969 --disable-sdl.])
970       ])
971     CPPFLAGS="$save_CPPFLAGS"
972     if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
973     then
974       AC_MSG_ERROR([The development package for SDL is not installed.
975 Please install it and try again. Alternatively you can also configure with
976 --disable-sdl.])
977     fi
978   elif test "x$enable_sdl" =  "xyes"
979   then
980     AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
981 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
982     ])
983   fi
984 fi
985
986 dnl
987 dnl  Windows DirectX module
988 dnl
989 AC_ARG_ENABLE(directx,
990   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
991 if test "x$enable_directx" != "xno"
992 then
993   if test x$SYS = xmingw32
994   then
995     AC_ARG_WITH(directx, 
996     [    --with-directx=PATH   Win32 DirectX headers and libraries])
997     if test "x$with_directx" = "x"
998     then
999       AC_CHECK_HEADERS(ddraw.h,
1000       [ PLUGINS="${PLUGINS} directx"
1001         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1002     else
1003       AC_MSG_CHECKING(for directX headers in ${with_directx})
1004       if test -f ${with_directx}/ddraw.h
1005       then
1006         PLUGINS="${PLUGINS} directx"
1007         directx_LDFLAGS="${directx_LDFLAGS} -L${with_directx}/lib -lgdi32"
1008         directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
1009         AC_MSG_RESULT(yes)
1010       else
1011         AC_MSG_RESULT(no)
1012         AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1013       fi
1014     fi
1015   fi
1016 fi
1017
1018 dnl
1019 dnl  Linux framebuffer module
1020 dnl
1021 AC_ARG_ENABLE(fb,
1022   [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
1023     if test x$enable_fb != xno
1024     then
1025       AC_CHECK_HEADERS(linux/fb.h, [
1026         PLUGINS="${PLUGINS} fb"
1027       ])
1028     fi
1029
1030 dnl
1031 dnl  Linux MGA module
1032 dnl
1033 AC_ARG_ENABLE(mga,
1034   [  --enable-mga            Linux kernel Matrox support (default disabled)],
1035   [ if test x$enable_mga = xyes
1036     then
1037       PLUGINS="${PLUGINS} mga xmga"
1038     fi ])
1039
1040 dnl
1041 dnl  GGI module
1042 dnl
1043 AC_ARG_ENABLE(ggi,
1044   [  --enable-ggi            GGI support (default disabled)])
1045 if test x$enable_ggi = xyes
1046 then
1047   PLUGINS="${PLUGINS} ggi"
1048   ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
1049   AC_ARG_WITH(ggi,
1050     [    --with-ggi=PATH       path to libggi],
1051     [ if test "x$with_ggi" != "xno" -a "x$with_ggi" != "x"
1052       then
1053         CFLAGS_GGI="${CFLAGS_GGI} -I$with_ggi/include"
1054         ggi_LDFLAGS="${ggi_LDFLAGS} -L$with_ggi/lib"
1055       fi ])
1056 fi
1057
1058 dnl
1059 dnl  Glide module
1060 dnl
1061 AC_ARG_ENABLE(glide,
1062   [  --enable-glide          Glide (3dfx) support (default disabled)])
1063 if test x$enable_glide = xyes
1064 then
1065   PLUGINS="${PLUGINS} glide"
1066   glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
1067   glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
1068   AC_ARG_WITH(glide,
1069     [    --with-glide=PATH     path to libglide],
1070     [ if test "x$with_glide" != "xno" -a "x$with_glide" != "x"
1071       then
1072         glide_CFLAGS="${glide_CFLAGS} -I$with_glide/include"
1073         glide_LDFLAGS="${glide_LDFLAGS} -L$with_glide/lib"
1074       fi ])
1075 fi
1076
1077 dnl
1078 dnl  AA plugin
1079 dnl
1080 AC_ARG_ENABLE(aa,
1081   [  --enable-aa             aalib output (default disabled)])
1082 if test x$enable_aa = xyes
1083 then
1084   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1085   if test x$have_aa = xtrue
1086   then
1087     PLUGINS="${PLUGINS} aa"
1088     aa_LDFLAGS="${aa_LDFLAGS} -laa"
1089   fi
1090 fi
1091
1092 dnl
1093 dnl  Audio plugins
1094 dnl
1095
1096 AC_ARG_WITH(,[Audio plugins:])
1097
1098 dnl
1099 dnl  OSS /dev/dsp module (enabled by default except on win32)
1100 dnl
1101 AC_ARG_ENABLE(dsp,
1102   [  --enable-dsp            Linux /dev/dsp support (enabled on Linux)])
1103
1104 if test x$enable_dsp != xno &&
1105   (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
1106 then
1107   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1108     PLUGINS="${PLUGINS} dsp"
1109     AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
1110   ])
1111 fi
1112
1113 dnl
1114 dnl  Esound module
1115 dnl
1116 AC_ARG_ENABLE(esd,
1117   [  --enable-esd            Esound library support (default disabled)],
1118   [if test x$enable_esd = xyes
1119    then
1120      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1121      if test x${ESD_CONFIG} != xno
1122      then
1123        PLUGINS="${PLUGINS} esd"
1124        esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1125        esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1126      fi
1127    fi])
1128
1129 dnl
1130 dnl  aRts module
1131 dnl
1132 AC_ARG_ENABLE(arts,
1133   [  --enable-arts           aRts sound server (default disabled)],
1134   [if test x$enable_arts = xyes
1135    then
1136      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1137      if test x${ARTS_CONFIG} != xno
1138      then
1139        PLUGINS="${PLUGINS} arts"
1140        arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1141        arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1142      fi
1143    fi])
1144
1145 dnl
1146 dnl  ALSA module
1147 dnl
1148 AC_ARG_ENABLE(alsa,
1149   [  --enable-alsa           ALSA sound support for Linux (default disabled)],
1150   [if test x$enable_alsa = xyes
1151    then
1152      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1153      if test x$have_alsa = xtrue
1154      then
1155        PLUGINS="${PLUGINS} alsa"
1156        alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1157      fi
1158    fi])
1159
1160 dnl
1161 dnl  win32 waveOut plugin
1162 dnl
1163 AC_ARG_ENABLE(waveout,
1164   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
1165 if test "x$enable_waveout" != "xno" -a x$SYS = xmingw32
1166   then
1167     PLUGINS="${PLUGINS} waveout"
1168     waveout_LDFLAGS="-lwinmm"
1169 fi
1170
1171 dnl
1172 dnl  Interface plugins
1173 dnl
1174
1175 AC_ARG_WITH(,[Interface plugins:])
1176
1177 dnl
1178 dnl  Gtk+ module
1179 dnl
1180 AC_ARG_ENABLE(gtk,
1181   [  --enable-gtk            Gtk+ support (default enabled)])
1182 if test x$enable_gtk != xno
1183 then
1184   GTK_PATH=$PATH
1185   AC_ARG_WITH(gtk-config-path,
1186     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1187     [ if test "x$with_gtk" != "xno"
1188       then
1189         GTK_PATH="$with_gtk:$PATH"
1190       fi ])
1191   # look for gtk-config
1192   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
1193   GTK_CONFIG=${GTK12_CONFIG}
1194   if test x${GTK_CONFIG} = xno
1195   then
1196     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
1197   fi
1198   if test x${GTK_CONFIG} != xno
1199   then
1200     if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
1201     then
1202       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.])
1203     fi
1204     gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1205     gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1206     # now look for the gtk.h header
1207     CPPFLAGS="$save_CPPFLAGS $gtk_CFLAGS"
1208     ac_cv_gtk_headers=yes
1209     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1210       ac_cv_gtk_headers=no
1211       echo "Cannot find gtk development headers."
1212     ])
1213     if test "x$ac_cv_gtk_headers" = xyes
1214     then
1215       PLUGINS="${PLUGINS} gtk"
1216       ALIASES="${ALIASES} gvlc"
1217     fi
1218     CPPFLAGS="$save_CPPFLAGS"
1219   fi
1220 fi
1221
1222 dnl
1223 dnl  Gnome module
1224 dnl
1225 AC_ARG_ENABLE(gnome,
1226   [  --enable-gnome          Gnome interface support (default disabled)],
1227   [if test x$enable_gnome = xyes; then
1228     # look for gnome-config
1229     AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1230     if test -x ${GNOME_CONFIG}
1231     then
1232        gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1233        gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1234     fi
1235     # now look for the gnome.h header
1236     CPPFLAGS="$save_CPPFLAGS $gnome_CFLAGS"
1237     AC_CHECK_HEADERS(gnome.h, [
1238       PLUGINS="${PLUGINS} gnome"
1239       ALIASES="${ALIASES} gnome-vlc"
1240      ],[
1241       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1242 developement tools or remove the --enable-gnome option])
1243      ])
1244     CPPFLAGS="$save_CPPFLAGS"
1245   fi])
1246
1247 dnl
1248 dnl  Qt module
1249 dnl
1250 AC_ARG_ENABLE(qt,
1251   [  --enable-qt             Qt interface support (default disabled)],
1252   [if test x$enable_qt = xyes; then
1253      PLUGINS="${PLUGINS} qt"
1254      ALIASES="${ALIASES} qvlc"
1255      qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1256      qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1257      if test -x ${QTDIR}/bin/moc
1258      then
1259        MOC=${QTDIR}/bin/moc
1260      else
1261        MOC=moc
1262      fi
1263    fi])
1264
1265 dnl 
1266 dnl  KDE module
1267 dnl
1268 AC_ARG_ENABLE(kde,
1269   [  --enable-kde            KDE interface support (default disabled)],
1270   [if test x$enable_kde = xyes; then
1271      PLUGINS="${PLUGINS} kde"
1272      ALIASES="${ALIASES} kvlc"
1273      kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1274      kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1275      kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1276      if test -x ${QTDIR}/bin/moc
1277      then
1278        MOC=${QTDIR}/bin/moc
1279      else
1280        MOC=moc
1281      fi
1282    fi])
1283
1284 dnl
1285 dnl  MacOS X module
1286 dnl
1287 AC_ARG_ENABLE(macosx,
1288   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
1289   [if test x$enable_macosx = xyes
1290    then
1291      BUILTINS="${BUILTINS} macosx"
1292      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc"
1293      macosx_CFLAGS="${macosx_CFLAGS} -ObjC"
1294      LDFLAGS="${LDFLAGS} -ObjC"
1295    fi],
1296   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1297      BUILTINS="${BUILTINS} macosx"
1298      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc"
1299      macosx_CFLAGS="${macosx_CFLAGS} -ObjC"
1300      LDFLAGS="${LDFLAGS} -ObjC"
1301    )])
1302
1303 dnl
1304 dnl  QNX RTOS module
1305 dnl
1306 AC_ARG_ENABLE(qnx,
1307   [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
1308     if test x$enable_qnx != xno
1309     then
1310       AC_CHECK_HEADERS(Ph.h, [
1311         PLUGINS="${PLUGINS} qnx"
1312         qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1313       ])
1314     fi
1315
1316 dnl
1317 dnl  Windows native interface module, built with Borland C++ Builder
1318 dnl
1319 AC_ARG_ENABLE(intfwin,
1320 [  --enable-intfwin        Win32 interface support (default disabled)],
1321 [ if test "x$enable_intfwin" != "xno"
1322   then
1323     AC_ARG_WITH(bcbuilder, 
1324     [    --with-bcbuilder=PATH Borland C++ Builder installation path])
1325     if test "x$with_bcbuilder" != "x"
1326     then
1327       BCBUILDER="$with_bcbuilder"
1328     fi
1329     PLUGINS="${PLUGINS} intfwin"
1330   fi ])
1331
1332 dnl
1333 dnl  ncurses module
1334 dnl
1335 AC_ARG_ENABLE(ncurses,
1336   [  --enable-ncurses        ncurses interface support (default disabled)],
1337   [if test x$enable_ncurses = xyes; then
1338      PLUGINS="${PLUGINS} ncurses"
1339      ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1340    fi])
1341
1342 dnl
1343 dnl  Lirc plugin
1344 dnl
1345 AC_ARG_ENABLE(lirc,
1346   [  --enable-lirc           lirc support (default disabled)])
1347 if test x$enable_lirc = xyes
1348 then
1349   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1350   if test x$have_lirc = xtrue
1351   then
1352     PLUGINS="${PLUGINS} lirc"
1353     lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1354   fi
1355 fi
1356
1357 AC_ARG_WITH(,[Misc options:])
1358
1359 dnl
1360 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1361 dnl
1362 dnl  We give the user the opportunity to specify
1363 dnl  --with-words=big or --with-words=little ; otherwise, try to guess
1364 dnl
1365 AC_ARG_WITH(words,
1366   [  --with-words=endianness set endianness (big or little)])
1367   case "x$with_words" in
1368     xbig)
1369       ac_cv_c_bigendian=yes
1370       ;;
1371     xlittle)
1372       ac_cv_c_bigendian=no
1373       ;;
1374     *)
1375       dnl  Try to guess endianness by matching patterns on a compiled
1376       dnl  binary, by looking for an ASCII or EBCDIC string
1377       AC_CACHE_CHECK([whether the byte order is big-endian],
1378         [ac_cv_c_bigendian],
1379         [ac_cv_c_bigendian=unknown
1380         [cat >conftest.c <<EOF
1381         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1382         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1383         void _a(void) { char*s = (char*)am; s = (char *)ai; }
1384         short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1385         short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1386         void _e(void) { char*s = (char*)em; s = (char*)ei; }
1387         int main(void) { _a(); _e(); return 0; }
1388 EOF
1389         ]
1390         if test -f conftest.c
1391         then 
1392           if ${CC-cc} -c conftest.c -o conftest.o >config.log 2>&1 \
1393               && test -f conftest.o
1394           then
1395             if test "`strings conftest.o | grep BIGenDianSyS`"
1396             then
1397               ac_cv_c_bigendian=yes
1398             fi
1399             if test "`strings conftest.o | grep LiTTleEnDian`"
1400             then
1401               ac_cv_c_bigendian=no
1402             fi
1403           fi
1404         fi
1405       ])
1406       if test x$ac_cv_c_bigendian = xunknown
1407       then
1408         AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1409       fi
1410       ;;
1411   esac
1412 dnl  Now we know what to use for endianness, just put it in the header
1413 if test $ac_cv_c_bigendian = yes
1414 then
1415   AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1416 fi
1417
1418 dnl
1419 dnl  Profiling
1420 dnl
1421 GPROF=0
1422 AC_ARG_ENABLE(gprof,
1423 [  --enable-gprof          gprof profiling (default disabled)],
1424 [ if test "x$enable_gprof" = "xyes"; then GPROF=1; fi ])
1425
1426 CPROF=0
1427 AC_ARG_ENABLE(cprof,
1428 [  --enable-cprof          cprof profiling (default disabled)],
1429 [ if test "x$enable_cprof" = "xyes";
1430   then
1431     LDFLAGS="${LDFLAGS} -lcprof"
1432     CPROF=1
1433   fi
1434 ])
1435
1436 dnl
1437 dnl  GNU portable threads
1438 dnl
1439 AC_ARG_ENABLE(pth,
1440   [  --enable-pth            GNU Pth support (default disabled)],
1441   [ if test "x$enable_pth" = "xyes"; then
1442     AC_CHECK_LIB(pth,pth_init)
1443     AC_EGREP_HEADER(pth_init,pth.h,[
1444       AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1445                 Define if <pth.h> defines pth_init)
1446     THREAD_LIB="-lpth"
1447     fi])
1448 ])
1449
1450 dnl
1451 dnl  State Threads
1452 dnl
1453 AC_ARG_ENABLE(st,
1454   [  --enable-st             State Threads (default disabled)],
1455   [ if test "x$enable_st" = "xyes"; then
1456     AC_CHECK_LIB(st,st_init)
1457     AC_EGREP_HEADER(st_init,st.h,[
1458       AC_DEFINE(ST_INIT_IN_ST_H, 1,
1459                 Define if <st.h> defines st_init)
1460     THREAD_LIB="-lst"
1461     fi])
1462 ])
1463
1464 LDFLAGS="${LDFLAGS} ${THREAD_LIB}"
1465
1466 dnl
1467 dnl  Plug-ins - this must be AT THE END
1468 dnl
1469 AC_ARG_ENABLE(plugins,
1470   [  --disable-plugins       make all plug-ins built-in (default plug-ins enabled)],
1471   [if test x$enable_plugins = xno
1472    then
1473      BUILTINS="${BUILTINS} ${PLUGINS}"
1474      PLUGINS=
1475    fi])
1476
1477 dnl Automagically disable plug-ins if there is no system support for .so files
1478 dnl don't forget vlc-win32 still can load .so as plugins
1479 if test x$ac_cv_header_dlfcn_h = xno -a x$ac_cv_header_image_h = xno -a x$SYS != xmingw32
1480 then
1481   echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1482   echo "as built-in"
1483   BUILTINS="${BUILTINS} ${PLUGINS}"
1484   PLUGINS=
1485 fi
1486
1487 dnl
1488 dnl  Stuff used by the program
1489 dnl
1490 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VERSION $CODENAME Copyright 1996-2002 VideoLAN", [Simple version string])
1491 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VERSION $CODENAME - (c) 1996-2002 VideoLAN", [Copyright string])
1492
1493 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
1494 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL", [String suffix for module functions])
1495 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL, [Symbol suffix for module functions])
1496
1497 DATA_PATH="${ac_tool_prefix}/share/videolan"
1498 AC_SUBST(DATA_PATH)
1499 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1500 AC_SUBST(PLUGIN_PATH)
1501
1502 dnl 
1503 dnl  Configuration is finished
1504 dnl
1505 AC_SUBST(SYS)
1506 AC_SUBST(ARCH)
1507 AC_SUBST(PLUGINS)
1508 AC_SUBST(BUILTINS)
1509 AC_SUBST(ALIASES)
1510 AC_SUBST(DEBUG)
1511 AC_SUBST(ASM)
1512 AC_SUBST(CPROF)
1513 AC_SUBST(GPROF)
1514 AC_SUBST(OPTIMS)
1515 AC_SUBST(TUNING)
1516 AC_SUBST(RELEASE)
1517 AC_SUBST(MOC)
1518 AC_SUBST(WINDRES)
1519 AC_SUBST(BCBUILDER)
1520 AC_SUBST(PACKAGE)
1521 AC_SUBST(VERSION)
1522 AC_SUBST(NEED_GETOPT)
1523
1524 AC_SUBST(CFLAGS_OPTIM)
1525 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
1526 AC_SUBST(LDFLAGS)
1527
1528 AC_SUBST(vlc_CFLAGS)
1529 AC_SUBST(plugins_CFLAGS)
1530 AC_SUBST(builtins_CFLAGS)
1531
1532 AC_SUBST(arts_CFLAGS)
1533 AC_SUBST(dvd_CFLAGS)
1534 AC_SUBST(dvdread_CFLAGS)
1535 AC_SUBST(mpeg_ts_dvbpsi_CFLAGS)
1536 AC_SUBST(directx_CFLAGS)
1537 AC_SUBST(esd_CFLAGS)
1538 AC_SUBST(ffmpeg_CFLAGS)
1539 AC_SUBST(glide_CFLAGS)
1540 AC_SUBST(gnome_CFLAGS)
1541 AC_SUBST(gtk_CFLAGS)
1542 AC_SUBST(kde_CFLAGS)
1543 AC_SUBST(idctaltivec_CFLAGS)
1544 AC_SUBST(macosx_CFLAGS)
1545 AC_SUBST(mad_CFLAGS)
1546 AC_SUBST(memcpyaltivec_CFLAGS)
1547 AC_SUBST(motionaltivec_CFLAGS)
1548 AC_SUBST(qt_CFLAGS)
1549 AC_SUBST(sdl_CFLAGS)
1550 AC_SUBST(x11_CFLAGS)
1551 AC_SUBST(xvideo_CFLAGS)
1552
1553 AC_SUBST(vlc_LDFLAGS)
1554 AC_SUBST(plugins_LDFLAGS)
1555 AC_SUBST(builtins_LDFLAGS)
1556
1557 AC_SUBST(a52_LDFLAGS)
1558 AC_SUBST(aa_LDFLAGS)
1559 AC_SUBST(alsa_LDFLAGS)
1560 AC_SUBST(arts_LDFLAGS)
1561 AC_SUBST(beos_LDFLAGS)
1562 AC_SUBST(chroma_i420_rgb_LDFLAGS)
1563 AC_SUBST(directx_LDFLAGS)
1564 AC_SUBST(dsp_LDFLAGS)
1565 AC_SUBST(dvd_LDFLAGS)
1566 AC_SUBST(dvdread_LDFLAGS)
1567 AC_SUBST(mpeg_ts_dvbpsi_LDFLAGS)
1568 AC_SUBST(esd_LDFLAGS)
1569 AC_SUBST(filter_distort_LDFLAGS)
1570 AC_SUBST(ffmpeg_LDFLAGS)
1571 AC_SUBST(ggi_LDFLAGS)
1572 AC_SUBST(glide_LDFLAGS)
1573 AC_SUBST(gnome_LDFLAGS)
1574 AC_SUBST(gtk_LDFLAGS)
1575 AC_SUBST(idctaltivec_LDFLAGS)
1576 AC_SUBST(imdct_LDFLAGS)
1577 AC_SUBST(imdct3dn_LDFLAGS)
1578 AC_SUBST(imdctsse_LDFLAGS)
1579 AC_SUBST(ipv4_LDFLAGS)
1580 AC_SUBST(kde_LDFLAGS)
1581 AC_SUBST(lirc_LDFLAGS)
1582 AC_SUBST(macosx_LDFLAGS)
1583 AC_SUBST(mad_LDFLAGS)
1584 AC_SUBST(memcpyaltivec_LDFLAGS)
1585 AC_SUBST(motionaltivec_LDFLAGS)
1586 AC_SUBST(ncurses_LDFLAGS)
1587 AC_SUBST(qnx_LDFLAGS)
1588 AC_SUBST(qt_LDFLAGS)
1589 AC_SUBST(rc_LDFLAGS)
1590 AC_SUBST(sdl_LDFLAGS)
1591 AC_SUBST(vcd_LDFLAGS)
1592 AC_SUBST(vorbis_LDFLAGS)
1593 AC_SUBST(waveout_LDFLAGS)
1594 AC_SUBST(x11_LDFLAGS)
1595 AC_SUBST(xvideo_LDFLAGS)
1596
1597 AC_OUTPUT([Makefile.opts po/Makefile.in])
1598
1599 echo "
1600 vlc configuration
1601 --------------------
1602 vlc version           : ${VERSION}
1603 system                : ${SYS}
1604 architecture          : ${ARCH}
1605 optimizations         : ${OPTIMS}
1606 tuning                : ${TUNING}
1607 debug mode            : ${DEBUG}
1608 release               : ${RELEASE}
1609 cprof/gprof support   : ${CPROF}/${GPROF}
1610 need builtin getopt   : ${NEED_GETOPT}
1611 built-in modules      :${BUILTINS}
1612 plug-in modules       :${PLUGINS}
1613 vlc aliases           :${ALIASES}
1614
1615 You may now tune Makefile.opts at your convenience, for instance to choose
1616 which modules get compiled as plugins.
1617
1618 To build vlc and its plugins, type \`$VLC_MAKE'.
1619 "
1620