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
150 [ --disable-rc rc module (default enabled)])
151 if test x$enable_rc != xno; then
152 BUILTINS="${BUILTINS} rc"; fi
155 dnl PentiumPro acceleration
158 [ --disable-ppro Disable PentiumPro optimizations (default enabled for x86)],
159 [ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ],
160 [ if test x${host_cpu} = xi686; then ARCH="${ARCH} ppro"; fi ])
166 [ --disable-mmx Disable MMX optimizations (default enabled for x86)],
167 [ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
168 BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ],
169 [ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86; then ARCH="${ARCH} mmx";
170 BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ])
173 dnl AltiVec acceleration
175 AC_ARG_ENABLE(altivec,
176 [ --enable-altivec Enable altivec optimizations (default disabled since it is broken)],
177 [ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
178 BUILTINS="${BUILTINS} idctaltivec"
179 LIB_IDCTALTIVEC="-framework vecLib"
181 #[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
184 dnl CSS DVD decryption
187 [ --disable-css Disable DVD CSS decryption (default enabled)],
188 [ if test x$enableval = xyes; then CSS=1; else CSS=0; fi ], [ CSS=1; ])
189 if test x${CSS} = x1; then AC_DEFINE(HAVE_CSS, 1, Define if you want DVD CSS decryption.) fi
195 [ --enable-debug Enable debug mode (default disabled)],
196 [ if test x$enableval = xyes; then DEBUG=1; fi ])
199 dnl Enable/disable statistics
202 [ --enable-stats Enable printing of statistics (default disabled)],
203 [ if test x$enableval = xyes; then STATS=1; fi ])
209 [ --enable-trace Enable trace mode (default disabled)],
210 [ if test x$enableval = xyes; then TRACE=1; fi ])
213 dnl Enable/disable optimizations
215 AC_ARG_ENABLE(optimizations,
216 [ --disable-optimizations Disable compiler optimizations (default enabled)],
217 [ if test x$enableval = xno; then OPTIMS=0; fi ],
222 dnl special case for BeOS
223 if test x$host_os = xbeos; then
224 BUILTINS="${BUILTINS} beos"
225 LIB_BEOS="-lbe -lgame -lroot -ltracker"
231 dnl OSS /dev/dsp module
234 [ --disable-dsp Linux /dev/dsp support (default enabled)])
235 if test x$enable_dsp != xno; then
236 if test -c /dev/dsp; then
237 PLUGINS="${PLUGINS} dsp"
245 [ --enable-esd Esound library support (default disabled)],
246 [if test x$enable_esd = xyes; then
247 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
248 if test x${ESD_CONFIG} != xno; then
249 PLUGINS="${PLUGINS} esd"
250 LIB_ESD="`${ESD_CONFIG} --libs`"
257 AC_ARG_ENABLE(darwin,
258 [ --enable-darwin Darwin sound support (default disabled)],
259 [if test x$enable_darwin = xyes; then
260 PLUGINS="${PLUGINS} darwin"
261 LIB_DARWIN="-framework CoreAudio"
267 AC_ARG_ENABLE(macosx,
268 [ --enable-macosx Mac OS X interface support (default enabled in Mac OS X)],
269 [if test x$enable_macosx = xyes; then
270 BUILTINS="${BUILTINS} macosx"
271 LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
272 LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
273 LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
275 [AC_CHECK_HEADERS(Carbon/Carbon.h,
276 BUILTINS="${BUILTINS} macosx"
277 LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
278 LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
279 LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
283 dnl Linux framebuffer module
286 [ --enable-fb Linux framebuffer support (default disabled)],
287 [if test x$enable_fb = xyes; then PLUGINS="${PLUGINS} fb"; fi])
293 [ --with-ggi[=name] GGI support (default disabled)],
294 [ if test "x$withval" != "xno";
296 PLUGINS="${PLUGINS} ggi";
297 if test "x$withval" != "xyes";
309 [ --with-sdl[=name] SDL support (default enabled)],
310 [ if test "x$withval" != "xno";
312 PLUGINS="${PLUGINS} sdl";
313 if test "x$withval" != "xyes";
315 LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -L"$withval"/lib -l"$withval
316 INCLUDE="${INCLUDE} -I"$withval"/include"
318 AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
319 LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"
322 if test "x$withval" = "x";
324 AC_CHECK_HEADERS(SDL/SDL.h,
325 [PLUGINS="${PLUGINS} sdl"
326 LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"])
333 [ --with-glide[=name] Glide (3dfx) support (default disabled)],
334 [ if test "x$withval" != "xno";
336 PLUGINS="${PLUGINS} glide";
337 if test "x$withval" != "xyes";
339 LIB_GLIDE="-l"$withval
341 LIB_GLIDE="-lglide2x"
348 AC_ARG_ENABLE(ncurses,
349 [ --enable-ncurses ncurses interface support (default disabled)],
350 [if test x$enable_ncurses = xyes; then
351 PLUGINS="${PLUGINS} ncurses"
352 LIB_NCURSES="-lncurses"
359 [ --enable-qt Qt interface support (default disabled)],
360 [if test x$enable_qt = xyes; then
361 PLUGINS="${PLUGINS} qt"
362 ALIASES="${ALIASES} qvlc"
363 LIB_QT="-lqt -L${QTDIR}/lib"
370 [ --enable-kde KDE interface support (default disabled)],
371 [if test x$enable_kde = xyes; then PLUGINS="${PLUGINS} kde"; ALIASES="${ALIASES} kvlc"; fi])
377 [ --enable-gnome Gnome interface support (default disabled)],
378 [if test x$enable_gnome = xyes; then
379 PLUGINS="${PLUGINS} gnome"
380 ALIASES="${ALIASES} gnome-vlc"
381 LIB_GNOME="`gnome-config --libs gnomeui | sed 's,-rdynamic,,'`"
388 [ --disable-gtk Gtk+ support (default enabled)])
389 if test x$enable_gtk != xno; then
390 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
391 if test x${GTK_CONFIG} != xno; then
392 PLUGINS="${PLUGINS} gtk"
393 ALIASES="${ALIASES} gvlc"
394 CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
395 LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
403 [ --disable-x11 X11 support (default enabled)])
404 if test x$enable_x11 != xno; then
405 if test x$x_includes = xNONE; then
406 x_includes=/usr/X11R6/include
408 if test x$x_libraries = xNONE; then
409 x_libraries=/usr/X11R6/lib
411 saved_CPPFLAGS=$CPPFLAGS
412 CPPFLAGS="$CPPFLAGS -I$x_includes"
413 AC_CHECK_HEADERS(X11/Xlib.h, [
414 PLUGINS="${PLUGINS} x11"
415 LIB_X11="-L$x_libraries -lX11 -lXext"
416 CFLAGS_X11="-I$x_includes"
418 CPPFLAGS=$saved_CPPFLAGS)
424 AC_ARG_ENABLE(xvideo,
425 [ --disable-xvideo XVideo support (default enabled)])
426 if test x$enable_xvideo != xno; then
427 if test x$x_includes = xNONE; then
428 x_includes=/usr/X11R6/include
430 if test x$x_libraries = xNONE; then
431 x_libraries=/usr/X11R6/lib
433 saved_CPPFLAGS=$CPPFLAGS
434 CPPFLAGS="$CPPFLAGS -I$x_includes"
435 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
436 PLUGINS="${PLUGINS} xvideo"
437 LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
438 CFLAGS_X11="-I$x_includes"
440 CPPFLAGS=$saved_CPPFLAGS)
447 [ --enable-alsa Alsa sound drivers support (Only for linux) (default disabled)],
448 [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
449 PLUGINS="${PLUGINS} alsa"
453 dnl end of non-BeOS stuff
457 dnl Configuration is finished
483 AC_SUBST(LIB_IDCTALTIVEC)
485 AC_SUBST(LIB_NCURSES)
496 AC_OUTPUT([Makefile.opts include/config.h])
501 vlc version : ${VLC_VERSION}
503 architecture : ${ARCH}
504 debug mode : ${DEBUG}
505 statistics : ${STATS}
506 trace mode : ${TRACE}
507 optimizations : ${OPTIMS}
508 CSS decryption : ${CSS}
509 need builtin getopt : ${GETOPT}
510 plugin modules : ${PLUGINS}
511 built-in modules : ${BUILTINS}
512 vlc aliases : ${ALIASES}
514 You may now tune Makefile.opts at your convenience."