]> git.sesse.net Git - vlc/blob - configure.in
* Fixed the continuous 'seeking position' bug in network mode.
[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.72
8 AC_SUBST(VLC_VERSION)
9 VLC_CODENAME=Ourumov
10 AC_SUBST(VLC_CODENAME)
11
12 dnl Check for tools
13 AC_PROG_MAKE_SET
14 AC_PROG_CC
15 AC_PROG_CPP
16
17 dnl AM_PROG_LIBTOOL
18 AC_PROG_INSTALL
19
20 dnl Check for compiler environment
21 AC_C_CONST
22 AC_C_BIGENDIAN
23
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)
33
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"],
38     [GETOPT=1])])
39 AC_SUBST(GETOPT)
40
41 AC_FUNC_MMAP
42 AC_TYPE_SIGNAL
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)
46 AC_EGREP_CPP(yes,
47         [#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version <= 500001
48           yes
49         #endif
50         ], AC_MSG_RESULT(yes)
51         DEFINE="${DEFINE} -D_THREAD_SAFE" LIB="${LIB} -pthread",
52         AC_MSG_RESULT(no)
53         AC_CHECK_LIB(pthread,pthread_create,LIB="${LIB} -lpthread"))
54 AC_CHECK_LIB(threads,thread_create,LIB="${LIB} -lthreads")
55
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)
65
66 dnl Check for threads library
67 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
68
69 dnl Do a series of bizarre compilation tests
70 save_CFLAGS=$CFLAGS
71
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))
79
80 dnl Check for -rdynamic flag
81 CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
82 AC_MSG_CHECKING([if \$CC groks -rdynamic without complaining too much])
83 AC_TRY_COMPILE([],,
84  LCFLAGS="${LCFLAGS} -rdynamic"
85  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
86
87 dnl End of the bizarre compilation tests
88 CFLAGS=$save_CFLAGS
89
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))
101
102 dnl Checks for typedefs, structures, and compiler characteristics.
103 AC_C_CONST
104 AC_TYPE_SIZE_T
105 AC_HEADER_TIME
106
107 ARCH=${host_cpu}
108
109 dnl
110 dnl  default modules
111 dnl
112 BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion"
113 if test x$host_os = xbeos; then
114     ACCEL_PLUGINS="yuvmmx idctmmx motionmmx"
115 else
116     ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext"
117 fi
118
119 dnl
120 dnl  DVD module: check for DVD ioctls
121 dnl
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)
127   ])
128 ])
129
130 dnl
131 dnl  dummy plugin
132 dnl
133 AC_ARG_ENABLE(dummy,
134   [  --disable-dummy         dummy module (default enabled)])
135 if test x$enable_dummy != xno; then
136   BUILTINS="${BUILTINS} dummy"; fi
137
138 dnl
139 dnl  null plugin
140 dnl
141 AC_ARG_ENABLE(null,
142   [  --disable-null          Null module (default enabled)])
143 if test x$enable_null != xno; then
144   BUILTINS="${BUILTINS} null"; fi
145
146 dnl
147 dnl  rc plugin
148 dnl
149 AC_ARG_ENABLE(rc,
150   [  --disable-rc            rc module (default enabled)])
151 if test x$enable_rc != xno; then
152   BUILTINS="${BUILTINS} rc"; fi
153
154 dnl
155 dnl  PentiumPro acceleration
156 dnl
157 AC_ARG_ENABLE(ppro,
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 ])
161
162 dnl
163 dnl  MMX acceleration
164 dnl
165 AC_ARG_ENABLE(mmx,
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 ])
171
172 dnl
173 dnl  AltiVec acceleration
174 dnl
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"
180   fi ])
181 #[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
182
183 dnl
184 dnl  CSS DVD decryption
185 dnl
186 AC_ARG_ENABLE(css,
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
190
191 dnl
192 dnl  Debugging mode
193 dnl
194 AC_ARG_ENABLE(debug,
195 [  --enable-debug          Enable debug mode (default disabled)],
196 [ if test x$enableval = xyes; then DEBUG=1; fi ])
197
198 dnl
199 dnl  Enable/disable statistics
200 dnl
201 AC_ARG_ENABLE(stats,
202 [  --enable-stats          Enable printing of statistics (default disabled)],
203 [ if test x$enableval = xyes; then STATS=1; fi ])
204
205 dnl
206 dnl  Enable/disable optimizations
207 dnl
208 AC_ARG_ENABLE(optimizations,
209 [  --disable-optimizations Disable compiler optimizations (default enabled)],
210 [ if test x$enableval = xno; then OPTIMS=0; fi ],
211 [ OPTIMS=1 ])
212
213 SYS=${host_os}
214
215 dnl special case for BeOS
216 if test x$host_os = xbeos; then
217     BUILTINS="${BUILTINS} beos"
218     LIB_BEOS="-lbe -lgame -lroot -ltracker"
219
220 dnl default case
221 else
222
223 dnl
224 dnl  OSS /dev/dsp module
225 dnl
226 AC_ARG_ENABLE(dsp,
227   [  --disable-dsp           Linux /dev/dsp support (default enabled)])
228 if test x$enable_dsp != xno; then
229   if test -c /dev/dsp; then
230     PLUGINS="${PLUGINS} dsp"
231   fi
232 fi
233
234 dnl
235 dnl  Esound module
236 dnl
237 AC_ARG_ENABLE(esd,
238   [  --enable-esd            Esound library support (default disabled)],
239   [if test x$enable_esd = xyes; then
240      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
241      if test x${ESD_CONFIG} != xno; then
242        PLUGINS="${PLUGINS} esd"
243        LIB_ESD="`${ESD_CONFIG} --libs`"
244      fi
245    fi])
246
247 dnl
248 dnl  Darwin module
249 dnl
250 AC_ARG_ENABLE(darwin,
251   [  --enable-darwin         Darwin sound support (default disabled)],
252   [if test x$enable_darwin = xyes; then
253      PLUGINS="${PLUGINS} darwin"
254      LIB_DARWIN="-framework CoreAudio"
255    fi])
256
257 dnl
258 dnl  MacOS X module
259 dnl
260 AC_ARG_ENABLE(macosx,
261   [  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)],
262   [if test x$enable_macosx = xyes; then
263      BUILTINS="${BUILTINS} macosx"
264      LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
265      LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
266      LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
267    fi],
268   [AC_CHECK_HEADERS(Carbon/Carbon.h,
269      BUILTINS="${BUILTINS} macosx"
270      LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
271      LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
272      LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
273    )])
274
275 dnl
276 dnl  Linux framebuffer module
277 dnl
278 AC_ARG_ENABLE(fb,
279   [  --enable-fb             Linux framebuffer support (default disabled)],
280   [if test x$enable_fb = xyes; then PLUGINS="${PLUGINS} fb"; fi])
281
282 dnl
283 dnl  GGI module
284 dnl
285 AC_ARG_WITH(ggi,
286   [  --with-ggi[=name]       GGI support (default disabled)],
287   [ if test "x$withval" != "xno";
288     then
289       PLUGINS="${PLUGINS} ggi";
290       if test "x$withval" != "xyes";
291       then
292         LIB_GGI="-l"$withval
293       else
294         LIB_GGI="-lggi"
295       fi
296     fi ])
297
298 dnl
299 dnl  SDL module
300 dnl
301 AC_ARG_WITH(sdl,
302   [  --with-sdl[=name]       SDL support (default enabled)],
303   [ if test "x$withval" != "xno";
304     then
305       PLUGINS="${PLUGINS} sdl";
306       if test "x$withval" != "xyes";
307       then
308         LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -L"$withval"/lib -l"$withval
309         INCLUDE="${INCLUDE} -I"$withval"/include"
310       else
311         AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
312         LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"
313       fi
314     fi ])
315     if test "x$withval" = "x";
316     then
317       AC_CHECK_HEADERS(SDL/SDL.h,
318       [PLUGINS="${PLUGINS} sdl"
319        LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"])
320     fi
321
322 dnl
323 dnl  Glide module
324 dnl
325 AC_ARG_WITH(glide,
326   [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
327   [ if test "x$withval" != "xno";
328     then
329       PLUGINS="${PLUGINS} glide";
330       if test "x$withval" != "xyes";
331       then
332         LIB_GLIDE="-l"$withval
333       else
334         LIB_GLIDE="-lglide2x"
335       fi
336     fi ])
337
338 dnl
339 dnl  ncurses module
340 dnl
341 AC_ARG_ENABLE(ncurses,
342   [  --enable-ncurses        ncurses interface support (default disabled)],
343   [if test x$enable_ncurses = xyes; then
344      PLUGINS="${PLUGINS} ncurses"
345      LIB_NCURSES="-lncurses"
346    fi])
347
348 dnl
349 dnl  Qt module
350 dnl
351 AC_ARG_ENABLE(qt,
352   [  --enable-qt             Qt interface support (default disabled)],
353   [if test x$enable_qt = xyes; then
354      PLUGINS="${PLUGINS} qt"
355      ALIASES="${ALIASES} qvlc"
356      LIB_QT="-lqt -L${QTDIR}/lib"
357    fi])
358
359 dnl 
360 dnl  KDE module
361 dnl
362 AC_ARG_ENABLE(kde,
363   [  --enable-kde            KDE interface support (default disabled)],
364   [if test x$enable_kde = xyes; then PLUGINS="${PLUGINS} kde"; ALIASES="${ALIASES} kvlc"; fi])
365
366 dnl
367 dnl  Gnome module
368 dnl
369 AC_ARG_ENABLE(gnome,
370   [  --enable-gnome          Gnome interface support (default disabled)],
371   [if test x$enable_gnome = xyes; then
372      PLUGINS="${PLUGINS} gnome"
373      ALIASES="${ALIASES} gnome-vlc"
374      LIB_GNOME="`gnome-config --libs gnomeui | sed 's,-rdynamic,,'`"
375    fi])
376
377 dnl
378 dnl  Gtk+ module
379 dnl
380 AC_ARG_ENABLE(gtk,
381   [  --disable-gtk           Gtk+ support (default enabled)])
382 if test x$enable_gtk != xno; then
383   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
384   if test x${GTK_CONFIG} != xno; then
385     PLUGINS="${PLUGINS} gtk"
386     ALIASES="${ALIASES} gvlc"
387     CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
388     LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
389   fi
390 fi
391
392 dnl
393 dnl  X11 module
394 dnl
395 AC_ARG_ENABLE(x11,
396   [  --disable-x11           X11 support (default enabled)])
397 if test x$enable_x11 != xno; then
398   if test x$x_includes = xNONE; then
399     x_includes=/usr/X11R6/include
400   fi
401   if test x$x_libraries = xNONE; then
402     x_libraries=/usr/X11R6/lib
403   fi
404   saved_CPPFLAGS=$CPPFLAGS
405   CPPFLAGS="$CPPFLAGS -I$x_includes"
406   AC_CHECK_HEADERS(X11/Xlib.h, [
407     PLUGINS="${PLUGINS} x11"
408     LIB_X11="-L$x_libraries -lX11 -lXext"
409     CFLAGS_X11="-I$x_includes"
410   ]
411   CPPFLAGS=$saved_CPPFLAGS)
412 fi
413
414 dnl
415 dnl  XVideo module
416 dnl
417 AC_ARG_ENABLE(xvideo,
418   [  --disable-xvideo        XVideo support (default enabled)])
419 if test x$enable_xvideo != xno; then
420   if test x$x_includes = xNONE; then
421     x_includes=/usr/X11R6/include
422   fi
423   if test x$x_libraries = xNONE; then
424     x_libraries=/usr/X11R6/lib
425   fi
426   saved_CPPFLAGS=$CPPFLAGS
427   CPPFLAGS="$CPPFLAGS -I$x_includes"
428   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
429     PLUGINS="${PLUGINS} xvideo"
430     LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
431     CFLAGS_X11="-I$x_includes"
432   ]
433   CPPFLAGS=$saved_CPPFLAGS)
434 fi
435
436 dnl
437 dnl  ALSA module
438 dnl
439 AC_ARG_ENABLE(alsa,
440   [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
441   [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
442      PLUGINS="${PLUGINS} alsa"
443      LIB_ALSA="-lasound"
444    fi; fi])
445
446 dnl  end of non-BeOS stuff
447 fi
448
449 dnl 
450 dnl  Configuration is finished
451 dnl
452 AC_SUBST(SYS)
453 AC_SUBST(ARCH)
454 AC_SUBST(PLUGINS)
455 AC_SUBST(BUILTINS)
456 AC_SUBST(ALIASES)
457 AC_SUBST(DEFINE)
458 AC_SUBST(INCLUDE)
459 AC_SUBST(DEBUG)
460 AC_SUBST(STATS)
461 AC_SUBST(OPTIMS)
462 AC_SUBST(CSS)
463
464 AC_SUBST(LCFLAGS)
465 AC_SUBST(LIB)
466
467 AC_SUBST(LIB_ALSA)
468 AC_SUBST(LIB_BEOS)
469 AC_SUBST(LIB_DARWIN)
470 AC_SUBST(LIB_ESD)
471 AC_SUBST(LIB_GGI)
472 AC_SUBST(LIB_GLIDE)
473 AC_SUBST(LIB_GNOME)
474 AC_SUBST(LIB_GTK)
475 AC_SUBST(LIB_IDCTALTIVEC)
476 AC_SUBST(LIB_MACOSX)
477 AC_SUBST(LIB_NCURSES)
478 AC_SUBST(LIB_QT)
479 AC_SUBST(LIB_TS)
480 AC_SUBST(LIB_SDL)
481 AC_SUBST(LIB_X11)
482 AC_SUBST(LIB_XVIDEO)
483 AC_SUBST(LIB_YUV)
484
485 AC_SUBST(CFLAGS_GTK)
486 AC_SUBST(CFLAGS_X11)
487
488 AC_OUTPUT([Makefile.opts include/config.h])
489
490 echo "
491 vlc configuration
492 -----------------
493 vlc version           : ${VLC_VERSION}
494 system                : ${SYS}
495 architecture          : ${ARCH}
496 debug mode            : ${DEBUG}
497 statistics            : ${STATS}
498 optimizations         : ${OPTIMS}
499 CSS decryption        : ${CSS}
500 need builtin getopt   : ${GETOPT}
501 plugin modules        : ${PLUGINS}
502 built-in modules      : ${BUILTINS}
503 vlc aliases           : ${ALIASES}
504
505 You may now tune Makefile.opts at your convenience."
506