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)
14 if test -z "$CC"; then
17 if test -z "$CPP"; then
24 dnl Check for compiler environment
28 AC_MSG_CHECKING([whether compiler accepts bswap x86 instruction])
29 AC_TRY_COMPILE([unsigned int foo( unsigned int x )
30 { __asm__("bswap %0" : "=r" (x) : "0" (x)); return x; }],,
31 AC_DEFINE(HAVE_X86_BSWAP, 1, Define if compiler accepts bswap x86 instruction.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
33 dnl Check for system libs needed
34 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
35 AC_CHECK_FUNCS(setenv putenv)
36 AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
37 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
38 AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,,[AC_CHECK_LIB(posix4,nanosleep)])])
39 AC_CHECK_FUNCS(usleep)
40 AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
41 AC_CHECK_FUNCS(vasprintf)
44 AC_CHECK_LIB(dl, dlopen)
45 AC_CHECK_LIB(gnugetopt, optarg)
50 AC_CHECK_LIB(pthread, pthread_create)
51 AC_CHECK_LIB(threads, thread_create)
53 dnl check for getopt_long, substitute the distributed versions if not
54 AC_CHECK_FUNC(getopt_long,,[LIBOBJS="$LIBOBJS getopt.o getopt1.o"])
57 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
58 AC_CHECK_HEADERS(stddef.h)
59 AC_CHECK_HEADERS(getopt.h)
60 AC_CHECK_HEADERS(sys/sockio.h)
61 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
62 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
63 AC_CHECK_HEADERS(dlfcn.h image.h)
64 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
65 AC_CHECK_HEADERS(machine/param.h)
67 dnl Check for threads library
68 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
70 dnl Do a series of bizarre compilation tests
73 dnl Check for ntohl, etc.
74 CFLAGS="${CFLAGS} -Wall -Werror"
75 AC_MSG_CHECKING([for ntohl in sys/param.h])
76 AC_TRY_COMPILE([#include <sys/param.h>
77 void foo() { int meuh; ntohl(meuh); }],,
78 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if ntohl is in <sys/param.h>.)
79 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
81 dnl Check for -rdynamic flag
82 CFLAGS="${CFLAGS} -rdynamic"
83 AC_MSG_CHECKING([if \$CC accepts -rdynamic])
85 DYNAMIC_FLAG="-rdynamic"
86 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
88 dnl End of the bizarre compilation tests
91 dnl Check for boolean_t in sys/types.h
92 AC_MSG_CHECKING([for boolean_t in sys/types.h])
93 AC_TRY_COMPILE([#include <sys/types.h>
94 void quux() { boolean_t foo; }],,
95 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
96 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
98 dnl Checks for typedefs, structures, and compiler characteristics.
103 dnl Checks for DVD ioctls
104 AC_CHECK_HEADERS(sys/ioctl.h)
105 AC_CHECK_HEADERS(sys/dvdio.h)
106 AC_CHECK_HEADERS(linux/cdrom.h)
107 AC_EGREP_HEADER(dvd,linux/cdrom.h,AC_DEFINE(LINUX_DVD,1,DVD support for linux))
110 PLUGINS=${PLUGINS}"ps ts dvd yuv idct idctclassic motion ";
114 [ --disable-ppro Disable PentiumPro optimizations (default enabled for x86)],
115 [ if test x$enableval = xyes; then ARCH=${ARCH}" ppro"; fi ],
116 [ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
118 [ --disable-mmx Disable MMX optimizations (default enabled for x86)],
119 [ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx motionmmx motionmmxext idctmmx idctmmxext "; fi ],
120 [ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx motionmmx motionmmxext idctmmx idctmmxext "; fi ])
122 [ --enable-debug Enable debug mode (default disabled)],
123 [ if test x$enableval = xyes; then DEBUG=1; fi ])
125 [ --enable-stats Enable printing of statistics (default disabled)],
126 [ if test x$enableval = xyes; then STATS=1; fi ])
127 AC_ARG_ENABLE(optimizations,
128 [ --disable-optimizations Disable compiler optimizations (default enabled)],
129 [ if test x$enableval = xno; then OPTIMS=0; fi ],
135 if test x$host_os = xbeos; then
136 PLUGINS=${PLUGINS}"dummy null beos "
142 [ --disable-dummy dummy audio and video support (default enabled)])
143 if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
145 [ --disable-null Null module (default enabled)])
146 if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
148 [ --disable-dsp Linux /dev/dsp support (default enabled)])
149 if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
151 [ --enable-esd Esound library support (default disabled)],
152 [if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
154 [ --enable-fb Linux framebuffer support (default disabled)],
155 [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; ALIASES=${ALIASES}"fbvlc "; fi])
157 [ --with-ggi[=name] GGI support (default disabled)],
158 [ PLUGINS=${PLUGINS}"ggi ";
159 if test "x$withval" != "xyes";
166 [ --with-sdl[=name] SDL support (default disabled)],
167 [ PLUGINS=${PLUGINS}"sdl ";
168 if test "x$withval" != "xyes";
175 [ --with-glide[=name] Glide (3dfx) support (default disabled)],
176 [ PLUGINS=${PLUGINS}"glide ";
177 if test "x$withval" != "xyes";
179 LIB_GLIDE="-l"$withval
181 LIB_GLIDE="-lglide2x"
184 [ --enable-gnome Gnome support (default disabled)],
185 [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi])
187 [ --disable-x11 X11 support (default enabled)])
188 if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
190 [ --enable-alsa Alsa sound drivers support (Only for linux) (default disabled)],
191 [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 $have_alsa = true; then PLUGINS=${PLUGINS}"alsa "; fi; fi])
201 AC_SUBST(DYNAMIC_FLAG)
206 AC_OUTPUT([Makefile include/config.h])
211 vlc version : ${VLC_VERSION}
213 architecture : ${ARCH}
214 debug mode : ${DEBUG}
215 statistics : ${STATS}
216 optimizations : ${OPTIMS}
218 vlc aliases : ${ALIASES}