]> git.sesse.net Git - vlc/blob - configure.in
* Bug fixes and enhancements in the Gtk+/Gnome interfaces.
[vlc] / configure.in
1 dnl Autoconf settings for vlc
2 AC_INIT(src/interface/main.c)
3 AC_CONFIG_HEADER(include/defs.h)
4
5 AC_CANONICAL_HOST
6
7 VLC_VERSION=0.2.63
8 AC_SUBST(VLC_VERSION)
9 VLC_CODENAME=Urumov
10 AC_SUBST(VLC_CODENAME)
11
12 dnl Check for tools
13 AC_PROG_MAKE_SET
14 if test -z "$CC"; then
15   AC_PROG_CC
16 fi
17 if test -z "$CPP"; then
18   AC_PROG_CPP
19 fi
20
21 dnl AM_PROG_LIBTOOL
22 AC_PROG_INSTALL
23
24 dnl Check for compiler environment
25 AC_C_CONST
26 AC_C_BIGENDIAN
27
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))
32
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)
42 AC_FUNC_MMAP
43 AC_TYPE_SIGNAL
44 AC_CHECK_LIB(dl, dlopen)
45 AC_CHECK_LIB(gnugetopt, optarg)
46 AC_CHECK_LIB(be, _)
47 AC_CHECK_LIB(game, _)
48 AC_CHECK_LIB(root, _)
49 AC_CHECK_LIB(m, powl)
50 AC_CHECK_LIB(pthread, pthread_create)
51 AC_CHECK_LIB(threads, thread_create)
52
53 dnl check for getopt_long, substitute the distributed versions if not
54 AC_CHECK_FUNC(getopt_long,,[LIBOBJS="$LIBOBJS getopt.o getopt1.o"])
55 AC_SUBST(LIBOBJS)
56
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/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)
66
67 dnl Check for threads library
68 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
69
70 dnl Do a series of bizarre compilation tests
71 save_CFLAGS=$CFLAGS
72
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))
80
81 dnl Check for -rdynamic flag
82 CFLAGS="${CFLAGS} -rdynamic"
83 AC_MSG_CHECKING([if \$CC accepts -rdynamic])
84 AC_TRY_COMPILE([],,
85  DYNAMIC_FLAG="-rdynamic"
86  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
87
88 dnl End of the bizarre compilation tests
89 CFLAGS=$save_CFLAGS
90
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))
97
98 dnl Checks for typedefs, structures, and compiler characteristics.
99 AC_C_CONST
100 AC_TYPE_SIZE_T
101 AC_HEADER_TIME
102
103 dnl default plugins 
104 PLUGINS=${PLUGINS}"ps ts yuv idct idctclassic motion "
105 if test x$host_os = xbeos; then
106     ACCEL_PLUGINS="yuvmmx idctmmx motionmmx "
107 else
108     ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext "
109 fi
110
111 dnl Checks for DVD ioctls
112 AC_CHECK_HEADERS(sys/ioctl.h,
113   [PLUGINS=${PLUGINS}"dvd "
114    AC_CHECK_HEADERS(linux/cdrom.h)
115    AC_EGREP_HEADER(dvd,linux/cdrom.h,[AC_DEFINE(LINUX_DVD,1,DVD support for linux)])])
116
117 ARCH=${host_cpu}
118 AC_ARG_ENABLE(ppro,
119 [  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
120 [ if test x$enableval = xyes; then ARCH=${ARCH}" ppro"; fi ],
121 [ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
122 AC_ARG_ENABLE(mmx,
123 [  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
124 [ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}${ACCEL_PLUGINS}; fi ],
125 [ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}${ACCEL_PLUGINS}; fi ])
126 AC_ARG_ENABLE(css,
127 [  --disable-css           Disable DVD CSS decryption (default enabled)],
128 [ if test x$enableval = xyes; then CSS=1; else CSS=0; fi ], [ CSS=1; ])
129 if test x${CSS} = x1; then AC_DEFINE(HAVE_CSS, 1, Define if you want DVD CSS decryption.) fi
130 AC_ARG_ENABLE(debug,
131 [  --enable-debug          Enable debug mode (default disabled)],
132 [ if test x$enableval = xyes; then DEBUG=1; fi ])
133 AC_ARG_ENABLE(stats,
134 [  --enable-stats          Enable printing of statistics (default disabled)],
135 [ if test x$enableval = xyes; then STATS=1; fi ])
136 AC_ARG_ENABLE(optimizations,
137 [  --disable-optimizations Disable compiler optimizations (default enabled)],
138 [ if test x$enableval = xno; then OPTIMS=0; fi ],
139 [ OPTIMS=1 ])
140
141 SYS=${host_os}
142
143 # special cases
144 if test x$host_os = xbeos; then
145     PLUGINS=${PLUGINS}"dummy null beos "
146
147 dnl default case
148 else
149
150 GVLC=0
151
152 AC_ARG_ENABLE(dummy,
153   [  --disable-dummy         dummy module (default enabled)])
154 if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
155 AC_ARG_ENABLE(null,
156   [  --disable-null          Null module (default enabled)])
157 if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
158 AC_ARG_ENABLE(dsp,
159   [  --disable-dsp           Linux /dev/dsp support (default enabled)])
160 if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
161 AC_ARG_ENABLE(esd,
162   [  --enable-esd            Esound library support (default disabled)],
163   [if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
164 AC_ARG_ENABLE(fb,
165   [  --enable-fb             Linux framebuffer support (default disabled)],
166   [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; fi])
167 AC_ARG_WITH(ggi,
168   [  --with-ggi[=name]       GGI support (default disabled)],
169   [ if test "x$withval" != "xno";
170     then
171       PLUGINS=${PLUGINS}"ggi ";
172       if test "x$withval" != "xyes";
173       then
174         LIB_GGI="-l"$withval
175       else
176         LIB_GGI="-lggi"
177       fi
178     fi ])
179 AC_ARG_WITH(sdl,
180   [  --with-sdl[=name]       SDL support (default enabled)],
181   [ if test "x$withval" != "xno";
182     then
183       PLUGINS=${PLUGINS}"sdl ";
184       if test "x$withval" != "xyes";
185       then
186         LIB_SDL="L/usr/X11R6/lib -l"$withval
187       else
188         LIB_SDL="-L/usr/X11R6/lib -lSDL"
189       fi
190     fi ])
191     if test "x$withval" = "x";
192     then
193       PLUGINS=${PLUGINS}"sdl "
194       LIB_SDL="-L/usr/X11R6/lib -lSDL"
195     fi
196 AC_ARG_WITH(glide,
197   [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
198   [ if test "x$withval" != "xno";
199     then
200       PLUGINS=${PLUGINS}"glide ";
201       if test "x$withval" != "xyes";
202       then
203         LIB_GLIDE="-l"$withval
204       else
205         LIB_GLIDE="-lglide2x"
206       fi
207     fi ])
208 AC_ARG_ENABLE(ncurses,
209   [  --enable-ncurses        ncurses interface support (default disabled)],
210   [if test x$enable_ncurses = xyes; then PLUGINS=${PLUGINS}"ncurses "; fi])
211 AC_ARG_ENABLE(qt,
212   [  --enable-qt             Qt interface support (default disabled)],
213   [if test x$enable_qt = xyes; then PLUGINS=${PLUGINS}"qt "; ALIASES=${ALIASES}"qvlc "; fi])
214 AC_ARG_ENABLE(kde,
215   [  --enable-kde            KDE interface support (default disabled)],
216   [if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASES=${ALIASES}"kvlc "; fi])
217 AC_ARG_ENABLE(gnome,
218   [  --enable-gnome          Gnome interface support (default disabled)],
219   [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; GVLC=1; fi])
220 AC_ARG_ENABLE(gtk,
221   [  --disable-gtk           Gtk+ support (default enabled)])
222 if test x$enable_gtk != xno; then PLUGINS=${PLUGINS}"gtk "; GVLC=1; fi
223 AC_ARG_ENABLE(x11,
224   [  --disable-x11           X11 support (default enabled)])
225 if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
226
227 AC_ARG_ENABLE(alsa,
228   [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
229   [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])
230
231 if test x$GVLC = x1 ; then ALIASES=${ALIASES}"gvlc "; fi
232
233 fi
234
235 AC_SUBST(SYS)
236 AC_SUBST(ARCH)
237 AC_SUBST(PLUGINS)
238 AC_SUBST(ALIASES)
239 AC_SUBST(DEBUG)
240 AC_SUBST(STATS)
241 AC_SUBST(OPTIMS)
242 AC_SUBST(CSS)
243 AC_SUBST(DYNAMIC_FLAG)
244 AC_SUBST(LIB_SDL)
245 AC_SUBST(LIB_GLIDE)
246 AC_SUBST(LIB_GGI)
247
248 AC_OUTPUT([Makefile include/config.h])
249
250 echo "
251 vlc configuration
252 -----------------
253 vlc version           : ${VLC_VERSION}
254 system                : ${SYS}
255 architecture          : ${ARCH}
256 debug mode            : ${DEBUG}
257 statistics            : ${STATS}
258 optimizations         : ${OPTIMS}
259 CSS decryption        : ${CSS}
260 plugins               : ${PLUGINS}
261 vlc aliases           : ${ALIASES}
262 "
263