configure.in 27.6 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/common.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
Sam Hocevar's avatar
   
Sam Hocevar committed
10
  VLC_VERSION=0.2.83
Sam Hocevar's avatar
   
Sam Hocevar committed
11
12
13
14
15
16
17
18
  AC_SUBST(VLC_VERSION)
  VLC_CODENAME=Ourumov
  AC_SUBST(VLC_CODENAME)
fi

HAVE_LIBDVDCSS=0
if test -r extras/libdvdcss/libdvdcss.c; then
  HAVE_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
19
  LIBDVDCSS_VERSION=0.0.3
Sam Hocevar's avatar
   
Sam Hocevar committed
20
21
  AC_SUBST(LIBDVDCSS_VERSION)
fi
22

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

27
28
dnl Check for tools
AC_PROG_MAKE_SET
Sam Hocevar's avatar
   
Sam Hocevar committed
29
30
AC_PROG_CC
AC_PROG_CPP
Sam Hocevar's avatar
   
Sam Hocevar committed
31
AC_PROG_RANLIB
32
33
34
35

dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

36
37
dnl Check for endianness
AC_C_BIGENDIAN
38
39
40
41

dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
AC_CHECK_FUNCS(setenv putenv)
Sam Hocevar's avatar
   
Sam Hocevar committed
42
43
44
45
46
47
48
49
50
51
52
AC_CHECK_FUNC(connect,,[
  AC_CHECK_LIB(socket,connect,LIB="${LIB} -lsocket")
])
AC_CHECK_FUNC(gethostbyname,,[
  AC_CHECK_LIB(nsl,gethostbyname,LIB="${LIB} -lnsl")
])
AC_CHECK_FUNC(nanosleep,,[
  AC_CHECK_LIB(rt,nanosleep,LIB="${LIB} -lrt",[
    AC_CHECK_LIB(posix4,nanosleep,LIB="${LIB} -lposix4")
  ])
])
53
AC_CHECK_FUNCS(usleep)
Sam Hocevar's avatar
   
Sam Hocevar committed
54
55
56
AC_CHECK_FUNC(inet_aton,,[
  AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
])
Sam Hocevar's avatar
   
Sam Hocevar committed
57
AC_CHECK_FUNCS(vasprintf)
Sam Hocevar's avatar
   
Sam Hocevar committed
58
AC_CHECK_FUNCS(swab)
59
AC_CHECK_FUNCS([memalign valloc])
Sam Hocevar's avatar
   
Sam Hocevar committed
60

Sam Hocevar's avatar
   
Sam Hocevar committed
61
62
AC_CHECK_FUNCS(sigrelse)

Sam Hocevar's avatar
   
Sam Hocevar committed
63
dnl Check for getopt
Sam Hocevar's avatar
   
Sam Hocevar committed
64
NEED_GETOPT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
65
66
67
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
68
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB="${LIB} -lgnugetopt"],
Sam Hocevar's avatar
   
Sam Hocevar committed
69
    [NEED_GETOPT=1])])
Sam Hocevar's avatar
   
Sam Hocevar committed
70

71
72
AC_FUNC_MMAP
AC_TYPE_SIGNAL
Sam Hocevar's avatar
   
Sam Hocevar committed
73
74
AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl")
AC_CHECK_LIB(m,pow,LIB_YUV="${LIB_YUV} -lm")
Sam Hocevar's avatar
   
Sam Hocevar committed
75

Sam Hocevar's avatar
   
Sam Hocevar committed
76
dnl Check for pthreads - borrowed from XMMS
Sam Hocevar's avatar
   
Sam Hocevar committed
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
91
92
93

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

Sam Hocevar's avatar
   
Sam Hocevar committed
95
96
97
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
98
            Define if <pthread.h> defines pthread_cond_t.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
99
100
AC_EGREP_HEADER(strncasecmp,strings.h,[
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Sam Hocevar's avatar
   
Sam Hocevar committed
101
            Define if <strings.h> defines strncasecmp.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
102

Sam Hocevar's avatar
   
Sam Hocevar committed
103
104
dnl Check for headers
AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
105
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
106
107
108
109
110
111
112
113
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
AC_CHECK_HEADERS(machine/param.h)

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
114
dnl Check for ntohl, etc.
Sam Hocevar's avatar
   
Sam Hocevar committed
115
CFLAGS="${save_CFLAGS} -Wall -Werror"
Christophe Massiot's avatar
Christophe Massiot committed
116
117
118
AC_MSG_CHECKING([for ntohl in sys/param.h])
AC_TRY_COMPILE([#include <sys/param.h>
void foo() { int meuh; ntohl(meuh); }],,
Sam Hocevar's avatar
   
Sam Hocevar committed
119
 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
Sam Hocevar's avatar
   
Sam Hocevar committed
120
121
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
122
dnl Check for inline function size limit
123
CFLAGS="${save_CFLAGS} -finline-limit-30000"
Sam Hocevar's avatar
   
Sam Hocevar committed
124
125
AC_MSG_CHECKING([if \$CC accepts -finline-limit])
AC_TRY_COMPILE([],,
126
 save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; AC_MSG_RESULT(yes),
Sam Hocevar's avatar
   
Sam Hocevar committed
127
128
 AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
129
130
dnl Check for Darwin plugin linking flags
CFLAGS="${save_CFLAGS} -bundle -undefined suppress"
Sam Hocevar's avatar
   
Sam Hocevar committed
131
AC_MSG_CHECKING([if \$CC accepts -bundle -undefined suppress])
Sam Hocevar's avatar
   
Sam Hocevar committed
132
133
134
135
136
137
AC_TRY_COMPILE([],,
 PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; AC_MSG_RESULT(yes),
 AC_MSG_RESULT(no))

dnl Check for standard plugin linking flags
CFLAGS="${save_CFLAGS} -shared"
Sam Hocevar's avatar
   
Sam Hocevar committed
138
AC_MSG_CHECKING([if \$CC accepts -shared])
Sam Hocevar's avatar
   
Sam Hocevar committed
139
140
141
142
AC_TRY_COMPILE([],,
 PLCFLAGS="${PLCFLAGS} -shared"; AC_MSG_RESULT(yes),
 AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
dnl Check for standard soname setting
if test x"${SOFLAGS}" = x; then
  try_SOFLAGS="-Wl,-soname -Wl,"
  LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
  AC_MSG_CHECKING([if linker accepts ${try_SOFLAGS}foo.so.0])
  AC_TRY_LINK([],,
   SOFLAGS="${try_SOFLAGS}"; AC_MSG_RESULT(yes),
   AC_MSG_RESULT(no))
fi

dnl Check for SunOS soname setting
if test x"${SOFLAGS}" = x; then
  try_SOFLAGS="-Wl,-h -Wl,"
  LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
  AC_MSG_CHECKING([if linker accepts ${try_SOFLAGS}foo.so.0])
  AC_TRY_LINK([],,
   SOFLAGS="${try_SOFLAGS}"; AC_MSG_RESULT(yes),
   AC_MSG_RESULT(no))
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
163
dnl End of the bizarre compilation tests
Sam Hocevar's avatar
   
Sam Hocevar committed
164
CFLAGS="${save_CFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
165
LDFLAGS="${save_LDFLAGS}"
Christophe Massiot's avatar
Christophe Massiot committed
166

167
dnl Check for boolean_t
Sam Hocevar's avatar
   
Sam Hocevar committed
168
169
170
171
172
AC_MSG_CHECKING([for boolean_t in sys/types.h])
AC_TRY_COMPILE([#include <sys/types.h>
void quux() { boolean_t foo; }],,
 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
173
174
175
176
177
AC_MSG_CHECKING([for boolean_t in pthread.h])
AC_TRY_COMPILE([#include <pthread.h>
void quux() { boolean_t foo; }],,
 AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
Sam Hocevar's avatar
   
Sam Hocevar committed
178
179
180
181
182
AC_MSG_CHECKING([for boolean_t in cthreads.h])
AC_TRY_COMPILE([#include <cthreads.h>
void quux() { boolean_t foo; }],,
 AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
Sam Hocevar's avatar
   
Sam Hocevar committed
183

184
185
186
187
188
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
    [ac_cv_c_attribute_aligned],
    [ac_cv_c_attribute_aligned=0
    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



205
ARCH=${target_cpu}
Sam Hocevar's avatar
   
Sam Hocevar committed
206
207
208
209

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
210
211
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion imdct downmix"
PLUGINS="${PLUGINS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
212
213
214
215

dnl
dnl  Accelerated modules
dnl
gbazin's avatar
   
gbazin committed
216
MMX_MODULES="yuvmmx idctmmx motionmmx"
Sam Hocevar's avatar
   
Sam Hocevar committed
217
218
219
MMXEXT_MODULES="idctmmxext motionmmxext"
THREEDNOW_MODULES="imdct3dn downmix3dn"
SSE_MODULES="imdctsse downmixsse"
220
ALTIVEC_MODULES="idctaltivec motionaltivec"
221

222
223
224
225
226
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
    [ac_cv_mmx_inline],
    [AC_TRY_COMPILE([void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}],,
	ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
if test x"$ac_cv_mmx_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
227
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
228
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
229

230
231
232
233
234
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
    [ac_cv_mmxext_inline],
    [AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],,
	ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
if test x"$ac_cv_mmxext_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
235
  ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
236
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
237

238
239
240
241
242
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
    [ac_cv_3dnow_inline],
    [AC_TRY_COMPILE([void quux(){void *p;asm("pfadd %%mm1,%%mm2"::"r"(p));}],,
	ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
if test x"$ac_cv_3dnow_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
243
  ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
244
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
245

246
247
248
249
250
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
    [ac_cv_sse_inline],
    [AC_TRY_COMPILE([void quux(){void *p;asm("xorps %%xmm1,%%xmm2"::"r"(p));}],,
	ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
if test x"$ac_cv_sse_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
251
  ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
252
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
253

254
255
256
257
258
AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
    [ac_cv_altivec_inline],
    [AC_TRY_COMPILE([void quux(){asm("mtspr 256,%0"::"r"(-1));}],,
	ac_cv_altivec_inline=yes, ac_cv_altivec_inline=no)])
if test x"$ac_cv_altivec_inline" != x"no"; then
259
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
260
fi
261

262
263
264
265
266
267
268
269
270
271
AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
    [ac_cv_c_altivec],
    [save_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS -faltivec"
     AC_TRY_COMPILE([void quux(){vec_mtvscr((vector unsigned int)(0));}],,
        ac_cv_c_altivec=yes, ac_cv_c_altivec=no)
     CFLAGS=$save_CFLAGS])
if test x"$ac_cv_c_altivec" != x"no"; then
  AC_DEFINE(HAVE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
272
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
273
dnl  libdvdcss: check for DVD ioctls
Sam Hocevar's avatar
   
Sam Hocevar committed
274
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
275

Sam Hocevar's avatar
   
Sam Hocevar committed
276
277
278
dnl  default is no
CAN_BUILD_LIBDVDCSS=0

Sam Hocevar's avatar
   
Sam Hocevar committed
279
280
dnl  for windoze
AC_CHECK_HEADERS(winioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
281
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
282
283
])

Sam Hocevar's avatar
   
Sam Hocevar committed
284
dnl  for Un*x and BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
285
AC_CHECK_HEADERS(sys/ioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
286
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
287
  AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
288
  BSD_DVD_STRUCT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
289
  LINUX_DVD_STRUCT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
  dnl
  dnl Old FreeBSD: sys/cdio.h
  dnl
  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.)
    BSD_DVD_STRUCT=1
  ])
  dnl
  dnl Newer FreeBSD: sys/dvdio.h
  dnl
  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.)
    BSD_DVD_STRUCT=1
  ])
  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
312
313
314
315
316
    LINUX_DVD_STRUCT=1
  ])
  dnl
  dnl BSDI: dvd.h
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
317
  NEED_BSDI_LIBDVD=0
Sam Hocevar's avatar
   
Sam Hocevar committed
318
319
320
  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
321
    LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
322
    LINUX_DVD_STRUCT=1
Sam Hocevar's avatar
   
Sam Hocevar committed
323
324
325
326
327
328
  ],[
    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
329
330
      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
331
      OBJ_LIBDVDCSS="${OBJ_LIBDVDCSS} bsdi_dvdioctl.o"
Sam Hocevar's avatar
   
Sam Hocevar committed
332
333
      LINUX_DVD_STRUCT=1
    ])
Sam Hocevar's avatar
   
Sam Hocevar committed
334
  ])
Sam Hocevar's avatar
   
Sam Hocevar committed
335
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
336
  dnl Solaris: sys/scsi/scsi_types.h, sys/scsi/impl/uscsi.h
Sam Hocevar's avatar
   
Sam Hocevar committed
337
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
338
  AC_CHECK_HEADER(sys/scsi/scsi_types.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
339
340
341
342
343
    AC_CHECK_HEADER(sys/scsi/impl/uscsi.h,[
      AC_DEFINE(SOLARIS_USCSI, 1, Have userspace SCSI headers.)
    ])
  ])
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
344
345
346
347
348
349
350
351
352
353
354
  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.)
  else
    if test x$BSD_DVD_STRUCT = x1; then
      AC_DEFINE(HAVE_BSD_DVD_STRUCT, 1,
                Define if BSD-like dvd_struct is defined.)
    fi
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
355
356
])

Sam Hocevar's avatar
   
Sam Hocevar committed
357

Sam Hocevar's avatar
   
Sam Hocevar committed
358
359
360
dnl
dnl  Check the operating system
dnl
361
case ${_os} in
Sam Hocevar's avatar
   
Sam Hocevar committed
362
363
364
  bsdi*)
    SYS=bsdi
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
365
366
367
368
  darwin*)
    SYS=darwin
    ;;
  *)
369
    SYS=${target_os}
Sam Hocevar's avatar
   
Sam Hocevar committed
370
371
372
    ;;
esac

Sam Hocevar's avatar
   
Sam Hocevar committed
373
374
375
dnl
dnl  PentiumPro acceleration
dnl
376
AC_ARG_ENABLE(ppro,
Sam Hocevar's avatar
   
Sam Hocevar committed
377
  [  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
378
[ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ],
379
[ if test x$ARCH = xi686; then ARCH="${ARCH} ppro"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
380
381
382
383

dnl
dnl  MMX acceleration
dnl
384
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
385
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
386
[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
387
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
388
[ 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";
389
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
390
391
392
393

dnl
dnl  AltiVec acceleration
dnl
394
AC_ARG_ENABLE(altivec,
395
396
397
[  --disable-altivec       Disable altivec optimizations (default enabled on PPC)],
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
398
[ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
399
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
400
401
402
403

dnl
dnl  Debugging mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
404
DEBUG=0
405
AC_ARG_ENABLE(debug,
406
[  --enable-debug          Enable debug mode (default disabled)],
407
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
408
409
410
411

dnl
dnl  Enable/disable statistics
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
412
STATS=0
413
AC_ARG_ENABLE(stats,
414
[  --enable-stats          Enable printing of statistics (default disabled)],
415
[ if test x$enableval = xyes; then STATS=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
416

417
418
419
dnl
dnl  Trace mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
420
TRACE=0
421
422
423
424
AC_ARG_ENABLE(trace,
[  --enable-trace          Enable trace mode (default disabled)],
[ if test x$enableval = xyes; then TRACE=1; fi ])

Sam Hocevar's avatar
   
Sam Hocevar committed
425
dnl
426
dnl  Profiling
Sam Hocevar's avatar
   
Sam Hocevar committed
427
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
428
429
430
431
432
433
434
435
436
437
438
439
440
441
GPROF=0
AC_ARG_ENABLE(gprof,
[  --enable-gprof          Enable gprof profiling (default disabled)],
[ if test x$enableval = xyes; then GPROF=1; fi ])

CPROF=0
AC_ARG_ENABLE(cprof,
[  --enable-cprof          Enable cprof profiling (default disabled)],
[ if test x$enableval = xyes;
  then
    LIB="${LIB} -lcprof"
    CPROF=1
  fi
])
Sam Hocevar's avatar
   
Sam Hocevar committed
442

Sam Hocevar's avatar
   
Sam Hocevar committed
443
444
445
dnl
dnl  Enable/disable optimizations
dnl
446
AC_ARG_ENABLE(optimizations,
447
[  --disable-optimizations Disable compiler optimizations (default enabled)],
448
449
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
450

Sam Hocevar's avatar
   
Sam Hocevar committed
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
dnl
dnl  GNU portable threads
dnl
AC_ARG_ENABLE(pth,
  [  --enable-pth            Enable GNU Pth support (default disabled)],
  [ if test x$enableval = xyes; then
    AC_CHECK_LIB(pth,pth_init)
    AC_EGREP_HEADER(pth_init,pth.h,[
      AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
                Define if <pth.h> defines pth_init)
    THREAD_LIB="-lpth"
    fi])
])

LIB="${LIB} ${THREAD_LIB}"

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
468
dnl  DVD module: check for installed libdvdcss or local libdvdcss
Sam Hocevar's avatar
   
Sam Hocevar committed
469
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
470
NEED_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
471
STATIC_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
472
DUMMY_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
473
AC_ARG_WITH(dvdcss,
Sam Hocevar's avatar
   
Sam Hocevar committed
474
  [  --with-dvdcss[=name]    way to use libdvdcss, either 'yes' or 'no', or 'local-static', 'local-shared', or a path to another libdvdcss such as '/usr/local' (default 'local-static')],
Sam Hocevar's avatar
   
Sam Hocevar committed
475
476
477
478
479
  [ case "x${withval}" in
    xlocal-static|xyes)
      # local libdvdcss, statically linked
      if test x${CAN_BUILD_LIBDVDCSS} = x1
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
480
        NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
481
482
483
        STATIC_LIBDVDCSS=1
        BUILTINS="${BUILTINS} dvd"
        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
484
485
        LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
486
487
488
489
      fi
    ;;
    xlocal-shared)
      # local libdvdcss, dynamically linked
Sam Hocevar's avatar
   
Sam Hocevar committed
490
491
      if test x${CAN_BUILD_LIBDVDCSS} = x1
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
492
        NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
493
494
495
496
497
        BUILTINS="${BUILTINS} dvd"
        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
        LIB_DVD="${LIB_DVD} -Llib -ldvdcss"
        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L../../lib -ldvdcss"
      fi
Sam Hocevar's avatar
   
Sam Hocevar committed
498
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
499
500
501
502
503
504
    xno)
      # don't use libdvdcss at all, build a DVD module that can dlopen() it
      DUMMY_LIBDVDCSS=1
      BUILTINS="${BUILTINS} dvd"
      OBJ_DVD="${OBJ_DVD} dummy_dvdcss.o"
      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
Sam Hocevar's avatar
   
Sam Hocevar committed
505
      CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
Sam Hocevar's avatar
   
Sam Hocevar committed
506
507
508
      LIB_DVD="${LIB_DVD} -ldl"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
509
    *)
Sam Hocevar's avatar
   
Sam Hocevar committed
510
511
512
513
514
515
516
517
518
      # existing libdvdcss
      BUILTINS="${BUILTINS} dvd"
      if test "x$withval" != "xyes"
      then
        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L"$withval"/lib"
        CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
      fi
      LIB_DVD="${LIB_DVD} -ldvdcss"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
519
    esac ],
Sam Hocevar's avatar
   
Sam Hocevar committed
520
  # user didn't decide, we choose to use local libdvdcss and link statically
Sam Hocevar's avatar
   
Sam Hocevar committed
521
  # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
Sam Hocevar's avatar
   
Sam Hocevar committed
522
523
  [ if test x${CAN_BUILD_LIBDVDCSS} = x1
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
524
      NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
525
526
527
      STATIC_LIBDVDCSS=1
      BUILTINS="${BUILTINS} dvd"
      CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
528
529
      LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
530
531
532
533
534
535
536
537
    else
      # XXX: no check for libdl is done, don't try this at home !
      DUMMY_LIBDVDCSS=1
      BUILTINS="${BUILTINS} dvd"
      OBJ_DVD="${OBJ_DVD} dummy_dvdcss.o"
      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
      LIB_DVD="${LIB_DVD} -ldl"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
Sam Hocevar's avatar
   
Sam Hocevar committed
538
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
539

Sam Hocevar's avatar
   
Sam Hocevar committed
540
541
542
543
544
dnl
dnl  dummy plugin
dnl
AC_ARG_ENABLE(dummy,
  [  --disable-dummy         dummy module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
545
546
547
548
549

if test x$enable_dummy != xno
then
  BUILTINS="${BUILTINS} dummy"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
550
551
552
553
554
555

dnl
dnl  null plugin
dnl
AC_ARG_ENABLE(null,
  [  --disable-null          Null module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
556
557
558
559
560

if test x$enable_null != xno
then
  BUILTINS="${BUILTINS} null"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
561
562
563
564
565
566

dnl
dnl  rc plugin
dnl
AC_ARG_ENABLE(rc,
  [  --disable-rc            rc module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
567
568
569
570
571

if test x$enable_rc != xno
then
  BUILTINS="${BUILTINS} rc"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
572

Sam Hocevar's avatar
   
Sam Hocevar committed
573
dnl special case for BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
574
575
if test x$SYS = xbeos
then
Sam Hocevar's avatar
   
Sam Hocevar committed
576
    BUILTINS="${BUILTINS} beos"
Sam Hocevar's avatar
   
Sam Hocevar committed
577
    LIB_BEOS="-lbe -lgame -lroot -ltracker"
Sam Hocevar's avatar
   
Sam Hocevar committed
578
    PLCFLAGS="${PLCFLAGS} -nostart"
579
580
581
582

dnl default case
else

Sam Hocevar's avatar
   
Sam Hocevar committed
583
584
585
dnl
dnl  OSS /dev/dsp module
dnl
586
AC_ARG_ENABLE(dsp,
587
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
588
589
590
591
592

if test x$enable_dsp != xno
then
  if test -c /dev/dsp
  then
Sam Hocevar's avatar
   
Sam Hocevar committed
593
    PLUGINS="${PLUGINS} dsp"
594
595
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
596
597
598
599

dnl
dnl  Esound module
dnl
600
AC_ARG_ENABLE(esd,
601
  [  --enable-esd            Esound library support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
602
603
  [if test x$enable_esd = xyes
   then
Sam Hocevar's avatar
   
Sam Hocevar committed
604
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
Sam Hocevar's avatar
   
Sam Hocevar committed
605
606
     if test x${ESD_CONFIG} != xno
     then
Sam Hocevar's avatar
   
Sam Hocevar committed
607
       PLUGINS="${PLUGINS} esd"
Sam Hocevar's avatar
   
Sam Hocevar committed
608
609
       LIB_ESD="`${ESD_CONFIG} --libs`"
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
610
611
612
613
614
   fi])

dnl
dnl  Darwin module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
615
616
AC_ARG_ENABLE(darwin,
  [  --enable-darwin         Darwin sound support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
617
  [if test x$enable_darwin = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
618
     PLUGINS="${PLUGINS} darwin"
Sam Hocevar's avatar
   
Sam Hocevar committed
619
620
621
622
623
624
     LIB_DARWIN="-framework CoreAudio"
   fi])

dnl
dnl  MacOS X module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
625
AC_ARG_ENABLE(macosx,
626
  [  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)],
Sam Hocevar's avatar
   
Sam Hocevar committed
627
628
  [if test x$enable_macosx = xyes
   then
Sam Hocevar's avatar
   
Sam Hocevar committed
629
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
630
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
631
632
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
633
634
   fi],
  [AC_CHECK_HEADERS(Carbon/Carbon.h,
Sam Hocevar's avatar
   
Sam Hocevar committed
635
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
636
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
637
638
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
639
640
   )])

641
642
643
644
dnl
dnl  QNX RTOS module
dnl
AC_ARG_ENABLE(qnx,
Sam Hocevar's avatar
   
Sam Hocevar committed
645
646
647
  [  --disable-qnx           QNX RTOS support (default enabled in QNX RTOS)])
    if test x$enable_qnx != xno
    then
648
649
650
651
652
653
      AC_CHECK_HEADERS(Ph.h, [
        PLUGINS="${PLUGINS} qnx"
        LIB_QNX="-lasound -lph"
      ])
    fi

Sam Hocevar's avatar
   
Sam Hocevar committed
654
655
656
dnl
dnl  Linux framebuffer module
dnl
657
658
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
659
660
661
662
  [ if test x$enable_fb = xyes
    then
      PLUGINS="${PLUGINS} fb"
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
663
664
665
666

dnl
dnl  GGI module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
667
668
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
669
  [ if test "x$withval" != "xno"
Christophe Massiot's avatar
Christophe Massiot committed
670
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
671
672
      PLUGINS="${PLUGINS} ggi"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
673
674
675
676
677
      then
        LIB_GGI="-l"$withval
      else
        LIB_GGI="-lggi"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
678
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
679
680
681
682

dnl
dnl  SDL module
dnl
683
684
AC_ARG_ENABLE(sdl,
  [  --disable-sdl           SDL support (default enabled)])
685
if test "x$enable_sdl" != "xno"
686
then
687
688
689
690
691
692
693
694
  SDL_PATH=$PATH
  AC_ARG_WITH(sdl-config-path,
    [  --with-sdl-config-path=path sdl-config path (default search in \$PATH)],
    [ if test "x$withval" != "xno"
      then
        SDL_PATH=$withval:$PATH
      fi ])
  AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
695
696
  SDL_CONFIG=${SDL12_CONFIG}
  SDL_HEADER="SDL12/SDL.h"
Sam Hocevar's avatar
   
Sam Hocevar committed
697
698
  if test x${SDL_CONFIG} = xno
  then
699
    AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
Sam Hocevar's avatar
   
Sam Hocevar committed
700
    SDL_CONFIG=${SDL11_CONFIG}
701
702
    SDL_HEADER="SDL11/SDL.h"
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
703
704
  if test x${SDL_CONFIG} = xno
  then
705
    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
706
    SDL_HEADER="SDL/SDL.h"
707
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
708
709
  if test x${SDL_CONFIG} != xno
  then
710
711
712
    PLUGINS="${PLUGINS} sdl"
    CFLAGS_SDL="`${SDL_CONFIG} --cflags`"
    LIB_SDL="`${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
Sam Hocevar's avatar
   
Sam Hocevar committed
713
714
    save_CPPFLAGS=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS $CFLAGS_SDL"
715
716
    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),
717
718
719
720
      [ 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
721
    CPPFLAGS=$save_CPPFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
722
    if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
Sam Hocevar's avatar
   
Sam Hocevar committed
723
    then
724
725
726
      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
727
    fi
728
  elif test "x$enable_sdl" =  "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
729
  then
730
731
732
    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.
    ])
733
734
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
735

Sam Hocevar's avatar
   
Sam Hocevar committed
736
737
738
739
740
dnl
dnl  Windows DirectX module
dnl
AC_ARG_WITH(directx,
  [  --with-directx[=name]   Windows DirectX support (default enabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
741
  [ if test "x$withval" != "xno"
Sam Hocevar's avatar
   
Sam Hocevar committed
742
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
743
744
      PLUGINS="${PLUGINS} directx"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
745
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
746
        LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lgdi32 -ldxguid"
Sam Hocevar's avatar
   
Sam Hocevar committed
747
748
        INCLUDE="${INCLUDE} -I"$withval"/include"
      else
749
750
751
        AC_CHECK_HEADERS(directx.h, , 
	  AC_MSG_ERROR([Cannot find DirectX headers !])
	)
Sam Hocevar's avatar
   
Sam Hocevar committed
752
        LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
Sam Hocevar's avatar
   
Sam Hocevar committed
753
754
      fi
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
755
    if test "x$withval" = "x"
Sam Hocevar's avatar
   
Sam Hocevar committed
756
757
758
    then
      AC_CHECK_HEADERS(directx.h,
      [PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
759
       LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"])
Sam Hocevar's avatar
   
Sam Hocevar committed
760
761
    fi

Sam Hocevar's avatar
   
Sam Hocevar committed
762
763
764
dnl
dnl  Glide module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
765
766
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
767
  [ if test "x$withval" != "xno"
Christophe Massiot's avatar
Christophe Massiot committed
768
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
769
770
      PLUGINS="${PLUGINS} glide"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
771
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
772
        LIB_GLIDE="-l"$withval" -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
773
      else
Sam Hocevar's avatar
   
Sam Hocevar committed
774
        LIB_GLIDE="-lglide2x -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
775
      fi
Christophe Massiot's avatar
Christophe Massiot committed
776
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
777
778
779
780

dnl
dnl  ncurses module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
781
782
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
783
  [if test x$enable_ncurses = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
784
     PLUGINS="${PLUGINS} ncurses"
Sam Hocevar's avatar
   
Sam Hocevar committed
785
786
787
788
789
790
     LIB_NCURSES="-lncurses"
   fi])

dnl
dnl  Qt module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
791
792
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
793
  [if test x$enable_qt = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
794
795
     PLUGINS="${PLUGINS} qt"
     ALIASES="${ALIASES} qvlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
796
     LIB_QT="-lqt -L${QTDIR}/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
797
     if test -x ${QTDIR}/bin/moc
Sam Hocevar's avatar
   
Sam Hocevar committed
798
799
800
801
802
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
803
804
805
806
807
   fi])

dnl 
dnl  KDE module
dnl
808
809
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
810
  [if test x$enable_kde = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
811
812
     PLUGINS="${PLUGINS} kde"
     ALIASES="${ALIASES} kvlc"
813
814
815
816
817
818
819
     LIB_KDE="-L${KDEDIR}/lib -lkfile"
     if test -x ${QTDIR}/bin/moc
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
820
   fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
821
822
823
824

dnl
dnl  Gnome module
dnl
825
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
   
Sam Hocevar committed
826
  [  --enable-gnome          Gnome interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
827
  [if test x$enable_gnome = xyes; then
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
    # look for gnome-config
    AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
    if test -x ${GNOME_CONFIG}
    then
       CFLAGS_GNOME="`${GNOME_CONFIG} --cflags gnomeui`"
       LIB_GNOME="`${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
    fi
    # now look for the gnome.h header
    saved_CPPFLAGS=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS $CFLAGS_GNOME"
    AC_CHECK_HEADERS(gnome.h, [
      PLUGINS="${PLUGINS} gnome"
      ALIASES="${ALIASES} gnome-vlc"
     ],[
      AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
developement librairie or remove the --enable-gnome option])
     ])
  
    CPPFLAGS=$saved_CPPFLAGS
  fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
848
849
850
851

dnl
dnl  Gtk+ module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
852
853
AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Gtk+ support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
854
855
856
if test x$enable_gtk != xno
then
  # look for gtk-config
Sam Hocevar's avatar
   
Sam Hocevar committed
857
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
Sam Hocevar's avatar
   
Sam Hocevar committed
858
859
  if test -x ${GTK_CONFIG}
  then
Sam Hocevar's avatar
   
Sam Hocevar committed
860
861
    CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
    LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
862
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
863
864
865
866
867
868
869
870
  # now look for the gtk.h header
  saved_CPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS $CFLAGS_GTK"
  AC_CHECK_HEADERS(gtk/gtk.h, [
    PLUGINS="${PLUGINS} gtk"
    ALIASES="${ALIASES} gvlc"
  ])
  CPPFLAGS=$saved_CPPFLAGS
871
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
872
873
874
875

dnl
dnl  X11 module
dnl
876
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
877
  [  --disable-x11           X11 support (default enabled)])
878
if test x$enable_x11 != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
879
880
881
882
883
884
885
886
  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"
Sam Hocevar's avatar
   
Sam Hocevar committed
887
  AC_CHECK_HEADERS(X11/Xlib.h, [
Sam Hocevar's avatar
   
Sam Hocevar committed
888
    PLUGINS="${PLUGINS} x11"
Sam Hocevar's avatar
   
Sam Hocevar committed
889
890
891
892
    LIB_X11="-L$x_libraries -lX11 -lXext"
    CFLAGS_X11="-I$x_includes"
  ]
  CPPFLAGS=$saved_CPPFLAGS)
893
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
894
895
896
897

dnl
dnl  XVideo module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
898
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
   
Sam Hocevar committed
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
  [  --disable-xvideo        XVideo support (default enabled)])
if test x$enable_xvideo != xno; 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, [
    PLUGINS="${PLUGINS} xvideo"
    LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
    CFLAGS_X11="-I$x_includes"
  ]
  CPPFLAGS=$saved_CPPFLAGS)
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
916
917
918
919

dnl
dnl  ALSA module
dnl
Henri Fallon's avatar
   
Henri Fallon committed
920
AC_ARG_ENABLE(alsa,
921
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
922
923
924
925
926
927
928
929
930
  [if test x$enable_alsa = xyes
   then
     AC_CHECK_HEADER(sys/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
     if test x$have_alsa = xtrue
     then
       PLUGINS="${PLUGINS} alsa"
       LIB_ALSA="-lasound"
     fi
   fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
931

Sam Hocevar's avatar
   
Sam Hocevar committed
932
dnl  end of non-BeOS stuff
933
934
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
935
936
937
dnl 
dnl  Configuration is finished
dnl
938
939
AC_SUBST(SYS)
AC_SUBST(ARCH)
940
AC_SUBST(PLUGINS)
Sam Hocevar's avatar
   
Sam Hocevar committed
941
AC_SUBST(BUILTINS)
942
AC_SUBST(ALIASES)
Sam Hocevar's avatar
   
Sam Hocevar committed
943
AC_SUBST(DEFINE)
Sam Hocevar's avatar
   
Sam Hocevar committed
944
AC_SUBST(INCLUDE)
945
946
AC_SUBST(DEBUG)
AC_SUBST(STATS)
Sam Hocevar's avatar
   
Sam Hocevar committed
947
AC_SUBST(ASM)
948
AC_SUBST(TRACE)
Sam Hocevar's avatar
   
Sam Hocevar committed
949
950
AC_SUBST(CPROF)
AC_SUBST(GPROF)
951
AC_SUBST(OPTIMS)
Sam Hocevar's avatar
   
Sam Hocevar committed
952
AC_SUBST(NEED_GETOPT)
Sam Hocevar's avatar
   
Sam Hocevar committed
953
AC_SUBST(MOC)
Sam Hocevar's avatar
   
Sam Hocevar committed
954
AC_SUBST(WINDRES)
Sam Hocevar's avatar
   
Sam Hocevar committed
955
956

AC_SUBST(LCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
957
AC_SUBST(PLCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
958
AC_SUBST(SOFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
959

Sam Hocevar's avatar
   
Sam Hocevar committed
960
AC_SUBST(LIB)
Sam Hocevar's avatar
   
Sam Hocevar committed
961
962
963
AC_SUBST(LIB_ALSA)
AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN)
Sam Hocevar's avatar
   
Sam Hocevar committed
964
AC_SUBST(LIB_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
965
AC_SUBST(LIB_DVD_PLUGIN)
Sam Hocevar's avatar
   
Sam Hocevar committed
966
AC_SUBST(LIB_ESD)
Christophe Massiot's avatar
Christophe Massiot committed
967
AC_SUBST(LIB_GGI)
Sam Hocevar's avatar
   
Sam Hocevar committed
968
969
970
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME)
AC_SUBST(LIB_GTK)
Sam Hocevar's avatar
   
Sam Hocevar committed
971
AC_SUBST(LIB_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
972
AC_SUBST(LIB_KDE)
Sam Hocevar's avatar
   
Sam Hocevar committed
973
AC_SUBST(LIB_MACOSX)
974
AC_SUBST(LIB_QNX)
Sam Hocevar's avatar
   
Sam Hocevar committed
975
976
977
978
AC_SUBST(LIB_NCURSES)
AC_SUBST(LIB_QT)
AC_SUBST(LIB_TS)
AC_SUBST(LIB_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
979
AC_SUBST(LIB_DIRECTX)
Sam Hocevar's avatar
   
Sam Hocevar committed
980
981
982
AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO)
AC_SUBST(LIB_YUV)
983

Sam Hocevar's avatar
   
Sam Hocevar committed
984
AC_SUBST(CFLAGS_VLC)
Sam Hocevar's avatar
   
Sam Hocevar committed
985
AC_SUBST(CFLAGS_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
986
AC_SUBST(CFLAGS_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
987
AC_SUBST(CFLAGS_GTK)
Sam Hocevar's avatar
   
Sam Hocevar committed
988
AC_SUBST(CFLAGS_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
989
990
AC_SUBST(CFLAGS_X11)

Sam Hocevar's avatar
   
Sam Hocevar committed
991
AC_SUBST(OBJ_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
992
AC_SUBST(OBJ_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
993

Sam Hocevar's avatar
   
Sam Hocevar committed
994
AC_SUBST(NEED_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
995

Sam Hocevar's avatar
   
Sam Hocevar committed
996
AC_OUTPUT([Makefile.opts include/config.h])
997

998
echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
999
1000
1001
1002
global configuration
--------------------
system                : ${SYS}
architecture          : ${ARCH}
Sam Hocevar's avatar
   
Sam Hocevar committed
1003
optimizations         : ${OPTIMS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
1004

Sam Hocevar's avatar
   
Sam Hocevar committed
1005
1006
1007
if test x${HAVE_VLC} = x1
then
  echo "
1008
1009
1010
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
1011
1012
debug mode            : ${DEBUG}
statistics            : ${STATS}
1013
trace mode            : ${TRACE}
Sam Hocevar's avatar
   
Sam Hocevar committed
1014
cprof/gprof support   : ${CPROF}/${GPROF}
Sam Hocevar's avatar
   
Sam Hocevar committed
1015
need builtin getopt   : ${NEED_GETOPT}
Sam Hocevar's avatar
   
Sam Hocevar committed
1016
built-in modules      :${BUILTINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
1017
plugin modules        :${PLUGINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
1018
1019
vlc aliases           :${ALIASES}"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1020

Sam Hocevar's avatar
   
Sam Hocevar committed
1021
echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
1022
1023
libdvdcss configuration
-----------------------
Sam Hocevar's avatar
   
Sam Hocevar committed
1024
can be built          : ${CAN_BUILD_LIBDVDCSS}
Sam Hocevar's avatar
   
Sam Hocevar committed
1025
1026
will be built         : ${NEED_LIBDVDCSS}"
if test x${NEED_LIBDVDCSS} = x1
Sam Hocevar's avatar
   
Sam Hocevar committed
1027
then
Sam Hocevar's avatar
   
Sam Hocevar committed
1028
  echo "need BSDI libdvd      : ${NEED_BSDI_LIBDVD}"
Sam Hocevar's avatar
   
Sam Hocevar committed
1029
1030
1031
  echo "link statically       : ${STATIC_LIBDVDCSS}"
else
  echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
1032
1033
1034
fi

echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
You may now tune Makefile.opts at your convenience, for instance to choose
which modules get compiled as plugins.
"
if test x${HAVE_VLC} = x1
then
  echo "To build vlc and its plugins, type \`make vlc'."
fi
if test x${HAVE_LIBDVDCSS} = x1
then
  echo "To build libdvdcss only, type \`make libdvdcss'."
fi
echo ""
1047