]> git.sesse.net Git - vlc/blob - configure.in
. should compile & run on Solaris with ./configure --disable-dsp
[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.1.99i
8 AC_SUBST(VLC_VERSION)
9 VLC_CODENAME=Onatopp
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 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)
37 AC_FUNC_MMAP
38 AC_TYPE_SIGNAL
39 AC_CHECK_LIB(dl, dlopen)
40 AC_CHECK_LIB(gnugetopt, optarg)
41 AC_CHECK_LIB(be, _)
42 AC_CHECK_LIB(game, _)
43 AC_CHECK_LIB(root, _)
44 AC_CHECK_LIB(m, powl)
45 AC_CHECK_LIB(pthread, pthread_create)
46 AC_CHECK_LIB(threads, thread_create)
47
48 dnl check for getopt_long, substitute the distributed versions if not
49 AC_CHECK_FUNC(getopt_long,,[LIBOBJS="$LIBOBJS getopt.o getopt1.o"])
50 AC_SUBST(LIBOBJS)
51
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)
61
62 dnl Check for threads library
63 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
64
65 dnl Do a series of bizarre compilation tests
66 save_CFLAGS=$CFLAGS
67
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))
75
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])
79 AC_TRY_COMPILE([],,
80  BIZARRE_OPTIMS="-fargument-noalias-global -fstrict-aliasing"
81  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
82
83 dnl Check for -rdynamic flag
84 CFLAGS="${CFLAGS} -rdynamic"
85 AC_MSG_CHECKING([if \$CC accepts -rdynamic])
86 AC_TRY_COMPILE([],,
87  DYNAMIC_FLAG="-rdynamic"
88  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
89
90 dnl End of the bizarre compilation tests
91 CFLAGS=$save_CFLAGS
92
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))
99
100 dnl Checks for typedefs, structures, and compiler characteristics.
101 AC_C_CONST
102 AC_TYPE_SIZE_T
103 AC_HEADER_TIME
104
105 dnl default plugins 
106 PLUGINS=${PLUGINS}"yuv ";
107
108 ARCH=${host_cpu}
109 AC_ARG_ENABLE(ppro,
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 ])
113 AC_ARG_ENABLE(mmx,
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 ])
117 AC_ARG_ENABLE(debug,
118 [  --enable-debug          Enable debug mode (default disabled)],
119 [ if test x$enableval = xyes; then DEBUG=1; fi ])
120 AC_ARG_ENABLE(stats,
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 ],
126 [ OPTIMS=1 ])
127
128 SYS=${host_os}
129
130 # special cases
131 if test x$host_os = xbeos; then
132     PLUGINS=${PLUGINS}"dummy null beos "
133
134 dnl default case
135 else
136
137 AC_ARG_ENABLE(dummy,
138   [  --disable-dummy         dummy audio and video support (default enabled)])
139 if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
140 AC_ARG_ENABLE(null,
141   [  --disable-null          Null module (default enabled)])
142 if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
143 AC_ARG_ENABLE(dsp,
144   [  --disable-dsp           Linux /dev/dsp support (default enabled)])
145 if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
146 AC_ARG_ENABLE(esd,
147   [  --enable-esd            Esound library support (default disabled)],
148   [if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
149 AC_ARG_ENABLE(fb,
150   [  --enable-fb             Linux framebuffer support (default disabled)],
151   [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; ALIASES=${ALIASES}"fbvlc "; fi])
152 AC_ARG_WITH(ggi,
153   [  --with-ggi[=name]       GGI support (default disabled)],
154   [ PLUGINS=${PLUGINS}"ggi ";
155     if test "x$withval" != "xyes";
156     then
157       LIB_GGI="-l"$withval
158     else
159       LIB_GGI="-lggi"
160     fi ])
161 AC_ARG_WITH(sdl,
162   [  --with-sdl[=name]       SDL support (default disabled)],
163   [ PLUGINS=${PLUGINS}"sdl ";
164     if test "x$withval" != "xyes";
165     then
166       LIB_SDL="-l"$withval
167     else
168       LIB_SDL="-lSDL"
169     fi ])
170 AC_ARG_WITH(glide,
171   [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
172   [ PLUGINS=${PLUGINS}"glide ";
173     if test "x$withval" != "xyes";
174     then
175       LIB_GLIDE="-l"$withval
176     else
177       LIB_GLIDE="-lglide2x"
178     fi ])
179 AC_ARG_ENABLE(gnome,
180   [  --enable-gnome          Gnome support (default disabled)],
181   [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi])
182 AC_ARG_ENABLE(x11,
183   [  --disable-x11           X11 support (default enabled)])
184 if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
185 AC_ARG_ENABLE(alsa,
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])
188
189 fi
190
191 AC_SUBST(SYS)
192 AC_SUBST(ARCH)
193 AC_SUBST(PLUGINS)
194 AC_SUBST(ALIASES)
195 AC_SUBST(DEBUG)
196 AC_SUBST(STATS)
197 AC_SUBST(OPTIMS)
198 AC_SUBST(BIZARRE_OPTIMS)
199 AC_SUBST(DYNAMIC_FLAG)
200 AC_SUBST(LIB_SDL)
201 AC_SUBST(LIB_GLIDE)
202 AC_SUBST(LIB_GGI)
203
204 AC_OUTPUT([Makefile include/config.h])
205
206 echo "
207 vlc configuration
208 -----------------
209 vlc version           : ${VLC_VERSION}
210 system                : ${SYS}
211 architecture          : ${ARCH}
212 debug mode            : ${DEBUG}
213 statistics            : ${STATS}
214 optimizations         : ${OPTIMS}
215 plugins               : ${PLUGINS}
216 vlc aliases           : ${ALIASES}
217 "
218