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 dnl Check for system libs needed
29 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
30 AC_CHECK_FUNCS(setenv putenv)
31 AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
32 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
33 AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,,[AC_CHECK_LIB(posix4,nanosleep)])])
34 AC_CHECK_FUNCS(usleep)
35 AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
36 AC_CHECK_FUNCS(vasprintf)
39 AC_CHECK_LIB(dl, dlopen)
40 AC_CHECK_LIB(gnugetopt, optarg)
45 AC_CHECK_LIB(pthread, pthread_create)
46 AC_CHECK_LIB(threads, thread_create)
48 dnl check for getopt_long, substitute the distributed versions if not
49 AC_CHECK_FUNC(getopt_long,,[LIBOBJS="$LIBOBJS getopt.o getopt1.o"])
52 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
53 AC_CHECK_HEADERS(stddef.h)
54 AC_CHECK_HEADERS(getopt.h)
55 AC_CHECK_HEADERS(sys/sockio.h)
56 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
57 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
58 AC_CHECK_HEADERS(dlfcn.h image.h)
59 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
60 AC_CHECK_HEADERS(machine/param.h)
62 dnl Check for threads library
63 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
65 dnl Do a series of bizarre compilation tests
68 dnl Check for ntohl, etc.
69 CFLAGS="${CFLAGS} -Wall -Werror"
70 AC_MSG_CHECKING([for ntohl in sys/param.h])
71 AC_TRY_COMPILE([#include <sys/param.h>
72 void foo() { int meuh; ntohl(meuh); }],,
73 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if ntohl is in <sys/param.h>.)
74 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
76 dnl Check for special optimization flags
77 CFLAGS="${CFLAGS} -fargument-noalias-global -fstrict-aliasing"
78 AC_MSG_CHECKING([if \$CC accepts -fargument-noalias-global -fstrict-aliasing])
80 BIZARRE_OPTIMS="-fargument-noalias-global -fstrict-aliasing"
81 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
83 dnl Check for -rdynamic flag
84 CFLAGS="${CFLAGS} -rdynamic"
85 AC_MSG_CHECKING([if \$CC accepts -rdynamic])
87 DYNAMIC_FLAG="-rdynamic"
88 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
90 dnl End of the bizarre compilation tests
93 dnl Check for boolean_t in sys/types.h
94 AC_MSG_CHECKING([for boolean_t in sys/types.h])
95 AC_TRY_COMPILE([#include <sys/types.h>
96 void quux() { boolean_t foo; }],,
97 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
98 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
100 dnl Checks for typedefs, structures, and compiler characteristics.
106 PLUGINS=${PLUGINS}"yuv ";
110 [ --disable-ppro Disable PentiumPro optimizations (default enabled for x86)],
111 [ if test x$enableval = xyes; then ARCH=${ARCH}" ppro"; fi ],
112 [ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
114 [ --disable-mmx Disable MMX optimizations (default enabled for x86)],
115 [ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi ],
116 [ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi ])
118 [ --enable-debug Enable debug mode (default disabled)],
119 [ if test x$enableval = xyes; then DEBUG=1; fi ])
121 [ --enable-stats Enable printing of statistics (default disabled)],
122 [ if test x$enableval = xyes; then STATS=1; fi ])
123 AC_ARG_ENABLE(optimizations,
124 [ --disable-optimizations Disable compiler optimizations (default enabled)],
125 [ if test x$enableval = xno; then OPTIMS=0; fi ],
131 if test x$host_os = xbeos; then
132 PLUGINS=${PLUGINS}"dummy null beos "
138 [ --disable-dummy dummy audio and video support (default enabled)])
139 if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
141 [ --disable-null Null module (default enabled)])
142 if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
144 [ --disable-dsp Linux /dev/dsp support (default enabled)])
145 if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
147 [ --enable-esd Esound library support (default disabled)],
148 [if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
150 [ --enable-fb Linux framebuffer support (default disabled)],
151 [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; ALIASES=${ALIASES}"fbvlc "; fi])
153 [ --with-ggi[=name] GGI support (default disabled)],
154 [ PLUGINS=${PLUGINS}"ggi ";
155 if test "x$withval" != "xyes";
162 [ --with-sdl[=name] SDL support (default disabled)],
163 [ PLUGINS=${PLUGINS}"sdl ";
164 if test "x$withval" != "xyes";
171 [ --with-glide[=name] Glide (3dfx) support (default disabled)],
172 [ PLUGINS=${PLUGINS}"glide ";
173 if test "x$withval" != "xyes";
175 LIB_GLIDE="-l"$withval
177 LIB_GLIDE="-lglide2x"
180 [ --enable-gnome Gnome support (default disabled)],
181 [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi])
183 [ --disable-x11 X11 support (default enabled)])
184 if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
186 [ --enable-alsa Alsa sound drivers support (Only for linux) (default disabled)],
187 [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])
198 AC_SUBST(BIZARRE_OPTIMS)
199 AC_SUBST(DYNAMIC_FLAG)
204 AC_OUTPUT([Makefile include/config.h])
209 vlc version : ${VLC_VERSION}
211 architecture : ${ARCH}
212 debug mode : ${DEBUG}
213 statistics : ${STATS}
214 optimizations : ${OPTIMS}
216 vlc aliases : ${ALIASES}