1 dnl Autoconf settings for vlc
2 AC_INIT(src/interface/main.c)
3 AC_CONFIG_HEADER(include/defs.h)
10 AC_SUBST(VLC_CODENAME)
20 dnl Check for compiler environment
24 dnl Check for system libs needed
25 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
26 AC_CHECK_FUNCS(setenv putenv)
27 AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect,LIB="${LIB} -lsocket")])
28 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname,LIB="${LIB} -lnsl")])
29 AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,LIB="${LIB} -lrt",[AC_CHECK_LIB(posix4,nanosleep,LIB="${LIB} -lposix4")])])
30 AC_CHECK_FUNCS(usleep)
31 AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")])
32 AC_CHECK_FUNCS(vasprintf)
34 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
35 [ # FreeBSD has a gnugetopt library for this:
36 AC_CHECK_LIB([gnugetopt],[getopt_long],
37 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB="${LIB} -lgnugetopt"],
43 AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl")
44 AC_CHECK_LIB(m,pow,LIB_YUV="${LIB_YUV} -lm")
45 AC_MSG_CHECKING(for old style FreeBSD -pthread flag)
47 [#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version <= 500001
51 DEFINE="${DEFINE} -D_THREAD_SAFE" LIB="${LIB} -pthread",
53 AC_CHECK_LIB(pthread,pthread_create,LIB="${LIB} -lpthread"))
54 AC_CHECK_LIB(threads,thread_create,LIB="${LIB} -lthreads")
56 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
57 AC_CHECK_HEADERS(stddef.h)
58 AC_CHECK_HEADERS(getopt.h)
59 AC_CHECK_HEADERS(sys/sockio.h)
60 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
61 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
62 AC_CHECK_HEADERS(dlfcn.h image.h)
63 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
64 AC_CHECK_HEADERS(machine/param.h)
66 dnl Check for threads library
67 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
69 dnl Do a series of bizarre compilation tests
72 dnl Check for ntohl, etc.
73 CFLAGS="${CFLAGS} -Wall -Werror"
74 AC_MSG_CHECKING([for ntohl in sys/param.h])
75 AC_TRY_COMPILE([#include <sys/param.h>
76 void foo() { int meuh; ntohl(meuh); }],,
77 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if ntohl is in <sys/param.h>.)
78 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
80 dnl Check for -rdynamic flag
81 CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
82 AC_MSG_CHECKING([if \$CC groks -rdynamic without complaining too much])
84 LCFLAGS="${LCFLAGS} -rdynamic"
85 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
87 dnl End of the bizarre compilation tests
90 dnl Check for boolean_t
91 AC_MSG_CHECKING([for boolean_t in sys/types.h])
92 AC_TRY_COMPILE([#include <sys/types.h>
93 void quux() { boolean_t foo; }],,
94 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
95 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
96 AC_MSG_CHECKING([for boolean_t in pthread.h])
97 AC_TRY_COMPILE([#include <pthread.h>
98 void quux() { boolean_t foo; }],,
99 AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
100 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
102 dnl Checks for typedefs, structures, and compiler characteristics.
112 BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion"
113 if test x$host_os = xbeos; then
114 ACCEL_PLUGINS="yuvmmx idctmmx motionmmx"
116 ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext"
120 dnl DVD module: check for DVD ioctls
122 AC_CHECK_HEADERS(sys/ioctl.h,[
123 BUILTINS="${BUILTINS} dvd"
124 AC_CHECK_HEADERS(linux/cdrom.h)
125 AC_EGREP_HEADER(dvd,linux/cdrom.h,[
126 AC_DEFINE(LINUX_DVD,1, DVD support for linux)
134 [ --disable-dummy dummy module (default enabled)])
135 if test x$enable_dummy != xno; then
136 BUILTINS="${BUILTINS} dummy"; fi
142 [ --disable-null Null module (default enabled)])
143 if test x$enable_null != xno; then
144 BUILTINS="${BUILTINS} null"; fi
147 dnl PentiumPro acceleration
150 [ --disable-ppro Disable PentiumPro optimizations (default enabled for x86)],
151 [ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ],
152 [ if test x${host_cpu} = xi686; then ARCH="${ARCH} ppro"; fi ])
158 [ --disable-mmx Disable MMX optimizations (default enabled for x86)],
159 [ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
160 BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ],
161 [ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86; then ARCH="${ARCH} mmx";
162 BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ])
165 dnl AltiVec acceleration
167 AC_ARG_ENABLE(altivec,
168 [ --enable-altivec Enable altivec optimizations (default disabled since it is broken)],
169 [ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
170 BUILTINS="${BUILTINS} idctaltivec"
171 LIB_IDCTALTIVEC="-framework vecLib"
173 #[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
176 dnl CSS DVD decryption
179 [ --disable-css Disable DVD CSS decryption (default enabled)],
180 [ if test x$enableval = xyes; then CSS=1; else CSS=0; fi ], [ CSS=1; ])
181 if test x${CSS} = x1; then AC_DEFINE(HAVE_CSS, 1, Define if you want DVD CSS decryption.) fi
187 [ --enable-debug Enable debug mode (default disabled)],
188 [ if test x$enableval = xyes; then DEBUG=1; fi ])
191 dnl Enable/disable statistics
194 [ --enable-stats Enable printing of statistics (default disabled)],
195 [ if test x$enableval = xyes; then STATS=1; fi ])
198 dnl Enable/disable optimizations
200 AC_ARG_ENABLE(optimizations,
201 [ --disable-optimizations Disable compiler optimizations (default enabled)],
202 [ if test x$enableval = xno; then OPTIMS=0; fi ],
207 dnl special case for BeOS
208 if test x$host_os = xbeos; then
209 BUILTINS="${BUILTINS} beos"
210 LIB_BEOS="-lbe -lgame -lroot -ltracker"
216 dnl OSS /dev/dsp module
219 [ --disable-dsp Linux /dev/dsp support (default enabled)])
220 if test x$enable_dsp != xno; then
221 if test -c /dev/dsp; then
222 PLUGINS="${PLUGINS} dsp"
230 [ --enable-esd Esound library support (default disabled)],
231 [if test x$enable_esd = xyes; then
232 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
233 if test x${ESD_CONFIG} != xno; then
234 PLUGINS="${PLUGINS} esd"
235 LIB_ESD="`${ESD_CONFIG} --libs`"
242 AC_ARG_ENABLE(darwin,
243 [ --enable-darwin Darwin sound support (default disabled)],
244 [if test x$enable_darwin = xyes; then
245 PLUGINS="${PLUGINS} darwin"
246 LIB_DARWIN="-framework CoreAudio"
252 AC_ARG_ENABLE(macosx,
253 [ --enable-macosx Mac OS X interface support (default enabled in Mac OS X)],
254 [if test x$enable_macosx = xyes; then
255 BUILTINS="${BUILTINS} macosx"
256 LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
257 LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
258 LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
260 [AC_CHECK_HEADERS(Carbon/Carbon.h,
261 BUILTINS="${BUILTINS} macosx"
262 LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
263 LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
264 LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
268 dnl Linux framebuffer module
271 [ --enable-fb Linux framebuffer support (default disabled)],
272 [if test x$enable_fb = xyes; then PLUGINS="${PLUGINS} fb"; fi])
278 [ --with-ggi[=name] GGI support (default disabled)],
279 [ if test "x$withval" != "xno";
281 PLUGINS="${PLUGINS} ggi";
282 if test "x$withval" != "xyes";
294 [ --with-sdl[=name] SDL support (default enabled)],
295 [ if test "x$withval" != "xno";
297 PLUGINS="${PLUGINS} sdl";
298 if test "x$withval" != "xyes";
300 LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -L"$withval"/lib -l"$withval
301 INCLUDE="${INCLUDE} -I"$withval"/include"
303 AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
304 LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"
307 if test "x$withval" = "x";
309 AC_CHECK_HEADERS(SDL/SDL.h,
310 [PLUGINS="${PLUGINS} sdl"
311 LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"])
318 [ --with-glide[=name] Glide (3dfx) support (default disabled)],
319 [ if test "x$withval" != "xno";
321 PLUGINS="${PLUGINS} glide";
322 if test "x$withval" != "xyes";
324 LIB_GLIDE="-l"$withval
326 LIB_GLIDE="-lglide2x"
333 AC_ARG_ENABLE(ncurses,
334 [ --enable-ncurses ncurses interface support (default disabled)],
335 [if test x$enable_ncurses = xyes; then
336 PLUGINS="${PLUGINS} ncurses"
337 LIB_NCURSES="-lncurses"
344 [ --enable-qt Qt interface support (default disabled)],
345 [if test x$enable_qt = xyes; then
346 PLUGINS="${PLUGINS} qt"
347 ALIASES="${ALIASES} qvlc"
348 LIB_QT="-lqt -L${QTDIR}/lib"
355 [ --enable-kde KDE interface support (default disabled)],
356 [if test x$enable_kde = xyes; then PLUGINS="${PLUGINS} kde"; ALIASES="${ALIASES} kvlc"; fi])
362 [ --enable-gnome Gnome interface support (default disabled)],
363 [if test x$enable_gnome = xyes; then
364 PLUGINS="${PLUGINS} gnome"
365 ALIASES="${ALIASES} gnome-vlc"
366 LIB_GNOME="`gnome-config --libs gnomeui | sed 's,-rdynamic,,'`"
373 [ --disable-gtk Gtk+ support (default enabled)])
374 if test x$enable_gtk != xno; then
375 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
376 if test x${GTK_CONFIG} != xno; then
377 PLUGINS="${PLUGINS} gtk"
378 ALIASES="${ALIASES} gvlc"
379 CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
380 LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
388 [ --disable-x11 X11 support (default enabled)])
389 if test x$enable_x11 != xno; then
390 if test x$x_includes = xNONE; then
391 x_includes=/usr/X11R6/include
393 if test x$x_libraries = xNONE; then
394 x_libraries=/usr/X11R6/lib
396 saved_CPPFLAGS=$CPPFLAGS
397 CPPFLAGS="$CPPFLAGS -I$x_includes"
398 AC_CHECK_HEADERS(X11/Xlib.h, [
399 PLUGINS="${PLUGINS} x11"
400 LIB_X11="-L$x_libraries -lX11 -lXext"
401 CFLAGS_X11="-I$x_includes"
403 CPPFLAGS=$saved_CPPFLAGS)
409 AC_ARG_ENABLE(xvideo,
410 [ --disable-xvideo XVideo support (default enabled)])
411 if test x$enable_xvideo != xno; then
412 if test x$x_includes = xNONE; then
413 x_includes=/usr/X11R6/include
415 if test x$x_libraries = xNONE; then
416 x_libraries=/usr/X11R6/lib
418 saved_CPPFLAGS=$CPPFLAGS
419 CPPFLAGS="$CPPFLAGS -I$x_includes"
420 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
421 PLUGINS="${PLUGINS} xvideo"
422 LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
423 CFLAGS_X11="-I$x_includes"
425 CPPFLAGS=$saved_CPPFLAGS)
432 [ --enable-alsa Alsa sound drivers support (Only for linux) (default disabled)],
433 [if test x$enable_alsa = xyes; then AC_CHECK_HEADER(sys/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false") if test x$have_alsa = xtrue; then
434 PLUGINS="${PLUGINS} alsa"
438 dnl end of non-BeOS stuff
442 dnl Configuration is finished
467 AC_SUBST(LIB_IDCTALTIVEC)
469 AC_SUBST(LIB_NCURSES)
480 AC_OUTPUT([Makefile.opts include/config.h])
485 vlc version : ${VLC_VERSION}
487 architecture : ${ARCH}
488 debug mode : ${DEBUG}
489 statistics : ${STATS}
490 optimizations : ${OPTIMS}
491 CSS decryption : ${CSS}
492 need builtin getopt : ${GETOPT}
493 plugin modules : ${PLUGINS}
494 built-in modules : ${BUILTINS}
495 vlc aliases : ${ALIASES}
497 You may now tune Makefile.opts at your convenience."