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

5
AC_CANONICAL_SYSTEM
6

Sam Hocevar's avatar
   
Sam Hocevar committed
7
8
9
HAVE_VLC=0
if test -r src/interface/main.c; then
  HAVE_VLC=1
10
  VLC_VERSION="0.2.92-dev"
Sam Hocevar's avatar
   
Sam Hocevar committed
11
12
13
14
15
16
  VLC_CODENAME=Ourumov
fi

HAVE_LIBDVDCSS=0
if test -r extras/libdvdcss/libdvdcss.c; then
  HAVE_LIBDVDCSS=1
17
  LIBDVDCSS_VERSION="1.0.1-dev"
Sam Hocevar's avatar
   
Sam Hocevar committed
18
  AC_SUBST(LIBDVDCSS_VERSION)
19
20
21
  if test -r extras/libdvdcss/csskeys.h; then
    AC_DEFINE(HAVE_CSSKEYS,1,css decryption with player keys)
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
22
fi
23

Sam Hocevar's avatar
   
Sam Hocevar committed
24
dnl Save CFLAGS and LDFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
25
save_CFLAGS="${CFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
26
save_LDFLAGS="${LDFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
27

28
29
dnl Check for tools
AC_PROG_MAKE_SET
Sam Hocevar's avatar
   
Sam Hocevar committed
30
31
AC_PROG_CC
AC_PROG_CPP
32

gbazin's avatar
   
gbazin committed
33
34
35
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)

Christophe Massiot's avatar
Christophe Massiot committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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
53
dnl Gettext stuff
54
ALL_LINGUAS="de fr no ru nl"
Sam Hocevar's avatar
Sam Hocevar committed
55

Sam Hocevar's avatar
   
Sam Hocevar committed
56
57
AC_DEFINE_UNQUOTED(PACKAGE, "vlc")
AC_DEFINE_UNQUOTED(VERSION, "$VLC_VERSION")
Sam Hocevar's avatar
   
Sam Hocevar committed
58
59
AM_GNU_GETTEXT

60
61
62
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

gbazin's avatar
   
gbazin committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
dnl
dnl  Check the operating system
dnl
case x"${target_os}" in
  x)
    SYS=unknown
    ;;
  xlinux*)
    SYS=linux
    ;;
  xbsdi*)
    SYS=bsdi
    ;;
  xdarwin*)
    SYS=darwin
    ;;
  x*mingw32*)
    SYS=mingw32
    AC_CHECK_TOOL(WINDRES, windres, :)
Sam Hocevar's avatar
   
Sam Hocevar committed
82
    LIB_IPV4="${LIB_IPV4} -lws2_32"
gbazin's avatar
   
gbazin committed
83
84
85
86
87
88
89
90
91
    LIB_RC="${LIB_RC} -lws2_32"
    ;;
  x*nto*)
    SYS=nto
    LIB_X11="${LIB_X11} -lsocket"
    LIB_XVIDEO="${LIB_XVIDEO} -lsocket"
    ;;
  xbeos)
    SYS=beos
Sam Hocevar's avatar
   
Sam Hocevar committed
92
    LIB_VLC="${LIB_VLC} -lbe"
gbazin's avatar
   
gbazin committed
93
    LIB_BEOS="${LIB_BEOS} -lbe -lgame -lroot -ltracker"
Sam Hocevar's avatar
   
Sam Hocevar committed
94
    LIB_IPV4="${LIB_IPV4} -lbind"
gbazin's avatar
   
gbazin committed
95
96
97
98
99
100
101
    PLDFLAGS="${PLDFLAGS} -nostart"
    ;;
  x*)
    SYS=${target_os}
    ;;
esac

102
dnl Check for system libs needed
Sam Hocevar's avatar
   
Sam Hocevar committed
103
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty)
Sam Hocevar's avatar
   
Sam Hocevar committed
104
AC_CHECK_FUNC(connect,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
105
106
107
108
  AC_CHECK_LIB(socket,connect,
    LIB_IPV4="${LIB_IPV4} -lsocket"
    LIB_VLC="${LIB_VLC} -lsocket"
)])
Sam Hocevar's avatar
   
Sam Hocevar committed
109
AC_CHECK_FUNC(gethostbyname,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
110
111
112
113
  AC_CHECK_LIB(nsl,gethostbyname,LIB_IPV4="${LIB_IPV4} -lnsl")
])
AC_CHECK_FUNC(gethostbyname,,[
  AC_CHECK_LIB(bind,gethostbyname,LIB_IPV4="${LIB_IPV4} -lbind")
Sam Hocevar's avatar
   
Sam Hocevar committed
114
115
])
AC_CHECK_FUNC(nanosleep,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
116
117
  AC_CHECK_LIB(rt,nanosleep,LIB_VLC="${LIB_VLC} -lrt",[
    AC_CHECK_LIB(posix4,nanosleep,LIB_VLC="${LIB_VLC} -lposix4")
Sam Hocevar's avatar
   
Sam Hocevar committed
118
119
  ])
])
120
AC_CHECK_FUNCS(usleep)
Sam Hocevar's avatar
   
Sam Hocevar committed
121
AC_CHECK_FUNC(inet_aton,,[
122
123
124
125
  AC_CHECK_LIB(resolv,inet_aton,LIB_VLC="${LIB_IPV4} -lresolv")
])
AC_CHECK_FUNC(textdomain,,[
  AC_CHECK_LIB(intl,textdomain,LIB_VLC="${LIB_VLC} -lintl")
Sam Hocevar's avatar
   
Sam Hocevar committed
126
])
Sam Hocevar's avatar
   
Sam Hocevar committed
127
AC_CHECK_FUNCS(vasprintf)
Sam Hocevar's avatar
   
Sam Hocevar committed
128
AC_CHECK_FUNCS(swab)
129
AC_CHECK_FUNCS([memalign valloc])
Sam Hocevar's avatar
   
Sam Hocevar committed
130

Sam Hocevar's avatar
   
Sam Hocevar committed
131
AC_CHECK_FUNCS(sigrelse)
gbazin's avatar
   
gbazin committed
132
AC_CHECK_FUNCS(getpwuid)
Sam Hocevar's avatar
   
Sam Hocevar committed
133

Sam Hocevar's avatar
   
Sam Hocevar committed
134
dnl Check for getopt
Sam Hocevar's avatar
   
Sam Hocevar committed
135
NEED_GETOPT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
136
137
138
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
139
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB_VLC="${LIB_VLC} -lgnugetopt"],
Sam Hocevar's avatar
   
Sam Hocevar committed
140
    [NEED_GETOPT=1])])
Sam Hocevar's avatar
   
Sam Hocevar committed
141

142
AC_TYPE_SIGNAL
Sam Hocevar's avatar
   
Sam Hocevar committed
143
AC_CHECK_LIB(dl,dlopen,LIB_VLC="${LIB_VLC} -ldl")
Sam Hocevar's avatar
   
Sam Hocevar committed
144
145
146
AC_CHECK_LIB(m,cos,
  LIB_IMDCT="${LIB_IMDCT} -lm"
  LIB_FILTER_DISTORT="${LIB_FILTER_DISTORT} -lm")
Sam Hocevar's avatar
   
Sam Hocevar committed
147
148
149
150
AC_CHECK_LIB(m,pow,
  LIB_IMDCT="${LIB_IMDCT} -lm"
  LIB_IMDCT3DN="${LIB_IMDCT3DN} -lm"
  LIB_IMDCTSSE="${LIB_IMDCTSSE} -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
151
  LIB_CHROMA_I420_RGB="${LIB_CHROMA_I420_RGB} -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
152
)
Sam Hocevar's avatar
   
Sam Hocevar committed
153

Sam Hocevar's avatar
   
Sam Hocevar committed
154
dnl Check for pthreads - borrowed from XMMS
Sam Hocevar's avatar
   
Sam Hocevar committed
155
156
157
158
159
160
161
162
163
164
165
166
167
168
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
169
170
171

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

Sam Hocevar's avatar
   
Sam Hocevar committed
173
174
175
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
176
            Define if <pthread.h> defines pthread_cond_t.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
177
178
AC_EGREP_HEADER(strncasecmp,strings.h,[
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Sam Hocevar's avatar
   
Sam Hocevar committed
179
            Define if <strings.h> defines strncasecmp.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
180

Sam Hocevar's avatar
   
Sam Hocevar committed
181
dnl Check for headers
Sam Hocevar's avatar
   
Sam Hocevar committed
182
AC_CHECK_HEADERS(getopt.h strings.h)
183
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
184
185
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
186
AC_CHECK_HEADERS(machine/param.h sys/shm.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
187

Sam Hocevar's avatar
   
Sam Hocevar committed
188
189
AC_HEADER_TIME

Sam Hocevar's avatar
   
Sam Hocevar committed
190
191
192
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
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
  saved_CPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS -I$x_includes"
  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.)
    ])
  ])
  CPPFLAGS=$saved_CPPFLAGS
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
213
dnl Check for ntohl, etc.
214
215
216
217
218
219
220
221
222
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
223

Sam Hocevar's avatar
   
Sam Hocevar committed
224
dnl Check for inline function size limit
225
226
227
228
229
230
231
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
232

Sam Hocevar's avatar
   
Sam Hocevar committed
233
234
235
236
237
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
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
311
dnl Check for Darwin plugin linking flags
Christophe Massiot's avatar
Christophe Massiot committed
312
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
313
    [ac_cv_ld_darwin],
Christophe Massiot's avatar
Christophe Massiot committed
314
    [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
315
316
     AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test x"$ac_cv_ld_darwin" != x"no"; then
Christophe Massiot's avatar
Christophe Massiot committed
317
    PLDFLAGS="${PLDFLAGS} -bundle -undefined error -lcc_dynamic"
318
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
319
320

dnl Check for standard plugin linking flags
321
322
323
324
325
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
326
    PLDFLAGS="${PLDFLAGS} -shared"
Sam Hocevar's avatar
   
Sam Hocevar committed
327
fi
328
329
        
dnl Check for soname setting
Sam Hocevar's avatar
   
Sam Hocevar committed
330
if test x"${SOFLAGS}" = x; then
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
    AC_CACHE_CHECK([for soname setting],
        [ac_cv_ld_soname],
        [
        # Standard
        try_SOFLAGS="-Wl,-soname -Wl,"
        LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
        AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}", [
            # SunOS
            try_SOFLAGS="-Wl,-h -Wl,"
            LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
            AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}",
                ac_cv_ld_soname=none)
        ])])
    if test x"$ac_cv_ld_soname" != x"none"; then
        SOFLAGS=$ac_cv_ld_soname
    else
        echo "
------------
Your system doesn't seem to have support for dynamic linking. You may
have problems using libdvdcss.
------------
"
353
    fi
Sam Hocevar's avatar
   
Sam Hocevar committed
354
355
fi

356
357
358
359
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
360
        CFLAGS="${save_CFLAGS} -Werror"
361
362
363
364
365
366
367
368
369
370
    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
371
dnl End of the bizarre compilation tests
Sam Hocevar's avatar
   
Sam Hocevar committed
372
CFLAGS="${save_CFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
373
LDFLAGS="${save_LDFLAGS}"
Christophe Massiot's avatar
Christophe Massiot committed
374

375
dnl Check for boolean_t
376
377
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
378
    [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
379
380
381
382
383
384
385
     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
386
    [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
387
388
389
390
391
392
393
     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
394
    [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
395
396
397
398
     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
399

Sam Hocevar's avatar
   
Sam Hocevar committed
400
401
402
403
404
405
406
407
408
409
410
dnl
dnl  Check the CPU
dnl
case x"${target_cpu}" in
  x)
    ARCH=unknown
    ;;
  *)
    ARCH=${target_cpu}
    ;;
esac
Sam Hocevar's avatar
   
Sam Hocevar committed
411
412
413
414

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
415
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
416
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
417
418
419
420

dnl
dnl  Accelerated modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
421
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
422
423
MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
Sam Hocevar's avatar
   
Sam Hocevar committed
424
SSE_MODULES="imdctsse downmixsse"
Christophe Massiot's avatar
Christophe Massiot committed
425
ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
426

427
428
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
    [ac_cv_mmx_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
429
    [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
430
                    ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
431
if test x"$ac_cv_mmx_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
432
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
433
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
434

435
436
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
    [ac_cv_mmxext_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
437
    [AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
438
                    ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
439
if test x"$ac_cv_mmxext_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
440
  ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
441
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
442

443
444
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
    [ac_cv_3dnow_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
445
    [AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
446
                    ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
447
if test x"$ac_cv_3dnow_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
448
  AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
Sam Hocevar's avatar
   
Sam Hocevar committed
449
  ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
450
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
451

452
453
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
    [ac_cv_sse_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
454
    [AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
455
                    ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
456
if test x"$ac_cv_sse_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
457
  AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
Sam Hocevar's avatar
   
Sam Hocevar committed
458
  ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
459
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
460

gbazin's avatar
   
gbazin committed
461
462
463
# 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
464
465
AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
    [ac_cv_altivec_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
466
    [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
467
468
469
         ac_cv_altivec_inline=yes,
         [save_CFLAGS=$CFLAGS
          CFLAGS="$CFLAGS -Wa,-m7400"
Sam Hocevar's avatar
   
Sam Hocevar committed
470
          AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
471
            [ac_cv_altivec_inline="-Wa,-m7400"],
472
            ac_cv_altivec_inline=no)
473
474
          CFLAGS=$save_CFLAGS
         ])])
475
if test x"$ac_cv_altivec_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
476
  AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
477
  if test x"$ac_cv_altivec_inline" != x"yes"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
478
479
    CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_altivec_inline"
    CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_altivec_inline"
Sam Hocevar's avatar
   
Sam Hocevar committed
480
    CFLAGS_VLC="$CFLAGS_VLC $ac_cv_altivec_inline"
481
  fi
482
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
483
fi
484

485
486
AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
    [ac_cv_c_altivec],
487
488
489
    [save_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -faltivec"
     # Darwin test
Sam Hocevar's avatar
   
Sam Hocevar committed
490
     AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
491
492
        ac_cv_c_altivec=-faltivec, [
        # Linux/PPC test
Sam Hocevar's avatar
   
Sam Hocevar committed
493
        CFLAGS="$save_CFLAGS $CFLAGS_IDCTALTIVEC -fvec"
Sam Hocevar's avatar
   
Sam Hocevar committed
494
        AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
495
496
497
498
            [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
        ])
     CFLAGS=$save_CFLAGS
    ])
499
if test x"$ac_cv_c_altivec" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
500
  AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
Sam Hocevar's avatar
   
Sam Hocevar committed
501
502
  CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_c_altivec"
  CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_c_altivec"
Sam Hocevar's avatar
   
Sam Hocevar committed
503
  CFLAGS_VLC="$CFLAGS_VLC $ac_cv_c_altivec"
504
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
505
506
507
508
509
510
511
512
513
514
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
515
516
  LIB_IDCTALTIVEC="${LIB_IDCTALTIVEC} -framework vecLib"
  LIB_MOTIONALTIVEC="${LIB_MOTIONALTIVEC} -framework vecLib"
Sam Hocevar's avatar
   
Sam Hocevar committed
517
  LIB_VLC="${LIB_VLC} -framework vecLib"
518
fi
gbazin's avatar
   
gbazin committed
519
fi # end if mingw32
520
521

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
522
dnl  DVD and VCD devices
523
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
524
525
case x$SYS in
  xmingw32)
Sam Hocevar's avatar
   
Sam Hocevar committed
526
527
528
529
530
531
532
533
534
535
536
537
    DVD_DEVICE="E:"
    VCD_DEVICE="E:"
    ;;
  *)
    DVD_DEVICE="/dev/dvd"
    VCD_DEVICE="/dev/cdrom"
    ;;
esac

AC_DEFINE_UNQUOTED(DVD_DEVICE, "$DVD_DEVICE")
AC_DEFINE_UNQUOTED(VCD_DEVICE, "$VCD_DEVICE")

538

Sam Hocevar's avatar
   
Sam Hocevar committed
539
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
540
dnl  libdvdcss: check for DVD ioctls
Sam Hocevar's avatar
   
Sam Hocevar committed
541
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
542

Sam Hocevar's avatar
   
Sam Hocevar committed
543
544
545
dnl  default is no
CAN_BUILD_LIBDVDCSS=0

Sam Hocevar's avatar
   
Sam Hocevar committed
546
547
dnl  for windoze
AC_CHECK_HEADERS(winioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
548
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
549
550
])

Sam Hocevar's avatar
   
Sam Hocevar committed
551
dnl  for Un*x and BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
552
AC_CHECK_HEADERS(sys/ioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
553
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
554
  AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
555
  BSD_DVD_STRUCT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
556
  LINUX_DVD_STRUCT=0
557
  OPENBSD_DVD_STRUCT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
558
559
560
  dnl
  dnl Old FreeBSD: sys/cdio.h
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
561
562
563
564
  AC_EGREP_HEADER(dvd_struct,sys/cdio.h,[
    AC_DEFINE(DVD_STRUCT_IN_SYS_CDIO_H, 1,
              Define if <sys/cdio.h> defines dvd_struct.)
    AC_EGREP_HEADER(struct dvd_struct,sys/cdio.h,[
565
                    BSD_DVD_STRUCT=1],[LINUX_DVD_STRUCT=1; OPENBSD_DVD_STRUCT=1])
Sam Hocevar's avatar
   
Sam Hocevar committed
566
567
568
569
  ])
  dnl
  dnl Newer FreeBSD: sys/dvdio.h
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
570
571
572
573
574
  AC_EGREP_HEADER(dvd_struct,sys/dvdio.h,[
    AC_DEFINE(DVD_STRUCT_IN_SYS_DVDIO_H, 1,
              Define if <sys/dvdio.h> defines dvd_struct.)
    AC_EGREP_HEADER(struct dvd_struct,sys/dvdio.h,[
                    BSD_DVD_STRUCT=1],[LINUX_DVD_STRUCT=1])
Sam Hocevar's avatar
   
Sam Hocevar committed
575
576
577
578
579
580
581
  ])
  dnl
  dnl Linux: linux/cdrom.h
  dnl
  AC_EGREP_HEADER(dvd_struct,linux/cdrom.h,[
    AC_DEFINE(DVD_STRUCT_IN_LINUX_CDROM_H, 1,
              Define if <linux/cdrom.h> defines DVD_STRUCT.)
Sam Hocevar's avatar
   
Sam Hocevar committed
582
583
584
585
586
    LINUX_DVD_STRUCT=1
  ])
  dnl
  dnl BSDI: dvd.h
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
587
  NEED_BSDI_LIBDVD=0
Sam Hocevar's avatar
   
Sam Hocevar committed
588
589
590
  AC_EGREP_HEADER(dvd_struct,dvd.h,[
    AC_DEFINE(DVD_STRUCT_IN_DVD_H, 1,
              Define if <dvd.h> defines DVD_STRUCT.)
Sam Hocevar's avatar
   
Sam Hocevar committed
591
    LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
592
    LINUX_DVD_STRUCT=1
Sam Hocevar's avatar
   
Sam Hocevar committed
593
594
595
596
597
598
  ],[
    dnl
    dnl BSDI: /sys/dev/scsi/scsi_ioctl.h, using our own libdvd
    dnl
    AC_CHECK_HEADERS(/sys/dev/scsi/scsi_ioctl.h,[
      NEED_BSDI_LIBDVD=1
Sam Hocevar's avatar
   
Sam Hocevar committed
599
600
      AC_DEFINE(DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H, 1,
                Define if <extras/BSDI_dvdioctl/dvd.h> defines DVD_STRUCT.)
Sam Hocevar's avatar
   
Sam Hocevar committed
601
      SRC_DVDCSS_EXTRA="${SRC_DVDCSS_EXTRA} bsdi_dvdioctl.c"
Sam Hocevar's avatar
   
Sam Hocevar committed
602
603
      LINUX_DVD_STRUCT=1
    ])
Sam Hocevar's avatar
   
Sam Hocevar committed
604
  ])
Sam Hocevar's avatar
   
Sam Hocevar committed
605
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
606
  dnl Solaris: sys/scsi/scsi_types.h, sys/scsi/impl/uscsi.h
Sam Hocevar's avatar
   
Sam Hocevar committed
607
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
608
  AC_CHECK_HEADER(sys/scsi/scsi_types.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
609
610
611
612
613
    AC_CHECK_HEADER(sys/scsi/impl/uscsi.h,[
      AC_DEFINE(SOLARIS_USCSI, 1, Have userspace SCSI headers.)
    ])
  ])
  dnl
614
615
616
617
618
619
620
621
  dnl HP-UX: sys/scsi.h
  dnl
  AC_CHECK_HEADER(sys/scsi.h,[
    AC_EGREP_HEADER(sctl_io,sys/scsi.h,[
      AC_DEFINE(HPUX_SCTL_IO, 1, Define if <sys/scsi.h> defines sctl_io.)
    ])
  ])
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
622
623
624
625
626
  dnl Final tests to check what was detected
  dnl
  if test x$LINUX_DVD_STRUCT = x1; then
    AC_DEFINE(HAVE_LINUX_DVD_STRUCT, 1,
              Define if Linux-like dvd_struct is defined.)
627
628
629
630
    if test x$OPENBSD_DVD_STRUCT = x1; then
      AC_DEFINE(HAVE_OPENBSD_DVD_STRUCT, 1,
                Define if OpenBSD-like dvd_struct is defined.)
    fi
Sam Hocevar's avatar
   
Sam Hocevar committed
631
632
633
  else
    if test x$BSD_DVD_STRUCT = x1; then
      AC_DEFINE(HAVE_BSD_DVD_STRUCT, 1,
Sam Hocevar's avatar
   
Sam Hocevar committed
634
                Define if FreeBSD-like dvd_struct is defined.)
Sam Hocevar's avatar
   
Sam Hocevar committed
635
636
    fi
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
637
638
])

Sam Hocevar's avatar
   
Sam Hocevar committed
639
640
641
AC_ARG_WITH(,[])
AC_ARG_WITH(,[Optimization options:])

Sam Hocevar's avatar
   
Sam Hocevar committed
642
dnl
643
dnl  Special arch tuning
Sam Hocevar's avatar
   
Sam Hocevar committed
644
dnl
645
AC_ARG_WITH(tuning,
Sam Hocevar's avatar
   
Sam Hocevar committed
646
[  --with-tuning=ARCH      enable special tuning for an architecture
647
648
649
650
                          (default i686 on IA-32 and 750 on PPC)])
if test "x$withval" != "x"; then
    TUNING=$withval
else
651
    if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
652
    else
653
        if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
654
655
    fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
656
657

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
658
dnl  x86 accelerations
Sam Hocevar's avatar
   
Sam Hocevar committed
659
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
660
661
662
663
664
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
665

Sam Hocevar's avatar
   
Sam Hocevar committed
666
667
668
669
670
671
672
673
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
674
675
676
dnl
dnl  AltiVec acceleration
dnl
677
AC_ARG_ENABLE(altivec,
Sam Hocevar's avatar
   
Sam Hocevar committed
678
[  --disable-altivec       disable altivec optimizations (default enabled on PPC)],
679
680
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
681
[ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
682
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
683
684
685
686

dnl
dnl  Debugging mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
687
DEBUG=0
688
AC_ARG_ENABLE(debug,
Sam Hocevar's avatar
   
Sam Hocevar committed
689
[  --enable-debug          debug mode (default disabled)],
690
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
691

Sam Hocevar's avatar
   
Sam Hocevar committed
692
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
693
dnl  Enable release-specific flags
Sam Hocevar's avatar
   
Sam Hocevar committed
694
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
695
696
697
698
699
AC_ARG_ENABLE(release,
[  --enable-release        activate extra optimizations (default disabled)],
[ if test x$enableval = xyes; then RELEASE=1; fi ],
[ VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`";
  LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ])
Sam Hocevar's avatar
   
Sam Hocevar committed
700

Sam Hocevar's avatar
   
Sam Hocevar committed
701
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
702
dnl  Input plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
703
704
dnl

Sam Hocevar's avatar
   
Sam Hocevar committed
705
AC_ARG_WITH(,[Input plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
706
707

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
708
dnl  DVD module: check for installed libdvdcss or local libdvdcss
Sam Hocevar's avatar
   
Sam Hocevar committed
709
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
710
NEED_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
711
STATIC_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
712
DUMMY_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
713
AC_ARG_WITH(dvdcss,
Sam Hocevar's avatar
   
Sam Hocevar committed
714
715
716
  [  --with-dvdcss[=name]    use libdvdcss, either 'yes', 'no', 'local-static',
                          'local-shared', or a path to another libdvdcss such
                          as '/usr/local' (default 'local-static')],
Sam Hocevar's avatar
   
Sam Hocevar committed
717
718
719
  [ case "x${withval}" in
    xlocal-static|xyes)
      # local libdvdcss, statically linked
Stéphane Borel's avatar
   
Stéphane Borel committed
720
      BUILTINS="${BUILTINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
721
722
      if test x${CAN_BUILD_LIBDVDCSS} = x1
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
723
        NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
724
725
        STATIC_LIBDVDCSS=1
        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
726
        LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
727
728
729
730
      fi
    ;;
    xlocal-shared)
      # local libdvdcss, dynamically linked
Stéphane Borel's avatar
   
Stéphane Borel committed
731
      PLUGINS="${PLUGINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
732
733
      if test x${CAN_BUILD_LIBDVDCSS} = x1
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
734
        NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
735
        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
736
        LIB_DVD="${LIB_DVD} -L../../lib -ldvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
737
      fi
Sam Hocevar's avatar
   
Sam Hocevar committed
738
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
739
740
    xno)
      # don't use libdvdcss at all, build a DVD module that can dlopen() it
Sam Hocevar's avatar
   
Sam Hocevar committed
741
      PLUGINS="${PLUGINS} dvd"
742
      DUMMY_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
743
      SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
Sam Hocevar's avatar
   
Sam Hocevar committed
744
      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
Sam Hocevar's avatar
   
Sam Hocevar committed
745
      CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
Sam Hocevar's avatar
   
Sam Hocevar committed
746
747
      LIB_DVD="${LIB_DVD} -ldl"
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
748
    *)
Sam Hocevar's avatar
   
Sam Hocevar committed
749
      # existing libdvdcss
Stéphane Borel's avatar
   
Stéphane Borel committed
750
      PLUGINS="${PLUGINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
751
752
      if test "x$withval" != "xyes"
      then
753
        LIB_DVD="${LIB_DVD} -L"$withval"/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
754
755
756
        CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
      fi
      LIB_DVD="${LIB_DVD} -ldvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
757
    esac ],
Sam Hocevar's avatar
   
Sam Hocevar committed
758
  # user didn't decide, we choose to use local libdvdcss and link statically
Sam Hocevar's avatar
   
Sam Hocevar committed
759
  # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
Sam Hocevar's avatar
   
Sam Hocevar committed
760
761
  [ if test x${CAN_BUILD_LIBDVDCSS} = x1
    then
Stéphane Borel's avatar
   
Stéphane Borel committed
762
      BUILTINS="${BUILTINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
763
      NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
764
765
      STATIC_LIBDVDCSS=1
      CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
766
      LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
767
768
    else
      # XXX: no check for libdl is done, don't try this at home !
Sam Hocevar's avatar
   
Sam Hocevar committed
769
      PLUGINS="${PLUGINS} dvd"
770
      DUMMY_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
771
      SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
Sam Hocevar's avatar
   
Sam Hocevar committed
772
773
      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
      LIB_DVD="${LIB_DVD} -ldl"
Sam Hocevar's avatar
   
Sam Hocevar committed
774
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
775

Stéphane Borel's avatar
Stéphane Borel committed
776
777
778
dnl
dnl DVDREAD module: check for libdvdread plugin
dnl
779
780
781
if test x${DUMMY_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
if test x${STATIC_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
AC_ARG_WITH(dvdread,
Sam Hocevar's avatar
   
Sam Hocevar committed
782
  [  --with-dvdread[=name]   use libdvdread, same options as dvdcss (default 'no')],
783
784
785
786
787
788
789
790
  [ case "x${withval}" in
    xlocal-static|xyes)
      if test x${STATIC_LIBDVDREAD} = x1
      then
        BUILTINS="${BUILTINS} dvdread" 
        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
      else
791
        AC_MSG_ERROR([Can't link static dvdread with shared dvdcss])
792
793
794
795
796
797
798
      fi
    ;;
    xno)
    ;;
    x)
      if test x${STATIC_LIBDVDREAD} = x1
      then
Christophe Massiot's avatar
Christophe Massiot committed
799
        #BUILTINS="${BUILTINS} dvdread" 
800
801
802
        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
      else
Christophe Massiot's avatar
Christophe Massiot committed
803
        #PLUGINS="${PLUGINS} dvdread"
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread  ${CFLAGS_DVD}"
        LIB_DVDREAD="${LIB_DVDREAD} -Llib -ldvdread ${LIB_DVD}"
      fi 
    ;;
    *)
      if test "x$withval" != "xlocal-shared"
      then
        LIB_DVDREAD="${LIB_DVDREAD} -L"$withval"/lib"
        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I"$withval"/include"
      else
        LIB_DVDREAD="${LIB_DVDREAD} -L../../lib"
        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
      fi
      if test x${STATIC_LIBDVDCSS} = x1
      then
819
        AC_MSG_ERROR([Can't link shared dvdread with static dvdcss])
820
      else
Christophe Massiot's avatar
Christophe Massiot committed
821
        #PLUGINS="${PLUGINS} dvdread"
822
823
824
825
826
827
828
829
830
831
        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD}"
        LIB_DVDREAD="${LIB_DVDREAD} -ldvdread ${LIB_DVD}"
      fi
    esac
    if test x${DUMMY_LIBDVDCSS} = x1
    then
      LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -ldl"
    else
      LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -L../../lib -ldvdcss"
    fi ])
Stéphane Borel's avatar
Stéphane Borel committed
832

833
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
834
dnl  VCD module
835
836
dnl
AC_ARG_ENABLE(vcd,
Sam Hocevar's avatar
   
Sam Hocevar committed
837
  [  --enable-vcd            VCD support for Linux (default enabled)])
838

Sam Hocevar's avatar
   
Sam Hocevar committed
839
840
841
if test x$enable_vcd != xno
then
  AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
842
    PLUGINS="${PLUGINS} vcd"
Sam Hocevar's avatar
   
Sam Hocevar committed
843
  ])
844

Sam Hocevar's avatar
   
Sam Hocevar committed
845
846
847
848
  if test "x${SYS}" = "xbsdi"
  then
    PLUGINS="${PLUGINS} vcd"
  fi
849

Sam Hocevar's avatar
   
Sam Hocevar committed
850
851
852
  if test "x${SYS}" = "xdarwin"
  then
    PLUGINS="${PLUGINS} vcd"
Christophe Massiot's avatar
Christophe Massiot committed
853
    LIB_VCD="${LIB_VCD} -framework IOKit -framework CoreFoundation" 
Sam Hocevar's avatar
   
Sam Hocevar committed
854
  fi
Jon Lech Johansen's avatar
Jon Lech Johansen committed
855
856
fi

Johan Bilien's avatar
Johan Bilien committed
857
858
859
860
861
862
863
864
865
866
867
dnl
dnl  Satellite input module
dnl
AC_ARG_ENABLE(satellite,
  [  --enable-satellite       Satellite card support (default disabled)],
  [ if test x$enable_satellite = xyes
    then
      BUILTINS="${BUILTINS} satellite"
      AC_DEFINE(HAVE_SATELLITE, 1, define if compiling with satellite card support)
    fi])

868
869
870
dnl
dnl  ipv6 plugin
dnl
Christophe Massiot's avatar
Christophe Massiot committed
871
AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
872

Sam Hocevar's avatar
   
Sam Hocevar committed
873
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
874
dnl  Codec plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
875
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
876

Sam Hocevar's avatar
   
Sam Hocevar committed
877
AC_ARG_WITH(,[Codec plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
878

879
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
880
dnl  mad plugin
881
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
882
883
AC_ARG_ENABLE(mad,
  [  --enable-mad            libmad module (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
884
if test x$enable_mad = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
885
886
887
888
889
890
891
then
  PLUGINS="${PLUGINS} mad"
  LIB_MAD="${LIB_MAD} -lmad"
  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
892
        CFLAGS_MAD="${CFLAGS_MAD} -I$with_val/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
        LIB_MAD="${LIB_MAD} -L$with_val/lib"
      fi ])
  save_CFLAGS=$CFLAGS
  save_LDFLAGS=$LDFLAGS
  CFLAGS="$CFLAGS $CFLAGS_MAD"
  LDFLAGS="$LDFLAGS $LIB_MAD"
  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
910

Sam Hocevar's avatar
   
Sam Hocevar committed
911
dnl special case for BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
912
913
if test x$SYS = xbeos
then
Sam Hocevar's avatar
   
Sam Hocevar committed
914
    PLUGINS="${PLUGINS} beos"
915
916
917
918

dnl default case
else

gbazin's avatar
   
gbazin committed
919
dnl
gbazin's avatar
   
gbazin committed
920
dnl  a52 AC3 decoder plugin
gbazin's avatar
   
gbazin committed
921
dnl
gbazin's avatar
   
gbazin committed
922
923
AC_ARG_ENABLE(a52,
  [  --disable-a52           AC3 support with liba52 (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
924
if test "x$enableval" != "xno" -a x$SYS != xmingw32
gbazin's avatar
   
gbazin committed
925
926
  then
    AC_CHECK_HEADERS(a52dec/a52.h, [
gbazin's avatar
   
gbazin committed
927
      BUILTINS="${BUILTINS} a52"
Sam Hocevar's avatar
   
Sam Hocevar committed
928
      LIB_A52="${LIB_A52} -la52 -lm"
gbazin's avatar
   
gbazin committed
929
930
931
     ],[])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
932
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
933
dnl  Video plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
934
935
dnl

Sam Hocevar's avatar
   
Sam Hocevar committed
936
AC_ARG_WITH(,[Video plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
937

Sam Hocevar's avatar
   
Sam Hocevar committed
938
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
939
940
dnl  X11 module
dnl  (enabled by default except on win32)
Sam Hocevar's avatar
   
Sam Hocevar committed
941
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
AC_ARG_ENABLE(x11,
  [  --disable-x11           X11 support (default enabled)])
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
  saved_CPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS -I$x_includes"
  AC_CHECK_HEADERS(X11/Xlib.h, [
    PLUGINS="${PLUGINS} x11"
    LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext"
    CFLAGS_X11="${CFLAGS_X11} -I$x_includes"
  ])
  CPPFLAGS=$saved_CPPFLAGS
fi

dnl
dnl  XVideo module
dnl  (enabled by default except on win32)
dnl
AC_ARG_ENABLE(xvideo,
  [  --disable-xvideo        XVideo support (default enabled)])
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
  saved_CPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS -I$x_includes"
  AC_CHECK_HEADERS(X11/extensions/Xv.h, [
    saved_CFLAGS=$CFLAGS
    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"
      LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv_pic"
      CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes",
      # We don't have Xv_pic, let's make xvideo.a as builtin
      BUILTINS="${BUILTINS} xvideo"
      LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv"
      CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes")
    CFLAGS=$saved_CFLAGS
  ]
  CPPFLAGS=$saved_CPPFLAGS)
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
994
995
996
997

dnl
dnl  SDL module
dnl
998
999
AC_ARG_ENABLE(sdl,
  [  --disable-sdl           SDL support (default enabled)])
1000
if test "x$enable_sdl" != "xno"
1001
then
1002
1003
  SDL_PATH=$PATH
  AC_ARG_WITH(sdl-config-path,
Sam Hocevar's avatar
   
Sam Hocevar committed
1004
    [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1005
1006
1007
1008
1009
    [ if test "x$withval" != "xno"
      then
        SDL_PATH=$withval:$PATH
      fi ])
  AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
1010
1011
  SDL_CONFIG=${SDL12_CONFIG}
  SDL_HEADER="SDL12/SDL.h"
Sam Hocevar's avatar
   
Sam Hocevar committed
1012
1013
  if test x${SDL_CONFIG} = xno
  then
1014
    AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
Sam Hocevar's avatar
   
Sam Hocevar committed
1015
    SDL_CONFIG=${SDL11_CONFIG}
1016
1017
    SDL_HEADER="SDL11/SDL.h"
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1018
1019
  if test x${SDL_CONFIG} = xno
  then
1020
    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
1021
    SDL_HEADER="SDL/SDL.h"
1022
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1023
1024
  if test x${SDL_CONFIG} != xno
  then
1025
    PLUGINS="${PLUGINS} sdl"
Sam Hocevar's avatar
   
Sam Hocevar committed
1026
1027
    CFLAGS_SDL="${CFLAGS_SDL} `${SDL_CONFIG} --cflags`"
    LIB_SDL="${LIB_SDL} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
Sam Hocevar's avatar
   
Sam Hocevar committed
1028
1029
    save_CPPFLAGS=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS $CFLAGS_SDL"
1030
1031
    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),
1032
1033
1034
1035
      [ 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
1036
    CPPFLAGS=$save_CPPFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
1037
    if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
Sam Hocevar's avatar
   
Sam Hocevar committed
1038
    then
1039
1040
1041
      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
1042
    fi
1043
  elif test "x$enable_sdl" =  "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
1044
  then
1045
1046
1047
    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.
    ])
1048
1049
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1050

Sam Hocevar's avatar
   
Sam Hocevar committed
1051
1052
1053
dnl
dnl  Windows DirectX module
dnl
1054
AC_ARG_ENABLE(directx,
Sam Hocevar's avatar
   
Sam Hocevar committed
1055
  [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
1056
1057
if test "x$enableval" != "xno"
then
Sam Hocevar's avatar
   
Sam Hocevar committed
1058
  if test x$SYS = xmingw32
1059
  then
Xavier Marchesini's avatar
   
Xavier Marchesini committed
1060
    AC_ARG_WITH(directx, 
Sam Hocevar's avatar
   
Sam Hocevar committed
1061
1062
    [    --with-directx=PATH   Win32 DirectX headers and libraries])
    if test "x$with_directx" = "x"
Sam Hocevar's avatar
   
Sam Hocevar committed
1063
    then
gbazin's avatar
   
gbazin committed
1064
      AC_CHECK_HEADERS(ddraw.h,
1065
      [ PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
1066
        LIB_DIRECTX="${LIB_DIRECTX} -lgdi32" ])
1067
1068
    else
      AC_MSG_CHECKING(for directX headers in ${withval})
gbazin's avatar
   
gbazin committed
1069
      if test -f ${withval}/ddraw.h
gbazin's avatar
   
gbazin committed
1070
      then
1071
        PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
1072
        LIB_DIRECTX="${LIB_DIRECTX} -L${withval}/lib -lgdi32"
gbazin's avatar
   
gbazin committed
1073
        INCLUDE="${INCLUDE} -I${withval}"
1074
        AC_MSG_RESULT(yes)
gbazin's avatar
   
gbazin committed
1075
      else
1076
        AC_MSG_RESULT(no)
gbazin's avatar
   
gbazin committed
1077
        AC_MSG_ERROR([Cannot find ${withval}/ddraw.h!])
gbazin's avatar
   
gbazin committed
1078
      fi
1079
1080
1081
    fi
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1082

gbazin's avatar
   
gbazin committed
1083
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1084
dnl  Linux framebuffer module
gbazin's avatar
   
gbazin committed
1085
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1086
1087
1088
1089
1090
1091
1092
1093
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
1094

Sam Hocevar's avatar
   
Sam Hocevar committed
1095
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1096
dnl  Linux MGA module
Sam Hocevar's avatar
   
Sam Hocevar committed
1097
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1098
1099
1100
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
1101
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
1102
      PLUGINS="${PLUGINS} mga xmga"
Sam Hocevar's avatar
   
Sam Hocevar committed
1103
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
1104

Sam Hocevar's avatar
   
Sam Hocevar committed
1105
1106
1107
1108
1109
dnl
dnl  GGI module
dnl
AC_ARG_ENABLE(ggi,
  [  --enable-ggi            GGI support (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
1110
if test x$enable_ggi = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
then
  PLUGINS="${PLUGINS} ggi"
  LIB_GGI="${LIB_GGI} -lggi"
  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"
        LIB_GGI="${LIB_GGI} -L$with_val/lib"
      fi ])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
1123
1124
1125
dnl
dnl  Glide module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1126
1127
AC_ARG_ENABLE(glide,
  [  --enable-glide          Glide (3dfx) support (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
1128
if test x$enable_glide = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
1129
1130
1131
1132
1133
1134
1135
then
  PLUGINS="${PLUGINS} glide"
  LIB_GLIDE="${LIB_GLIDE} -lglide2x -lm"
  CFLAGS_GLIDE="${CFLAGS_GLIDE} -I/usr/include/glide"
  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
1136
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
1137
1138
1139
1140
        CFLAGS_GLIDE="${CFLAGS_GLIDE} -I$with_val/include"
        LIB_GLIDE="${LIB_GLIDE} -L$with_val/lib"
      fi ])
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1141

Sam Hocevar's avatar
   
Sam Hocevar committed
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
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"
    LIB_AA="${LIB_AA} -laa"
  fi
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
1157
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1158
dnl  Audio plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
1159
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183