configure.in 17 KB
Newer Older
1
2
3
dnl Autoconf settings for vlc
AC_INIT(src/interface/main.c)
AC_CONFIG_HEADER(include/defs.h)
4

5
6
AC_CANONICAL_HOST

Sam Hocevar's avatar
   
Sam Hocevar committed
7
VLC_VERSION=0.2.80
8
AC_SUBST(VLC_VERSION)
Sam Hocevar's avatar
   
Sam Hocevar committed
9
VLC_CODENAME=Ourumov
10
11
AC_SUBST(VLC_CODENAME)

Sam Hocevar's avatar
   
Sam Hocevar committed
12
13
14
dnl Save CFLAGS
save_CFLAGS="${CFLAGS}"

15
16
dnl Check for tools
AC_PROG_MAKE_SET
Sam Hocevar's avatar
   
Sam Hocevar committed
17
18
AC_PROG_CC
AC_PROG_CPP
Sam Hocevar's avatar
   
Sam Hocevar committed
19
AC_PROG_RANLIB
20
21
22
23
24
25

dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

dnl Check for compiler environment
AC_C_CONST
Sam Hocevar's avatar
   
Sam Hocevar committed
26
27
28
29
30

dnl Check for endianness if not cross-compiling
if test x${cross_compiling} != xyes; then
  AC_C_BIGENDIAN
fi
31
32
33
34

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
35
36
37
38
39
40
41
42
43
44
45
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")
  ])
])
46
AC_CHECK_FUNCS(usleep)
Sam Hocevar's avatar
   
Sam Hocevar committed
47
48
49
AC_CHECK_FUNC(inet_aton,,[
  AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
])
Sam Hocevar's avatar
   
Sam Hocevar committed
50
AC_CHECK_FUNCS(vasprintf)
Sam Hocevar's avatar
   
Sam Hocevar committed
51
AC_CHECK_FUNCS(swab)
Sam Hocevar's avatar
   
Sam Hocevar committed
52
53
54
55

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
56
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB="${LIB} -lgnugetopt"],
Sam Hocevar's avatar
   
Sam Hocevar committed
57
    [GETOPT=1])])
Sam Hocevar's avatar
   
Sam Hocevar committed
58
59
AC_SUBST(GETOPT)

60
61
AC_FUNC_MMAP
AC_TYPE_SIGNAL
Sam Hocevar's avatar
   
Sam Hocevar committed
62
63
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
64

Christophe Massiot's avatar
Christophe Massiot committed
65
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
66
CFLAGS="${CFLAGS} -I/usr/local/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
67

Sam Hocevar's avatar
   
Sam Hocevar committed
68
69
70
dnl Check for pthreads - borrowed from XMMS
PTHREAD_LIBS=error
AC_CHECK_LIB(pthread,pthread_attr_init,PTHREAD_LIBS="-lpthread")
Sam Hocevar's avatar
   
Sam Hocevar committed
71
if test "x${PTHREAD_LIBS}" = xerror; then
Sam Hocevar's avatar
   
Sam Hocevar committed
72
73
  AC_CHECK_LIB(pthreads,pthread_attr_init,PTHREAD_LIBS="-lpthreads")
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
74
if test "x${PTHREAD_LIBS}" = xerror; then
Sam Hocevar's avatar
   
Sam Hocevar committed
75
76
  AC_CHECK_LIB(c_r,pthread_attr_init,PTHREAD_LIBS="-lc_r")
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
77
if test "x${PTHREAD_LIBS}" = xerror; then
Sam Hocevar's avatar
   
Sam Hocevar committed
78
79
80
81
  PTHREAD_LIBS=""
  AC_CHECK_FUNC(pthread_attr_init)
fi
LIB="${LIB} ${PTHREAD_LIBS}"
82

Sam Hocevar's avatar
   
Sam Hocevar committed
83
84
85
86
87
88
89
90
91
92
dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
  AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
            Define if <pthread.h> defines pthread_cond_t.)
])
AC_EGREP_HEADER(strncasecmp,strings.h,[
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
            Define if <strings.h> defines strncasecmp.)
])

Sam Hocevar's avatar
   
Sam Hocevar committed
93
94
95
96
97
98
99
100
101
102
103
dnl Check for headers
AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h unistd.h)
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
104
dnl Check for ntohl, etc.
Sam Hocevar's avatar
   
Sam Hocevar committed
105
CFLAGS="${save_CFLAGS} -Wall -Werror"
Christophe Massiot's avatar
Christophe Massiot committed
106
107
108
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
109
 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
Sam Hocevar's avatar
   
Sam Hocevar committed
110
111
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
112
113
114
115
116
117
118
119
120
121
122
123
124
125
dnl Check for Darwin plugin linking flags
CFLAGS="${save_CFLAGS} -bundle -undefined suppress"
AC_MSG_CHECKING([if \$CC compiles plugins with -bundle -undefined suppress])
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"
AC_MSG_CHECKING([if \$CC compiles plugins with -shared])
AC_TRY_COMPILE([],,
 PLCFLAGS="${PLCFLAGS} -shared"; AC_MSG_RESULT(yes),
 AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
126
dnl End of the bizarre compilation tests
Sam Hocevar's avatar
   
Sam Hocevar committed
127
CFLAGS="${save_CFLAGS}"
Christophe Massiot's avatar
Christophe Massiot committed
128

129
dnl Check for boolean_t
Sam Hocevar's avatar
   
Sam Hocevar committed
130
131
132
133
134
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))
135
136
137
138
139
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
140

141
142
143
144
145
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
146
147
148
149
150
ARCH=${host_cpu}

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
151
152
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion imdct downmix"
PLUGINS="${PLUGINS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
153
154
155
156

dnl
dnl  Accelerated modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
157
158
case x$host_os in
  xmingw32msvc)
Sam Hocevar's avatar
   
Sam Hocevar committed
159
160
    MMX_MODULES="idctmmx motionmmx"
    MMXEXT_MODULES="idctmmxext motionmmxext imdct3dn"
Sam Hocevar's avatar
   
Sam Hocevar committed
161
162
    ;;
  *)
Sam Hocevar's avatar
   
Sam Hocevar committed
163
164
    MMX_MODULES="yuvmmx idctmmx motionmmx"
    MMXEXT_MODULES="idctmmxext motionmmxext imdct3dn imdctsse downmix3dn downmixsse"
Sam Hocevar's avatar
   
Sam Hocevar committed
165
166
    ;;
esac
167

Sam Hocevar's avatar
   
Sam Hocevar committed
168
169
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
170
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
Sam Hocevar's avatar
   
Sam Hocevar committed
171
172
  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

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

Sam Hocevar's avatar
   
Sam Hocevar committed
178
179
180
181
dnl
dnl  DVD module: check for DVD ioctls
dnl
AC_CHECK_HEADERS(sys/ioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
182
  BUILTINS="${BUILTINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
183
184
  LIB_DVD="${LIB_DVD} -Llib -L../../lib -ldvdcss"
  CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
   
Sam Hocevar committed
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
  AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h)
  BSD_DVD_STRUCT=0
  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
  ])
  if test x$BSD_DVD_STRUCT = x1; then
    AC_DEFINE(HAVE_BSD_DVD_STRUCT, 1,
              Define if BSD-like dvd_struct is defined.)
  fi
  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
213
214
215
216
217
218
  ])
])

dnl
dnl  dummy plugin
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
219
220
AC_ARG_ENABLE(dummy,
  [  --disable-dummy         dummy module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
221
if test x$enable_dummy != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
222
  BUILTINS="${BUILTINS} dummy"; fi
Sam Hocevar's avatar
   
Sam Hocevar committed
223
224
225
226

dnl
dnl  null plugin
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
227
228
AC_ARG_ENABLE(null,
  [  --disable-null          Null module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
229
if test x$enable_null != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
230
  BUILTINS="${BUILTINS} null"; fi
Sam Hocevar's avatar
   
Sam Hocevar committed
231

Sam Hocevar's avatar
   
Sam Hocevar committed
232
233
234
235
236
237
238
239
dnl
dnl  rc plugin
dnl
AC_ARG_ENABLE(rc,
  [  --disable-rc            rc module (default enabled)])
if test x$enable_rc != xno; then
  BUILTINS="${BUILTINS} rc"; fi

Sam Hocevar's avatar
   
Sam Hocevar committed
240
241
242
dnl
dnl  PentiumPro acceleration
dnl
243
AC_ARG_ENABLE(ppro,
244
[  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
245
246
[ 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
247
248
249
250

dnl
dnl  MMX acceleration
dnl
251
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
252
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
253
[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
Sam Hocevar's avatar
   
Sam Hocevar committed
254
  BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
Sam Hocevar's avatar
   
Sam Hocevar committed
255
[ 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
256
  BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
257
258
259
260

dnl
dnl  AltiVec acceleration
dnl
261
AC_ARG_ENABLE(altivec,
262
[  --enable-altivec        Enable altivec optimizations (default disabled since it is broken)],
Sam Hocevar's avatar
   
Sam Hocevar committed
263
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
Sam Hocevar's avatar
   
Sam Hocevar committed
264
    BUILTINS="${BUILTINS} idctaltivec"
Sam Hocevar's avatar
   
Sam Hocevar committed
265
266
    LIB_IDCTALTIVEC="-framework vecLib"
  fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
267
#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
268
269
270
271

dnl
dnl  CSS DVD decryption
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
272
273
274
275
AC_ARG_ENABLE(css,
[  --disable-css           Disable DVD CSS decryption (default enabled)],
[ if test x$enableval = xyes; then CSS=1; else CSS=0; fi ], [ CSS=1; ])
if test x${CSS} = x1; then AC_DEFINE(HAVE_CSS, 1, Define if you want DVD CSS decryption.) fi
Sam Hocevar's avatar
   
Sam Hocevar committed
276
277
278
279

dnl
dnl  Debugging mode
dnl
280
AC_ARG_ENABLE(debug,
281
[  --enable-debug          Enable debug mode (default disabled)],
282
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
283
284
285
286

dnl
dnl  Enable/disable statistics
dnl
287
AC_ARG_ENABLE(stats,
288
[  --enable-stats          Enable printing of statistics (default disabled)],
289
[ if test x$enableval = xyes; then STATS=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
290

291
292
293
294
295
296
297
dnl
dnl  Trace mode
dnl
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
298
299
300
dnl
dnl  Enable/disable optimizations
dnl
301
AC_ARG_ENABLE(optimizations,
302
[  --disable-optimizations Disable compiler optimizations (default enabled)],
303
304
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
305
306
307

SYS=${host_os}

Sam Hocevar's avatar
   
Sam Hocevar committed
308
dnl special case for BeOS
309
if test x$host_os = xbeos; then
Sam Hocevar's avatar
   
Sam Hocevar committed
310
    BUILTINS="${BUILTINS} beos"
Sam Hocevar's avatar
   
Sam Hocevar committed
311
    LIB_BEOS="-lbe -lgame -lroot -ltracker"
Sam Hocevar's avatar
   
Sam Hocevar committed
312
    PLCFLAGS="${PLCFLAGS} -nostart"
313
314
315
316

dnl default case
else

Sam Hocevar's avatar
   
Sam Hocevar committed
317
318
319
dnl
dnl  OSS /dev/dsp module
dnl
320
AC_ARG_ENABLE(dsp,
321
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
322
if test x$enable_dsp != xno; then
323
  if test -c /dev/dsp; then
Sam Hocevar's avatar
   
Sam Hocevar committed
324
    PLUGINS="${PLUGINS} dsp"
325
326
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
327
328
329
330

dnl
dnl  Esound module
dnl
331
AC_ARG_ENABLE(esd,
332
  [  --enable-esd            Esound library support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
333
  [if test x$enable_esd = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
334
335
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
     if test x${ESD_CONFIG} != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
336
       PLUGINS="${PLUGINS} esd"
Sam Hocevar's avatar
   
Sam Hocevar committed
337
338
       LIB_ESD="`${ESD_CONFIG} --libs`"
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
339
340
341
342
343
   fi])

dnl
dnl  Darwin module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
344
345
AC_ARG_ENABLE(darwin,
  [  --enable-darwin         Darwin sound support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
346
  [if test x$enable_darwin = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
347
     PLUGINS="${PLUGINS} darwin"
Sam Hocevar's avatar
   
Sam Hocevar committed
348
349
350
351
352
353
     LIB_DARWIN="-framework CoreAudio"
   fi])

dnl
dnl  MacOS X module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
354
AC_ARG_ENABLE(macosx,
355
  [  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)],
Sam Hocevar's avatar
   
Sam Hocevar committed
356
  [if test x$enable_macosx = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
357
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
358
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
359
360
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
361
362
   fi],
  [AC_CHECK_HEADERS(Carbon/Carbon.h,
Sam Hocevar's avatar
   
Sam Hocevar committed
363
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
364
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
365
366
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
367
368
369
370
371
   )])

dnl
dnl  Linux framebuffer module
dnl
372
373
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
374
  [if test x$enable_fb = xyes; then PLUGINS="${PLUGINS} fb"; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
375
376
377
378

dnl
dnl  GGI module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
379
380
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
381
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
382
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
383
      PLUGINS="${PLUGINS} ggi";
Sam Hocevar's avatar
   
Sam Hocevar committed
384
385
386
387
388
389
      if test "x$withval" != "xyes";
      then
        LIB_GGI="-l"$withval
      else
        LIB_GGI="-lggi"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
390
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
391
392
393
394

dnl
dnl  SDL module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
395
AC_ARG_WITH(sdl,
Sam Hocevar's avatar
   
Sam Hocevar committed
396
  [  --with-sdl[=name]       SDL support (default enabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
397
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
398
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
399
      PLUGINS="${PLUGINS} sdl";
Sam Hocevar's avatar
   
Sam Hocevar committed
400
401
      if test "x$withval" != "xyes";
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
402
        LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -L"$withval"/lib -lSDL"
Sam Hocevar's avatar
   
Sam Hocevar committed
403
        CFLAGS_SDL="-I"$withval"/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
404
      else
405
        AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
Sam Hocevar's avatar
   
Sam Hocevar committed
406
        LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"
Sam Hocevar's avatar
   
Sam Hocevar committed
407
      fi
Christophe Massiot's avatar
Christophe Massiot committed
408
    fi ])
409
    if test "x$withval" = "x";
Sam Hocevar's avatar
   
Sam Hocevar committed
410
    then
411
      AC_CHECK_HEADERS(SDL/SDL.h,
Sam Hocevar's avatar
   
Sam Hocevar committed
412
413
      [PLUGINS="${PLUGINS} sdl"
       LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"])
Sam Hocevar's avatar
   
Sam Hocevar committed
414
    fi
Sam Hocevar's avatar
   
Sam Hocevar committed
415

Sam Hocevar's avatar
   
Sam Hocevar committed
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
dnl
dnl  Windows DirectX module
dnl
AC_ARG_WITH(directx,
  [  --with-directx[=name]   Windows DirectX support (default enabled)],
  [ if test "x$withval" != "xno";
    then
      PLUGINS="${PLUGINS} directx";
      if test "x$withval" != "xyes";
      then
        LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lddraw -ldsound"
        INCLUDE="${INCLUDE} -I"$withval"/include"
      else
        AC_CHECK_HEADERS(directx.h, , [echo "Cannot find DirectX headers !"; exit])
        LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"
      fi
    fi ])
    if test "x$withval" = "x";
    then
      AC_CHECK_HEADERS(directx.h,
      [PLUGINS="${PLUGINS} directx"
       LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"])
    fi

Sam Hocevar's avatar
   
Sam Hocevar committed
440
441
442
dnl
dnl  Glide module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
443
444
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
445
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
446
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
447
      PLUGINS="${PLUGINS} glide";
Sam Hocevar's avatar
   
Sam Hocevar committed
448
449
      if test "x$withval" != "xyes";
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
450
        LIB_GLIDE="-l"$withval" -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
451
      else
Sam Hocevar's avatar
   
Sam Hocevar committed
452
        LIB_GLIDE="-lglide2x -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
453
      fi
Christophe Massiot's avatar
Christophe Massiot committed
454
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
455
456
457
458

dnl
dnl  ncurses module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
459
460
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
461
  [if test x$enable_ncurses = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
462
     PLUGINS="${PLUGINS} ncurses"
Sam Hocevar's avatar
   
Sam Hocevar committed
463
464
465
466
467
468
     LIB_NCURSES="-lncurses"
   fi])

dnl
dnl  Qt module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
469
470
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
471
  [if test x$enable_qt = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
472
473
     PLUGINS="${PLUGINS} qt"
     ALIASES="${ALIASES} qvlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
474
     LIB_QT="-lqt -L${QTDIR}/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
475
476
477
478
479
480
     if test -x ${QTDIR}/bin/moc ;
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
481
482
483
484
485
   fi])

dnl 
dnl  KDE module
dnl
486
487
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
488
  [if test x$enable_kde = xyes; then PLUGINS="${PLUGINS} kde"; ALIASES="${ALIASES} kvlc"; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
489
490
491
492

dnl
dnl  Gnome module
dnl
493
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
   
Sam Hocevar committed
494
  [  --enable-gnome          Gnome interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
495
  [if test x$enable_gnome = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
496
497
     PLUGINS="${PLUGINS} gnome"
     ALIASES="${ALIASES} gnome-vlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
498
499
500
501
502
503
     LIB_GNOME="`gnome-config --libs gnomeui | sed 's,-rdynamic,,'`"
   fi])

dnl
dnl  Gtk+ module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
504
505
AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Gtk+ support (default enabled)])
506
if test x$enable_gtk != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
507
508
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
  if test x${GTK_CONFIG} != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
509
510
    PLUGINS="${PLUGINS} gtk"
    ALIASES="${ALIASES} gvlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
511
512
    CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
    LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
513
514
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
515
516
517
518

dnl
dnl  X11 module
dnl
519
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
520
  [  --disable-x11           X11 support (default enabled)])
521
if test x$enable_x11 != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
522
523
524
525
526
527
528
529
  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
530
  AC_CHECK_HEADERS(X11/Xlib.h, [
Sam Hocevar's avatar
   
Sam Hocevar committed
531
    PLUGINS="${PLUGINS} x11"
Sam Hocevar's avatar
   
Sam Hocevar committed
532
533
534
535
    LIB_X11="-L$x_libraries -lX11 -lXext"
    CFLAGS_X11="-I$x_includes"
  ]
  CPPFLAGS=$saved_CPPFLAGS)
536
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
537
538
539
540

dnl
dnl  XVideo module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
541
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
   
Sam Hocevar committed
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
  [  --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
559
560
561
562

dnl
dnl  ALSA module
dnl
Henri Fallon's avatar
   
Henri Fallon committed
563
AC_ARG_ENABLE(alsa,
564
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
565
566
  [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"
Sam Hocevar's avatar
   
Sam Hocevar committed
567
568
     LIB_ALSA="-lasound"
   fi; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
569

Sam Hocevar's avatar
   
Sam Hocevar committed
570
dnl  end of non-BeOS stuff
571
572
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
573
574
575
dnl 
dnl  Configuration is finished
dnl
576
577
AC_SUBST(SYS)
AC_SUBST(ARCH)
578
AC_SUBST(PLUGINS)
Sam Hocevar's avatar
   
Sam Hocevar committed
579
AC_SUBST(BUILTINS)
580
AC_SUBST(ALIASES)
Sam Hocevar's avatar
   
Sam Hocevar committed
581
AC_SUBST(DEFINE)
Sam Hocevar's avatar
   
Sam Hocevar committed
582
AC_SUBST(INCLUDE)
583
584
AC_SUBST(DEBUG)
AC_SUBST(STATS)
585
AC_SUBST(TRACE)
586
AC_SUBST(OPTIMS)
Sam Hocevar's avatar
   
Sam Hocevar committed
587
AC_SUBST(CSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
588
AC_SUBST(MOC)
Sam Hocevar's avatar
   
Sam Hocevar committed
589
590

AC_SUBST(LCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
591
AC_SUBST(PLCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
592
593
AC_SUBST(LIB)

Sam Hocevar's avatar
   
Sam Hocevar committed
594
595
596
AC_SUBST(LIB_ALSA)
AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN)
Sam Hocevar's avatar
   
Sam Hocevar committed
597
AC_SUBST(LIB_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
598
AC_SUBST(LIB_ESD)
Christophe Massiot's avatar
Christophe Massiot committed
599
AC_SUBST(LIB_GGI)
Sam Hocevar's avatar
   
Sam Hocevar committed
600
601
602
603
604
605
606
607
608
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME)
AC_SUBST(LIB_GTK)
AC_SUBST(LIB_IDCTALTIVEC)
AC_SUBST(LIB_MACOSX)
AC_SUBST(LIB_NCURSES)
AC_SUBST(LIB_QT)
AC_SUBST(LIB_TS)
AC_SUBST(LIB_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
609
AC_SUBST(LIB_DIRECTX)
Sam Hocevar's avatar
   
Sam Hocevar committed
610
611
612
AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO)
AC_SUBST(LIB_YUV)
613

Sam Hocevar's avatar
   
Sam Hocevar committed
614
AC_SUBST(CFLAGS_VLC)
Sam Hocevar's avatar
   
Sam Hocevar committed
615
AC_SUBST(CFLAGS_DVD)
Sam Hocevar's avatar
   
Sam Hocevar committed
616
AC_SUBST(CFLAGS_GTK)
Sam Hocevar's avatar
   
Sam Hocevar committed
617
AC_SUBST(CFLAGS_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
618
619
AC_SUBST(CFLAGS_X11)

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

622
echo "
Sam Hocevar's avatar
   
Sam Hocevar committed
623
624
625
626
627
628
global configuration
--------------------
system                : ${SYS}
architecture          : ${ARCH}
optimizations         : ${OPTIMS}

629
630
631
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
632
633
debug mode            : ${DEBUG}
statistics            : ${STATS}
634
trace mode            : ${TRACE}
Sam Hocevar's avatar
   
Sam Hocevar committed
635
need builtin getopt   : ${GETOPT}
Sam Hocevar's avatar
   
Sam Hocevar committed
636
built-in modules      :${BUILTINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
637
plugin modules        :${PLUGINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
638
vlc aliases           :${ALIASES}
Sam Hocevar's avatar
   
Sam Hocevar committed
639

Sam Hocevar's avatar
   
Sam Hocevar committed
640
641
642
643
644
645
libdvdcss configuration
-----------------------
CSS decryption        : ${CSS}

You may now tune Makefile.opts at your convenience. To build vlc, type
\`make vlc'. To build libdvdcss only, type \`make libdvdcss'."
646