configure.in 25 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
dnl Check for pthreads - borrowed from XMMS
Sam Hocevar's avatar
   
Sam Hocevar committed
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
AC_CHECK_FUNC(pthread_attr_init,,[
  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
    THREAD_LIB=""
  fi
])

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

Sam Hocevar's avatar
   
Sam Hocevar committed
100
101
102
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
103
            Define if <pthread.h> defines pthread_cond_t.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
104
105
AC_EGREP_HEADER(strncasecmp,strings.h,[
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Sam Hocevar's avatar
   
Sam Hocevar committed
106
            Define if <strings.h> defines strncasecmp.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
107

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

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

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

172
dnl Check for boolean_t
Sam Hocevar's avatar
   
Sam Hocevar committed
173
174
175
176
177
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))
178
179
180
181
182
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
183
184
185
186
187
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
188

189
190
191
192
193
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
194
195
196
197
198
ARCH=${host_cpu}

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
199
200
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion imdct downmix"
PLUGINS="${PLUGINS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
201
202
203
204

dnl
dnl  Accelerated modules
dnl
gbazin's avatar
   
gbazin committed
205
206
MMX_MODULES="yuvmmx idctmmx motionmmx"
MMXEXT_MODULES="idctmmxext motionmmxext imdct3dn imdctsse downmix3dn downmixsse"
207

Sam Hocevar's avatar
   
Sam Hocevar committed
208
209
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
210
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
Sam Hocevar's avatar
   
Sam Hocevar committed
211
212
  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

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

Sam Hocevar's avatar
   
Sam Hocevar committed
218
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
219
dnl  libdvdcss: check for DVD ioctls
Sam Hocevar's avatar
   
Sam Hocevar committed
220
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
221

Sam Hocevar's avatar
   
Sam Hocevar committed
222
223
224
dnl  default is no
CAN_BUILD_LIBDVDCSS=0

Sam Hocevar's avatar
   
Sam Hocevar committed
225
226
dnl  for windoze
AC_CHECK_HEADERS(winioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
227
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
228
229
])

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

Sam Hocevar's avatar
   
Sam Hocevar committed
303

Sam Hocevar's avatar
   
Sam Hocevar committed
304
305
306
307
dnl
dnl  Check the operating system
dnl
case ${host_os} in
Sam Hocevar's avatar
   
Sam Hocevar committed
308
309
310
  bsdi*)
    SYS=bsdi
    ;;
Sam Hocevar's avatar
   
Sam Hocevar committed
311
312
313
314
315
316
317
318
  darwin*)
    SYS=darwin
    ;;
  *)
    SYS=${host_os}
    ;;
esac

Sam Hocevar's avatar
   
Sam Hocevar committed
319
320
321
dnl
dnl  PentiumPro acceleration
dnl
322
AC_ARG_ENABLE(ppro,
Sam Hocevar's avatar
   
Sam Hocevar committed
323
  [  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
324
325
[ 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
326
327
328
329

dnl
dnl  MMX acceleration
dnl
330
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
331
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
332
[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
Sam Hocevar's avatar
   
Sam Hocevar committed
333
  BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
Sam Hocevar's avatar
   
Sam Hocevar committed
334
[ 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
335
  BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
336
337
338
339

dnl
dnl  AltiVec acceleration
dnl
340
AC_ARG_ENABLE(altivec,
341
[  --enable-altivec        Enable altivec optimizations (default disabled since it is broken)],
Sam Hocevar's avatar
   
Sam Hocevar committed
342
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec"
Sam Hocevar's avatar
   
Sam Hocevar committed
343
    BUILTINS="${BUILTINS} idctaltivec"
Sam Hocevar's avatar
   
Sam Hocevar committed
344
345
    LIB_IDCTALTIVEC="-framework vecLib"
  fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
346
#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
347
348
349
350

dnl
dnl  Debugging mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
351
DEBUG=0
352
AC_ARG_ENABLE(debug,
353
[  --enable-debug          Enable debug mode (default disabled)],
354
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
355
356
357
358

dnl
dnl  Enable/disable statistics
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
359
STATS=0
360
AC_ARG_ENABLE(stats,
361
[  --enable-stats          Enable printing of statistics (default disabled)],
362
[ if test x$enableval = xyes; then STATS=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
363

364
365
366
dnl
dnl  Trace mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
367
TRACE=0
368
369
370
371
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
372
373
374
dnl
dnl  Trace mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
375
PROFILING=0
Sam Hocevar's avatar
   
Sam Hocevar committed
376
377
378
379
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
380
381
382
dnl
dnl  Enable/disable optimizations
dnl
383
AC_ARG_ENABLE(optimizations,
384
[  --disable-optimizations Disable compiler optimizations (default enabled)],
385
386
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
387

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

Sam Hocevar's avatar
   
Sam Hocevar committed
477
478
479
480
481
dnl
dnl  dummy plugin
dnl
AC_ARG_ENABLE(dummy,
  [  --disable-dummy         dummy module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
482
483
484
485
486

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

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

if test x$enable_null != xno
then
  BUILTINS="${BUILTINS} null"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
498
499
500
501
502
503

dnl
dnl  rc plugin
dnl
AC_ARG_ENABLE(rc,
  [  --disable-rc            rc module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
504
505
506
507
508

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

Sam Hocevar's avatar
   
Sam Hocevar committed
510
dnl special case for BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
511
512
if test x$SYS = xbeos
then
Sam Hocevar's avatar
   
Sam Hocevar committed
513
    BUILTINS="${BUILTINS} beos"
Sam Hocevar's avatar
   
Sam Hocevar committed
514
    LIB_BEOS="-lbe -lgame -lroot -ltracker"
Sam Hocevar's avatar
   
Sam Hocevar committed
515
    PLCFLAGS="${PLCFLAGS} -nostart"
516
517
518
519

dnl default case
else

Sam Hocevar's avatar
   
Sam Hocevar committed
520
521
522
dnl
dnl  OSS /dev/dsp module
dnl
523
AC_ARG_ENABLE(dsp,
524
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
525
526
527
528
529

if test x$enable_dsp != xno
then
  if test -c /dev/dsp
  then
Sam Hocevar's avatar
   
Sam Hocevar committed
530
    PLUGINS="${PLUGINS} dsp"
531
532
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
533
534
535
536

dnl
dnl  Esound module
dnl
537
AC_ARG_ENABLE(esd,
538
  [  --enable-esd            Esound library support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
539
540
  [if test x$enable_esd = xyes
   then
Sam Hocevar's avatar
   
Sam Hocevar committed
541
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
Sam Hocevar's avatar
   
Sam Hocevar committed
542
543
     if test x${ESD_CONFIG} != xno
     then
Sam Hocevar's avatar
   
Sam Hocevar committed
544
       PLUGINS="${PLUGINS} esd"
Sam Hocevar's avatar
   
Sam Hocevar committed
545
546
       LIB_ESD="`${ESD_CONFIG} --libs`"
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
547
548
549
550
551
   fi])

dnl
dnl  Darwin module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
552
553
AC_ARG_ENABLE(darwin,
  [  --enable-darwin         Darwin sound support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
554
  [if test x$enable_darwin = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
555
     PLUGINS="${PLUGINS} darwin"
Sam Hocevar's avatar
   
Sam Hocevar committed
556
557
558
559
560
561
     LIB_DARWIN="-framework CoreAudio"
   fi])

dnl
dnl  MacOS X module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
562
AC_ARG_ENABLE(macosx,
563
  [  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)],
Sam Hocevar's avatar
   
Sam Hocevar committed
564
565
  [if test x$enable_macosx = xyes
   then
Sam Hocevar's avatar
   
Sam Hocevar committed
566
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
567
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
568
569
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
570
571
   fi],
  [AC_CHECK_HEADERS(Carbon/Carbon.h,
Sam Hocevar's avatar
   
Sam Hocevar committed
572
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
573
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
574
575
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
576
577
   )])

578
579
580
581
dnl
dnl  QNX RTOS module
dnl
AC_ARG_ENABLE(qnx,
Sam Hocevar's avatar
   
Sam Hocevar committed
582
583
584
  [  --disable-qnx           QNX RTOS support (default enabled in QNX RTOS)])
    if test x$enable_qnx != xno
    then
585
586
587
588
589
590
      AC_CHECK_HEADERS(Ph.h, [
        PLUGINS="${PLUGINS} qnx"
        LIB_QNX="-lasound -lph"
      ])
    fi

Sam Hocevar's avatar
   
Sam Hocevar committed
591
592
593
dnl
dnl  Linux framebuffer module
dnl
594
595
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
596
597
598
599
  [ if test x$enable_fb = xyes
    then
      PLUGINS="${PLUGINS} fb"
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
600
601
602
603

dnl
dnl  GGI module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
604
605
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
606
  [ if test "x$withval" != "xno"
Christophe Massiot's avatar
Christophe Massiot committed
607
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
608
609
      PLUGINS="${PLUGINS} ggi"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
610
611
612
613
614
      then
        LIB_GGI="-l"$withval
      else
        LIB_GGI="-lggi"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
615
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
616
617
618
619

dnl
dnl  SDL module
dnl
620
621
AC_ARG_ENABLE(sdl,
  [  --disable-sdl           SDL support (default enabled)])
622
if test "x$enable_sdl" != "xno"
623
then
624
625
626
627
628
629
630
631
  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)
632
633
  SDL_CONFIG=${SDL12_CONFIG}
  SDL_HEADER="SDL12/SDL.h"
Sam Hocevar's avatar
   
Sam Hocevar committed
634
635
  if test x${SDL_CONFIG} = xno
  then
636
    AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
Sam Hocevar's avatar
   
Sam Hocevar committed
637
    SDL_CONFIG=${SDL11_CONFIG}
638
639
    SDL_HEADER="SDL11/SDL.h"
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
640
641
  if test x${SDL_CONFIG} = xno
  then
642
    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
643
    SDL_HEADER="SDL/SDL.h"
644
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
645
646
  if test x${SDL_CONFIG} != xno
  then
647
648
649
650
651
    PLUGINS="${PLUGINS} sdl"
    CFLAGS_SDL="`${SDL_CONFIG} --cflags`"
    LIB_SDL="`${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
    save_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS $CFLAGS_SDL"
652
653
654
655
656
    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 ])
657
    CFLAGS=$save_CFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
658
    if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
Sam Hocevar's avatar
   
Sam Hocevar committed
659
    then
660
661
662
      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
663
    fi
664
  elif test "x$enable_sdl" =  "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
665
  then
666
    echo "I couldn't find the SDL package. You can download libSDL from"
667
668
669
    echo "http://www.libsdl.org/, or configure with --disable-sdl. Have a"
    echo "nice day."
    exit 1
670
671
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
672

Sam Hocevar's avatar
   
Sam Hocevar committed
673
674
675
676
677
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
678
  [ if test "x$withval" != "xno"
Sam Hocevar's avatar
   
Sam Hocevar committed
679
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
680
681
      PLUGINS="${PLUGINS} directx"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
682
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
683
        LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lgdi32 -ldxguid"
Sam Hocevar's avatar
   
Sam Hocevar committed
684
685
686
        INCLUDE="${INCLUDE} -I"$withval"/include"
      else
        AC_CHECK_HEADERS(directx.h, , [echo "Cannot find DirectX headers !"; exit])
Sam Hocevar's avatar
   
Sam Hocevar committed
687
        LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
Sam Hocevar's avatar
   
Sam Hocevar committed
688
689
      fi
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
690
    if test "x$withval" = "x"
Sam Hocevar's avatar
   
Sam Hocevar committed
691
692
693
    then
      AC_CHECK_HEADERS(directx.h,
      [PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
694
       LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"])
Sam Hocevar's avatar
   
Sam Hocevar committed
695
696
    fi

Sam Hocevar's avatar
   
Sam Hocevar committed
697
698
699
dnl
dnl  Glide module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
700
701
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
702
  [ if test "x$withval" != "xno"
Christophe Massiot's avatar
Christophe Massiot committed
703
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
704
705
      PLUGINS="${PLUGINS} glide"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
706
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
707
        LIB_GLIDE="-l"$withval" -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
708
      else
Sam Hocevar's avatar
   
Sam Hocevar committed
709
        LIB_GLIDE="-lglide2x -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
710
      fi
Christophe Massiot's avatar
Christophe Massiot committed
711
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
712
713
714
715

dnl
dnl  ncurses module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
716
717
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
718
  [if test x$enable_ncurses = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
719
     PLUGINS="${PLUGINS} ncurses"
Sam Hocevar's avatar
   
Sam Hocevar committed
720
721
722
723
724
725
     LIB_NCURSES="-lncurses"
   fi])

dnl
dnl  Qt module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
726
727
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
728
  [if test x$enable_qt = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
729
730
     PLUGINS="${PLUGINS} qt"
     ALIASES="${ALIASES} qvlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
731
     LIB_QT="-lqt -L${QTDIR}/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
732
     if test -x ${QTDIR}/bin/moc
Sam Hocevar's avatar
   
Sam Hocevar committed
733
734
735
736
737
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
738
739
740
741
742
   fi])

dnl 
dnl  KDE module
dnl
743
744
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
745
  [if test x$enable_kde = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
746
747
     PLUGINS="${PLUGINS} kde"
     ALIASES="${ALIASES} kvlc"
748
749
750
751
752
753
754
     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
755
   fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
756
757
758
759

dnl
dnl  Gnome module
dnl
760
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
   
Sam Hocevar committed
761
  [  --enable-gnome          Gnome interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
762
  [if test x$enable_gnome = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
763
764
     PLUGINS="${PLUGINS} gnome"
     ALIASES="${ALIASES} gnome-vlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
765
766
767
768
769
770
     LIB_GNOME="`gnome-config --libs gnomeui | sed 's,-rdynamic,,'`"
   fi])

dnl
dnl  Gtk+ module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
771
772
AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Gtk+ support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
773
774
775
if test x$enable_gtk != xno
then
  # look for gtk-config
Sam Hocevar's avatar
   
Sam Hocevar committed
776
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
Sam Hocevar's avatar
   
Sam Hocevar committed
777
778
  if test -x ${GTK_CONFIG}
  then
Sam Hocevar's avatar
   
Sam Hocevar committed
779
780
    CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
    LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
781
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
782
783
784
785
786
787
788
789
  # 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
790
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
791
792
793
794

dnl
dnl  X11 module
dnl
795
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
796
  [  --disable-x11           X11 support (default enabled)])
797
if test x$enable_x11 != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
798
799
800
801
802
803
804
805
  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
806
  AC_CHECK_HEADERS(X11/Xlib.h, [
Sam Hocevar's avatar
   
Sam Hocevar committed
807
    PLUGINS="${PLUGINS} x11"
Sam Hocevar's avatar
   
Sam Hocevar committed
808
809
810
811
    LIB_X11="-L$x_libraries -lX11 -lXext"
    CFLAGS_X11="-I$x_includes"
  ]
  CPPFLAGS=$saved_CPPFLAGS)
812
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
813
814
815
816

dnl
dnl  XVideo module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
817
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
   
Sam Hocevar committed
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
  [  --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
835
836
837
838

dnl
dnl  ALSA module
dnl
Henri Fallon's avatar
   
Henri Fallon committed
839
AC_ARG_ENABLE(alsa,
840
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
841
842
843
844
845
846
847
848
849
  [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
850

Sam Hocevar's avatar
   
Sam Hocevar committed
851
dnl  end of non-BeOS stuff
852
853
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
854
855
856
dnl 
dnl  Configuration is finished
dnl
857
858
AC_SUBST(SYS)
AC_SUBST(ARCH)
859
AC_SUBST(PLUGINS)
Sam Hocevar's avatar
   
Sam Hocevar committed
860
AC_SUBST(BUILTINS)
861
AC_SUBST(ALIASES)
Sam Hocevar's avatar
   
Sam Hocevar committed
862
AC_SUBST(DEFINE)
Sam Hocevar's avatar
   
Sam Hocevar committed
863
AC_SUBST(INCLUDE)
864
865
AC_SUBST(DEBUG)
AC_SUBST(STATS)
Sam Hocevar's avatar
   
Sam Hocevar committed
866
AC_SUBST(ASM)
867
AC_SUBST(TRACE)
Sam Hocevar's avatar
   
Sam Hocevar committed
868
AC_SUBST(PROFILING)
869
AC_SUBST(OPTIMS)
Sam Hocevar's avatar
   
Sam Hocevar committed
870
AC_SUBST(NEED_GETOPT)
Sam Hocevar's avatar
   
Sam Hocevar committed
871
AC_SUBST(MOC)
Sam Hocevar's avatar
   
Sam Hocevar committed
872
AC_SUBST(WINDRES)
Sam Hocevar's avatar
   
Sam Hocevar committed
873
874

AC_SUBST(LCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
875
AC_SUBST(PLCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
876
AC_SUBST(SOFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
877

Sam Hocevar's avatar
   
Sam Hocevar committed
878
AC_SUBST(LIB)
Sam Hocevar's avatar
   
Sam Hocevar committed
879
880
881
AC_SUBST(LIB_ALSA)
AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN)
Sam Hocevar's avatar
   
Sam Hocevar committed
882
AC_SUBST(LIB_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
883
AC_SUBST(LIB_DVD_PLUGIN)
Sam Hocevar's avatar
   
Sam Hocevar committed
884
AC_SUBST(LIB_ESD)
Christophe Massiot's avatar
Christophe Massiot committed
885
AC_SUBST(LIB_GGI)
Sam Hocevar's avatar
   
Sam Hocevar committed
886
887
888
889
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME)
AC_SUBST(LIB_GTK)
AC_SUBST(LIB_IDCTALTIVEC)
Sam Hocevar's avatar
   
Sam Hocevar committed
890
AC_SUBST(LIB_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
891
AC_SUBST(LIB_KDE)
Sam Hocevar's avatar
   
Sam Hocevar committed
892
AC_SUBST(LIB_MACOSX)
893
AC_SUBST(LIB_QNX)
Sam Hocevar's avatar
   
Sam Hocevar committed
894
895
896
897
AC_SUBST(LIB_NCURSES)
AC_SUBST(LIB_QT)
AC_SUBST(LIB_TS)
AC_SUBST(LIB_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
898
AC_SUBST(LIB_DIRECTX)
Sam Hocevar's avatar
   
Sam Hocevar committed
899
900
901
AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO)
AC_SUBST(LIB_YUV)
902

Sam Hocevar's avatar
   
Sam Hocevar committed
903
AC_SUBST(CFLAGS_VLC)
Sam Hocevar's avatar
   
Sam Hocevar committed
904
AC_SUBST(CFLAGS_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
905
AC_SUBST(CFLAGS_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
906
AC_SUBST(CFLAGS_GTK)
Sam Hocevar's avatar
   
Sam Hocevar committed
907
AC_SUBST(CFLAGS_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
908
909
AC_SUBST(CFLAGS_X11)

Sam Hocevar's avatar
   
Sam Hocevar committed
910
AC_SUBST(OBJ_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
911
AC_SUBST(OBJ_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
912

Sam Hocevar's avatar
   
Sam Hocevar committed
913
AC_SUBST(NEED_LIBDVDCSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
914

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

917
echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
918
919
920
921
global configuration
--------------------
system                : ${SYS}
architecture          : ${ARCH}
Sam Hocevar's avatar
   
Sam Hocevar committed
922
optimizations         : ${OPTIMS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
923

Sam Hocevar's avatar
   
Sam Hocevar committed
924
925
926
if test x${HAVE_VLC} = x1
then
  echo "
927
928
929
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
930
931
debug mode            : ${DEBUG}
statistics            : ${STATS}
932
trace mode            : ${TRACE}
Sam Hocevar's avatar
   
Sam Hocevar committed
933
profiling             : ${PROFILING}
Sam Hocevar's avatar
   
Sam Hocevar committed
934
need builtin getopt   : ${NEED_GETOPT}
Sam Hocevar's avatar
   
Sam Hocevar committed
935
built-in modules      :${BUILTINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
936
plugin modules        :${PLUGINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
937
938
vlc aliases           :${ALIASES}"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
939

Sam Hocevar's avatar
   
Sam Hocevar committed
940
echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
941
942
libdvdcss configuration
-----------------------
Sam Hocevar's avatar
   
Sam Hocevar committed
943
can be built          : ${CAN_BUILD_LIBDVDCSS}
Sam Hocevar's avatar
   
Sam Hocevar committed
944
945
will be built         : ${NEED_LIBDVDCSS}"
if test x${NEED_LIBDVDCSS} = x1
Sam Hocevar's avatar
   
Sam Hocevar committed
946
then
Sam Hocevar's avatar
   
Sam Hocevar committed
947
  echo "need BSDI libdvd      : ${NEED_BSDI_LIBDVD}"
Sam Hocevar's avatar
   
Sam Hocevar committed
948
949
950
  echo "link statically       : ${STATIC_LIBDVDCSS}"
else
  echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
951
952
953
fi

echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
954
955
956
957
958
959
960
961
962
963
964
965
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 ""
966