configure.in 24.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
6
AC_CANONICAL_HOST

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.82
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

Sam Hocevar's avatar
   
Sam Hocevar committed
36
37
38
39
dnl Check for endianness if not cross-compiling
if test x${cross_compiling} != xyes; then
  AC_C_BIGENDIAN
fi
40
41
42
43

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
44
45
46
47
48
49
50
51
52
53
54
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")
  ])
])
55
AC_CHECK_FUNCS(usleep)
Sam Hocevar's avatar
   
Sam Hocevar committed
56
57
58
AC_CHECK_FUNC(inet_aton,,[
  AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
])
Sam Hocevar's avatar
   
Sam Hocevar committed
59
AC_CHECK_FUNCS(vasprintf)
Sam Hocevar's avatar
   
Sam Hocevar committed
60
AC_CHECK_FUNCS(swab)
Sam Hocevar's avatar
   
Sam Hocevar committed
61

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

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

72
73
AC_FUNC_MMAP
AC_TYPE_SIGNAL
Sam Hocevar's avatar
   
Sam Hocevar committed
74
75
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
76

Christophe Massiot's avatar
Christophe Massiot committed
77
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
78
CFLAGS="${CFLAGS} -I/usr/local/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
79

Sam Hocevar's avatar
   
Sam Hocevar committed
80
81
dnl Check for pthreads - borrowed from XMMS
PTHREAD_LIBS=error
Sam Hocevar's avatar
   
Sam Hocevar committed
82
83
84
AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
Sam Hocevar's avatar
   
Sam Hocevar committed
85
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
86
87
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
Sam Hocevar's avatar
   
Sam Hocevar committed
88
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
89
90
if test "x${THREAD_LIB}" = xerror; then
  THREAD_LIBS=""
Sam Hocevar's avatar
   
Sam Hocevar committed
91
92
  AC_CHECK_FUNC(pthread_attr_init)
fi
93

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

Sam Hocevar's avatar
   
Sam Hocevar committed
102
103
dnl Check for headers
AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
104
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
105
106
107
108
109
110
111
112
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
113
dnl Check for ntohl, etc.
Sam Hocevar's avatar
   
Sam Hocevar committed
114
CFLAGS="${save_CFLAGS} -Wall -Werror"
Christophe Massiot's avatar
Christophe Massiot committed
115
116
117
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
118
 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
Sam Hocevar's avatar
   
Sam Hocevar committed
119
120
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

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

Sam Hocevar's avatar
   
Sam Hocevar committed
128
129
dnl Check for Darwin plugin linking flags
CFLAGS="${save_CFLAGS} -bundle -undefined suppress"
Sam Hocevar's avatar
   
Sam Hocevar committed
130
AC_MSG_CHECKING([if \$CC accepts -bundle -undefined suppress])
Sam Hocevar's avatar
   
Sam Hocevar committed
131
132
133
134
135
136
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
137
AC_MSG_CHECKING([if \$CC accepts -shared])
Sam Hocevar's avatar
   
Sam Hocevar committed
138
139
140
141
AC_TRY_COMPILE([],,
 PLCFLAGS="${PLCFLAGS} -shared"; AC_MSG_RESULT(yes),
 AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
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
162
dnl End of the bizarre compilation tests
Sam Hocevar's avatar
   
Sam Hocevar committed
163
CFLAGS="${save_CFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
164
LDFLAGS="${save_LDFLAGS}"
Christophe Massiot's avatar
Christophe Massiot committed
165

166
dnl Check for boolean_t
Sam Hocevar's avatar
   
Sam Hocevar committed
167
168
169
170
171
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))
172
173
174
175
176
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
177

178
179
180
181
182
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

Sam Hocevar's avatar
   
Sam Hocevar committed
183
184
185
186
187
ARCH=${host_cpu}

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
188
189
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion imdct downmix"
PLUGINS="${PLUGINS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
190
191
192
193

dnl
dnl  Accelerated modules
dnl
gbazin's avatar
   
gbazin committed
194
195
MMX_MODULES="yuvmmx idctmmx motionmmx"
MMXEXT_MODULES="idctmmxext motionmmxext imdct3dn imdctsse downmix3dn downmixsse"
196

Sam Hocevar's avatar
   
Sam Hocevar committed
197
198
AC_MSG_CHECKING([if \$CC groks MMX inline assembly])
AC_TRY_COMPILE([void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}],,
Sam Hocevar's avatar
   
Sam Hocevar committed
199
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
Sam Hocevar's avatar
   
Sam Hocevar committed
200
201
  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
202
AC_MSG_CHECKING([if \$CC groks MMX EXT or SSE inline assembly])
Sam Hocevar's avatar
   
Sam Hocevar committed
203
AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],,
Sam Hocevar's avatar
   
Sam Hocevar committed
204
  ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
Sam Hocevar's avatar
   
Sam Hocevar committed
205
206
  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
207
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
208
dnl  libdvdcss: check for DVD ioctls
Sam Hocevar's avatar
   
Sam Hocevar committed
209
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
210

Sam Hocevar's avatar
   
Sam Hocevar committed
211
212
213
dnl  default is no
CAN_BUILD_LIBDVDCSS=0

Sam Hocevar's avatar
   
Sam Hocevar committed
214
215
dnl  for windoze
AC_CHECK_HEADERS(winioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
216
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
217
218
])

Sam Hocevar's avatar
   
Sam Hocevar committed
219
dnl  for Un*x and BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
220
AC_CHECK_HEADERS(sys/ioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
221
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
222
  AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
223
  BSD_DVD_STRUCT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
224
  LINUX_DVD_STRUCT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
  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
247
248
249
250
251
    LINUX_DVD_STRUCT=1
  ])
  dnl
  dnl BSDI: dvd.h
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
252
  NEED_BSDI_LIBDVD=0
Sam Hocevar's avatar
   
Sam Hocevar committed
253
254
255
  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
256
    LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
257
    LINUX_DVD_STRUCT=1
Sam Hocevar's avatar
   
Sam Hocevar committed
258
259
260
261
262
263
  ],[
    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
264
265
      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
266
      OBJ_LIBDVDCSS="${OBJ_LIBDVDCSS} bsdi_dvdioctl.o"
Sam Hocevar's avatar
   
Sam Hocevar committed
267
268
      LINUX_DVD_STRUCT=1
    ])
Sam Hocevar's avatar
   
Sam Hocevar committed
269
  ])
Sam Hocevar's avatar
   
Sam Hocevar committed
270
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
271
  dnl Solaris: sys/scsi/scsi_types.h, sys/scsi/impl/uscsi.h
Sam Hocevar's avatar
   
Sam Hocevar committed
272
  dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
273
  AC_CHECK_HEADER(sys/scsi/scsi_types.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
274
275
276
277
278
    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
279
280
281
282
283
284
285
286
287
288
289
  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
290
291
])

Sam Hocevar's avatar
   
Sam Hocevar committed
292

Sam Hocevar's avatar
   
Sam Hocevar committed
293
294
295
296
dnl
dnl  Check the operating system
dnl
case ${host_os} in
Sam Hocevar's avatar
   
Sam Hocevar committed
297
298
299
  bsdi*)
    SYS=bsdi
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
300
301
302
303
304
305
306
307
  darwin*)
    SYS=darwin
    ;;
  *)
    SYS=${host_os}
    ;;
esac

Sam Hocevar's avatar
   
Sam Hocevar committed
308
309
310
dnl
dnl  PentiumPro acceleration
dnl
311
AC_ARG_ENABLE(ppro,
Sam Hocevar's avatar
   
Sam Hocevar committed
312
  [  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
313
314
[ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ],
[ if test x${host_cpu} = xi686; then ARCH="${ARCH} ppro"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
315
316
317
318

dnl
dnl  MMX acceleration
dnl
319
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
320
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
321
[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
Sam Hocevar's avatar
   
Sam Hocevar committed
322
  BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
Sam Hocevar's avatar
   
Sam Hocevar committed
323
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86 -o x${host_cpu} = xi386; then ARCH="${ARCH} mmx";
Sam Hocevar's avatar
   
Sam Hocevar committed
324
  BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
325
326
327
328

dnl
dnl  AltiVec acceleration
dnl
329
AC_ARG_ENABLE(altivec,
330
[  --enable-altivec        Enable altivec optimizations (default disabled since it is broken)],
Sam Hocevar's avatar
   
Sam Hocevar committed
331
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec"
Sam Hocevar's avatar
   
Sam Hocevar committed
332
    BUILTINS="${BUILTINS} idctaltivec"
Sam Hocevar's avatar
   
Sam Hocevar committed
333
334
    LIB_IDCTALTIVEC="-framework vecLib"
  fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
335
#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
336
337
338
339

dnl
dnl  Debugging mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
340
DEBUG=0
341
AC_ARG_ENABLE(debug,
342
[  --enable-debug          Enable debug mode (default disabled)],
343
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
344
345
346
347

dnl
dnl  Enable/disable statistics
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
348
STATS=0
349
AC_ARG_ENABLE(stats,
350
[  --enable-stats          Enable printing of statistics (default disabled)],
351
[ if test x$enableval = xyes; then STATS=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
352

353
354
355
dnl
dnl  Trace mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
356
TRACE=0
357
358
359
360
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
361
362
363
dnl
dnl  Trace mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
364
PROFILING=0
Sam Hocevar's avatar
   
Sam Hocevar committed
365
366
367
368
AC_ARG_ENABLE(profiling,
[  --enable-profiling      Enable gprof profiling (default disabled)],
[ if test x$enableval = xyes; then PROFILING=1; fi ])

Sam Hocevar's avatar
   
Sam Hocevar committed
369
370
371
dnl
dnl  Enable/disable optimizations
dnl
372
AC_ARG_ENABLE(optimizations,
373
[  --disable-optimizations Disable compiler optimizations (default enabled)],
374
375
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
376

Sam Hocevar's avatar
   
Sam Hocevar committed
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
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
394
dnl  DVD module: check for installed libdvdcss or local libdvdcss
Sam Hocevar's avatar
   
Sam Hocevar committed
395
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
396
NEED_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
397
STATIC_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
398
DUMMY_LIBDVDCSS=0
Sam Hocevar's avatar
   
Sam Hocevar committed
399
AC_ARG_WITH(dvdcss,
Sam Hocevar's avatar
   
Sam Hocevar committed
400
  [  --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
401
402
403
404
405
  [ 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
406
        NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
407
408
409
        STATIC_LIBDVDCSS=1
        BUILTINS="${BUILTINS} dvd"
        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
410
411
        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
412
413
414
415
      fi
    ;;
    xlocal-shared)
      # local libdvdcss, dynamically linked
Sam Hocevar's avatar
   
Sam Hocevar committed
416
417
      if test x${CAN_BUILD_LIBDVDCSS} = x1
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
418
        NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
419
420
421
422
423
        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
424
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
425
426
427
428
429
430
    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
431
      CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
Sam Hocevar's avatar
   
Sam Hocevar committed
432
433
434
      LIB_DVD="${LIB_DVD} -ldl"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
435
    *)
Sam Hocevar's avatar
   
Sam Hocevar committed
436
437
438
439
440
441
442
443
444
      # 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
445
    esac ],
Sam Hocevar's avatar
   
Sam Hocevar committed
446
  # user didn't decide, we choose to use local libdvdcss and link statically
Sam Hocevar's avatar
   
Sam Hocevar committed
447
  # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
Sam Hocevar's avatar
   
Sam Hocevar committed
448
449
  [ if test x${CAN_BUILD_LIBDVDCSS} = x1
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
450
      NEED_LIBDVDCSS=1
Sam Hocevar's avatar
   
Sam Hocevar committed
451
452
453
      STATIC_LIBDVDCSS=1
      BUILTINS="${BUILTINS} dvd"
      CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
454
455
      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
456
457
458
459
460
461
462
463
    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
464
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
465

Sam Hocevar's avatar
   
Sam Hocevar committed
466
467
468
469
470
dnl
dnl  dummy plugin
dnl
AC_ARG_ENABLE(dummy,
  [  --disable-dummy         dummy module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
471
472
473
474
475

if test x$enable_dummy != xno
then
  BUILTINS="${BUILTINS} dummy"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
476
477
478
479
480
481

dnl
dnl  null plugin
dnl
AC_ARG_ENABLE(null,
  [  --disable-null          Null module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
482
483
484
485
486

if test x$enable_null != xno
then
  BUILTINS="${BUILTINS} null"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
487
488
489
490
491
492

dnl
dnl  rc plugin
dnl
AC_ARG_ENABLE(rc,
  [  --disable-rc            rc module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
493
494
495
496
497

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

Sam Hocevar's avatar
   
Sam Hocevar committed
499
dnl special case for BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
500
501
if test x$SYS = xbeos
then
Sam Hocevar's avatar
   
Sam Hocevar committed
502
    BUILTINS="${BUILTINS} beos"
Sam Hocevar's avatar
   
Sam Hocevar committed
503
    LIB_BEOS="-lbe -lgame -lroot -ltracker"
Sam Hocevar's avatar
   
Sam Hocevar committed
504
    PLCFLAGS="${PLCFLAGS} -nostart"
505
506
507
508

dnl default case
else

Sam Hocevar's avatar
   
Sam Hocevar committed
509
510
511
dnl
dnl  OSS /dev/dsp module
dnl
512
AC_ARG_ENABLE(dsp,
513
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
514
515
516
517
518

if test x$enable_dsp != xno
then
  if test -c /dev/dsp
  then
Sam Hocevar's avatar
   
Sam Hocevar committed
519
    PLUGINS="${PLUGINS} dsp"
520
521
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
522
523
524
525

dnl
dnl  Esound module
dnl
526
AC_ARG_ENABLE(esd,
527
  [  --enable-esd            Esound library support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
528
529
  [if test x$enable_esd = xyes
   then
Sam Hocevar's avatar
   
Sam Hocevar committed
530
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
Sam Hocevar's avatar
   
Sam Hocevar committed
531
532
     if test x${ESD_CONFIG} != xno
     then
Sam Hocevar's avatar
   
Sam Hocevar committed
533
       PLUGINS="${PLUGINS} esd"
Sam Hocevar's avatar
   
Sam Hocevar committed
534
535
       LIB_ESD="`${ESD_CONFIG} --libs`"
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
536
537
538
539
540
   fi])

dnl
dnl  Darwin module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
541
542
AC_ARG_ENABLE(darwin,
  [  --enable-darwin         Darwin sound support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
543
  [if test x$enable_darwin = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
544
     PLUGINS="${PLUGINS} darwin"
Sam Hocevar's avatar
   
Sam Hocevar committed
545
546
547
548
549
550
     LIB_DARWIN="-framework CoreAudio"
   fi])

dnl
dnl  MacOS X module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
551
AC_ARG_ENABLE(macosx,
552
  [  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)],
Sam Hocevar's avatar
   
Sam Hocevar committed
553
554
  [if test x$enable_macosx = xyes
   then
Sam Hocevar's avatar
   
Sam Hocevar committed
555
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
556
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
557
558
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
559
560
   fi],
  [AC_CHECK_HEADERS(Carbon/Carbon.h,
Sam Hocevar's avatar
   
Sam Hocevar committed
561
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
562
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
563
564
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
565
566
   )])

567
568
569
570
dnl
dnl  QNX RTOS module
dnl
AC_ARG_ENABLE(qnx,
Sam Hocevar's avatar
   
Sam Hocevar committed
571
572
573
  [  --disable-qnx           QNX RTOS support (default enabled in QNX RTOS)])
    if test x$enable_qnx != xno
    then
574
575
576
577
578
579
      AC_CHECK_HEADERS(Ph.h, [
        PLUGINS="${PLUGINS} qnx"
        LIB_QNX="-lasound -lph"
      ])
    fi

Sam Hocevar's avatar
   
Sam Hocevar committed
580
581
582
dnl
dnl  Linux framebuffer module
dnl
583
584
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
585
586
587
588
  [ if test x$enable_fb = xyes
    then
      PLUGINS="${PLUGINS} fb"
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
589
590
591
592

dnl
dnl  GGI module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
593
594
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
595
  [ if test "x$withval" != "xno"
Christophe Massiot's avatar
Christophe Massiot committed
596
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
597
598
      PLUGINS="${PLUGINS} ggi"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
599
600
601
602
603
      then
        LIB_GGI="-l"$withval
      else
        LIB_GGI="-lggi"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
604
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
605
606
607
608

dnl
dnl  SDL module
dnl
609
610
AC_ARG_ENABLE(sdl,
  [  --disable-sdl           SDL support (default enabled)])
611
if test "x$enable_sdl" != "xno"
612
then
613
614
615
616
617
618
619
620
  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)
621
622
  SDL_CONFIG=${SDL12_CONFIG}
  SDL_HEADER="SDL12/SDL.h"
Sam Hocevar's avatar
   
Sam Hocevar committed
623
624
  if test x${SDL_CONFIG} = xno
  then
625
    AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
Sam Hocevar's avatar
   
Sam Hocevar committed
626
    SDL_CONFIG=${SDL11_CONFIG}
627
628
    SDL_HEADER="SDL11/SDL.h"
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
629
630
  if test x${SDL_CONFIG} = xno
  then
631
    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
632
    SDL_HEADER="SDL/SDL.h"
633
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
634
635
  if test x${SDL_CONFIG} != xno
  then
636
637
638
639
640
    PLUGINS="${PLUGINS} sdl"
    CFLAGS_SDL="`${SDL_CONFIG} --cflags`"
    LIB_SDL="`${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
    save_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS $CFLAGS_SDL"
641
642
643
644
645
    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),
      [ echo "The development package for SDL is not installed. Please install it"
        echo "and try again. Alternatively you can also configure with --disable-sdl."
        exit 1 ])
646
    CFLAGS=$save_CFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
647
    if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
Sam Hocevar's avatar
   
Sam Hocevar committed
648
    then
649
650
651
      echo "You need SDL version 1.1.5 or later. Install it and try again."
      echo "Alternatively, you can also configure with --disable-sdl."
      exit 1
Sam Hocevar's avatar
   
Sam Hocevar committed
652
    fi
653
  elif test "x$enable_sdl" =  "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
654
  then
655
    echo "I couldn't find the SDL package. You can download libSDL from"
656
657
658
    echo "http://www.libsdl.org/, or configure with --disable-sdl. Have a"
    echo "nice day."
    exit 1
659
660
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
661

Sam Hocevar's avatar
   
Sam Hocevar committed
662
663
664
665
666
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
667
  [ if test "x$withval" != "xno"
Sam Hocevar's avatar
   
Sam Hocevar committed
668
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
669
670
      PLUGINS="${PLUGINS} directx"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
671
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
672
        LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lgdi32 -ldxguid"
Sam Hocevar's avatar
   
Sam Hocevar committed
673
674
675
        INCLUDE="${INCLUDE} -I"$withval"/include"
      else
        AC_CHECK_HEADERS(directx.h, , [echo "Cannot find DirectX headers !"; exit])
Sam Hocevar's avatar
   
Sam Hocevar committed
676
        LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
Sam Hocevar's avatar
   
Sam Hocevar committed
677
678
      fi
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
679
    if test "x$withval" = "x"
Sam Hocevar's avatar
   
Sam Hocevar committed
680
681
682
    then
      AC_CHECK_HEADERS(directx.h,
      [PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
683
       LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"])
Sam Hocevar's avatar
   
Sam Hocevar committed
684
685
    fi

Sam Hocevar's avatar
   
Sam Hocevar committed
686
687
688
dnl
dnl  Glide module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
689
690
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
691
  [ if test "x$withval" != "xno"
Christophe Massiot's avatar
Christophe Massiot committed
692
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
693
694
      PLUGINS="${PLUGINS} glide"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
695
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
696
        LIB_GLIDE="-l"$withval" -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
697
      else
Sam Hocevar's avatar
   
Sam Hocevar committed
698
        LIB_GLIDE="-lglide2x -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
699
      fi
Christophe Massiot's avatar
Christophe Massiot committed
700
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
701
702
703
704

dnl
dnl  ncurses module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
705
706
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
707
  [if test x$enable_ncurses = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
708
     PLUGINS="${PLUGINS} ncurses"
Sam Hocevar's avatar
   
Sam Hocevar committed
709
710
711
712
713
714
     LIB_NCURSES="-lncurses"
   fi])

dnl
dnl  Qt module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
715
716
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
717
  [if test x$enable_qt = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
718
719
     PLUGINS="${PLUGINS} qt"
     ALIASES="${ALIASES} qvlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
720
     LIB_QT="-lqt -L${QTDIR}/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
721
     if test -x ${QTDIR}/bin/moc
Sam Hocevar's avatar
   
Sam Hocevar committed
722
723
724
725
726
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
727
728
729
730
731
   fi])

dnl 
dnl  KDE module
dnl
732
733
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
734
  [if test x$enable_kde = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
735
736
     PLUGINS="${PLUGINS} kde"
     ALIASES="${ALIASES} kvlc"
737
738
739
740
741
742
743
     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
744
   fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
745
746
747
748

dnl
dnl  Gnome module
dnl
749
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
   
Sam Hocevar committed
750
  [  --enable-gnome          Gnome interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
751
  [if test x$enable_gnome = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
752
753
     PLUGINS="${PLUGINS} gnome"
     ALIASES="${ALIASES} gnome-vlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
754
755
756
757
758
759
     LIB_GNOME="`gnome-config --libs gnomeui | sed 's,-rdynamic,,'`"
   fi])

dnl
dnl  Gtk+ module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
760
761
AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Gtk+ support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
762
763
764
if test x$enable_gtk != xno
then
  # look for gtk-config
Sam Hocevar's avatar
   
Sam Hocevar committed
765
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
Sam Hocevar's avatar
   
Sam Hocevar committed
766
767
  if test -x ${GTK_CONFIG}
  then
Sam Hocevar's avatar
   
Sam Hocevar committed
768
769
    CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
    LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
770
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
771
772
773
774
775
776
777
778
  # 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
779
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
780
781
782
783

dnl
dnl  X11 module
dnl
784
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
785
  [  --disable-x11           X11 support (default enabled)])
786
if test x$enable_x11 != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
787
788
789
790
791
792
793
794
  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
795
  AC_CHECK_HEADERS(X11/Xlib.h, [
Sam Hocevar's avatar
   
Sam Hocevar committed
796
    PLUGINS="${PLUGINS} x11"
Sam Hocevar's avatar
   
Sam Hocevar committed
797
798
799
800
    LIB_X11="-L$x_libraries -lX11 -lXext"
    CFLAGS_X11="-I$x_includes"
  ]
  CPPFLAGS=$saved_CPPFLAGS)
801
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
802
803
804
805

dnl
dnl  XVideo module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
806
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
   
Sam Hocevar committed
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
  [  --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
824
825
826
827

dnl
dnl  ALSA module
dnl
Henri Fallon's avatar
   
Henri Fallon committed
828
AC_ARG_ENABLE(alsa,
829
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
830
831
832
833
834
835
836
837
838
  [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
839

Sam Hocevar's avatar
   
Sam Hocevar committed
840
dnl  end of non-BeOS stuff
841
842
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
843
844
845
dnl 
dnl  Configuration is finished
dnl
846
847
AC_SUBST(SYS)
AC_SUBST(ARCH)
848
AC_SUBST(PLUGINS)
Sam Hocevar's avatar
   
Sam Hocevar committed
849
AC_SUBST(BUILTINS)
850
AC_SUBST(ALIASES)
Sam Hocevar's avatar
   
Sam Hocevar committed
851
AC_SUBST(DEFINE)
Sam Hocevar's avatar
   
Sam Hocevar committed
852
AC_SUBST(INCLUDE)
853
854
AC_SUBST(DEBUG)
AC_SUBST(STATS)
Sam Hocevar's avatar
   
Sam Hocevar committed
855
AC_SUBST(ASM)
856
AC_SUBST(TRACE)
Sam Hocevar's avatar
   
Sam Hocevar committed
857
AC_SUBST(PROFILING)
858
AC_SUBST(OPTIMS)
Sam Hocevar's avatar
   
Sam Hocevar committed
859
AC_SUBST(NEED_GETOPT)
Sam Hocevar's avatar
   
Sam Hocevar committed
860
AC_SUBST(MOC)
Sam Hocevar's avatar
   
Sam Hocevar committed
861
AC_SUBST(WINDRES)
Sam Hocevar's avatar
   
Sam Hocevar committed
862
863

AC_SUBST(LCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
864
AC_SUBST(PLCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
865
AC_SUBST(SOFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
866

Sam Hocevar's avatar
   
Sam Hocevar committed
867
AC_SUBST(LIB)
Sam Hocevar's avatar
   
Sam Hocevar committed
868
869
870
AC_SUBST(LIB_ALSA)
AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN)
Sam Hocevar's avatar
   
Sam Hocevar committed
871
AC_SUBST(LIB_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
872
AC_SUBST(LIB_DVD_PLUGIN)
Sam Hocevar's avatar
   
Sam Hocevar committed
873
AC_SUBST(LIB_ESD)
Christophe Massiot's avatar
Christophe Massiot committed
874
AC_SUBST(LIB_GGI)
Sam Hocevar's avatar
   
Sam Hocevar committed
875
876
877
878
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME)
AC_SUBST(LIB_GTK)
AC_SUBST(LIB_IDCTALTIVEC)
Sam Hocevar's avatar
   
Sam Hocevar committed
879
AC_SUBST(LIB_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
880
AC_SUBST(LIB_KDE)
Sam Hocevar's avatar
   
Sam Hocevar committed
881
AC_SUBST(LIB_MACOSX)
882
AC_SUBST(LIB_QNX)
Sam Hocevar's avatar
   
Sam Hocevar committed
883
884
885
886
AC_SUBST(LIB_NCURSES)
AC_SUBST(LIB_QT)
AC_SUBST(LIB_TS)
AC_SUBST(LIB_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
887
AC_SUBST(LIB_DIRECTX)
Sam Hocevar's avatar
   
Sam Hocevar committed
888
889
890
AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO)
AC_SUBST(LIB_YUV)
891

Sam Hocevar's avatar
   
Sam Hocevar committed
892
AC_SUBST(CFLAGS_VLC)
Sam Hocevar's avatar
   
Sam Hocevar committed
893
AC_SUBST(CFLAGS_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
894
AC_SUBST(CFLAGS_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
895
AC_SUBST(CFLAGS_GTK)
Sam Hocevar's avatar
   
Sam Hocevar committed
896
AC_SUBST(CFLAGS_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
897
898
AC_SUBST(CFLAGS_X11)

Sam Hocevar's avatar
   
Sam Hocevar committed
899
AC_SUBST(OBJ_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
900
AC_SUBST(OBJ_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
901

Sam Hocevar's avatar
   
Sam Hocevar committed
902
AC_SUBST(NEED_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
903

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

906
echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
907
908
909
910
global configuration
--------------------
system                : ${SYS}
architecture          : ${ARCH}
Sam Hocevar's avatar
   
Sam Hocevar committed
911
optimizations         : ${OPTIMS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
912

Sam Hocevar's avatar
   
Sam Hocevar committed
913
914
915
if test x${HAVE_VLC} = x1
then
  echo "
916
917
918
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
919
920
debug mode            : ${DEBUG}
statistics            : ${STATS}
921
trace mode            : ${TRACE}
Sam Hocevar's avatar
   
Sam Hocevar committed
922
profiling             : ${PROFILING}
Sam Hocevar's avatar
   
Sam Hocevar committed
923
need builtin getopt   : ${NEED_GETOPT}
Sam Hocevar's avatar
   
Sam Hocevar committed
924
built-in modules      :${BUILTINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
925
plugin modules        :${PLUGINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
926
927
vlc aliases           :${ALIASES}"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
928

Sam Hocevar's avatar
   
Sam Hocevar committed
929
echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
930
931
libdvdcss configuration
-----------------------
Sam Hocevar's avatar
   
Sam Hocevar committed
932
can be built          : ${CAN_BUILD_LIBDVDCSS}
Sam Hocevar's avatar
   
Sam Hocevar committed
933
934
will be built         : ${NEED_LIBDVDCSS}"
if test x${NEED_LIBDVDCSS} = x1
Sam Hocevar's avatar
   
Sam Hocevar committed
935
then
Sam Hocevar's avatar
   
Sam Hocevar committed
936
  echo "need BSDI libdvd      : ${NEED_BSDI_LIBDVD}"
Sam Hocevar's avatar
   
Sam Hocevar committed
937
938
939
  echo "link statically       : ${STATIC_LIBDVDCSS}"
else
  echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
940
941
942
fi

echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
943
944
945
946
947
948
949
950
951
952
953
954
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 ""
955