configure.in 47.5 KB
Newer Older
Sam Hocevar's avatar
   
Sam Hocevar committed
1
dnl Autoconf settings for vlc
Sam Hocevar's avatar
   
Sam Hocevar committed
2
AC_INIT(include/main.h)
3
AC_CONFIG_HEADER(include/defs.h)
4
AC_CANONICAL_SYSTEM
5

Sam Hocevar's avatar
   
Sam Hocevar committed
6
PACKAGE="vlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
7
VERSION="0.3.1"
Sam Hocevar's avatar
   
Sam Hocevar committed
8
CODENAME=Ourumov
9

Sam Hocevar's avatar
   
Sam Hocevar committed
10
dnl Save CFLAGS and LDFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
11
save_CFLAGS="${CFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
12
save_CPPFLAGS="${CPPFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
13
save_LDFLAGS="${LDFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
14

15
16
dnl Check for tools
AC_PROG_MAKE_SET
Sam Hocevar's avatar
   
Sam Hocevar committed
17
18
AC_PROG_CC
AC_PROG_CPP
19

gbazin's avatar
   
gbazin committed
20
21
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)
Sam Hocevar's avatar
   
Sam Hocevar committed
22
AC_CHECK_TOOL(STRIP, strip, :)
gbazin's avatar
   
gbazin committed
23

Christophe Massiot's avatar
Christophe Massiot committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
dnl Check for GNU make
AC_PATH_PROG(GMAKE, gmake, no)
if test "x$GMAKE" = "xno"; then
  AC_CACHE_CHECK([whether GNU make is installed],
      [ac_cv_gmake],
      [if make --version | grep -q -i gnu; then
         ac_cv_gmake="yes"
       else
         echo "This software needs you to install GNU make to compile properly."
         echo "You can get it from http://www.gnu.org/."
         exit
       fi])
  VLC_MAKE="make"
else
  VLC_MAKE="gmake"
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
41
dnl Gettext stuff
42
ALL_LINGUAS="de en_GB fr ja no ru nl"
Sam Hocevar's avatar
Sam Hocevar committed
43

Sam Hocevar's avatar
   
Sam Hocevar committed
44
AC_DEFINE_UNQUOTED(VLC_PACKAGE, "$PACKAGE", [Package name])
Sam Hocevar's avatar
   
Sam Hocevar committed
45
AC_DEFINE_UNQUOTED(VLC_VERSION, "$VERSION", [Package version])
Sam Hocevar's avatar
   
Sam Hocevar committed
46
47
AM_GNU_GETTEXT

48
49
50
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

gbazin's avatar
   
gbazin committed
51
52
53
54
55
56
57
58
59
60
61
62
dnl
dnl  Check the operating system
dnl
case x"${target_os}" in
  x)
    SYS=unknown
    ;;
  xlinux*)
    SYS=linux
    ;;
  xbsdi*)
    SYS=bsdi
Sam Hocevar's avatar
   
Sam Hocevar committed
63
64
65
66
67
68
69
    save_CFLAGS="${save_CFLAGS} -pthread"
    dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
    vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
    ;;
  x*bsd*)
    SYS="${target_os}"
    save_CFLAGS="${save_CFLAGS} -pthread"
gbazin's avatar
   
gbazin committed
70
71
72
    ;;
  xdarwin*)
    SYS=darwin
Sam Hocevar's avatar
   
Sam Hocevar committed
73
    save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"
gbazin's avatar
   
gbazin committed
74
75
76
77
    ;;
  x*mingw32*)
    SYS=mingw32
    AC_CHECK_TOOL(WINDRES, windres, :)
Sam Hocevar's avatar
   
Sam Hocevar committed
78
    save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"
Sam Hocevar's avatar
   
Sam Hocevar committed
79
    vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
Sam Hocevar's avatar
   
Sam Hocevar committed
80
81
82
    vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
    ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
    rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
gbazin's avatar
   
gbazin committed
83
84
85
    ;;
  x*nto*)
    SYS=nto
Sam Hocevar's avatar
   
Sam Hocevar committed
86
87
    x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
    xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
gbazin's avatar
   
gbazin committed
88
89
90
    ;;
  xbeos)
    SYS=beos
Sam Hocevar's avatar
   
Sam Hocevar committed
91
    save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"
Sam Hocevar's avatar
   
Sam Hocevar committed
92
93
94
95
    vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
    plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
    beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
    ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
gbazin's avatar
   
gbazin committed
96
97
    ;;
  x*)
Sam Hocevar's avatar
   
Sam Hocevar committed
98
    SYS="${target_os}"
gbazin's avatar
   
gbazin committed
99
100
101
    ;;
esac

Sam Hocevar's avatar
   
Sam Hocevar committed
102
103
104
105
106
107
108
109
110
dnl Flags for plugin compilation
if test x"${SYS}" = xmingw32
then
  plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
else
  plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
fi

dnl The -DSYS_FOO flag
Sam Hocevar's avatar
   
Sam Hocevar committed
111
save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
Sam Hocevar's avatar
   
Sam Hocevar committed
112

113
dnl Check for system libs needed
Sam Hocevar's avatar
   
Sam Hocevar committed
114
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
Sam Hocevar's avatar
   
Sam Hocevar committed
115

Sam Hocevar's avatar
   
Sam Hocevar committed
116
AC_CHECK_FUNC(connect,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
117
  AC_CHECK_LIB(socket,connect,
Sam Hocevar's avatar
   
Sam Hocevar committed
118
119
    ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
    vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
Sam Hocevar's avatar
   
Sam Hocevar committed
120
)])
Sam Hocevar's avatar
   
Sam Hocevar committed
121
AC_CHECK_FUNC(gethostbyname,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
122
  AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl")
Sam Hocevar's avatar
   
Sam Hocevar committed
123
124
])
AC_CHECK_FUNC(gethostbyname,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
125
  AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
Sam Hocevar's avatar
   
Sam Hocevar committed
126
127
])
AC_CHECK_FUNC(nanosleep,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
128
129
  AC_CHECK_LIB(rt,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lrt",[
    AC_CHECK_LIB(posix4,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4")
Sam Hocevar's avatar
   
Sam Hocevar committed
130
131
132
  ])
])
AC_CHECK_FUNC(inet_aton,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
133
  AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
134
135
])
AC_CHECK_FUNC(textdomain,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
136
  AC_CHECK_LIB(intl,textdomain,save_LDFLAGS="${save_LDFLAGS} -lintl")
Sam Hocevar's avatar
   
Sam Hocevar committed
137
])
Sam Hocevar's avatar
   
Sam Hocevar committed
138

Sam Hocevar's avatar
   
Sam Hocevar committed
139
dnl Check for getopt
Sam Hocevar's avatar
   
Sam Hocevar committed
140
NEED_GETOPT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
141
142
143
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
  AC_CHECK_LIB([gnugetopt],[getopt_long],
Sam Hocevar's avatar
   
Sam Hocevar committed
144
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
Sam Hocevar's avatar
   
Sam Hocevar committed
145
    [NEED_GETOPT=1])])
Sam Hocevar's avatar
   
Sam Hocevar committed
146

147
AC_TYPE_SIGNAL
Sam Hocevar's avatar
   
Sam Hocevar committed
148
AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
Sam Hocevar's avatar
   
Sam Hocevar committed
149
AC_CHECK_LIB(m,cos,
Sam Hocevar's avatar
   
Sam Hocevar committed
150
151
  imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
  filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
Sam Hocevar's avatar
   
Sam Hocevar committed
152
AC_CHECK_LIB(m,pow,
Sam Hocevar's avatar
   
Sam Hocevar committed
153
154
155
156
  imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
  imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
  imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
  chroma_i420_rgb_LDFLAGS="${chroma_i420_rgb_LDFLAGS} -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
157
)
Sam Hocevar's avatar
   
Sam Hocevar committed
158

Sam Hocevar's avatar
   
Sam Hocevar committed
159
dnl Check for pthreads - borrowed from XMMS
Sam Hocevar's avatar
   
Sam Hocevar committed
160
161
162
163
164
165
166
167
168
169
170
171
172
173
THREAD_LIB=error
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
fi
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
fi
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
fi
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_FUNC(pthread_attr_init)
  THREAD_LIB=""
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
174
175
176

dnl Check for cthreads under GNU/Hurd for instance
AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
177

Sam Hocevar's avatar
   
Sam Hocevar committed
178
179
180
dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
  AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
Sam Hocevar's avatar
   
Sam Hocevar committed
181
            Define if <pthread.h> defines pthread_cond_t.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
182
183
AC_EGREP_HEADER(strncasecmp,strings.h,[
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Sam Hocevar's avatar
   
Sam Hocevar committed
184
            Define if <strings.h> defines strncasecmp.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
185

Sam Hocevar's avatar
   
Sam Hocevar committed
186
dnl Check for headers
Sam Hocevar's avatar
   
Sam Hocevar committed
187
AC_CHECK_HEADERS(getopt.h strings.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
188
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
189
190
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
191
AC_CHECK_HEADERS(machine/param.h sys/shm.h)
192
AC_CHECK_HEADERS(linux/version.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
193

Sam Hocevar's avatar
   
Sam Hocevar committed
194
195
AC_HEADER_TIME

Sam Hocevar's avatar
   
Sam Hocevar committed
196
197
198
dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)

Sam Hocevar's avatar
   
Sam Hocevar committed
199
200
201
202
203
204
205
206
207
dnl Check for DPMS
if test x$SYS != xmingw32
then
  if test x$x_includes = xNONE; then
    x_includes=/usr/X11R6/include
  fi
  if test x$x_libraries = xNONE; then
    x_libraries=/usr/X11R6/lib
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
208
  CPPFLAGS="$save_CPPFLAGS -I$x_includes"
Sam Hocevar's avatar
   
Sam Hocevar committed
209
210
211
212
213
214
  AC_CHECK_HEADERS(X11/extensions/dpms.h, [
    AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
      AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
                Define if <X11/extensions/dpms.h> defines DPMSInfo.)
    ])
  ])
Sam Hocevar's avatar
   
Sam Hocevar committed
215
  CPPFLAGS="$save_CPPFLAGS"
Sam Hocevar's avatar
   
Sam Hocevar committed
216
217
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
218
dnl Check for ntohl, etc.
219
220
221
222
223
224
225
226
227
AC_CACHE_CHECK([for ntohl in sys/param.h],
    [ac_cv_c_ntohl_sys_param_h],
    [CFLAGS="${save_CFLAGS} -Wall -Werror"
     AC_TRY_COMPILE([#include <sys/param.h>],
        [void foo() { int meuh; ntohl(meuh); }],
        ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
    AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
228

Sam Hocevar's avatar
   
Sam Hocevar committed
229
dnl Check for inline function size limit
230
231
232
233
234
235
236
AC_CACHE_CHECK([if \$CC accepts -finline-limit],
    [ac_cv_c_inline_limit],
    [CFLAGS="${save_CFLAGS} -finline-limit-30000"
     AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
if test x"$ac_cv_c_inline_limit" != x"no"; then
    save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
237

Sam Hocevar's avatar
   
Sam Hocevar committed
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
dnl Check for -W or -w flags
AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
    [ac_cv_c_Wall_Winline],
    [CFLAGS="${save_CFLAGS} -Wall -Winline"
     AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
if test x"$ac_cv_c_Wall_Winline" != x"no"; then
    save_CFLAGS="${save_CFLAGS} -Wall -Winline"
else
    AC_CACHE_CHECK([if \$CC accepts -wall -winline],
        [ac_cv_c_wall_winline],
        [CFLAGS="${save_CFLAGS} -wall -winline"
         AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
    if test x"$ac_cv_c_wall_winline" != x"no"; then
        save_CFLAGS="${save_CFLAGS} -wall -winline"
    fi
fi

dnl Check for -pipe
AC_CACHE_CHECK([if \$CC accepts -pipe],
    [ac_cv_c_pipe],
    [CFLAGS="${save_CFLAGS} -pipe"
     AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
if test x"$ac_cv_c_pipe" != x"no"; then
    save_CFLAGS="${save_CFLAGS} -pipe"
fi

dnl Check for various optimization flags
AC_CACHE_CHECK([if \$CC accepts -O3],
    [ac_cv_c_o3],
    [CFLAGS="${save_CFLAGS} -O3"
     AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
if test x"$ac_cv_c_o3" != x"no"; then
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
else
    AC_CACHE_CHECK([if \$CC accepts -O2],
        [ac_cv_c_o2],
        [CFLAGS="${save_CFLAGS} -O2"
         AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
    if test x"$ac_cv_c_o2" != x"no"; then
        CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
    else
        AC_CACHE_CHECK([if \$CC accepts -O],
            [ac_cv_c_o],
            [CFLAGS="${save_CFLAGS} -O"
             AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
        if test x"$ac_cv_c_o" != x"no"; then
            CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
        fi
    fi
fi

dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math],
    [ac_cv_c_fast_math],
    [CFLAGS="${save_CFLAGS} -ffast-math"
     AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
if test x"$ac_cv_c_fast_math" != x"no"; then
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
fi

dnl Check for -funroll-loops
AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
    [ac_cv_c_unroll_loops],
    [CFLAGS="${save_CFLAGS} -funroll-loops"
     AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
if test x"$ac_cv_c_unroll_loops" != x"no"; then
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
fi

dnl Check for -fomit-frame-pointer
AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
    [ac_cv_c_omit_frame_pointer],
    [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
     AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
    CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
316
dnl Check for Darwin plugin linking flags
Christophe Massiot's avatar
Christophe Massiot committed
317
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
318
    [ac_cv_ld_darwin],
Christophe Massiot's avatar
Christophe Massiot committed
319
    [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
320
321
     AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test x"$ac_cv_ld_darwin" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
322
    plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
323
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
324
325

dnl Check for standard plugin linking flags
326
327
328
329
330
AC_CACHE_CHECK([if \$CC accepts -shared],
    [ac_cv_ld_plugins],
    [CFLAGS="${save_CFLAGS} -shared"
     AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
if test x"$ac_cv_ld_plugins" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
331
    plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
Sam Hocevar's avatar
   
Sam Hocevar committed
332
fi
333
        
334
335
336
337
dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
    [ac_cv_c_attribute_aligned],
    [ac_cv_c_attribute_aligned=0
Sam Hocevar's avatar
   
Sam Hocevar committed
338
        CFLAGS="${save_CFLAGS} -Werror"
339
340
341
342
343
344
345
346
347
348
    for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
        AC_TRY_COMPILE([],
        [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
        [ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
    done])
if test x"$ac_cv_c_attribute_aligned" != x"0"; then
    AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
        [$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
349
dnl End of the bizarre compilation tests
Sam Hocevar's avatar
   
Sam Hocevar committed
350
CFLAGS="${save_CFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
351
CPPFLAGS="${save_CPPFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
352
LDFLAGS="${save_LDFLAGS}"
Christophe Massiot's avatar
Christophe Massiot committed
353

354
dnl Check for boolean_t
355
356
AC_CACHE_CHECK([for boolean_t in sys/types.h],
    [ac_cv_c_boolean_t_sys_types_h],
Sam Hocevar's avatar
   
Sam Hocevar committed
357
    [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
358
359
360
361
362
363
364
     ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
    AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
fi

AC_CACHE_CHECK([for boolean_t in pthread.h],
    [ac_cv_c_boolean_t_pthread_h],
Sam Hocevar's avatar
   
Sam Hocevar committed
365
    [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
366
367
368
369
370
371
372
     ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
    AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
fi

AC_CACHE_CHECK([for boolean_t in cthreads.h],
    [ac_cv_c_boolean_t_cthreads_h],
Sam Hocevar's avatar
   
Sam Hocevar committed
373
    [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
374
375
376
377
     ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
    AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
378

Sam Hocevar's avatar
   
Sam Hocevar committed
379
380
381
382
383
384
385
386
dnl
dnl  Check the CPU
dnl
case x"${target_cpu}" in
  x)
    ARCH=unknown
    ;;
  *)
Sam Hocevar's avatar
   
Sam Hocevar committed
387
    ARCH="${target_cpu}"
Sam Hocevar's avatar
   
Sam Hocevar committed
388
389
    ;;
esac
Sam Hocevar's avatar
   
Sam Hocevar committed
390
391
392
393

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
394
BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
Sam Hocevar's avatar
   
Sam Hocevar committed
395
PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
Sam Hocevar's avatar
   
Sam Hocevar committed
396
397
398
399

dnl
dnl  Accelerated modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
400
MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
Sam Hocevar's avatar
   
Sam Hocevar committed
401
402
MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
gbazin's avatar
   
gbazin committed
403
SSE_MODULES="imdctsse downmixsse"
404
ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
405

406
407
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
    [ac_cv_mmx_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
408
    [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
409
                    ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
410
if test x"$ac_cv_mmx_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
411
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
412
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
413

414
415
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
    [ac_cv_mmxext_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
416
    [AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
417
                    ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
418
if test x"$ac_cv_mmxext_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
419
  ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
420
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
421

422
423
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
    [ac_cv_3dnow_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
424
    [AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
425
                    ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
426
if test x"$ac_cv_3dnow_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
427
  AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
Sam Hocevar's avatar
   
Sam Hocevar committed
428
  ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
429
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
430

431
432
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
    [ac_cv_sse_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
433
    [AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
434
                    ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
Sam Hocevar's avatar
   
Sam Hocevar committed
435
if test x"$ac_cv_sse_inline" != x"no" -a x$SYS != xmingw32; then
Sam Hocevar's avatar
   
Sam Hocevar committed
436
  AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
Sam Hocevar's avatar
   
Sam Hocevar committed
437
  ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
438
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
439

gbazin's avatar
   
gbazin committed
440
441
442
# don't try to grok altivec with native mingw32 it doesn't work right now
# we should be able to remove this test with future versions of mingw32
if test x$SYS != xmingw32; then
443
444
AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
    [ac_cv_altivec_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
445
    [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
446
447
448
         ac_cv_altivec_inline=yes,
         [save_CFLAGS=$CFLAGS
          CFLAGS="$CFLAGS -Wa,-m7400"
Sam Hocevar's avatar
   
Sam Hocevar committed
449
          AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
450
            [ac_cv_altivec_inline="-Wa,-m7400"],
451
            ac_cv_altivec_inline=no)
452
453
          CFLAGS=$save_CFLAGS
         ])])
454
if test x"$ac_cv_altivec_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
455
  AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
456
  if test x"$ac_cv_altivec_inline" != x"yes"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
457
458
459
460
    idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_altivec_inline"
    motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_altivec_inline"
    memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_altivec_inline"
    vlc_CFLAGS="$vlc_CFLAGS $ac_cv_altivec_inline"
461
  fi
462
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
463
fi
464

465
466
AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
    [ac_cv_c_altivec],
467
468
469
    [save_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -faltivec"
     # Darwin test
Sam Hocevar's avatar
   
Sam Hocevar committed
470
     AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
471
472
        ac_cv_c_altivec=-faltivec, [
        # Linux/PPC test
Sam Hocevar's avatar
   
Sam Hocevar committed
473
        CFLAGS="$save_CFLAGS $idctaltivec_CFLAGS -fvec"
Sam Hocevar's avatar
   
Sam Hocevar committed
474
        AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
475
476
477
478
            [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
        ])
     CFLAGS=$save_CFLAGS
    ])
479
if test x"$ac_cv_c_altivec" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
480
  AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
Sam Hocevar's avatar
   
Sam Hocevar committed
481
482
483
484
  idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_c_altivec"
  motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_c_altivec"
  memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_c_altivec"
  vlc_CFLAGS="$vlc_CFLAGS $ac_cv_c_altivec"
485
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
486
487
488
489
490
491
492
493
494
495
fi

AC_CACHE_CHECK([if linker needs -framework vecLib],
    [ac_cv_ld_altivec],
    [save_LDFLAGS=$LDFLAGS
     LDFLAGS="$LDFLAGS -framework vecLib"
     AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
     LDFLAGS=$save_LDFLAGS
    ])
if test x"$ac_cv_ld_altivec" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
496
497
498
499
  idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
  motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
  memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
  vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
500
fi
gbazin's avatar
   
gbazin committed
501
fi # end if mingw32
502
503


Sam Hocevar's avatar
   
Sam Hocevar committed
504
505
506
AC_ARG_WITH(,[])
AC_ARG_WITH(,[Optimization options:])

Sam Hocevar's avatar
   
Sam Hocevar committed
507
dnl
508
dnl  Special arch tuning
Sam Hocevar's avatar
   
Sam Hocevar committed
509
dnl
510
AC_ARG_WITH(tuning,
Sam Hocevar's avatar
   
Sam Hocevar committed
511
[  --with-tuning=ARCH      enable special tuning for an architecture
512
513
514
515
                          (default i686 on IA-32 and 750 on PPC)])
if test "x$withval" != "x"; then
    TUNING=$withval
else
516
    if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
517
    else
518
        if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
519
520
    fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
521
522

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
523
dnl  x86 accelerations
Sam Hocevar's avatar
   
Sam Hocevar committed
524
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
525
526
527
528
529
if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
then
    ARCH="${ARCH} mmx"
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
530

Sam Hocevar's avatar
   
Sam Hocevar committed
531
532
533
534
535
536
537
538
dnl
dnl  Enable/disable optimizations
dnl
AC_ARG_ENABLE(optimizations,
[  --disable-optimizations disable compiler optimizations (default enabled)],
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])

Sam Hocevar's avatar
   
Sam Hocevar committed
539
540
541
dnl
dnl  AltiVec acceleration
dnl
542
AC_ARG_ENABLE(altivec,
Sam Hocevar's avatar
   
Sam Hocevar committed
543
[  --disable-altivec       disable altivec optimizations (default enabled on PPC)],
544
545
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
546
[ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
547
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
548
549
550
551

dnl
dnl  Debugging mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
552
DEBUG=0
553
AC_ARG_ENABLE(debug,
Sam Hocevar's avatar
   
Sam Hocevar committed
554
[  --enable-debug          debug mode (default disabled)],
555
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
556

Sam Hocevar's avatar
   
Sam Hocevar committed
557
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
558
dnl  Enable release-specific flags
Sam Hocevar's avatar
   
Sam Hocevar committed
559
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
560
RELEASE=0
Sam Hocevar's avatar
   
Sam Hocevar committed
561
562
563
AC_ARG_ENABLE(release,
[  --enable-release        activate extra optimizations (default disabled)],
[ if test x$enableval = xyes; then RELEASE=1; fi ],
Sam Hocevar's avatar
   
Sam Hocevar committed
564
[ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
Sam Hocevar's avatar
   
Sam Hocevar committed
565

Sam Hocevar's avatar
   
Sam Hocevar committed
566
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
567
dnl  Input plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
568
569
dnl

Sam Hocevar's avatar
   
Sam Hocevar committed
570
AC_ARG_WITH(,[Input plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
571
572

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
573
574
575
576
577
578
579
580
dnl  DVD module: optionally check for installed libdvdcss
dnl
AC_ARG_ENABLE(dvd,
[  --enable-dvd            DVD input module (default enabled)])
if test "x$enableval" != "xno"
then
  AC_ARG_WITH(dvdcss, 
  [    --with-dvdcss=PATH    libdvdcss headers and libraries])
Sam Hocevar's avatar
   
Sam Hocevar committed
581
582
  AC_ARG_WITH(dvdcss-tree, 
  [    --with-dvdcss-tree=PATH libdvdcss tree for static linking])
Sam Hocevar's avatar
   
Sam Hocevar committed
583
  case "x$with_dvdcss" in
Sam Hocevar's avatar
   
Sam Hocevar committed
584
  x|xyes)
Sam Hocevar's avatar
   
Sam Hocevar committed
585
586
587
588
    if test "x$with_dvdcss_tree" = x
    then
      AC_CHECK_HEADERS(dvdcss/dvdcss.h,
        [ PLUGINS="${PLUGINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
589
          dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
Sam Hocevar's avatar
   
Sam Hocevar committed
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
        [ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss=<path/where/libdvdcss/was/installed> for dynamic linking (recommended under Unix) or --with-dvdcss-tree=<path/where/libdvdcss/was/built> for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.])
          AC_MSG_ERROR([cannot find libdvdcss headers]) ])
    else
      AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
      real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
      if test "x$real_dvdcss_tree" = x
      then
        dnl  The given directory can't be found
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
      fi
      if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
      then
        dnl  Use a custom libdvdcss
        AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
        BUILTINS="${BUILTINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
606
607
        dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
        dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
Sam Hocevar's avatar
   
Sam Hocevar committed
608
609
610
611
612
613
      else
        dnl  The given libdvdcss wasn't built
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
      fi
    fi
Sam Hocevar's avatar
   
Sam Hocevar committed
614
615
  ;;
  xno)
Sam Hocevar's avatar
   
Sam Hocevar committed
616
    dnl  Compile without dvdcss (dlopen version, works only under Linux)
Sam Hocevar's avatar
   
Sam Hocevar committed
617
    PLUGINS="${PLUGINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
618
619
    dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
    dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
Sam Hocevar's avatar
   
Sam Hocevar committed
620
621
  ;;
  *)
Sam Hocevar's avatar
   
Sam Hocevar committed
622
623
    AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
    if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
Sam Hocevar's avatar
   
Sam Hocevar committed
624
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
625
      dnl  Use ${with_dvdcss}/include/dvdcss/dvdcss.h
Sam Hocevar's avatar
   
Sam Hocevar committed
626
      AC_MSG_RESULT(yes)
Sam Hocevar's avatar
   
Sam Hocevar committed
627
      PLUGINS="${PLUGINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
628
629
      dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
      dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
630
    else
Sam Hocevar's avatar
   
Sam Hocevar committed
631
      dnl  No libdvdcss could be found, sorry
Sam Hocevar's avatar
   
Sam Hocevar committed
632
      AC_MSG_RESULT(no)
Sam Hocevar's avatar
   
Sam Hocevar committed
633
      AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
Sam Hocevar's avatar
   
Sam Hocevar committed
634
635
636
637
    fi
  ;;
  esac
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
638

Stéphane Borel's avatar
Stéphane Borel committed
639
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
640
dnl dvdread module: check for libdvdread plugin
Stéphane Borel's avatar
Stéphane Borel committed
641
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
642
643
AC_ARG_ENABLE(dvdread,
[  --enable-dvdread        dvdread input module (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
644
if test "x$enable_dvdread" != "xno"
Sam Hocevar's avatar
   
Sam Hocevar committed
645
646
647
then
  AC_ARG_WITH(dvdread, 
  [    --with-dvdread=PATH   libdvdread headers and libraries])
Sam Hocevar's avatar
   
Sam Hocevar committed
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
  if test "x$withval" = x
  then
    test_LDFLAGS=""
    test_CFLAGS=""
  else
    test_LDFLAGS="-L${withval}/lib"
    test_CFLAGS="-I${withval}/include"
  fi
  CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
  AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
     AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
        [void foo() { int i=DVD_VIDEO_LB_LEN; }],[
          PLUGINS="${PLUGINS} dvdread"
          dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
          dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
        ],[
Sam Hocevar's avatar
   
Sam Hocevar committed
664
          if test "x$enable_dvdread" != x
Sam Hocevar's avatar
   
Sam Hocevar committed
665
666
667
668
669
          then
            AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
          fi
        ])
  ],[
Sam Hocevar's avatar
   
Sam Hocevar committed
670
    if test "x$enable_dvdread" != x
671
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
672
673
674
675
676
677
      if test "x$withval" != x
      then
        AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${withval}/include])
      else
        AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
      fi
Sam Hocevar's avatar
   
Sam Hocevar committed
678
    fi
Sam Hocevar's avatar
   
Sam Hocevar committed
679
680
  ])
  CPPFLAGS="$save_CPPFLAGS"
Sam Hocevar's avatar
   
Sam Hocevar committed
681
fi
Stéphane Borel's avatar
Stéphane Borel committed
682

683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
dnl
dnl  libdvbpsi ts demux
dnl
AC_ARG_ENABLE(dvbpsi,
[  --enable-dvbpsi        dvbpsi ts demux module (default disabled)])
if test "x$enable_dvdread" != "xno"
then
  if test "x$withval" = x
  then
    test_LDFLAGS=""
    test_CFLAGS=""
  else
    test_LDFLAGS="-L${withval}/lib"
    test_CFLAGS="-I${withval}/include"
  fi
  CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
  AC_CHECK_HEADER([dvbpsi/dvbpsi.h],[
    PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
    mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
    mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
    ],[
    if test "x$enable_dvbpsi" != x
    then
      AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org])
    fi
  ])
  CPPFLAGS="$save_CPPFLAGS"
fi
 
712
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
713
dnl  VCD module
714
715
dnl
AC_ARG_ENABLE(vcd,
Sam Hocevar's avatar
   
Sam Hocevar committed
716
  [  --enable-vcd            VCD support for Linux and MacOS X (default enabled)])
717

Sam Hocevar's avatar
   
Sam Hocevar committed
718
719
720
if test x$enable_vcd != xno
then
  AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
721
    PLUGINS="${PLUGINS} vcd"
Sam Hocevar's avatar
   
Sam Hocevar committed
722
  ])
723

Sam Hocevar's avatar
   
Sam Hocevar committed
724
725
726
727
  if test "x${SYS}" = "xbsdi"
  then
    PLUGINS="${PLUGINS} vcd"
  fi
728

Sam Hocevar's avatar
   
Sam Hocevar committed
729
730
731
  if test "x${SYS}" = "xdarwin"
  then
    PLUGINS="${PLUGINS} vcd"
Sam Hocevar's avatar
   
Sam Hocevar committed
732
    vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation" 
Sam Hocevar's avatar
   
Sam Hocevar committed
733
  fi
Jon Lech Johansen's avatar
Jon Lech Johansen committed
734
735
fi

Johan Bilien's avatar
Johan Bilien committed
736
737
738
739
dnl
dnl  Satellite input module
dnl
AC_ARG_ENABLE(satellite,
Sam Hocevar's avatar
   
Sam Hocevar committed
740
  [  --enable-satellite      satellite card support (default disabled)],
Johan Bilien's avatar
Johan Bilien committed
741
742
  [ if test x$enable_satellite = xyes
    then
743
      PLUGINS="${PLUGINS} satellite"
Johan Bilien's avatar
Johan Bilien committed
744
745
    fi])

746
747
748
dnl
dnl  ipv6 plugin
dnl
Christophe Massiot's avatar
Christophe Massiot committed
749
AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
750

751
752
753
754
755
756
757
758
759
760
dnl
dnl  AVI demux plugin
dnl
AC_ARG_ENABLE(avi,
  [  --enable-avi            AVI demux module (default enabled)])
if test x$enable_avi != xno
then
  PLUGINS="${PLUGINS} avi"
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
761
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
762
dnl  Codec plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
763
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
764

Sam Hocevar's avatar
   
Sam Hocevar committed
765
AC_ARG_WITH(,[Codec plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
766

767
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
768
dnl  mad plugin
769
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
770
771
AC_ARG_ENABLE(mad,
  [  --enable-mad            libmad module (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
772
if test x$enable_mad = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
773
774
then
  PLUGINS="${PLUGINS} mad"
Sam Hocevar's avatar
   
Sam Hocevar committed
775
  mad_LDFLAGS="${mad_LDFLAGS} -lmad"
Sam Hocevar's avatar
   
Sam Hocevar committed
776
777
778
779
  AC_ARG_WITH(mad,
    [    --with-mad=PATH       path to libmad],
    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
780
781
        mad_CFLAGS="${mad_CFLAGS} -I$with_val/include"
        mad_LDFLAGS="${mad_LDFLAGS} -L$with_val/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
782
783
784
      fi ])
  save_CFLAGS=$CFLAGS
  save_LDFLAGS=$LDFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
785
786
  CFLAGS="$CFLAGS $mad_CFLAGS"
  LDFLAGS="$LDFLAGS $mad_LDFLAGS"
Sam Hocevar's avatar
   
Sam Hocevar committed
787
788
789
790
791
792
793
794
795
796
797
  AC_CHECK_HEADERS(mad.h, ,
  [ echo "Cannot find development headers for libmad..."
    exit 1
  ])
  AC_CHECK_LIB(mad, mad_bit_init, ,
  [ echo "Cannot find libmad library..."
    exit 1
  ])
  CFLAGS=$save_CFLAGS
  LDFLAGS=$save_LDFLAGS
fi
798

799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
dnl
dnl  ffmpeg decoder plugin
dnl
AC_ARG_ENABLE(ffmpeg,
[  --enable-ffmpeg         ffmpeg codec (default disabled)])
if test "x$enableval" = "xyes"
then
  AC_ARG_WITH(ffmpeg-tree, 
  [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
  if test "x$with_ffmpeg_tree" = x
  then
    AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a])
  else
    AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
    real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
    if test "x$real_ffmpeg_tree" = x
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
    fi
    if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
    then
      dnl  Use a custom libffmpeg
      AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
      BUILTINS="${BUILTINS} ffmpeg"
      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
      ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
    else
      dnl  The given libavcodec wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
    fi
  fi
fi


Sam Hocevar's avatar
   
Sam Hocevar committed
836
dnl special case for BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
837
838
if test x$SYS = xbeos
then
Sam Hocevar's avatar
   
Sam Hocevar committed
839
    PLUGINS="${PLUGINS} beos"
Sam Hocevar's avatar
   
Sam Hocevar committed
840
fi
841

gbazin's avatar
   
gbazin committed
842
dnl
gbazin's avatar
   
gbazin committed
843
dnl  a52 AC3 decoder plugin
gbazin's avatar
   
gbazin committed
844
dnl
gbazin's avatar
   
gbazin committed
845
AC_ARG_ENABLE(a52,
Sam Hocevar's avatar
   
Sam Hocevar committed
846
  [  --enable-a52            AC3 support with liba52 (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
847
if test "x$enableval" != "xno" -a x$SYS != xmingw32
gbazin's avatar
   
gbazin committed
848
849
  then
    AC_CHECK_HEADERS(a52dec/a52.h, [
gbazin's avatar
   
gbazin committed
850
      BUILTINS="${BUILTINS} a52"
Sam Hocevar's avatar
   
Sam Hocevar committed
851
      a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
gbazin's avatar
   
gbazin committed
852
853
854
     ],[])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
855
856
857
858
dnl
dnl  ogg vorbis plugin
dnl
AC_ARG_ENABLE(vorbis,
Sam Hocevar's avatar
   
Sam Hocevar committed
859
  [  --enable-vorbis         Ogg/Vorbis decoder support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
860
861
862
if test "x$enableval" != "xno"
then
  AC_CHECK_HEADERS(ogg/ogg.h, [
863
864
    dnl disabled for the moment
    #PLUGINS="${PLUGINS} vorbis"
Sam Hocevar's avatar
   
Sam Hocevar committed
865
    vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
Sam Hocevar's avatar
   
Sam Hocevar committed
866
867
868
   ],[])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
869
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
870
dnl  Video plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
871
872
dnl

Sam Hocevar's avatar
   
Sam Hocevar committed
873
AC_ARG_WITH(,[Video plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
874

Sam Hocevar's avatar
   
Sam Hocevar committed
875
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
876
877
dnl  X11 module
dnl  (enabled by default except on win32)
Sam Hocevar's avatar
   
Sam Hocevar committed
878
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
879
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
880
  [  --enable-x11            X11 support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
881
882
883
884
885
886
887
888
if test x$enable_x11 != xno &&
  (test x$SYS != xmingw32 || test x$enable_x11 = xyes); then
  if test x$x_includes = xNONE; then
    x_includes=/usr/X11R6/include
  fi
  if test x$x_libraries = xNONE; then
    x_libraries=/usr/X11R6/lib
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
889
  CPPFLAGS="$save_CPPFLAGS -I$x_includes"
Sam Hocevar's avatar
   
Sam Hocevar committed
890
891
  AC_CHECK_HEADERS(X11/Xlib.h, [
    PLUGINS="${PLUGINS} x11"
Sam Hocevar's avatar
   
Sam Hocevar committed
892
893
    x11_LDFLAGS="${x11_LDFLAGS} -L$x_libraries -lX11 -lXext"
    x11_CFLAGS="${x11_CFLAGS} -I$x_includes"
Sam Hocevar's avatar
   
Sam Hocevar committed
894
  ])
Sam Hocevar's avatar
   
Sam Hocevar committed
895
  CPPFLAGS="$save_CPPFLAGS"
Sam Hocevar's avatar
   
Sam Hocevar committed
896
897
898
899
900
901
902
fi

dnl
dnl  XVideo module
dnl  (enabled by default except on win32)
dnl
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
   
Sam Hocevar committed
903
  [  --enable-xvideo         XVideo support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
904
905
906
907
908
909
910
911
if test x$enable_xvideo != xno &&
  (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); then
  if test x$x_includes = xNONE; then
    x_includes=/usr/X11R6/include
  fi
  if test x$x_libraries = xNONE; then
    x_libraries=/usr/X11R6/lib
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
912
913
  save_CPPFLAGS=$CPPFLAGS
  CPPFLAGS="$save_CPPFLAGS -I$x_includes"
Sam Hocevar's avatar
   
Sam Hocevar committed
914
  AC_CHECK_HEADERS(X11/extensions/Xv.h, [
Sam Hocevar's avatar
   
Sam Hocevar committed
915
    save_CFLAGS=$CFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
916
917
918
919
    CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
    AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
      # We have Xv_pic, that's good, we can build an xvideo.so plugin !
      PLUGINS="${PLUGINS} xvideo"
Sam Hocevar's avatar
   
Sam Hocevar committed
920
921
      xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv_pic"
      xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes",
Sam Hocevar's avatar
   
Sam Hocevar committed
922
923
      # We don't have Xv_pic, let's make xvideo.a as builtin
      BUILTINS="${BUILTINS} xvideo"
Sam Hocevar's avatar
   
Sam Hocevar committed
924
925
926
      xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv"
      xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes")
    CFLAGS="$save_CFLAGS"
Sam Hocevar's avatar
   
Sam Hocevar committed
927
  ]
Sam Hocevar's avatar
   
Sam Hocevar committed
928
  CPPFLAGS="$save_CPPFLAGS")
Sam Hocevar's avatar
   
Sam Hocevar committed
929
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
930
931
932
933

dnl
dnl  SDL module
dnl
934
AC_ARG_ENABLE(sdl,
Sam Hocevar's avatar
   
Sam Hocevar committed
935
  [  --enable-sdl            SDL support (default enabled)])
936
if test "x$enable_sdl" != "xno"
937
then
938
939
  SDL_PATH=$PATH
  AC_ARG_WITH(sdl-config-path,
Sam Hocevar's avatar
   
Sam Hocevar committed
940
    [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
941
942
943
944
945
    [ if test "x$withval" != "xno"
      then
        SDL_PATH=$withval:$PATH
      fi ])
  AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
946
947
  SDL_CONFIG=${SDL12_CONFIG}
  SDL_HEADER="SDL12/SDL.h"
Sam Hocevar's avatar
   
Sam Hocevar committed
948
949
  if test x${SDL_CONFIG} = xno
  then
950
    AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
Sam Hocevar's avatar
   
Sam Hocevar committed
951
    SDL_CONFIG=${SDL11_CONFIG}
952
953
    SDL_HEADER="SDL11/SDL.h"
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
954
955
  if test x${SDL_CONFIG} = xno
  then
956
    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
957
    SDL_HEADER="SDL/SDL.h"
958
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
959
960
  if test x${SDL_CONFIG} != xno
  then
961
    PLUGINS="${PLUGINS} sdl"
Sam Hocevar's avatar
   
Sam Hocevar committed
962
963
964
    sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
    sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
    CPPFLAGS="$save_CPPFLAGS $sdl_CFLAGS"
965
966
    AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
      <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
967
968
969
970
      [ AC_MSG_ERROR([The development package for SDL is not installed. 
Please install it and try again. Alternatively you can also configure with 
--disable-sdl.])
      ])
Sam Hocevar's avatar
   
Sam Hocevar committed
971
    CPPFLAGS="$save_CPPFLAGS"
Sam Hocevar's avatar
   
Sam Hocevar committed
972
    if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
Sam Hocevar's avatar
   
Sam Hocevar committed
973
    then
974
975
976
      AC_MSG_ERROR([The development package for SDL is not installed.
Please install it and try again. Alternatively you can also configure with
--disable-sdl.])
Sam Hocevar's avatar
   
Sam Hocevar committed
977
    fi
978
  elif test "x$enable_sdl" =  "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
979
  then
980
981
982
    AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
    ])
983
984
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
985

Sam Hocevar's avatar
   
Sam Hocevar committed
986
987
988
dnl
dnl  Windows DirectX module
dnl
989
AC_ARG_ENABLE(directx,
Sam Hocevar's avatar
   
Sam Hocevar committed
990
  [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
991
992
if test "x$enableval" != "xno"
then
Sam Hocevar's avatar
   
Sam Hocevar committed
993
  if test x$SYS = xmingw32
994
  then
Xavier Marchesini's avatar
   
Xavier Marchesini committed
995
    AC_ARG_WITH(directx, 
Sam Hocevar's avatar
   
Sam Hocevar committed
996
997
    [    --with-directx=PATH   Win32 DirectX headers and libraries])
    if test "x$with_directx" = "x"
Sam Hocevar's avatar
   
Sam Hocevar committed
998
    then
gbazin's avatar
   
gbazin committed
999
      AC_CHECK_HEADERS(ddraw.h,
1000
      [ PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
1001
        directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1002
1003
    else
      AC_MSG_CHECKING(for directX headers in ${withval})
gbazin's avatar
   
gbazin committed
1004
      if test -f ${withval}/ddraw.h
gbazin's avatar
   
gbazin committed
1005
      then
1006
        PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
1007
1008
        directx_LDFLAGS="${directx_LDFLAGS} -L${withval}/lib -lgdi32"
        directx_CFLAGS="${directx_CFLAGS} -I${withval}"
1009
        AC_MSG_RESULT(yes)
gbazin's avatar
   
gbazin committed
1010
      else
1011
        AC_MSG_RESULT(no)
gbazin's avatar
   
gbazin committed
1012
        AC_MSG_ERROR([Cannot find ${withval}/ddraw.h!])
gbazin's avatar
   
gbazin committed
1013
      fi
1014
1015
1016
    fi
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1017

gbazin's avatar
   
gbazin committed
1018
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1019
dnl  Linux framebuffer module
gbazin's avatar
   
gbazin committed
1020
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1021
1022
1023
1024
1025
1026
1027
1028
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
    if test x$enable_fb != xno
    then
      AC_CHECK_HEADERS(linux/fb.h, [
        PLUGINS="${PLUGINS} fb"
      ])
    fi
gbazin's avatar
   
gbazin committed
1029

Sam Hocevar's avatar
   
Sam Hocevar committed
1030
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1031
dnl  Linux MGA module
Sam Hocevar's avatar
   
Sam Hocevar committed
1032
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1033
1034
1035
AC_ARG_ENABLE(mga,
  [  --enable-mga            Linux kernel Matrox support (default disabled)],
  [ if test x$enable_mga = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
1036
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
1037
      PLUGINS="${PLUGINS} mga xmga"
Sam Hocevar's avatar
   
Sam Hocevar committed
1038
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
1039

Sam Hocevar's avatar
   
Sam Hocevar committed
1040
1041
1042
1043
1044
dnl
dnl  GGI module
dnl
AC_ARG_ENABLE(ggi,
  [  --enable-ggi            GGI support (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
1045
if test x$enable_ggi = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
1046
1047
then
  PLUGINS="${PLUGINS} ggi"
Sam Hocevar's avatar
   
Sam Hocevar committed
1048
  ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
Sam Hocevar's avatar
   
Sam Hocevar committed
1049
1050
1051
1052
1053
  AC_ARG_WITH(ggi,
    [    --with-ggi=PATH       path to libggi],
    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
      then
        CFLAGS_GGI="${CFLAGS_GGI} -I$with_val/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
1054
        ggi_LDFLAGS="${ggi_LDFLAGS} -L$with_val/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
1055
1056
1057
      fi ])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
1058
1059
1060
dnl
dnl  Glide module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1061
1062
AC_ARG_ENABLE(glide,
  [  --enable-glide          Glide (3dfx) support (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
1063
if test x$enable_glide = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
1064
1065
then
  PLUGINS="${PLUGINS} glide"
Sam Hocevar's avatar
   
Sam Hocevar committed
1066
1067
  glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
  glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
Sam Hocevar's avatar
   
Sam Hocevar committed
1068
1069
1070
  AC_ARG_WITH(glide,
    [    --with-glide=PATH     path to libglide],
    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
Sam Hocevar's avatar
   
Sam Hocevar committed
1071
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
1072
1073
        glide_CFLAGS="${glide_CFLAGS} -I$with_val/include"
        glide_LDFLAGS="${glide_LDFLAGS} -L$with_val/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
1074
1075
      fi ])
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1076

Sam Hocevar's avatar
   
Sam Hocevar committed
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
dnl
dnl  AA plugin
dnl
AC_ARG_ENABLE(aa,
  [  --enable-aa             aalib output (default disabled)])
if test x$enable_aa = xyes
then
  AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
  if test x$have_aa = xtrue
  then
    PLUGINS="${PLUGINS} aa"
Sam Hocevar's avatar
   
Sam Hocevar committed
1088
    aa_LDFLAGS="${aa_LDFLAGS} -laa"
Sam Hocevar's avatar
   
Sam Hocevar committed
1089
1090
1091
  fi
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
1092
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1093
dnl  Audio plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
1094
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108

AC_ARG_WITH(,[Audio plugins:])

dnl
dnl  OSS /dev/dsp module (enabled by default except on win32)
dnl
AC_ARG_ENABLE(dsp,
  [  --enable-dsp            Linux /dev/dsp support (enabled on Linux)])

if test x$enable_dsp != xno &&
  (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
then
  AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
    PLUGINS="${PLUGINS} dsp"
Sam Hocevar's avatar
   
Sam Hocevar committed
1109
    AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
Sam Hocevar's avatar
   
Sam Hocevar committed
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
  ])
fi

dnl
dnl  Esound module
dnl
AC_ARG_ENABLE(esd,
  [  --enable-esd            Esound library support (default disabled)],
  [if test x$enable_esd = xyes
   then
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
     if test x${ESD_CONFIG} != xno
     then
       PLUGINS="${PLUGINS} esd"
Sam Hocevar's avatar
   
Sam Hocevar committed
1124
1125
       esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
       esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
Sam Hocevar's avatar
   
Sam Hocevar committed
1126
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1127
1128
1129
   fi])

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1130
dnl  aRts module
Sam Hocevar's avatar
   
Sam Hocevar committed
1131
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1132
1133
1134
1135
1136
1137
AC_ARG_ENABLE(arts,
  [  --enable-arts           aRts sound server (default disabled)],
  [if test x$enable_arts = xyes
   then
     AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
     if test x${ARTS_CONFIG} != xno
Sam Hocevar's avatar
   
Sam Hocevar committed
1138
     then
Sam Hocevar's avatar
   
Sam Hocevar committed
1139
       PLUGINS="${PLUGINS} arts"
Sam Hocevar's avatar
   
Sam Hocevar committed
1140
1141
       arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
       arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
Sam Hocevar's avatar
   
Sam Hocevar committed
1142
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1143
1144
1145
   fi])

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1146
1147
1148
1149
1150
1151
1152
1153
dnl  ALSA module
dnl
AC_ARG_ENABLE(alsa,
  [  --enable-alsa           ALSA sound support for Linux (default disabled)],
  [if test x$enable_alsa = xyes
   then
     AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
     if test x$have_alsa = xtrue